/**
 * 公會系統樣式
 * 不使用 Bootstrap，完全自定義
 */

/* ==========================================
   頁面佈局修復 - 確保 footer 固定在底部
   ========================================== */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   公會頁面容器
   ========================================== */
.guild-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem 1rem;
    flex: 1;
    min-height: calc(100vh - 160px);
}

/* ==========================================
   Grid 系統 — 12 欄 CSS Grid
   ========================================== */
.guild-row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 0;
    width: 100%;
}

.guild-col-3,
.guild-col-4,
.guild-col-6,
.guild-col-8,
.guild-col-12 {
    flex: none;
    max-width: none;
    padding: 0;
    box-sizing: border-box;
    min-width: 0;
}

.guild-col-3 { grid-column: span 3; }   /* 25% — 統計卡 */
.guild-col-4 { grid-column: span 4; }   /* 33% */
.guild-col-6 { grid-column: span 6; }   /* 50% */
.guild-col-8 { grid-column: span 8; }
.guild-col-12 { grid-column: 1 / -1; }

/* 置中單一卡片（管理登入等） */
.guild-row-center {
    display: grid;
    grid-template-columns: minmax(280px, 560px);
    justify-content: center;
    gap: 1.25rem;
    margin: 0;
    width: 100%;
}

.guild-row-center > [class*="guild-col"] {
    grid-column: auto;
    width: 100%;
}

/* 四欄等寬（統計卡片） */
.guild-row-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.guild-row-cols-4 > [class*="guild-col"] {
    grid-column: auto;
}

/* 五欄等寬（成員列表） */
.guild-row-cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.guild-row-cols-5 > [class*="guild-col"] {
    grid-column: auto;
}

@media (max-width: 992px) {
    .guild-col-3,
    .guild-col-4,
    .guild-col-6,
    .guild-col-8 {
        grid-column: span 6;
    }

    .guild-row-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .guild-row-cols-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .guild-col-3,
    .guild-col-4,
    .guild-col-6,
    .guild-col-8 {
        grid-column: 1 / -1;
    }

    .guild-row-cols-4,
    .guild-row-cols-5 {
        grid-template-columns: 1fr;
    }

    .guild-row-center {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ==========================================
   卡片樣式
   ========================================== */
.guild-card-wrap {
    background: linear-gradient(180deg, rgba(255, 253, 246, 0.97), rgba(251, 243, 220, 0.9));
    border-radius: 16px;
    border: 1px solid rgba(229, 184, 66, 0.38);
    box-shadow: 0 10px 28px rgba(45, 31, 23, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.guild-card-wrap:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(45, 31, 23, 0.18), 0 0 0 1px rgba(229, 184, 66, 0.45);
}

.guild-card-header {
    padding: 1rem 1.25rem;
    color: #2D1F17;
}

.guild-card-header.bg-primary {
    background: linear-gradient(135deg, #E5B842 0%, #C5922A 55%, #A9761F 100%);
}

.guild-card-header.bg-success {
    background: linear-gradient(135deg, #3F7D4A 0%, #2F5F38 100%);
    color: #fff;
}

.guild-card-header.bg-info {
    background: linear-gradient(135deg, #3B5998 0%, #2D4373 100%);
    color: #fff;
}

.guild-card-header.bg-warning {
    background: linear-gradient(135deg, #E5B842 0%, #A9761F 100%);
}

.guild-card-header.bg-secondary {
    background: #5C4636;
    color: #F4E8C1;
}

.guild-card-header h4 {
    margin: 0;
    font-size: 1.25rem;
}

.guild-card-body {
    padding: 1.25rem;
    flex: 1;
}

.guild-description-preview {
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    max-height: calc(1.5em * 5);
    word-break: break-word;
    word-wrap: break-word;
    white-space: pre-line;
}

.guild-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.guild-card-img-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.guild-card-img-placeholder i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.3);
}

/* ==========================================
   按鈕樣式
   ========================================== */
.guild-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.guild-btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.guild-btn-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    color: white;
}

.guild-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    color: white;
}

.guild-btn-success {
    background: linear-gradient(135deg, #00c9ff 0%, #92fe9d 100%);
    color: white;
}

.guild-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 201, 255, 0.4);
    color: white;
}

.guild-btn-warning {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
    color: white;
}

.guild-btn-info {
    background: linear-gradient(135deg, #E0A458 0%, #A8552B 100%);
    color: white;
}

.guild-btn-secondary {
    background: #6c757d;
    color: white;
}

.guild-btn-outline {
    background: transparent;
    border: 2px solid #ff6b6b;
    color: #ff6b6b;
}

.guild-btn-outline:hover {
    background: #ff6b6b;
    color: white;
}

.guild-btn-outline-light {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.7);
    color: white;
}

.guild-btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
}

.guild-btn-outline-light.active {
    background: white;
    color: #ff6b6b;
}

.guild-btn-group {
    display: inline-flex;
    gap: 0.25rem;
}

/* ==========================================
   徽章樣式
   ========================================== */
.guild-badge {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
}

.guild-badge-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    color: white;
}

.guild-badge-success {
    background: linear-gradient(135deg, #00c9ff 0%, #92fe9d 100%);
    color: white;
}

.guild-badge-warning {
    background: linear-gradient(135deg, #feca57 0%, #ff9ff3 100%);
    color: white;
}

.guild-badge-info {
    background: linear-gradient(135deg, #E0A458 0%, #A8552B 100%);
    color: white;
}

.guild-badge-danger {
    background: #dc3545;
    color: white;
}

.guild-badge-secondary {
    background: #6c757d;
    color: white;
}

/* ==========================================
   分頁樣式
   ========================================== */
.guild-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.guild-pagination a,
.guild-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #ff6b6b;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.guild-pagination a:hover {
    background: #ff6b6b;
    color: white;
    transform: translateY(-2px);
}

.guild-pagination .active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    color: white;
}

/* ==========================================
   頁面標題
   ========================================== */
.guild-page-header {
    margin-bottom: 2rem;
    padding: 0;
}

.guild-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    background:
        linear-gradient(135deg, rgba(45, 31, 23, 0.94), rgba(59, 89, 152, 0.78)),
        #2D1F17;
    border-radius: 20px;
    padding: 1.75rem 2rem;
    border: 2px solid rgba(229, 184, 66, 0.5);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.guild-header-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 85% 20%, rgba(229, 184, 66, 0.22), transparent 45%);
    pointer-events: none;
}

.guild-header-main {
    text-align: left;
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 220px;
}

.guild-page-header h1 {
    font-size: clamp(1.7rem, 3vw, 2.4rem);
    color: #FFF8E7;
    margin: 0 0 0.5rem 0;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    letter-spacing: -0.3px;
}

.guild-page-header h1 i {
    margin-right: 0.65rem;
    color: #E5B842;
    text-shadow: 0 0 18px rgba(229, 184, 66, 0.45);
}

.guild-page-header p {
    color: rgba(244, 232, 193, 0.85);
    font-size: 1.05rem;
    margin: 0;
    font-weight: 400;
    text-shadow: none;
}

.guild-header-badge {
    margin-top: 0;
    display: flex;
    justify-content: flex-end;
    position: relative;
    z-index: 1;
}

.guild-badge-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.95);
    color: #ff6b6b;
    padding: 0.875rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.guild-badge-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    background: #ffffff;
    border-color: #ffd700;
    color: #ff6b6b;
}

.guild-badge-link i:first-child {
    color: #ff6b6b;
    font-size: 1.1rem;
}

.guild-badge-link i:last-child {
    color: #ff6b6b;
    font-size: 0.9rem;
    transition: transform 0.3s ease;
}

.guild-badge-link:hover i:last-child {
    transform: translateX(4px);
}

.badge-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.badge-name {
    color: #ff6b6b;
    font-weight: 700;
    font-size: 1.05rem;
}

.guild-badge-link:hover .badge-name {
    color: #ff6b6b;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .guild-header-content {
        padding: 2rem 1.5rem;
    }
    
    .guild-page-header h1 {
        font-size: 2rem;
    }
    
    .guild-page-header p {
        font-size: 1rem;
    }
    
    .guild-badge-link {
        padding: 0.75rem 1.25rem;
        font-size: 0.9rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .badge-label,
    .badge-name {
        font-size: 0.85rem;
    }
}

/* ==========================================
   排行榜頭部
   ========================================== */
.guild-ranking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ==========================================
   Tab 導航（自定義，不用 Bootstrap）
   ========================================== */
.guild-tabs {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    padding: 0.4rem;
    background: rgba(45, 31, 23, 0.72);
    border: 1px solid rgba(229, 184, 66, 0.35);
    border-radius: 999px;
    border-bottom: 1px solid rgba(229, 184, 66, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.guild-tab {
    padding: 0.65rem 1.15rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    border-bottom: 1px solid transparent;
    color: #F4E8C1;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.guild-tab:hover {
    color: #2D1F17;
    background: rgba(229, 184, 66, 0.55);
}

.guild-tab.active {
    color: #2D1F17;
    border-color: #A9761F;
    background: linear-gradient(180deg, #E5B842, #C5922A);
    box-shadow: 0 4px 14px rgba(197, 146, 42, 0.4);
}

.guild-tab-content {
    display: none;
}

.guild-tab-content.active {
    display: block;
}

/* ==========================================
   表單樣式
   ========================================== */
.guild-form-group {
    margin-bottom: 1rem;
}

.guild-form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.guild-form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.guild-form-control:focus {
    outline: none;
    border-color: #E8C46B;
    box-shadow: 0 0 0 3px rgba(232, 196, 107, 0.2);
}

textarea.guild-form-control {
    resize: vertical;
    min-height: 100px;
}

.guild-form-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.guild-img-fluid {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   成員列表
   ========================================== */
.guild-member-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid rgba(229, 184, 66, 0.35);
    border-radius: 12px;
    background: rgba(255, 253, 246, 0.95);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(45, 31, 23, 0.06);
    min-width: 0;
    height: 100%;
}

.guild-member-card:hover {
    box-shadow: 0 4px 16px rgba(169, 118, 31, 0.18);
    transform: translateY(-2px);
    border-color: rgba(229, 184, 66, 0.55);
}

.guild-member-avatar,
.guild-member-avatar-placeholder {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    max-width: 48px;
    max-height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    display: block;
}

.guild-member-avatar-placeholder {
    background: linear-gradient(135deg, #8A7360 0%, #5C4636 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.guild-member-avatar.is-hidden,
.guild-member-avatar-placeholder.is-hidden {
    display: none !important;
}

.guild-member-info {
    flex: 1;
    min-width: 0;
    padding: 0.35rem 0.55rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(45, 31, 23, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.guild-member-name {
    font-weight: 600;
    margin: 0 0 0.2rem 0;
    color: #2D1F17;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guild-member-role {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================
   留言板
   ========================================== */
.guild-message-item {
    padding: 1.25rem;
    border-bottom: 1px solid #e9ecef;
    background: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.guild-message-item:hover {
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.1);
}

.guild-message-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.guild-message-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.guild-message-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.guild-message-content {
    word-wrap: break-word;
    word-break: break-word;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    white-space: normal;
    color: #333;
}

.guild-message-content br {
    line-height: 1.5;
    display: block;
    margin: 0;
    content: "";
}

.guild-message-content br + br {
    margin-top: 0.25em;
}

.guild-message-actions {
    display: flex;
    gap: 0.5rem;
}

.guild-message-action-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.guild-message-action-btn:hover {
    background: #f8f9fa;
}

.guild-message-action-btn.danger:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* ==========================================
   消息/公告卡片
   ========================================== */
.guild-post-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.guild-post-card:hover {
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.15);
    transform: translateY(-2px);
}

.guild-post-header {
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05) 0%, rgba(255, 165, 0, 0.05) 100%);
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guild-post-body {
    padding: 1rem;
}

.guild-post-images {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.guild-post-images img {
    max-width: 400px;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.guild-post-images img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 圖片放大模态框 */
.guild-image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.guild-image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.guild-image-modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.guild-image-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.guild-image-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.guild-image-modal-close:active {
    transform: rotate(90deg) scale(0.9);
}

/* ==========================================
   空狀態
   ========================================== */
.guild-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.guild-empty-state i {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
    display: block;
}

/* ==========================================
   工具類別
   ========================================== */
.guild-text-muted { color: #6c757d; }
.guild-text-center { text-align: center; }
.guild-text-small { font-size: 0.875rem; }

.guild-mb-3 { margin-bottom: 1rem; }
.guild-mb-4 { margin-bottom: 1.5rem; }
.guild-mb-5 { margin-bottom: 2rem; }
.guild-mt-4 { margin-top: 1.5rem; }
.guild-my-5 { margin-top: 2rem; margin-bottom: 2rem; }

.guild-d-flex { display: flex; }
.guild-justify-between { justify-content: space-between; }
.guild-align-center { align-items: center; }
.guild-flex-wrap { flex-wrap: wrap; }
.guild-gap-2 { gap: 0.5rem; }

/* ==========================================
   響應式設計
   ========================================== */
@media (max-width: 768px) {
    .guild-container {
        padding: 1rem;
    }
    
    .guild-page-header h1 {
        font-size: 1.75rem;
    }
    
    .guild-ranking-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .guild-tabs {
        overflow-x: auto;
    }
    
    .guild-member-card {
        flex-direction: row;
        text-align: left;
    }
}

/* ==========================================
   橫幅圖片
   ========================================== */
.guild-banner {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: block;
}

/* ==========================================
   公會詳情頁標題區
   ========================================== */
.guild-detail-header {
    background:
        linear-gradient(135deg, rgba(45, 31, 23, 0.94), rgba(59, 89, 152, 0.78)),
        #2D1F17;
    border-radius: 20px;
    padding: 1.75rem 2rem;
    margin-bottom: 1.75rem;
    border: 2px solid rgba(229, 184, 66, 0.5);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    position: relative;
    overflow: hidden;
}

.guild-detail-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 90% 15%, rgba(229, 184, 66, 0.22), transparent 42%);
    pointer-events: none;
    animation: none;
}

.guild-detail-title {
    position: relative;
    z-index: 1;
    flex: 1;
}

.guild-detail-title h1 {
    font-size: 2.5rem;
    margin: 0;
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.guild-detail-title h1 i {
    margin-right: 0.75rem;
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.guild-detail-meta {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin-top: 0.5rem;
}

.guild-detail-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* ==========================================
   Alert 提示框
   ========================================== */
.guild-alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.guild-alert i {
    margin-top: 0.15rem;
}

.guild-alert-info {
    background: #e7f3ff;
    color: #0c5460;
    border: 1px solid #b8daff;
}

.guild-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.guild-alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.guild-alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ==========================================
   統計卡片
   ========================================== */
.guild-stat-card {
    border-radius: 12px;
    padding: 1.25rem;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.guild-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.guild-stat-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guild-stat-info {
    flex: 1;
}

.guild-stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.guild-stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.guild-stat-icon {
    font-size: 3rem;
    opacity: 0.5;
}

/* ==========================================
   快速操作按鈕
   ========================================== */
.guild-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.guild-quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1.5rem;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    background: white;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 140px;
    text-align: center;
    position: relative;
}

.guild-quick-action-btn:hover {
    border-color: #E8C46B;
    background: rgba(232, 196, 107, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.guild-quick-action-btn i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #E8C46B;
}

.guild-quick-action-btn span {
    font-weight: 500;
}

.guild-quick-action-btn .guild-badge {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

/* ==========================================
   列表項目
   ========================================== */
.guild-list-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #dee2e6;
}

.guild-list-item:last-child {
    border-bottom: none;
}

/* ==========================================
   Modal 樣式
   ========================================== */
.guild-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guild-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.guild-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 10000;
}

.guild-modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.guild-modal-header h4 {
    margin: 0;
    font-size: 1.25rem;
}

.guild-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.guild-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

.guild-modal-body {
    padding: 1.25rem;
}

.guild-modal-footer {
    padding: 1.25rem;
    border-top: 1px solid #dee2e6;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.guild-btn-danger {
    background: #dc3545;
    color: white;
}

.guild-btn-danger:hover {
    background: #c82333;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

/* ==========================================
   表單頁面樣式改進
   ========================================== */
.guild-form-group {
    margin-bottom: 1.5rem;
}

.guild-form-group:last-child {
    margin-bottom: 0;
}

/* 消息類型選擇器樣式 */
.guild-type-selector {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.guild-type-option {
    flex: 1;
    position: relative;
}

.guild-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.guild-type-option .guild-type-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    text-align: center;
}

.guild-type-option input[type="radio"]:checked + .guild-type-btn,
.guild-type-option .guild-type-btn.active {
    border-color: transparent;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.guild-type-option input[type="radio"][value="event"]:checked + .guild-type-btn,
.guild-type-option input[type="radio"][value="event"] + .guild-type-btn.active {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
}

.guild-type-option input[type="radio"][value="announcement"]:checked + .guild-type-btn,
.guild-type-option input[type="radio"][value="announcement"] + .guild-type-btn.active {
    background: linear-gradient(135deg, #E0A458 0%, #A8552B 100%);
}

.guild-type-option .guild-type-btn:hover {
    border-color: #E8C46B;
    transform: translateY(-1px);
}

/* 文件上傳樣式改進 */
input[type="file"].guild-form-control {
    padding: 0.5rem;
    border: 2px dashed #dee2e6;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="file"].guild-form-control:hover {
    border-color: #E8C46B;
    background: #f0f4ff;
}

input[type="file"].guild-form-control:focus {
    border-color: #E8C46B;
    background: white;
    border-style: solid;
}

/* 複選框樣式改進 */
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #E8C46B;
}

/* 表單按鈕組 */
.guild-form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
}

.guild-form-actions .guild-btn {
    width: 100%;
    justify-content: center;
}

/* ==========================================
   響應式調整
   ========================================== */
@media (max-width: 992px) {
    .guild-stat-card {
        margin-bottom: 0;
    }
    
    .guild-detail-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .guild-detail-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .guild-detail-actions .guild-btn {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 576px) {
    .guild-quick-actions {
        flex-direction: column;
    }
    
    .guild-quick-action-btn {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
    }
    
    .guild-quick-action-btn i {
        margin-bottom: 0;
    }
    
    .guild-type-selector {
        flex-direction: column;
    }
    
    .guild-detail-title h1 {
        font-size: 1.75rem;
    }
}
