/* =========================================================
   论坛现代版设计层（forum-modern）
   在 forum-pages.css 之后加载，用于统一覆盖论坛各页视觉。
   设计方向：更柔和的珊瑚粉渐变、更大的圆角与留白、
   卡片悬浮层次、桌面双栏布局、移动端单栏。
   ========================================================= */

:root {
    --fm-pink: #ec6a83;
    --fm-pink-deep: #d94a67;
    --fm-coral: #f2a184;
    --fm-grad: linear-gradient(135deg, #ef7289 0%, #f4a487 100%);
    --fm-grad-soft: linear-gradient(135deg, #fff2f5 0%, #ffedf1 100%);
    --fm-ink: #2d2530;
    --fm-text: #5f5158;
    --fm-muted: #8a7881;
    --fm-line: rgba(217, 74, 103, .13);
    --fm-bg: #fbf7f8;
    --fm-card: #ffffff;
    --fm-radius: 20px;
    --fm-radius-sm: 14px;
    --fm-shadow: 0 10px 30px rgba(217, 74, 103, .07);
    --fm-shadow-hover: 0 18px 44px rgba(217, 74, 103, .14);
}

/* ===== 页面基底 ===== */
.wall-container { background: var(--fm-bg); }

.fm-page {
    max-width: 1160px;
    margin: 0 auto;
    padding: 2rem 1.25rem 3.5rem;
}

/* ===== 横幅 ===== */
.forum-hero {
    position: relative;
    overflow: hidden;
    border-radius: 26px !important;
    background:
        radial-gradient(620px 220px at 12% -12%, rgba(255, 255, 255, .26), transparent 62%),
        radial-gradient(420px 180px at 96% 120%, rgba(255, 219, 186, .35), transparent 70%),
        var(--fm-grad) !important;
    box-shadow: 0 20px 50px rgba(217, 74, 103, .20) !important;
    padding: 2.6rem 2.4rem 2.2rem !important;
    margin-bottom: 1.8rem !important;
}

.forum-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.4rem) !important;
    letter-spacing: .5px;
    margin-bottom: .6rem !important;
}

.forum-hero p { font-size: 1rem; opacity: .95; }

.hero-crumb a {
    background: rgba(255, 255, 255, .16) !important;
    border: 1px solid rgba(255, 255, 255, .28);
    backdrop-filter: blur(6px);
    transition: all .25s ease;
}

.hero-crumb a:hover {
    background: rgba(255, 255, 255, .3) !important;
    transform: translateY(-1px);
}

.hero-stat {
    background: rgba(255, 255, 255, .16) !important;
    border: 1px solid rgba(255, 255, 255, .24);
    backdrop-filter: blur(6px);
}

/* ===== 首页双栏布局 ===== */
.fm-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 316px;
    gap: 24px;
    align-items: start;
}

.fm-layout .forum-container {
    max-width: none;
    margin: 0;
    padding: 0;
}

.fm-side {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fm-card {
    background: var(--fm-card);
    border: 1px solid var(--fm-line);
    border-radius: var(--fm-radius);
    box-shadow: var(--fm-shadow);
    padding: 1.25rem 1.3rem;
}

.fm-card h3 {
    margin: 0 0 .9rem;
    font-size: .98rem;
    color: var(--fm-ink);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.fm-card h3 i { color: var(--fm-pink); }

.fm-cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .2rem; }

.fm-cat-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .55rem .6rem;
    border-radius: 10px;
    color: var(--fm-text);
    font-size: .9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all .2s ease;
}

.fm-cat-list a:hover {
    background: var(--fm-grad-soft);
    color: var(--fm-pink-deep);
    text-decoration: none;
}

.fm-cat-list .fm-count {
    font-size: .76rem;
    color: var(--fm-muted);
    background: #fff5f7;
    border-radius: 999px;
    padding: .05rem .5rem;
}

.fm-tag-cloud { display: flex; flex-wrap: wrap; gap: .45rem; }

.fm-tag-cloud a {
    padding: .3rem .75rem;
    border-radius: 999px;
    background: var(--fm-grad-soft);
    color: #e0475e;
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
}

.fm-tag-cloud a:hover {
    background: var(--fm-grad);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.fm-cta {
    background: var(--fm-grad);
    border: none;
    color: #fff;
    text-align: center;
    padding: 1.5rem 1.3rem;
}

.fm-cta h3 { color: #fff; justify-content: center; }
.fm-cta p { margin: 0 0 1rem; font-size: .86rem; opacity: .92; line-height: 1.7; }

.fm-cta a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #fff;
    color: var(--fm-pink-deep);
    font-weight: 700;
    font-size: .9rem;
    padding: .6rem 1.3rem;
    border-radius: 999px;
    text-decoration: none;
    transition: transform .2s ease;
}

.fm-cta a:hover { transform: translateY(-2px); text-decoration: none; }

/* ===== 统计卡 ===== */
.stat-cards { gap: 14px !important; margin-bottom: 1.6rem !important; }

.stat-card {
    border-radius: var(--fm-radius) !important;
    border: 1px solid var(--fm-line) !important;
    box-shadow: var(--fm-shadow) !important;
    padding: 1.2rem 1.3rem !important;
    transition: transform .25s ease, box-shadow .25s ease;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--fm-shadow-hover) !important; }

.stat-card .stat-icon {
    width: 48px !important; height: 48px !important;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 14px !important;
    background: var(--fm-grad-soft);
    color: var(--fm-pink) !important;
    font-size: 1.15rem !important;
    margin: 0 auto .6rem !important;
}

.stat-card h3 { font-size: .8rem !important; color: var(--fm-muted) !important; font-weight: 500; margin: 0 0 .3rem !important; }

.stat-num { font-size: 1.7rem !important; font-weight: 800 !important; color: var(--fm-ink) !important; margin: 0 !important; font-variant-numeric: tabular-nums; }

/* ===== 快捷导航 / 搜索 ===== */
.quick-nav, .search-bar {
    border-radius: var(--fm-radius) !important;
    border: 1px solid var(--fm-line) !important;
    box-shadow: var(--fm-shadow) !important;
    padding: 1.1rem 1.2rem !important;
    margin-bottom: 1.4rem !important;
}

.nav-chip, .tag-chip {
    border-radius: 999px !important;
    border: 1px solid var(--fm-line) !important;
    background: #fff !important;
    color: var(--fm-text) !important;
    transition: all .22s ease;
}

.nav-chip:hover, .tag-chip:hover {
    background: var(--fm-grad) !important;
    color: #fff !important;
    border-color: transparent !important;
    transform: translateY(-1px);
}

.search-form {
    background: #fff7f9;
    border: 1px solid var(--fm-line);
    border-radius: 999px;
    padding: .3rem .3rem .3rem 1.1rem;
}

.search-input { border: none !important; background: transparent !important; box-shadow: none !important; }

.btn-pill {
    border-radius: 999px !important;
    background: var(--fm-grad) !important;
    box-shadow: 0 8px 20px rgba(240, 78, 106, .25) !important;
    transition: transform .2s ease, box-shadow .2s ease;
}

.btn-pill:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(240, 78, 106, .32) !important; }

.btn-ghost {
    border-radius: 999px !important;
    border: 1px solid var(--fm-line) !important;
    background: #fff !important;
    color: var(--fm-pink-deep) !important;
    transition: all .2s ease;
}

.btn-ghost:hover { background: var(--fm-grad-soft) !important; }

/* ===== 板块标题 ===== */
.section-title { margin: 1.8rem 0 1rem !important; }

.section-title h2 {
    font-size: 1.16rem !important;
    color: var(--fm-ink) !important;
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0 !important;
}

.section-title h2::before {
    content: '';
    width: 4px;
    height: 18px;
    border-radius: 4px;
    background: var(--fm-grad);
    display: inline-block;
}

.section-title h2 i { color: var(--fm-pink); font-size: .95rem; }

/* ===== 板块卡片 ===== */
.categories-grid { gap: 14px !important; }

.category-card {
    border-radius: var(--fm-radius) !important;
    border: 1px solid var(--fm-line) !important;
    box-shadow: var(--fm-shadow) !important;
    padding: 1.4rem 1.4rem 1.2rem !important;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--fm-shadow-hover) !important;
    border-color: rgba(255, 107, 129, .34) !important;
}

.category-title h3 { font-size: 1.06rem !important; color: var(--fm-ink) !important; }

.post-count {
    background: var(--fm-grad-soft) !important;
    color: var(--fm-pink-deep) !important;
    border-radius: 999px;
    padding: .12rem .6rem;
    font-size: .75rem !important;
    font-weight: 600;
}

.category-description { color: var(--fm-text) !important; font-size: .88rem; line-height: 1.75; }

.category-footer a { color: var(--fm-pink-deep) !important; font-weight: 600; }

/* ===== 帖子列表 ===== */
.posts-list {
    border-radius: var(--fm-radius) !important;
    border: 1px solid var(--fm-line) !important;
    box-shadow: var(--fm-shadow) !important;
    overflow: hidden;
}

.post-item {
    padding: 1.35rem 1.5rem !important;
    transition: background .22s ease, box-shadow .22s ease;
    position: relative;
}

.post-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--fm-grad);
    opacity: 0;
    transition: opacity .22s ease;
}

.post-item:hover { background: #fffafb !important; }
.post-item:hover::before { opacity: 1; }

.post-avatar {
    width: 42px !important; height: 42px !important;
    border: 2px solid #ffe1e8 !important;
    box-shadow: 0 3px 10px rgba(255, 107, 129, .18);
}

.post-author { color: var(--fm-pink-deep) !important; font-weight: 700; }

.post-category {
    background: var(--fm-grad-soft);
    color: #e0475e;
    border-radius: 999px;
    padding: .08rem .55rem;
    font-size: .75rem;
    font-weight: 600;
}

.post-meta { color: var(--fm-muted) !important; font-size: .84rem !important; gap: .75rem !important; }

.post-title a {
    color: var(--fm-ink) !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    letter-spacing: .2px;
}
.post-title a:hover { color: var(--fm-pink-deep) !important; }

.post-content { color: var(--fm-text) !important; font-size: .9rem !important; line-height: 1.75 !important; }

.post-footer { color: var(--fm-muted) !important; font-size: .84rem !important; gap: 1.1rem !important; }
.post-footer-item i, .post-footer i { color: #ffb1c0 !important; }

.share-link { color: var(--fm-pink-deep) !important; }

/* ===== 详情页正文卡片 ===== */
.post-card, .replies-section, .reply-form, .related-block {
    border-radius: var(--fm-radius) !important;
    border: 1px solid var(--fm-line) !important;
    box-shadow: var(--fm-shadow) !important;
}

.post-content { line-height: 1.9 !important; }

/* ===== 分页 ===== */
.pagination a, .pagination span {
    border-radius: 12px !important;
    border-color: var(--fm-line) !important;
}

.pagination .current {
    background: var(--fm-grad) !important;
    border-color: transparent !important;
    box-shadow: 0 6px 16px rgba(240, 78, 106, .22);
}

.pagination a:hover { background: var(--fm-grad) !important; border-color: transparent !important; }

/* ===== 空状态 ===== */
.fx-empty { border-radius: var(--fm-radius); }
.fx-empty-icon { background: var(--fm-grad-soft) !important; color: var(--fm-pink) !important; }

.fx-empty-btn { background: var(--fm-grad) !important; border-radius: 999px !important; }

/* ===== 详情/列表页容器 ===== */
.category-container,
.create-post-container,
.tag-container { max-width: 900px; }

.category-container { padding-top: 2rem !important; }

/* ===== 移动端 ===== */
@media (max-width: 1024px) {
    .fm-layout { grid-template-columns: 1fr; }
    .fm-side { position: static; flex-direction: row; flex-wrap: wrap; }
    .fm-side > .fm-card { flex: 1 1 260px; }
    .fm-cta { flex: 1 1 100%; }
}

@media (max-width: 640px) {
    .fm-page { padding: 1.2rem .9rem 2.5rem; }
    .forum-hero { padding: 1.7rem 1.4rem 1.5rem !important; border-radius: 20px !important; }
    .stat-cards { grid-template-columns: 1fr 1fr !important; }
    .stat-num { font-size: 1.4rem !important; }
    .post-item { padding: 1.15rem 1.1rem !important; }
    .fm-card { padding: 1.1rem 1.15rem; }
}

/* =========================================================
   紧凑化：减少纵向空白，提升信息密度
   ========================================================= */
.fm-page { padding: 1.4rem 1.25rem 2.6rem; }

/* 首页横幅紧贴顶部，去掉 forum-pages.css 额外的 1.5rem 外边距 */
.fm-page { padding-top: .5rem; }
.fm-page.wall-container > .forum-hero { margin-top: 0 !important; }

.forum-hero {
    padding: 1.55rem 1.9rem 1.4rem !important;
    margin-bottom: 1.1rem !important;
    border-radius: 22px !important;
}

.forum-hero h1 { font-size: clamp(1.45rem, 3vw, 1.85rem) !important; margin-bottom: .3rem !important; }
.forum-hero p { font-size: .9rem !important; }

/* 统计卡：图标 | 标题+数字 的横向紧凑排版 */
.stat-cards {
    gap: 10px !important;
    margin: .3rem 0 1.1rem !important;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
}

.stat-card {
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: .7rem;
    padding: .8rem 1rem !important;
    text-align: left !important;
}

.stat-card .stat-icon {
    width: 44px !important; height: 44px !important;
    margin: 0 !important;
    font-size: 1.05rem !important;
}

.stat-card h3 {
    margin: 0 0 .1rem !important;
    font-size: .76rem !important;
    font-weight: 500 !important;
}

.stat-card .stat-num {
    margin: 0 !important;
    font-size: 1.3rem !important;
    line-height: 1.1;
    color: var(--fm-pink-deep) !important;
}

/* 快捷导航 / 搜索 */
.quick-nav, .search-bar {
    padding: .85rem 1rem !important;
    margin-bottom: .95rem !important;
}

.quick-nav-top { gap: .6rem; }
.quick-nav-tags { margin-top: .55rem !important; gap: .35rem !important; }

.section-title { margin: .95rem 0 .6rem !important; }
.section-title h2 { font-size: 1.04rem !important; }
.section-title h2::before { height: 15px; }

/* 板块卡 */
.categories-grid { gap: 10px !important; }

.category-card {
    padding: .95rem 1.1rem .85rem !important;
}

.category-title h3 { font-size: .98rem !important; }
.category-description { font-size: .84rem; line-height: 1.6 !important; margin: .35rem 0 !important; }
.category-footer { margin-top: .45rem !important; font-size: .8rem; }

/* 帖子列表 */
.posts-section, .all-posts-section { margin-bottom: 1.2rem; }

.post-item { padding: 1rem 1.25rem !important; }
.post-header { margin-bottom: .45rem !important; }
.post-title { margin: .2rem 0 .35rem !important; }
.post-content { margin-bottom: .45rem !important; }
.post-footer { font-size: .81rem !important; }

/* 侧边栏 */
.fm-side { gap: 12px; }
.fm-card { padding: 1rem 1.1rem; }
.fm-card h3 { margin-bottom: .65rem; font-size: .92rem; }
.fm-cat-list a { padding: .45rem .55rem; font-size: .86rem; }
.fm-tag-cloud a { padding: .26rem .68rem; font-size: .78rem; }
.fm-cta { padding: 1.15rem 1.1rem; }
.fm-cta h3 { margin-bottom: .5rem !important; }
.fm-cta p { margin-bottom: .8rem; font-size: .82rem; }

@media (max-width: 640px) {
    .fm-page { padding: 1rem .85rem 2rem; }
    .forum-hero { padding: 1.25rem 1.15rem 1.1rem !important; }
    .forum-hero h1 { font-size: 1.35rem !important; }
    .stat-cards { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
    .stat-card { padding: .65rem .75rem !important; grid-template-columns: 36px minmax(0, 1fr) auto; gap: .5rem; }
    .stat-card .stat-icon { width: 36px !important; height: 36px !important; font-size: .95rem !important; }
    .stat-card .stat-num { font-size: 1.1rem !important; }
    .post-item { padding: .9rem 1rem !important; }
    .category-card { padding: .85rem .95rem !important; }
}

/* =========================================================
   配色细节：统一强调色与可访问性焦点
   ========================================================= */
.forum-hero h1 { color: #fff !important; text-shadow: 0 2px 12px rgba(160, 40, 70, .28); }
.forum-hero p { color: rgba(255, 255, 255, .94) !important; }

.fm-card h3 i,
.section-title h2 i { color: var(--fm-pink-deep) !important; }

.fm-tag-cloud a,
.post-category,
.post-count { color: var(--fm-pink-deep) !important; }

.fm-tag-cloud a:hover { background: var(--fm-grad) !important; color: #fff !important; border-color: transparent !important; }

.post-tags-row a {
    background: var(--fm-grad-soft) !important;
    color: var(--fm-pink-deep) !important;
}
.post-tags-row a:hover { background: var(--fm-grad) !important; color: #fff !important; }

.related-block h3 i { color: var(--fm-pink-deep) !important; }
.related-list a:hover { color: var(--fm-pink-deep) !important; }
.related-list li:hover { background: #fff1f4 !important; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--fm-pink);
    outline-offset: 2px;
}

/* 主按钮 hover 加深，避免发灰 */
.btn-pill:hover,
.fx-empty-btn:hover,
.fm-cta a:hover { filter: saturate(1.06) brightness(.98); }
