/* ============================================
   攻略論壇 — Strategy Forum Styles (列表重排版)
   ============================================ */

/* ── 頁面佈局：內容少時 footer 貼底 ── */
html {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
}

.main-content {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: calc(100vh - 160px);
    min-height: calc(100dvh - 160px);
}

@keyframes forumFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── 單一頁面殼 ── */
.forum-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 20px 3rem;
    box-sizing: border-box;
}

/* ── 頂部：標題 + 搜尋 ── */
.forum-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding: 1.1rem 1.35rem;
    background:
        linear-gradient(135deg, rgba(45, 31, 23, 0.94), rgba(59, 89, 152, 0.72)),
        #2D1F17;
    border: 1px solid rgba(229, 184, 66, 0.45);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: forumFadeUp 0.45s ease both;
}

.forum-top-brand {
    min-width: 0;
    flex: 1;
}

.forum-page-title {
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: 800;
    color: #FFF8E7;
    margin: 0 0 0.2rem;
    line-height: 1.25;
}

.forum-page-title i {
    color: #E5B842;
    margin-right: 0.35rem;
}

.forum-page-subtitle {
    margin: 0;
    color: rgba(244, 232, 193, 0.78);
    font-size: 0.88rem;
}

.forum-top-search {
    flex: 0 1 360px;
    min-width: 220px;
    width: 100%;
}

.forum-search-inner {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(255, 253, 246, 0.96);
    border: 1px solid rgba(229, 184, 66, 0.4);
    border-radius: 999px;
    padding: 0.3rem 0.35rem 0.3rem 0.9rem;
}

.forum-search-icon {
    color: #A9761F;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.forum-search-input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: #2D1F17;
    outline: none;
    font-family: inherit;
}

.forum-search-input::placeholder {
    color: rgba(58, 36, 23, 0.4);
}

.forum-search-btn {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #E5B842, #A9761F);
    color: #2D1F17;
    font-size: 0.84rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: filter 0.2s;
}

.forum-search-btn:hover {
    filter: brightness(1.06);
}

.forum-search-clear {
    margin-right: 0.15rem;
}

/* ── 工具列 ── */
.forum-toolbar {
    display: flex;
    gap: 0.55rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.forum-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    border: none;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.forum-btn-primary {
    background: linear-gradient(135deg, #6F8FC9, #3B5998);
    color: #fff;
    box-shadow: 0 3px 12px rgba(59, 89, 152, 0.28);
}
.forum-btn-primary:hover { transform: translateY(-1px); color: #fff; }

.forum-btn-secondary {
    background: linear-gradient(135deg, #E8C46B, #A9761F);
    color: #2D1F17;
    box-shadow: 0 3px 12px rgba(169, 118, 31, 0.25);
}
.forum-btn-secondary:hover { transform: translateY(-1px); color: #2D1F17; }

.forum-btn-outline {
    background: #FFFDF6;
    color: #3A2417;
    border: 1px solid rgba(58, 36, 23, 0.18);
}
.forum-btn-outline:hover {
    border-color: rgba(169, 118, 31, 0.45);
    background: #fff;
}

.forum-btn-danger {
    background: linear-gradient(135deg, #B3452F, #8C3320);
    color: #fff;
}
.forum-btn-danger:hover { color: #fff; }

.forum-btn-sm { padding: 0.3rem 0.75rem; font-size: 0.78rem; }

.forum-sort-hint {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: rgba(58, 36, 23, 0.55);
    margin: 0 0 0.85rem;
    padding: 0.45rem 0.75rem;
    background: rgba(232, 196, 107, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(232, 196, 107, 0.18);
}

.forum-sort-hint i { color: #C5922A; }

/* ── 分類 Tabs ── */
.forum-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(229, 184, 66, 0.28);
}

.forum-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: transparent;
    border: 1px solid transparent;
    color: #5C4636;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.forum-tab:hover {
    background: rgba(255, 253, 246, 0.9);
    border-color: rgba(229, 184, 66, 0.35);
    color: #2D1F17;
}

.forum-tab.is-active {
    background: linear-gradient(135deg, #E5B842, #A9761F);
    color: #2D1F17;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(169, 118, 31, 0.25);
}

.forum-tab-count {
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 4px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(45, 31, 23, 0.08);
    color: #8A6418;
    line-height: 1;
}

.forum-tab.is-active .forum-tab-count {
    background: rgba(45, 31, 23, 0.14);
    color: #2D1F17;
}

/* ── 貢獻者精簡列 ── */
.forum-contrib {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.forum-contrib-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #8A6418;
    letter-spacing: 0.04em;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.forum-contrib-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    min-width: 0;
}

.forum-contributor-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FFFDF6;
    border: 1px solid rgba(229, 184, 66, 0.28);
    border-radius: 999px;
    padding: 3px 10px 3px 3px;
    text-decoration: none;
    color: #3A2417;
    transition: border-color 0.2s, background 0.2s;
    cursor: default;
}

.forum-contributor-chip.is-self {
    cursor: pointer;
    border-color: rgba(59, 89, 152, 0.4);
}

.forum-contributor-chip.is-self:hover {
    background: #fff;
    border-color: rgba(59, 89, 152, 0.55);
}

.forum-contributor-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.forum-contributor-name {
    font-size: 0.78rem;
    font-weight: 600;
    max-width: 7rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.forum-contributor-count {
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 4px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(232, 196, 107, 0.2);
    color: #8A6418;
}

.forum-contributor-edit-hint {
    font-size: 0.68rem;
    color: #3B5998;
}

.forum-contributor-chip.forum-contributor-rank-1 {
    border-color: rgba(255, 193, 7, 0.7);
}
.forum-contributor-chip.forum-contributor-rank-1 .forum-contributor-count {
    background: #ffc107;
    color: #5d4037;
}
.forum-contributor-chip.forum-contributor-rank-2 {
    border-color: rgba(158, 158, 158, 0.65);
}
.forum-contributor-chip.forum-contributor-rank-2 .forum-contributor-count {
    background: #e0e0e0;
    color: #424242;
}
.forum-contributor-chip.forum-contributor-rank-3 {
    border-color: rgba(205, 127, 50, 0.6);
}
.forum-contributor-chip.forum-contributor-rank-3 .forum-contributor-count {
    background: #cd7f32;
    color: #4e342e;
}

/* ── 主體 / 分類 section ── */
.forum-main {
    width: 100%;
}

.forum-category-section {
    margin-bottom: 1.75rem;
}

.forum-category-section--filtered {
    margin-bottom: 1rem;
}

.forum-category-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.forum-category-head-text {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    min-width: 0;
    flex-wrap: wrap;
}

.forum-category-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
    color: #2D1F17;
    position: relative;
    padding-left: 12px;
    line-height: 1.3;
}

.forum-category-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.2em;
    bottom: 0.2em;
    width: 3px;
    border-radius: 2px;
    background: linear-gradient(180deg, #E5B842, #A9761F);
}

.forum-category-count {
    font-size: 0.8rem;
    color: rgba(58, 36, 23, 0.45);
    font-weight: 600;
}

.forum-category-actions {
    display: flex;
    gap: 0.35rem;
    flex-shrink: 0;
}

.forum-section-heading {
    font-size: 1.05rem;
    font-weight: 700;
    color: #2D1F17;
    margin: 0 0 1rem;
}

.forum-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(58, 36, 23, 0.4);
}

.forum-empty-state i {
    font-size: 2.2rem;
    display: block;
    margin-bottom: 0.65rem;
    opacity: 0.35;
}

.forum-empty-state p {
    margin: 0;
}

/* ── 文章網格 ── */
.forum-cards-list,
.forum-cards-list--expanded {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
    gap: 0.9rem;
    width: 100%;
    align-items: stretch;
}

.forum-cards-list.forum-sort-saving {
    opacity: 0.65;
    pointer-events: none;
}

.forum-article-sort-wrap {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.forum-article-sort-handle {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 3;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: #C5922A;
    cursor: grab;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.forum-article-sort-handle:active { cursor: grabbing; }

.forum-article-sort-wrap.forum-article-dragging {
    opacity: 0.55;
}

.forum-article-sort-wrap.forum-article-drag-over .forum-article-card {
    box-shadow: 0 0 0 2px rgba(197, 146, 42, 0.5);
}

/* ── 文章卡片（乾淨雜誌風） ── */
.forum-article-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-width: 0;
    background: #FFFDF6;
    border: 1px solid rgba(229, 184, 66, 0.32);
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 14px rgba(45, 31, 23, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.forum-article-card:hover {
    transform: translateY(-3px);
    border-color: rgba(197, 146, 42, 0.55);
    box-shadow: 0 10px 24px rgba(45, 31, 23, 0.12);
}

.forum-card-cover-wrap {
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    aspect-ratio: 16 / 10;
    background: #F6ECC9;
}

.forum-card-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.forum-article-card:hover .forum-card-cover {
    transform: scale(1.04);
}

.forum-card-cover-placeholder {
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: rgba(169, 118, 31, 0.35);
    background: linear-gradient(135deg, #FBF3DC, #F6ECC9);
}

.forum-card-body {
    padding: 0.7rem 0.8rem 0.85rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.45rem;
}

.forum-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #2D1F17;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.forum-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}

.forum-card-author-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.forum-card-author-name {
    font-size: 0.74rem;
    color: rgba(58, 36, 23, 0.55);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.forum-card-date {
    font-size: 0.7rem;
    color: rgba(58, 36, 23, 0.4);
    flex-shrink: 0;
}

/* ── 空卡 / 新增 ── */
.forum-empty-card {
    width: 100%;
    min-width: 0;
    min-height: 140px;
    height: 100%;
    border-radius: 14px;
    background: rgba(255, 253, 246, 0.7);
    border: 1.5px dashed rgba(229, 184, 66, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(58, 36, 23, 0.4);
    font-size: 0.84rem;
    gap: 8px;
    box-sizing: border-box;
    text-decoration: none;
}

.forum-empty-card i {
    font-size: 1.5rem;
}

.forum-empty-card--add {
    color: rgba(169, 118, 31, 0.65);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.forum-empty-card--add:hover {
    border-color: rgba(169, 118, 31, 0.55);
    background: rgba(232, 196, 107, 0.1);
    color: #8A6418;
}

/* ── 搜尋結果 ── */
.forum-search-results {
    animation: forumFadeUp 0.35s ease both;
}

.forum-search-result-item {
    background: #FFFDF6;
    border: 1px solid rgba(229, 184, 66, 0.28);
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 0.65rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.forum-search-result-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(45, 31, 23, 0.08);
}

.forum-search-result-cover {
    width: 72px;
    height: 54px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #F6ECC9;
}

.forum-search-result-cover--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: rgba(169, 118, 31, 0.35);
}

.forum-search-result-body { flex: 1; min-width: 0; }
.forum-search-result-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2D1F17;
    margin-bottom: 0.25rem;
}
.forum-search-result-meta {
    font-size: 0.78rem;
    color: rgba(58, 36, 23, 0.5);
}

/* ── 分類排序列表（modal 用） ── */
.forum-cat-sort-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.forum-cat-sort-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    background: #FFFDF6;
    border: 1px solid rgba(229, 184, 66, 0.25);
    border-radius: 10px;
}

.forum-cat-sort-index {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(232, 196, 107, 0.2);
    color: #8A6418;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.forum-cat-sort-name {
    flex: 1;
    font-weight: 600;
    color: #2D1F17;
    min-width: 0;
}

.forum-cat-sort-actions {
    display: flex;
    gap: 0.25rem;
}

.forum-cat-sort-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(229, 184, 66, 0.3);
    border-radius: 8px;
    background: #fff;
    color: #C5922A;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.forum-cat-sort-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* 舊 class 相容（避免其他頁殘留） */
.forum-hero,
.forum-hero-inner,
.forum-search-bar,
.forum-cat-nav-wrap,
.forum-contributors-wrap,
.forum-cards-track,
.forum-category-row,
.forum-filtered-head,
.forum-section-divider {
    /* no-op legacy shells */
}

/* ── RWD ── */
@media (max-width: 720px) {
    .forum-page {
        padding: 1rem 14px 2.5rem;
    }

    .forum-top {
        padding: 1rem;
        align-items: stretch;
    }

    .forum-top-search {
        flex: 1 1 100%;
    }

    .forum-cards-list,
    .forum-cards-list--expanded {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.65rem;
    }

    .forum-card-title {
        font-size: 0.82rem;
    }
}

@media (max-width: 400px) {
    .forum-page-title {
        font-size: 1.25rem;
    }
}


/* ============================================
   文章詳情頁 — Article Page
   ============================================ */
.article-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 4rem;
    animation: forumFadeUp 0.7s ease both;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-page--short {
    justify-content: center;
    min-height: 40vh;
}

.article-cover-wrap {
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    max-height: 460px;
}

.article-cover-img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    display: block;
}

.article-header {
    margin-bottom: 2rem;
}

.article-category-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 50px;
    background: linear-gradient(135deg, rgba(232,196,107,0.15), rgba(59,89,152,0.1));
    border: 1px solid rgba(232,196,107,0.25);
    font-size: 0.78rem;
    font-weight: 600;
    color: #E8C46B;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-title {
    font-size: 2rem;
    font-weight: 800;
    color: #3A2417;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.article-meta-row {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    padding: 1rem 1.2rem;
    background: rgba(255,255,255,0.65);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(232,196,107,0.15);
}

.article-author-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.article-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.article-author-name {
    font-weight: 600;
    color: #3A2417;
    font-size: 0.92rem;
}

.article-meta-sep {
    color: rgba(58,36,23,0.25);
}

.article-meta-date, .article-meta-views {
    font-size: 0.82rem;
    color: rgba(58,36,23,0.5);
}

/* 文章內容樣式 */
.article-content {
    flex: 1;
    background: linear-gradient(135deg, rgba(255,255,255,0.85), rgba(255,255,255,0.7)) padding-box,
                linear-gradient(135deg, rgba(232,196,107,0.15), rgba(59,89,152,0.12)) border-box;
    border: 2px solid transparent;
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
    line-height: 1.9;
    color: #2d3748;
    margin-bottom: 2rem;
}

.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .article-content h6 {
    color: #3A2417;
    margin: 1.5rem 0 0.75rem;
    font-weight: 700;
}
.article-content h2 { font-size: 1.5rem; border-bottom: 2px solid rgba(232,196,107,0.2); padding-bottom: 0.4rem; }
.article-content h3 { font-size: 1.2rem; }
.article-content p { margin-bottom: 1rem; }
.article-content img { max-width: 100%; border-radius: 10px; margin: 0.75rem 0; }
.article-content a { color: #E8C46B; text-decoration: underline; }
.article-content ul, .article-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.article-content li { margin-bottom: 0.3rem; }
.article-content blockquote {
    border-left: 4px solid rgba(232,196,107,0.4);
    padding-left: 1rem;
    margin: 1rem 0;
    color: rgba(58,36,23,0.7);
    font-style: italic;
}
.article-content pre, .article-content code {
    background: rgba(232,196,107,0.08);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 0.88rem;
}
.article-content pre { padding: 1rem; overflow-x: auto; }
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}
.article-content th, .article-content td {
    padding: 0.65rem 1rem;
    border: 1px solid rgba(232,196,107,0.2);
    text-align: left;
}
.article-content thead tr { background: rgba(232,196,107,0.1); }

.article-actions-row {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1.5rem;
    flex-wrap: wrap;
}

/* ── 麵包屑 ── */
.forum-breadcrumb {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0.5rem 20px 1.5rem;
    font-size: 0.85rem;
    color: rgba(58,36,23,0.55);
    animation: forumFadeUp 0.5s ease both;
}

.forum-breadcrumb a { color: rgba(58,36,23,0.6); text-decoration: none; transition: color 0.2s; }
.forum-breadcrumb a:hover { color: #3B5998; }
.forum-breadcrumb .sep { margin: 0 6px; }

@media (max-width: 768px) {
    .article-title { font-size: 1.5rem; }
    .article-content { padding: 1.5rem; }
    .article-page { padding: 0 12px 3rem; }
}


/* ============================================
   文章編輯頁 — Edit Page
   ============================================ */
.article-edit-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px 4rem;
    animation: forumFadeUp 0.7s ease both;
}

.article-edit-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.8)) padding-box,
                linear-gradient(135deg, rgba(232,196,107,0.2), rgba(59,89,152,0.15)) border-box;
    border: 2px solid transparent;
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.article-edit-title {
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #E8C46B, #3B5998);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(232,196,107,0.15);
}

.forum-form-group {
    margin-bottom: 1.4rem;
}

.forum-form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #3A2417;
    margin-bottom: 0.5rem;
    letter-spacing: 0.2px;
}

.forum-form-label .required { color: #B3452F; margin-left: 3px; }

.forum-form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid rgba(232,196,107,0.2);
    border-radius: 12px;
    background: rgba(255,255,255,0.85);
    font-size: 0.92rem;
    color: #3A2417;
    transition: all 0.25s ease;
    font-family: var(--ms-font-body), sans-serif;
}

.forum-form-control:focus {
    outline: none;
    border-color: rgba(232,196,107,0.5);
    background: white;
    box-shadow: 0 0 0 4px rgba(232,196,107,0.08);
}

.forum-form-hint { font-size: 0.78rem; color: rgba(58,36,23,0.5); margin-top: 0.35rem; }

.forum-cover-preview {
    max-height: 200px;
    border-radius: 12px;
    object-fit: cover;
    margin-top: 0.75rem;
    display: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.forum-cover-preview.show { display: block; }

#tinyEditor {
    border-radius: 0 0 12px 12px;
}

/* ── Profile Modal ── */
.forum-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    z-index: 99999;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem 3rem;
    overflow-y: auto;
    box-sizing: border-box;
}

.forum-modal-overlay.open {
    display: flex;
}

.forum-modal {
    background: linear-gradient(135deg, rgba(255,255,255,0.97), rgba(255,255,255,0.92));
    border-radius: 24px;
    padding: 2rem 2.5rem;
    width: 100%;
    max-width: 640px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.25);
    margin: auto;
    flex-shrink: 0;
    animation: forumFadeUp 0.3s ease;
}

.forum-modal-sm { max-width: 460px; }

.forum-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(232,196,107,0.15);
}

.forum-modal-title {
    font-size: 1.25rem;
    font-weight: 800;
    background: linear-gradient(135deg, #E8C46B, #3B5998);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.forum-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.08);
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.forum-modal-close:hover {
    background: rgba(179,69,47,0.15);
    color: #B3452F;
}

.forum-profile-preview {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(232,196,107,0.06);
    border-radius: 14px;
    margin-bottom: 1.2rem;
}

.forum-profile-preview-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

@media (max-width: 768px) {
    .forum-contributors { padding: 1rem 1.2rem; }
    .forum-cat-nav { padding: 0.85rem 1rem; }
    .forum-cat-nav-list { gap: 0.45rem; }
    .forum-cat-nav-btn { font-size: 0.82rem; padding: 0.4rem 0.8rem; }
    .forum-modal { padding: 1.5rem 1.2rem; }
}

.forum-edit-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 2px solid rgba(232,196,107,0.1);
}
