/* ========================================
   Honor Forum - 主样式表
   ======================================== */

:root {
    --primary: #1a73e8;
    --primary-hover: #1557b0;
    --primary-light: #e8f0fe;
    --success: #198754;
    --warning: #fd7e14;
    --danger: #dc3545;
    --info: #0dcaf0;
    --dark: #1a1a2e;
    --gray-50: #f8f9fa;
    --gray-100: #f0f2f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow: 0 2px 8px rgba(0,0,0,.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --transition: all .2s ease;
    --font: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--gray-100); color: var(--gray-800); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; }
.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* ===== 按钮 ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 20px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
    cursor: pointer; border: none; transition: var(--transition); text-decoration: none;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-hover); color: var(--white); }
.btn-outline { background: transparent; border: 1.5px solid var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #c82333; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 32px; font-size: 16px; }
.btn-block { width: 100%; }

/* ===== 头部导航 ===== */
.header {
    background: var(--white); border-bottom: 1px solid var(--gray-200);
    position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm);
}
.header-inner { display: flex; align-items: center; height: 60px; gap: 24px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--dark); }
.logo-icon { font-size: 28px; color: var(--primary); }
.nav { display: flex; gap: 4px; }
.nav-item { position: relative; }
.nav-link { padding: 8px 16px; border-radius: var(--radius-sm); color: var(--gray-600); font-size: 14px; font-weight: 500; transition: var(--transition); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.nav-link:hover, .nav-link.active { color: var(--primary); background: var(--primary-light); }
.nav-icon-emoji { font-size: 16px; line-height: 1; }
.nav-icon { font-size: 14px; }
.nav-arrow { font-size: 10px; margin-left: 2px; }
.nav-dropdown { display: none; position: absolute; top: 100%; left: 0; min-width: 180px; background: var(--white); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 6px 0; z-index: 200; box-shadow: var(--shadow-lg); }
.nav-item:hover .nav-dropdown { display: block; }
.nav-dropdown-link { display: block; padding: 8px 16px; color: var(--gray-700); font-size: 13px; transition: var(--transition); white-space: nowrap; }
.nav-dropdown-link:hover { color: var(--primary); background: var(--primary-light); }
.nav-dropdown-link--sub { padding-left: 32px; font-size: 12px; color: var(--gray-500); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ===== 头部搜索框 ===== */
.header-search {
    position: relative; display: flex; align-items: center; flex: 1; max-width: 300px;
    margin: 0 16px;
    background: var(--gray-100); border: 1px solid transparent; border-radius: var(--radius-sm);
    transition: var(--transition);
}
.header-search:hover { background: var(--white); border-color: var(--gray-200); box-shadow: var(--shadow-sm); }
.header-search:focus-within { background: var(--white); border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.header-search-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--gray-400); pointer-events: none; transition: var(--transition);
}
.header-search:focus-within .header-search-icon { color: var(--primary); }
.header-search-input {
    width: 100%; height: 36px; padding: 0 56px 0 36px; border: none; background: transparent;
    font-size: 14px; color: var(--gray-700); outline: none;
}
.header-search-input::placeholder { color: var(--gray-400); }
.header-search-btn {
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    height: 28px; padding: 0 10px; border-radius: 4px; border: none;
    background: var(--primary); color: var(--white);
    font-size: 12px; font-weight: 500; cursor: pointer; transition: var(--transition);
    opacity: 0; visibility: hidden;
}
.header-search:hover .header-search-btn,
.header-search:focus-within .header-search-btn,
.header-search-input:not(:placeholder-shown) + .header-search-btn {
    opacity: 1; visibility: visible;
}
.header-search-btn:hover { background: var(--primary-hover); }

@media (max-width: 768px) {
    .header-search { max-width: none; margin: 8px 0; order: 3; width: 100%; }
    .header-inner { flex-wrap: wrap; height: auto; padding: 8px 20px; }
    .header-search-btn { opacity: 1; visibility: visible; }
}
.user-menu { position: relative; }
.user-avatar-link { display: flex; align-items: center; gap: 8px; color: var(--gray-700); }
.user-avatar-sm { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; border: 2px solid var(--gray-200); }
.user-name { font-size: 14px; font-weight: 500; }
.user-menu:hover .dropdown-menu {
    visibility: visible; opacity: 1; transform: translateY(0); pointer-events: auto;
}
.dropdown-menu {
    position: absolute; top: 100%; right: -14px; padding-top: 10px;
    visibility: hidden; opacity: 0; pointer-events: none;
    transform: translateY(-4px);
    transition: visibility 0.15s, opacity 0.15s, transform 0.15s;
    z-index: 200;
    min-width: 178px;
}
.dropdown-menu-inner {
    position: relative; background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 28px rgba(0,0,0,.13), 0 2px 6px rgba(0,0,0,.06);
    padding: 5px 0;
    overflow: hidden;
}
.dropdown-menu-caret {
    position: absolute; top: 4px; right: 24px;
    width: 10px; height: 10px;
    background: var(--white);
    border-left: 1px solid var(--gray-200);
    border-top: 1px solid var(--gray-200);
    transform: rotate(45deg);
    border-top-left-radius: 2px;
}
.dropdown-menu-label {
    padding: 7px 16px 5px;
    font-size: 10px; font-weight: 600;
    letter-spacing: .5px; text-transform: uppercase;
    color: var(--gray-400);
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 3px;
}
.dropdown-menu-item {
    display: flex; align-items: center; gap: 9px;
    padding: 6px 16px; font-size: 13px; color: var(--gray-700);
    transition: var(--transition);
    cursor: pointer;
}
.dropdown-menu-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; flex-shrink: 0;
    border-radius: 6px;
    color: var(--gray-500);
    background: transparent;
    transition: var(--transition);
}
.dropdown-menu-icon svg { width: 13px; height: 13px; }
.dropdown-menu-text { flex: 1; line-height: 1.4; }
.dropdown-menu-item:hover {
    background: var(--primary-light); color: var(--primary);
}
.dropdown-menu-item:hover .dropdown-menu-icon {
    color: var(--white); background: var(--primary);
    box-shadow: 0 1px 4px rgba(26,115,232,.3);
}
.dropdown-menu-divider {
    border-top: 1px solid var(--gray-200);
    margin: 5px 0;
}
.dropdown-menu-item--danger,
.dropdown-menu-item--danger .dropdown-menu-text { color: var(--danger); }
.dropdown-menu-item--danger .dropdown-menu-icon { color: var(--danger); background: transparent; }
.dropdown-menu-item--danger:hover { background: #fdecea; color: var(--danger); }
.dropdown-menu-item--danger:hover .dropdown-menu-icon { background: var(--danger); color: var(--white); box-shadow: 0 1px 4px rgba(220,53,69,.3); }
.dropdown-menu-item .dropdown-menu-button {
    display: flex; align-items: center; gap: 9px; flex: 1;
    background: none; border: 0; padding: 0; margin: 0;
    font: inherit; color: inherit; cursor: pointer; text-align: left;
}
.dropdown-menu-inner .mail-unread-badge { margin-left: auto; margin-right: 0; }

/* 邮件中心未读消息徽标 */
.mail-unread-badge {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 4px;
    border-radius: 9px;
    background: var(--danger);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

/* ===== 面包屑 ===== */
.breadcrumb { padding: 16px 0; font-size: 13px; color: var(--gray-500); }
.breadcrumb a { color: var(--gray-600); }
.breadcrumb a:hover { color: var(--primary); }

/* ===== 英雄区域 ===== */
.hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: var(--white); padding: 80px 0 60px; text-align: center;
}
.hero-title { font-size: 40px; font-weight: 800; margin-bottom: 12px; }
.hero-desc { font-size: 18px; color: rgba(255,255,255,.7); margin-bottom: 32px; }
.hero-actions { display: flex; justify-content: center; gap: 16px; margin-bottom: 48px; }
.hero-actions .btn-outline { border-color: rgba(255,255,255,.3); color: var(--white); }
.hero-actions .btn-outline:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.5); }
.hero-stats { display: flex; justify-content: center; gap: 48px; }
.stat-item { text-align: center; }
.stat-value { font-size: 32px; font-weight: 700; display: block; }
.stat-label { font-size: 13px; color: rgba(255,255,255,.5); margin-top: 4px; }

/* ===== 门户布局 ===== */
.portal-content { display: grid; grid-template-columns: 1fr 340px; gap: 24px; padding: 32px 0; }
.portal-main { min-width: 0; }
.portal-section { margin-bottom: 32px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.section-title { font-size: 20px; font-weight: 700; }
.section-more { font-size: 13px; color: var(--gray-500); }
.section-more:hover { color: var(--primary); }

/* ===== 帖子列表 ===== */
.thread-list { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.thread-item {
    display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}
.thread-item:last-child { border-bottom: none; }
.thread-item:hover { background: var(--gray-50); }
.thread-avatar img { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }
.thread-info { flex: 1; min-width: 0; }
.thread-title { display: block; font-size: 15px; font-weight: 600; color: var(--gray-800); margin-bottom: 6px; line-height: 1.4; }
.thread-title:hover { color: var(--primary); }
.thread-meta { display: flex; gap: 16px; font-size: 12px; color: var(--gray-500); }
.badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 11px; font-weight: 700; margin-right: 4px; }
.badge-essence { background: #fff3cd; color: #856404; }
.badge-pin { background: #d1ecf1; color: #0c5460; }
.badge-locked { background: #f8d7da; color: #721c24; }

/* ===== 热门卡片 ===== */
.hot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.hot-card {
    background: var(--white); border-radius: var(--radius); padding: 16px;
    box-shadow: var(--shadow-sm); transition: var(--transition); border: 1px solid transparent;
}
.hot-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.hot-card h4 { font-size: 14px; margin-bottom: 10px; color: var(--gray-800); line-height: 1.4; }
.hot-card-meta { display: flex; gap: 12px; font-size: 12px; color: var(--gray-500); }

/* ===== 精华列表 ===== */
.essence-list { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.essence-item {
    display: flex; align-items: center; gap: 10px; padding: 12px 20px;
    border-bottom: 1px solid var(--gray-100); transition: var(--transition);
}
.essence-item:last-child { border-bottom: none; }
.essence-item:hover { background: var(--gray-50); }
.essence-icon { font-size: 16px; flex-shrink: 0; }
.essence-title { flex: 1; font-size: 14px; color: var(--gray-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.essence-meta { font-size: 12px; color: var(--gray-500); flex-shrink: 0; }

/* ===== 侧边栏 ===== */
.portal-sidebar { position: sticky; top: 80px; }
.sidebar-card {
    background: var(--white); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow-sm); margin-bottom: 20px;
}
.sidebar-card-title { font-size: 16px; font-weight: 700; margin-bottom: 14px; color: var(--gray-800); }
.sidebar-nav-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.sidebar-nav-list li a { display: flex; align-items: center; gap: 8px; padding: 8px 10px; color: var(--gray-700); border-radius: var(--radius-sm); transition: background .2s, color .2s; }
.sidebar-nav-list li a:hover { background: var(--gray-100); color: var(--primary); }
.user-card { text-align: center; }
.user-card-header { margin-bottom: 16px; }
.user-card-avatar { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; margin-bottom: 10px; border: 3px solid var(--primary-light); }
.user-card h3 { font-size: 16px; margin-bottom: 4px; }
.user-group-badge { font-size: 12px; font-weight: 600; }
.user-group-badge-sm { font-size: 11px; margin-left: 4px; }
.user-card-stats { display: flex; justify-content: center; gap: 24px; padding-top: 12px; border-top: 1px solid var(--gray-100); }
.ucs-item { text-align: center; }
.ucs-value { display: block; font-size: 18px; font-weight: 700; color: var(--gray-800); }
.ucs-label { font-size: 12px; color: var(--gray-500); }

/* ===== 排行列表 ===== */
.rank-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 0;
    border-bottom: 1px solid var(--gray-100); color: var(--gray-700); transition: var(--transition);
}
.rank-item:last-child { border-bottom: none; }
.rank-item:hover { color: var(--primary); }
.rank-num { width: 24px; text-align: center; font-weight: 700; font-size: 14px; color: var(--gray-400); }
.rank-num.rank-top { color: var(--warning); font-size: 16px; }
.rank-avatar { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.rank-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-points { font-size: 12px; color: var(--gray-500); }

/* ========================================
   排行榜页面
   ======================================== */
.rank-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: var(--white); text-align: center; padding: 56px 0 40px;
}
.rank-hero h1 { font-size: 32px; font-weight: 800; margin-bottom: 8px; }
.rank-hero p { font-size: 15px; color: rgba(255,255,255,.65); }

/* Tab 切换 */
.rank-tabs {
    display: flex; gap: 4px; margin: -22px 0 28px;
    background: var(--white); padding: 5px; border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.rank-tab {
    flex: 1; text-align: center; padding: 12px 20px; border: none;
    border-radius: var(--radius-sm); font-size: 15px; font-weight: 600;
    cursor: pointer; transition: var(--transition);
    background: transparent; color: var(--gray-600);
}
.rank-tab:hover { color: var(--gray-800); background: var(--gray-50); }
.rank-tab.active {
    background: var(--primary); color: var(--white);
    box-shadow: 0 2px 8px rgba(26,115,232,.3);
}

/* 隐藏非活跃 tab 内容 */
.rank-tab-content { display: none; }
.rank-tab-content.active { display: block; }

/* ===== 前三名领奖台 ===== */
.rank-podium {
    display: flex; align-items: flex-end; justify-content: center;
    gap: 16px; margin-bottom: 28px; padding: 0 20px;
}
.podium-item {
    display: flex; flex-direction: column; align-items: center;
    width: 180px; padding-top: 24px; border-radius: var(--radius-lg);
    position: relative; transition: transform .25s ease;
}
.podium-item:hover { transform: translateY(-6px); }
.podium-gold   { background: linear-gradient(180deg, #fff9e6 0%, #fff3cc 100%); z-index: 3; width: 200px; padding-top: 16px; }
.podium-silver { background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%); z-index: 2; }
.podium-bronze { background: linear-gradient(180deg, #fef5e7 0%, #fdebd0 100%); z-index: 1; }

.podium-avatar-wrap { position: relative; margin-bottom: 10px; }
.podium-avatar {
    width: 72px; height: 72px; border-radius: 8px; object-fit: cover;
    border: 3px solid var(--white); box-shadow: var(--shadow);
}
.podium-gold .podium-avatar { width: 84px; height: 84px; border-color: #ffd700; }
.podium-silver .podium-avatar { border-color: #c0c0c0; }
.podium-bronze .podium-avatar { border-color: #cd7f32; }

.podium-medal {
    position: absolute; bottom: -4px; right: -12px; font-size: 24px;
}
.podium-crown {
    position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
    font-size: 26px; animation: crown-bounce 1.5s ease-in-out infinite;
}
@keyframes crown-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-6px); }
}

.podium-name { margin-bottom: 4px; }
.podium-name a {
    font-size: 15px; font-weight: 700; color: var(--gray-800);
}
.podium-name a:hover { color: var(--primary); }
.podium-gold .podium-name a { font-size: 16px; }
.podium-score {
    font-size: 14px; font-weight: 600; color: var(--gray-600); margin-bottom: 16px;
}
.podium-gold .podium-score { color: #b8860b; }

.podium-bar { width: 100%; border-radius: 6px 6px 0 0; }
.podium-bar-1 { height: 100px; background: linear-gradient(180deg, #ffd700, #ffaa00); }
.podium-bar-2 { height: 72px; background: linear-gradient(180deg, #c0c0c0, #a0a0a0); }
.podium-bar-3 { height: 54px; background: linear-gradient(180deg, #cd7f32, #a0522d); }

/* ===== 排名列表卡片 ===== */
.rank-list-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    overflow: hidden; margin-bottom: 40px;
}
.rank-item-full {
    display: flex; align-items: center; gap: 16px; padding: 14px 24px;
    border-bottom: 1px solid var(--gray-100); transition: var(--transition);
}
.rank-item-full:last-child { border-bottom: none; }
.rank-item-full:hover { background: var(--gray-50); }

.rank-item-num {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: var(--gray-400);
    border-radius: 50%; background: var(--gray-100); flex-shrink: 0;
}
.rank-item-full:nth-child(1) .rank-item-num,
.rank-item-full:nth-child(2) .rank-item-num,
.rank-item-full:nth-child(3) .rank-item-num { color: var(--warning); background: #fff3cd; }

.rank-item-user {
    display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0;
}
.rank-item-avatar {
    width: 40px; height: 40px; border-radius: 8px; object-fit: cover;
    border: 2px solid var(--gray-200); flex-shrink: 0;
}
.rank-item-info { min-width: 0; }
.rank-item-name {
    font-size: 15px; font-weight: 600; color: var(--gray-800);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
}
.rank-item-name:hover { color: var(--primary); }

.rank-item-stat {
    display: flex; flex-direction: column; align-items: center;
    min-width: 72px; flex-shrink: 0;
}
.rank-item-credits,
.rank-item-count {
    font-size: 15px; font-weight: 700; color: var(--primary);
}
.rank-item-label { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* 响应式 */
@media (max-width: 768px) {
    .rank-hero { padding: 36px 0 28px; }
    .rank-hero h1 { font-size: 24px; }
    .rank-podium { gap: 10px; }
    .podium-item { width: 32%; padding: 16px 8px 0; }
    .podium-gold { width: 34%; }
    .podium-avatar { width: 52px; height: 52px; }
    .podium-gold .podium-avatar { width: 60px; height: 60px; }
    .podium-name a { font-size: 12px; }
    .podium-score { font-size: 11px; }
    .podium-bar-1 { height: 60px; }
    .podium-bar-2 { height: 44px; }
    .podium-bar-3 { height: 32px; }
    .rank-item-full { padding: 12px 16px; gap: 10px; }
    .rank-item-avatar { width: 34px; height: 34px; }
    .rank-item-num { width: 30px; height: 30px; font-size: 12px; }
    .rank-item-stat { min-width: 56px; }
    .rank-item-name { font-size: 14px; }
    .rank-item-credits, .rank-item-count { font-size: 14px; }
}

/* ===== 活跃用户 ===== */
.active-users-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.active-user-item img { width: 100%; aspect-ratio: 1; border-radius: 8px; object-fit: cover; transition: var(--transition); }
.active-user-item:hover img { transform: scale(1.1); }

/* ===== 今日数据 ===== */
.today-stats { display: flex; gap: 16px; }
.today-stat { flex: 1; text-align: center; }
.ts-label { display: block; font-size: 12px; color: var(--gray-500); margin-bottom: 4px; }
.ts-value { font-size: 22px; font-weight: 700; color: var(--primary); }

/* ===== 论坛页面 ===== */
.forum-page {
    padding: 28px 0 40px;
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
    min-height: calc(100vh - 200px);
}
.forum-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding: 22px 28px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 20px rgba(26, 115, 232, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(26, 115, 232, 0.08);
    position: relative;
    overflow: hidden;
}
.forum-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, #6aa8f0 100%);
    border-radius: 4px 0 0 4px;
}
.forum-header h1 {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}
.forum-header p {
    color: var(--gray-500);
    font-size: 13px;
    margin-top: 2px;
    font-weight: 500;
}

/* ===== 分类卡片 ===== */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 36px;
}
.category-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
}
.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.6) 50%, transparent 100%);
    pointer-events: none;
}
.category-card:hover {
    border-color: rgba(26, 115, 232, 0.2);
    box-shadow: 0 12px 32px rgba(26, 115, 232, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}
.category-card.top-category {
    border-left: 5px solid transparent;
    background: linear-gradient(180deg, #ffffff 0%, #fdfdfd 100%);
}
.category-card.top-category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, #6aa8f0 50%, var(--primary) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.category-card.top-category:hover::before {
    opacity: 1;
}
.category-card.top-category:hover {
    border-left-color: var(--primary);
}
.category-card.sub-category {
    border-left: none;
    margin-left: 0;
}
.category-card.depth-1 {
    margin-left: 28px;
    border-radius: var(--radius);
    border-left: 4px solid var(--gray-200);
}
.category-card.depth-1::before {
    display: none;
}
.category-card.depth-1:hover {
    border-left-color: var(--primary);
    box-shadow: 0 8px 20px rgba(26, 115, 232, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    transform: translateX(2px);
}
.category-card.depth-2 {
    margin-left: 56px;
    border-radius: var(--radius);
    border-left: 4px solid var(--gray-200);
}
.category-card.depth-2::before {
    display: none;
}
.category-card.depth-2:hover {
    border-left-color: var(--primary);
    box-shadow: 0 8px 20px rgba(26, 115, 232, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    transform: translateX(2px);
}
.category-card.depth-3 {
    margin-left: 84px;
    border-radius: var(--radius);
    border-left: 4px solid var(--gray-200);
}
.category-card.depth-3::before {
    display: none;
}
.category-card.depth-3:hover {
    border-left-color: var(--primary);
    box-shadow: 0 8px 20px rgba(26, 115, 232, 0.08), 0 2px 6px rgba(0, 0, 0, 0.04);
    transform: translateX(2px);
}
.category-card.depth-4 {
    margin-left: 112px;
    border-radius: var(--radius);
    border-left: 4px solid var(--gray-200);
}
.category-card.depth-4:hover {
    border-left-color: var(--primary);
}
.category-card.depth-5 {
    margin-left: 140px;
    border-radius: var(--radius);
    border-left: 4px solid var(--gray-200);
}
.category-card.depth-5:hover {
    border-left-color: var(--primary);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(248, 250, 252, 0.5) 100%);
}
.sub-category .category-header {
    padding: 14px 20px;
    background: transparent;
}
.sub-category .category-icon {
    width: 40px;
    height: 40px;
    font-size: 15px;
}
.sub-category .category-name {
    font-size: 14px;
}
.category-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.category-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, transparent 50%);
    pointer-events: none;
}
.category-card:hover .category-icon {
    transform: scale(1.05) rotate(-3deg);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.category-info {
    flex: 1;
    min-width: 0;
}
.category-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    transition: color 0.2s ease;
    display: inline-block;
    position: relative;
}
.category-name::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), #6aa8f0);
    border-radius: 2px;
    transition: width 0.3s ease;
}
.category-name:hover {
    color: var(--primary);
}
.category-name:hover::after {
    width: 100%;
}
.category-desc {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 4px;
    line-height: 1.5;
}
.category-stats {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--gray-500);
    flex-shrink: 0;
    flex-direction: column;
    text-align: right;
    background: linear-gradient(180deg, var(--gray-50) 0%, #f5f7fa 100%);
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid var(--gray-100);
}
.category-stats span {
    font-weight: 500;
    line-height: 1.6;
}
.category-stats span::before {
    font-weight: 700;
    color: var(--primary);
    margin-right: 4px;
}

/* 板块"今日新帖"角标：仅在有未读新帖时显示；用户阅读后自动 -1 */
.new-post-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    color: #fff;
    background: linear-gradient(90deg, #ff6b35, #ff3d5a);
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(255, 61, 90, 0.28);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.new-post-badge:hover {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(255, 61, 90, 0.35);
}

/* 板块折叠按钮 */
.category-toggle {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    background: linear-gradient(180deg, var(--white) 0%, var(--gray-50) 100%);
    border-radius: 10px;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid var(--gray-200);
}
.category-toggle:hover {
    background: linear-gradient(180deg, var(--primary-light) 0%, #dbeafe 100%);
    color: var(--primary);
    border-color: rgba(26, 115, 232, 0.2);
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.15);
    transform: scale(1.08);
}
.category-toggle.collapsed {
    transform: rotate(-90deg);
}
.category-toggle.collapsed:hover {
    transform: rotate(-90deg) scale(1.08);
}

/* 子版块容器（折叠动画） */
.sub-categories {
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
    max-height: 2000px;
    opacity: 1;
    padding: 0 0 16px;
}

/* ==== 子版块横排（Grid）通用样式 ====
   由模板通过 .sub-categories-grid + CSS 变量 --sub-per-row 控制列数 */
.sub-categories.sub-categories-grid {
    display: grid;
    grid-template-columns: repeat(var(--sub-per-row, 3), 1fr);
    gap: 14px;
    padding: 4px 24px 20px;
    box-sizing: border-box;
    /* 横排模式默认展开，不再受折叠高度限制 */
    max-height: none !important;
    opacity: 1 !important;
    overflow: visible;
}

.sub-categories-grid .category-card.grid-item {
    margin-left: 0 !important;      /* 横排卡片取消左侧缩进深度 margin */
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
    border-radius: var(--radius);
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.sub-categories-grid .category-card.grid-item::before { display: none; }

.sub-categories-grid .category-card.grid-item:hover {
    background: linear-gradient(145deg, #ffffff 0%, #f0f7ff 100%);
    border-color: rgba(26, 115, 232, 0.2);
    box-shadow: 0 8px 24px rgba(26, 115, 232, 0.1), 0 2px 6px rgba(0, 0, 0, 0.04);
    transform: translateY(-3px);
}

.sub-categories-grid .category-card.grid-item .category-header {
    padding: 14px 16px;
    gap: 12px;
    background: transparent;
}

.sub-categories-grid .category-card.grid-item .category-icon {
    width: 42px;
    height: 42px;
    font-size: 15px;
    border-radius: 12px;
}

.sub-categories-grid .category-card.grid-item .category-name {
    font-size: 14px;
    font-weight: 700;
}

.sub-categories-grid .category-card.grid-item .category-desc {
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.4;
}

.sub-categories-grid .category-card.grid-item .category-stats {
    flex-direction: row !important;
    gap: 12px !important;
    font-size: 11px;
    text-align: right;
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
    align-items: center;
}
.sub-categories-grid .category-card.grid-item .category-stats span::before { display: none; }

/* 列数较大时收紧布局 */
.sub-categories-grid[style*="--sub-per-row:4"],
.sub-categories-grid[style*="--sub-per-row:5"],
.sub-categories-grid[style*="--sub-per-row:6"],
.sub-categories-grid[style*="--sub-per-row:7"],
.sub-categories-grid[style*="--sub-per-row:8"] {
    gap: 10px;
    padding: 4px 20px 18px;
}

.sub-categories-grid[style*="--sub-per-row:4"] .category-header,
.sub-categories-grid[style*="--sub-per-row:5"] .category-header,
.sub-categories-grid[style*="--sub-per-row:6"] .category-header,
.sub-categories-grid[style*="--sub-per-row:7"] .category-header,
.sub-categories-grid[style*="--sub-per-row:8"] .category-header {
    padding: 10px 12px;
    gap: 8px;
}

.sub-categories-grid[style*="--sub-per-row:5"] .category-icon,
.sub-categories-grid[style*="--sub-per-row:6"] .category-icon,
.sub-categories-grid[style*="--sub-per-row:7"] .category-icon,
.sub-categories-grid[style*="--sub-per-row:8"] .category-icon {
    width: 34px;
    height: 34px;
    font-size: 12px;
    border-radius: 8px;
}

/* ========== 分区页横排子版块：.category-card 的 .category-body 内部布局 ==========
   模板结构：
   .category-card.sub-category.grid-item
     ├─ .category-header (名称+右侧统计数)
     └─ .category-body (图标 + 描述/分类徽章 + 进入按钮)  */
.sub-categories-grid .category-card.grid-item .category-body {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0 16px 14px;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    min-height: 0;
}
.sub-categories-grid .category-card.grid-item .category-body::after {
    content: '';
    display: table;
    clear: both;
}

/* 图标：固定尺寸左上角块 */
.sub-categories-grid .category-card.grid-item .category-body .category-icon {
    flex-shrink: 0;
    align-self: stretch;
    width: 42px;
    height: 42px;
    font-size: 15px;
    border-radius: 12px;
}

/* 中间描述 + 标签容器 */
.sub-categories-grid .category-card.grid-item .category-body .category-desc-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}
.sub-categories-grid .category-card.grid-item .category-body .category-desc-wrap .category-desc {
    margin: 0;
    font-size: 12px;
    color: var(--gray-500);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.sub-categories-grid .category-card.grid-item .category-body .category-desc-wrap .category-tags {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* 进入按钮：块独立于描述，放在卡片右下角或与图标/描述并行 */
.sub-categories-grid .category-card.grid-item .category-body .category-enter-btn {
    flex-shrink: 0;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    background: linear-gradient(180deg, #fff 0%, #f5f9ff 100%);
    border: 1px solid rgba(26, 115, 232, 0.25);
    border-radius: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(26, 115, 232, 0.05);
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.sub-categories-grid .category-card.grid-item .category-body .category-enter-btn:hover {
    color: #fff;
    background: linear-gradient(180deg, var(--primary) 0%, #1557b0 100%);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.25);
    transform: translateY(-1px);
}

/* 列数较多时收紧：图标缩小、padding 缩小、隐藏描述或进入按钮移下一行 */
.sub-categories-grid[style*="--sub-per-row:4"] .category-card.grid-item .category-body,
.sub-categories-grid[style*="--sub-per-row:5"] .category-card.grid-item .category-body,
.sub-categories-grid[style*="--sub-per-row:6"] .category-card.grid-item .category-body,
.sub-categories-grid[style*="--sub-per-row:7"] .category-card.grid-item .category-body,
.sub-categories-grid[style*="--sub-per-row:8"] .category-card.grid-item .category-body {
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 14px 12px;
}
.sub-categories-grid[style*="--sub-per-row:4"] .category-card.grid-item .category-body .category-icon,
.sub-categories-grid[style*="--sub-per-row:5"] .category-card.grid-item .category-body .category-icon,
.sub-categories-grid[style*="--sub-per-row:6"] .category-card.grid-item .category-body .category-icon,
.sub-categories-grid[style*="--sub-per-row:7"] .category-card.grid-item .category-body .category-icon,
.sub-categories-grid[style*="--sub-per-row:8"] .category-card.grid-item .category-body .category-icon {
    width: 34px;
    height: 34px;
    font-size: 12px;
    border-radius: 8px;
}
.sub-categories-grid[style*="--sub-per-row:4"] .category-card.grid-item .category-body .category-enter-btn,
.sub-categories-grid[style*="--sub-per-row:5"] .category-card.grid-item .category-body .category-enter-btn,
.sub-categories-grid[style*="--sub-per-row:6"] .category-card.grid-item .category-body .category-enter-btn,
.sub-categories-grid[style*="--sub-per-row:7"] .category-card.grid-item .category-body .category-enter-btn,
.sub-categories-grid[style*="--sub-per-row:8"] .category-card.grid-item .category-body .category-enter-btn {
    width: 100%;
    height: 28px;
    padding: 0;
    margin-top: 2px;
}

/* 子版块卡片内的 .category-header 在横排场景下：强制单行，统计列固定右对齐 */
.sub-categories-grid .category-card.grid-item > .category-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 10px;
    width: 100%;
    box-sizing: border-box;
}
.sub-categories-grid .category-card.grid-item > .category-header .category-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 32px;
    padding-top: 1px;
}
.sub-categories-grid .category-card.grid-item > .category-header .category-info .category-name {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sub-categories-grid .category-card.grid-item > .category-header .category-stats {
    flex-shrink: 0;
    gap: 2px !important;
    background: transparent;
    padding: 0;
    border: none;
    text-align: right;
    font-size: 11px;
}

/* 分类页（category.php）的横排子版块：避免被 .category-page .category-header 「页面头部的 flex-start/space-between」
   与页面容器误覆盖，对内部卡片 header 再兜底。 */
.category-page .sub-categories .category-card.grid-item > .category-header {
    align-items: flex-start;
    justify-content: space-between;
    padding: 14px 16px 10px;
    flex-wrap: nowrap;
}

/* 分区页横排容器：与原有卡片视觉衔接 */
.sub-categories-section .sub-categories.sub-categories-grid {
    margin: 0;
    padding: 0;
}

/* 响应式：窄屏自适应减少列数 */
@media (max-width: 960px) {
    .sub-categories.sub-categories-grid {
        grid-template-columns: repeat(min(var(--sub-per-row, 3), 3), 1fr) !important;
    }
}
@media (max-width: 640px) {
    .sub-categories.sub-categories-grid {
        grid-template-columns: repeat(min(var(--sub-per-row, 2), 2), 1fr) !important;
    }
}

/* 子版块区域 */
.sub-categories-section { margin-bottom: 24px; }
.sub-categories-title { font-size: 16px; font-weight: 600; color: var(--gray-700); margin-bottom: 12px; }
.sub-category-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.sub-category-card {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
    transition: var(--transition); text-decoration: none; border: 1px solid transparent;
}
.sub-category-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.sub-cat-icon {
    width: 40px; height: 40px; border-radius: var(--radius-sm); display: flex;
    align-items: center; justify-content: center; font-size: 16px; font-weight: 700;
    color: var(--white); flex-shrink: 0;
}
.sub-cat-info { min-width: 0; }
.sub-cat-name { display: block; font-size: 14px; font-weight: 600; color: var(--gray-800); }
.sub-cat-meta { font-size: 12px; color: var(--gray-500); margin-top: 2px; }


/* 分类页面面包屑 */
.category-page .breadcrumb { padding: 12px 0 0; }
.category-page .breadcrumb .bc-sep { margin: 0 8px; color: var(--gray-400); }
.category-page .category-header { 
    display: flex; 
    align-items: flex-start; 
    justify-content: space-between; 
    padding: 8px 0 16px; 
    flex-wrap: wrap; 
    gap: 12px;
}
.category-page .category-header-left { 
    flex: 1; 
    min-width: 0; 
}
.category-page .category-header-right { 
    flex-shrink: 0; 
    display: flex; 
    align-items: flex-start; 
    justify-content: flex-end; 
}
.category-page .category-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-800);
    margin: 8px 0 6px;
    line-height: 1.3;
}
.category-page .category-desc {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.6;
    margin-top: 4px;
}

/* ===== 板块规则（支持 HTML） ===== */
.category-rules {
    background: var(--white);
    border: 1px solid #f0d878;
    border-left: 4px solid #f0ad4e;
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
}
.category-rules-header {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    background: #fff8e1;
    border-bottom: 1px solid #f0d878;
    font-size: 14px; font-weight: 600; color: #b08020;
}
.category-rules-icon { font-size: 16px; line-height: 1; }
.category-rules-body {
    padding: 14px 18px;
    font-size: 14px;
    color: var(--gray-700);
    line-height: 1.7;
}
.category-rules-body h1,
.category-rules-body h2,
.category-rules-body h3,
.category-rules-body h4,
.category-rules-body h5,
.category-rules-body h6 {
    margin: 8px 0 6px;
    color: var(--gray-800);
    line-height: 1.4;
}
.category-rules-body h1 { font-size: 20px; }
.category-rules-body h2 { font-size: 18px; }
.category-rules-body h3 { font-size: 16px; }
.category-rules-body h4 { font-size: 15px; }
.category-rules-body h5,
.category-rules-body h6 { font-size: 14px; }
.category-rules-body p { margin: 6px 0; }
.category-rules-body ul,
.category-rules-body ol { margin: 6px 0 6px 22px; padding: 0; }
.category-rules-body li { margin: 3px 0; }
.category-rules-body a { color: #1a73e8; text-decoration: underline; }
.category-rules-body a:hover { opacity: .8; }
.category-rules-body img { max-width: 100%; border-radius: 4px; }
.category-rules-body code {
    background: #f6f8fa; padding: 2px 6px; border-radius: 3px;
    font-family: Consolas, Monaco, monospace; font-size: 13px;
}
.category-rules-body pre {
    background: #f6f8fa; padding: 10px 12px; border-radius: 4px;
    overflow: auto; margin: 8px 0;
}
.category-rules-body blockquote {
    border-left: 3px solid #f0ad4e;
    margin: 8px 0;
    padding: 4px 12px;
    color: var(--gray-600);
    background: #fff8e1;
    border-radius: 0 4px 4px 0;
}
.category-rules-body table {
    border-collapse: collapse; margin: 8px 0; width: 100%;
}
.category-rules-body th,
.category-rules-body td {
    border: 1px solid var(--gray-200);
    padding: 6px 10px; text-align: left;
}
.category-rules-body th { background: var(--gray-100); }

/* ===== 板块标签徽章（首页板块卡片中） ===== */
.category-tags {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.cat-tag-badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    opacity: 0.9;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    letter-spacing: 0.2px;
}
.cat-tag-badge::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, transparent 55%);
    pointer-events: none;
}
.cat-tag-badge:hover {
    opacity: 1;
    transform: translateY(-1px) scale(1.04);
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ===== 标签筛选栏 ===== */
.tag-filter-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 18px; background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow-sm); margin-bottom: 20px; flex-wrap: wrap;
}
.tag-filter-label {
    font-size: 13px; font-weight: 600; color: var(--gray-600); flex-shrink: 0;
}
.tag-filter-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-filter-item {
    display: inline-block; padding: 5px 14px; border-radius: 20px;
    font-size: 13px; font-weight: 500; color: var(--gray-600);
    background: var(--gray-100); text-decoration: none;
    transition: var(--transition); border: 1.5px solid transparent;
}
.tag-filter-item:hover { border-color: var(--gray-300); color: var(--gray-800); }
.tag-filter-item.active {
    background: var(--tag-color); color: #fff; border-color: var(--tag-color);
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}

/* 当前筛选提示 */
.tag-filter-active {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: var(--primary-light); border-radius: var(--radius-sm);
    margin-bottom: 16px; font-size: 13px;
}
.tag-filter-clear {
    font-size: 12px; color: var(--primary); text-decoration: none;
    font-weight: 500; padding: 2px 10px; border-radius: 12px;
    border: 1px solid var(--primary); transition: var(--transition);
}
.tag-filter-clear:hover { background: var(--primary); color: #fff; }

/* 帖子列表中的标签 */
.td-thread-tags { display: flex; gap: 4px; margin-top: 3px; }
.thread-tag-mini {
    display: inline-block; padding: 1px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 500; color: #fff; opacity: .75;
}

/* ===== 发帖页标签选择 ===== */
.tag-select-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tag-select-item {
    display: inline-flex; align-items: center; cursor: pointer;
    transition: transform .15s ease;
}
.tag-select-item:hover { transform: scale(1.05); }
.tag-select-item input[type="checkbox"] { display: none; }
.tag-select-item .tag-select-badge {
    display: inline-block; padding: 5px 14px; border-radius: 20px;
    font-size: 13px; font-weight: 500; opacity: .5; transition: opacity .2s ease;
}
.tag-select-item input:checked + .tag-select-badge {
    opacity: 1; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* ===== 论坛区块 ===== */
.forum-section {
    margin-top: 32px;
}
.forum-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-200);
    position: relative;
}
.forum-section .section-header::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), #6aa8f0);
    border-radius: 2px;
}
.forum-section .section-header h2 {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.3px;
    position: relative;
    padding-left: 14px;
}
.forum-section .section-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: linear-gradient(180deg, var(--primary), #6aa8f0);
    border-radius: 4px;
}

/* ===== 紧凑帖子列表 ===== */
.thread-list {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
    margin-bottom: 28px;
}
.thread-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
    line-height: 1.4;
    transition: background 0.15s ease, padding-left 0.2s ease;
    position: relative;
}
.thread-item:last-child { border-bottom: none; }
.thread-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary), #6aa8f0);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.thread-item:hover {
    background: linear-gradient(90deg, #f8fbff 0%, #fcfdff 100%);
    padding-left: 20px;
}
.thread-item:hover::before { opacity: 1; }

.ti-index {
    flex-shrink: 0;
    width: 26px;
    color: var(--gray-400);
    font-weight: 600;
    font-size: 12px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.ti-cat {
    flex-shrink: 0;
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    border: 1px solid;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}
.ti-title {
    flex: 1;
    min-width: 0;
    color: var(--gray-800);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
    font-size: 13px;
}
.ti-title:hover { color: var(--primary); }
.ti-spacer {
    flex-shrink: 0;
    color: var(--gray-400);
    font-size: 11px;
    margin: 0 4px;
}
.ti-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
.ti-author {
    color: var(--gray-500);
    text-decoration: none;
    font-weight: 500;
    font-size: 12px;
    transition: color 0.2s ease;
    white-space: nowrap;
}
.ti-author:hover { color: var(--primary); }
.ti-time {
    color: var(--gray-400);
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}
.ti-mod {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 4px;
}
.ti-mod .list-mod-btn {
    width: 22px;
    height: 22px;
    font-size: 13px;
}

/* ===== 列表页版主操作列 ===== */
.list-mod-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 3px;
    font-size: 14px; color: var(--gray-600); text-decoration: none;
    transition: background .15s, color .15s; cursor: pointer;
    user-select: none;
}
.list-mod-btn:hover { background: var(--gray-200); color: var(--gray-900); text-decoration: none; }
.list-mod-del { color: var(--danger) !important; }
.list-mod-del:hover { background: #fde2e2 !important; color: #b02a37 !important; }

/* ===== 帖子详情 ===== */
.thread-page { padding: 24px 0; }
/* 帖子详情页宽屏：内容区撑满容器，消除左右空白（仅作用于 default 模板） */
.thread-page .container { max-width: 100%; }
.thread-page .thread-main { max-width: 100%; margin: 0 auto; }
.thread-content-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    overflow: hidden; margin-bottom: 24px;
}
.thread-header { padding: 24px 24px 16px; border-bottom: 1px solid var(--gray-100); }
.thread-title { font-size: 24px; font-weight: 700; line-height: 1.4; margin-bottom: 12px; }
.thread-meta-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.thread-author { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--gray-700); }
.thread-author img { width: 28px; height: 28px; border-radius: 8px; }
.thread-time, .thread-views { font-size: 13px; color: var(--gray-500); }
.thread-body { padding: 24px; font-size: 15px; line-height: 1.8; word-break: break-word; }
.thread-footer { padding: 12px 24px; border-top: 1px solid var(--gray-100); }
.thread-actions { display: flex; gap: 16px; }
.btn-action {
    display: inline-flex; align-items: center; gap: 4px;
    background: none; border: none; padding: 6px 12px; border-radius: var(--radius-sm);
    font-size: 14px; color: var(--gray-500); cursor: pointer; transition: var(--transition);
}
.btn-action:hover { background: var(--gray-100); color: var(--gray-700); }
.btn-action.liked { color: var(--danger); }
.btn-action.collected { color: var(--warning); }

/* ===== 回复列表 ===== */
.posts-section { margin-bottom: 24px; }
.posts-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.pagination-info { font-size: 13px; color: var(--gray-500); font-weight: 400; }
.post-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    margin-bottom: 12px; display: flex; overflow: hidden;
}
.post-sidebar {
    width: 160px; padding: 20px; text-align: center; background: var(--gray-50);
    border-right: 1px solid var(--gray-100); flex-shrink: 0;
}
.post-avatar { width: 80px; height: 80px; border-radius: 8px; object-fit: cover; margin-bottom: 8px; }
.post-username { display: block; font-size: 14px; font-weight: 600; color: var(--gray-800); margin-bottom: 2px; }
.post-floor { display: block; font-size: 12px; color: var(--gray-400); margin-top: 8px; }
.post-body { flex: 1; padding: 20px 24px; display: flex; flex-direction: column; }
.post-content { flex: 1; font-size: 15px; line-height: 1.8; word-break: break-word; }
.post-footer {
    margin-top: auto; padding-top: 12px; border-top: 1px solid var(--gray-100);
    display: flex; align-items: center; gap: 16px;
}
.post-time { font-size: 12px; color: var(--gray-400); }

/* ===== 分页 ===== */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 24px; }
.page-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 12px; border-radius: var(--radius-sm);
    font-size: 14px; color: var(--gray-600); background: var(--white);
    border: 1px solid var(--gray-200); transition: var(--transition);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.page-ellipsis { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; color: var(--gray-400); font-size: 14px; user-select: none; }

/* ===== 回复表单 ===== */
.reply-section { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.reply-section h3 { font-size: 18px; font-weight: 700; margin-bottom: 16px; }
.reply-form textarea {
    width: 100%; padding: 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
    font-size: 15px; font-family: var(--font); resize: vertical; min-height: 120px;
    transition: var(--transition);
}
.reply-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.reply-form button { margin-top: 12px; }
.reply-login-hint { text-align: center; padding: 20px; color: var(--gray-500); }
.thread-locked-notice { text-align: center; padding: 32px; background: var(--white); border-radius: var(--radius); color: var(--gray-500); }

/* ===== 认证页面 ===== */
.auth-page {
    min-height: calc(100vh - 200px); display: flex; align-items: center; justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    background: var(--white); border-radius: var(--radius-lg); padding: 40px;
    box-shadow: var(--shadow-lg); width: 100%; max-width: 420px;
}
.auth-title { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 6px; }
.auth-subtitle { text-align: center; color: var(--gray-500); margin-bottom: 28px; font-size: 14px; }
.auth-form .form-group { margin-bottom: 18px; }
.auth-form label { display: block; font-size: 14px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
    font-size: 15px; font-family: var(--font); transition: var(--transition);
}
.auth-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-check { display: flex; align-items: center; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--gray-600); cursor: pointer; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--gray-500); }

/* ===== 警告提示 ===== */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

/* ===== 主要内容 ===== */
.main-content { flex: 1; }

/* ===== 页脚 ===== */
.footer { background: var(--dark); color: rgba(255,255,255,.6); padding: 48px 0 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-col h4 { color: var(--white); font-size: 16px; margin-bottom: 14px; }
.footer-col p { font-size: 13px; line-height: 1.6; }
.footer-col a { display: block; font-size: 13px; color: rgba(255,255,255,.5); padding: 4px 0; transition: var(--transition); }
.footer-col a:hover { color: var(--white); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 20px; text-align: center; font-size: 13px; }
.footer-bottom p { color: rgba(255,255,255,.5); margin: 0; }
.footer-runtime { display: inline-block; margin-left: 8px; vertical-align: middle; color: rgba(255,255,255,.5); }
.footer-friend-links { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-friend-links .friend-links-label { color: rgba(255,255,255,.4); font-size: 12px; }
.footer-friend-links a { color: rgba(255,255,255,.5); font-size: 12px; transition: var(--transition); }
.footer-friend-links a:hover { color: var(--white); }
.friend-link-img { max-height: 20px; vertical-align: middle; }

/* ===== 发帖页面 ===== */
.create-thread-page { padding: 32px 0; }
.create-thread-card {
    background: var(--white); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); max-width: 840px; margin: 0 auto;
    overflow: hidden;
}
.create-thread-header {
    padding: 32px 32px 24px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
    border-bottom: 1px solid var(--gray-100);
}
.create-thread-header h1 { font-size: 26px; font-weight: 700; color: var(--gray-800); margin-bottom: 6px; }
.create-thread-subtitle { color: var(--gray-500); font-size: 14px; }
.create-thread-form { padding: 28px 32px 36px; }
.create-thread-form .form-row { margin-bottom: 24px; }
.create-thread-form .form-row:last-of-type { margin-bottom: 0; }
.create-thread-form .field-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 8px;
}
.create-thread-form .label-icon { font-size: 16px; }
.create-thread-form .input-hint {
    font-size: 12px; color: var(--gray-400); margin-bottom: 6px;
}
.create-thread-form .form-control {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm); font-size: 15px; font-family: var(--font);
    background: var(--white); transition: var(--transition);
}
.create-thread-form .form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.create-thread-form select.form-control {
    appearance: none; -webkit-appearance: none; cursor: pointer;
}
.select-wrapper { position: relative; }
.select-wrapper::after {
    content: '▾'; position: absolute; right: 14px; top: 50%;
    transform: translateY(-50%); color: var(--gray-400); pointer-events: none;
    font-size: 12px;
}
.create-thread-form .title-input { font-size: 16px; font-weight: 500; }
.create-thread-form .editor-textarea {
    border-top-left-radius: 0; border-top-right-radius: 0;
    resize: vertical; min-height: 260px; line-height: 1.7;
}
.create-thread-form .char-count {
    text-align: right; font-size: 12px; color: var(--gray-400); margin-top: 6px;
}
.create-thread-form .char-count.near-limit { color: var(--warning); }
.content-meta {
    display: flex; justify-content: space-between; align-items: center; margin-top: 6px;
}
.editor-hint { font-size: 12px; color: var(--gray-400); }
.editor-toolbar {
    display: flex; align-items: center; gap: 4px;
    padding: 8px 12px; background: var(--gray-50);
    border: 1.5px solid var(--gray-200); border-bottom: none;
    border-top-left-radius: var(--radius-sm); border-top-right-radius: var(--radius-sm);
}
.editor-toolbar .tool-btn {
    padding: 6px 10px; border: none; background: transparent;
    border-radius: var(--radius-sm); color: var(--gray-600);
    font-size: 13px; cursor: pointer; transition: var(--transition);
}
.editor-toolbar .tool-btn:hover { background: var(--white); color: var(--primary); box-shadow: var(--shadow-sm); }
.editor-toolbar .tool-btn code { font-size: 12px; background: rgba(0,0,0,.06); padding: 1px 4px; border-radius: 3px; }
.toolbar-divider { width: 1px; height: 18px; background: var(--gray-300); margin: 0 4px; }
.create-actions { display: flex; gap: 12px; margin-top: 8px; }
.create-actions .submit-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    box-shadow: 0 4px 12px rgba(26,115,232,.25); border: none;
}
.create-actions .submit-btn:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #104494 100%);
    box-shadow: 0 6px 16px rgba(26,115,232,.35);
}
.create-actions .cancel-btn { color: var(--gray-500); }
.create-actions .cancel-btn:hover { color: var(--primary); border-color: var(--primary); }

/* ===== 响应式 ===== */
/* ===== 用户主页 ===== */
.user-profile-page { padding: 24px 0; }
.profile-card {
    background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow);
    overflow: hidden; margin-bottom: 24px;
}
.profile-header {
    display: flex; align-items: flex-start; gap: 24px; padding: 32px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
}
.profile-avatar-wrap { flex-shrink: 0; }
.profile-avatar { width: 100px; height: 100px; border-radius: 8px; object-fit: cover; border: 4px solid var(--white); box-shadow: var(--shadow-sm); }
.profile-info { flex: 1; min-width: 0; }
.profile-name-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.profile-name { font-size: 24px; font-weight: 700; margin: 0; }
.user-group-badge { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 20px; background: rgba(0,0,0,.06); }
.profile-username { font-size: 14px; color: var(--gray-500); margin-bottom: 8px; }
.profile-signature { font-size: 14px; color: var(--gray-600); margin-bottom: 12px; font-style: italic; }
.profile-meta { display: flex; gap: 16px; font-size: 13px; color: var(--gray-500); }
.profile-actions { flex-shrink: 0; padding-top: 8px; }
.profile-actions .follow-btn.following { background: var(--primary); color: var(--white); }
.profile-stats {
    display: flex; border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}
.ps-item {
    flex: 1; text-align: center; padding: 18px 12px; border-right: 1px solid var(--gray-100);
    text-decoration: none; color: inherit; cursor: pointer; transition: var(--transition);
}
.ps-item:hover { background: var(--primary-light); }
.ps-item:hover .ps-value { color: var(--primary); }
.ps-item.active { background: var(--primary-light); }
.ps-item.active .ps-value { color: var(--primary); }
.ps-item:last-child { border-right: none; }
.ps-value { display: block; font-size: 22px; font-weight: 700; color: var(--dark); }
.ps-label { display: block; font-size: 12px; color: var(--gray-500); margin-top: 4px; }

/* ===== 用户列表页 ===== */
.list-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-100);
}
.list-header .section-title { margin-bottom: 0; }
.list-count {
    font-size: 13px; font-weight: 400; color: var(--gray-500); margin-left: 8px;
}

/* 回复列表 */
.profile-post-list { display: flex; flex-direction: column; gap: 12px; }
.profile-post-item {
    display: block; padding: 16px 18px; background: var(--gray-50);
    border-radius: var(--radius); text-decoration: none; color: inherit;
    transition: all 0.2s ease; border: 1px solid transparent;
    position: relative;
}
.profile-post-item::before {
    content: ''; position: absolute; left: 0; top: 12px; bottom: 12px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.profile-post-item:hover {
    background: var(--white); border-color: var(--primary);
    box-shadow: 0 2px 12px rgba(26,115,232,.12);
    transform: translateX(2px);
}
.pp-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.pp-badge {
    font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
    background: var(--primary); color: var(--white); white-space: nowrap;
}
.pp-thread-title {
    flex: 1; min-width: 0; font-size: 14px; font-weight: 600;
    color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.profile-post-item:hover .pp-thread-title { color: var(--primary); }
.pp-time { font-size: 12px; color: var(--gray-500); white-space: nowrap; }
.pp-content {
    font-size: 14px; color: var(--gray-600); line-height: 1.7;
    word-break: break-all; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* 用户列表（关注/粉丝） */
.profile-user-list { display: flex; flex-direction: column; gap: 10px; }
.profile-user-item {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px;
    background: var(--gray-50); border-radius: var(--radius-sm); transition: var(--transition);
}
.profile-user-item:hover { background: var(--primary-light); }
.pu-avatar {
    width: 48px; height: 48px; border-radius: 8px; object-fit: cover;
    border: 2px solid var(--white); box-shadow: var(--shadow-sm);
}
.pu-info { flex: 1; min-width: 0; }
.pu-name {
    display: block; font-size: 15px; font-weight: 600; color: var(--dark);
    text-decoration: none; margin-bottom: 2px;
}
.pu-name:hover { color: var(--primary); }
.pu-username { font-size: 12px; color: var(--gray-500); }
.pu-actions { flex-shrink: 0; }

/* 分页 */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--gray-100);
}
.page-btn {
    padding: 8px 18px; border: 1px solid var(--gray-300); border-radius: var(--radius-sm);
    font-size: 14px; color: var(--gray-700); text-decoration: none;
    transition: var(--transition); background: var(--white);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-info { font-size: 14px; color: var(--gray-500); }

.profile-content { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
.profile-main { min-width: 0; }
.profile-section {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 24px; margin-bottom: 20px;
}
.section-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

.medals-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.medal-item {
    display: flex; align-items: center; gap: 6px; padding: 8px 14px;
    background: var(--gray-50); border-radius: 20px; font-size: 13px;
}
.medal-icon { width: 24px; height: 24px; object-fit: contain; }
.medal-icon-text {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; font-size: 18px; line-height: 1;
}
.medal-name { color: var(--gray-700); font-weight: 500; }

/* ========================================
   勋章中心
   ======================================== */
.medal-center-page { padding: 24px 0; }
.medal-hero {
    text-align: center; padding: 48px 20px 40px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fef3e0 50%, #e8f5e9 100%);
    border-radius: var(--radius-lg); margin-bottom: 28px;
}
.medal-hero h1 { font-size: 28px; font-weight: 800; margin-bottom: 8px; color: var(--dark); }
.medal-hero p { font-size: 15px; color: var(--gray-600); max-width: 520px; margin: 0 auto; }

.medal-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px; margin-bottom: 36px;
}
.medal-card {
    display: flex; gap: 16px; padding: 20px;
    background: var(--white); border: 2px solid var(--gray-200);
    border-radius: var(--radius); transition: all 0.2s;
}
.medal-card:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.medal-card.owned { border-color: #c6e4c6; background: #f6fff6; }
.medal-card-icon {
    flex-shrink: 0; width: 64px; height: 64px;
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-50); border-radius: var(--radius);
}
.medal-card-img { width: 48px; height: 48px; object-fit: contain; }
.medal-card-emoji { font-size: 40px; line-height: 1; }
.medal-card-body { flex: 1; min-width: 0; }
.medal-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.medal-card-name { font-size: 16px; font-weight: 700; color: var(--dark); }
.medal-owned-badge {
    display: inline-block; padding: 2px 10px; border-radius: 10px;
    font-size: 11px; font-weight: 600; color: #198754; background: #d1fae5;
}
.medal-card-desc { font-size: 13px; color: var(--gray-600); margin-bottom: 10px; line-height: 1.5; }
.medal-card-meta { display: flex; gap: 16px; font-size: 12px; color: var(--gray-500); margin-bottom: 10px; }
.medal-card-actions { padding-top: 8px; border-top: 1px solid var(--gray-100); }
.medal-owned-text { font-size: 13px; color: #198754; font-weight: 600; }
.medal-manual-hint { font-size: 12px; color: var(--gray-500); }
.medal-status-text {
    display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 12px; font-weight: 600;
}
.status-pending { color: #b45309; background: #fef3c7; }
.status-approved { color: #15803d; background: #dcfce7; }
.status-rejected { color: #b91c1c; background: #fee2e2; }

.medal-section { margin-bottom: 36px; }
.medal-section-title { font-size: 20px; font-weight: 700; margin-bottom: 16px; color: var(--dark); }

.recent-awards {
    display: flex; flex-direction: column; gap: 8px;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: 16px;
}
.recent-award-item { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.recent-award-item + .recent-award-item { border-top: 1px solid var(--gray-100); padding-top: 10px; }
.recent-award-icon { width: 28px; height: 28px; object-fit: contain; }
.recent-award-emoji { font-size: 20px; }
.recent-award-info { font-size: 13px; color: var(--gray-600); }
.recent-award-user { font-weight: 600; color: var(--primary); }
.recent-award-name { font-weight: 600; color: var(--gray-800); }
.recent-award-time { font-size: 11px; color: var(--gray-400); margin-left: 8px; }

/* 申请弹窗 */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.modal-dialog {
    background: var(--white); border-radius: var(--radius-lg);
    width: 100%; max-width: 420px; box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { font-size: 17px; font-weight: 700; color: var(--dark); }
.modal-close {
    background: none; border: none; font-size: 22px; color: var(--gray-500);
    cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--gray-800); }
.modal-body { padding: 20px; }
.apply-medal-name { font-size: 15px; font-weight: 600; color: var(--dark); margin-bottom: 14px; }
.modal-body .form-group { margin-bottom: 0; }
.modal-body label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.modal-body .form-control {
    width: 100%; padding: 10px 12px; border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
    resize: vertical; transition: border-color 0.15s;
}
.modal-body .form-control:focus { outline: none; border-color: var(--primary); }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 14px 20px; border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

@media (max-width: 768px) {
    .medal-list { grid-template-columns: 1fr; }
    .medal-hero { padding: 32px 16px 28px; }
    .medal-hero h1 { font-size: 22px; }
    .medal-card { flex-direction: column; align-items: center; text-align: center; }
    .medal-card-header { justify-content: center; flex-wrap: wrap; }
    .medal-card-meta { justify-content: center; flex-wrap: wrap; }
    .medal-card-icon { width: 56px; height: 56px; }
    .medal-card-img { width: 40px; height: 40px; }
    .medal-card-emoji { font-size: 32px; }
}

.profile-thread-list { display: flex; flex-direction: column; gap: 12px; }
.profile-thread-item { padding: 12px 16px; background: var(--gray-50); border-radius: var(--radius-sm); }
.pt-title { font-size: 15px; font-weight: 500; color: var(--dark); display: block; margin-bottom: 6px; }
.pt-title:hover { color: var(--primary); }
.pt-meta { display: flex; gap: 16px; font-size: 12px; color: var(--gray-500); }

.profile-threads-more-wrap { display: flex; justify-content: center; padding: 16px 0 4px; }
.profile-threads-more-btn {
    padding: 8px 28px;
    font-size: 13px;
    border-radius: var(--radius);
    transition: background .2s, color .2s;
}
.profile-threads-more-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.profile-sidebar { position: sticky; top: 80px; }
.sidebar-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 20px; margin-bottom: 20px;
}
.sidebar-card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.profile-detail-list { display: flex; flex-direction: column; gap: 10px; }
.pdl-item { display: flex; justify-content: space-between; font-size: 13px; }
.pdl-label { color: var(--gray-500); }
.pdl-value { color: var(--gray-800); font-weight: 500; }
.empty-state { text-align: center; padding: 32px; color: var(--gray-400); font-size: 14px; }

/* ===== 账号设置页 ===== */
.settings-page { padding: 24px 0; }
.settings-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.settings-card {
    background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 24px; margin-bottom: 20px;
}
.settings-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.settings-form .form-group { margin-bottom: 16px; }
.settings-form label { display: block; font-size: 14px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.settings-form input[type="text"],
.settings-form input[type="password"] {
    width: 100%; padding: 10px 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
    font-size: 14px; font-family: var(--font); transition: var(--transition);
}
.settings-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.settings-form button { margin-top: 8px; }
.settings-sidebar { position: sticky; top: 80px; }

.avatar-upload-area { text-align: center; }
.avatar-preview { width: 100px; height: 100px; border-radius: 8px; object-fit: cover; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.avatar-upload-btn { cursor: pointer; display: inline-block; }
.avatar-hint { font-size: 12px; color: var(--gray-400); margin-top: 8px; }

.settings-info-list { display: flex; flex-direction: column; gap: 12px; }
.sil-item { display: flex; justify-content: space-between; font-size: 13px; }
.sil-label { color: var(--gray-500); }
.sil-value { color: var(--gray-800); font-weight: 500; }

.page-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; }

/* ===== 动态页面 ===== */
.dynamic-page { padding: 32px 0; min-height: 60vh; }
.page-header { margin-bottom: 32px; padding-bottom: 16px; border-bottom: 2px solid var(--gray-200); }
.page-header h1 { font-size: 28px; font-weight: 700; color: var(--dark); }
.dynamic-content {
    background: var(--white); border-radius: var(--radius); padding: 32px;
    box-shadow: var(--shadow-sm); line-height: 1.8; font-size: 15px;
}
.dynamic-content h2 { font-size: 20px; font-weight: 700; margin: 28px 0 12px; color: var(--gray-800); }
.dynamic-content h2:first-child { margin-top: 0; }
.dynamic-content p { margin-bottom: 12px; color: var(--gray-700); }
.dynamic-content ul { padding-left: 24px; margin-bottom: 16px; }
.dynamic-content li { margin-bottom: 6px; color: var(--gray-700); }
.dynamic-content strong { color: var(--gray-800); }

@media (max-width: 768px) {
    .portal-content { grid-template-columns: 1fr; }
    .portal-sidebar { position: static; }
    .hero-title { font-size: 28px; }
    .hero-stats { gap: 24px; }
    .stat-value { font-size: 24px; }
    .thread-item { padding: 9px 12px; }
    .ti-time { display: none; }
    .ti-mod { display: none; }
    .post-card { flex-direction: column; }
    .post-sidebar { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 16px; text-align: left; border-right: none; border-bottom: 1px solid var(--gray-100); }
    .post-avatar { width: 48px; height: 48px; margin: 0; }
    .post-floor { margin: 0 0 0 auto; }
    .footer-grid { grid-template-columns: 1fr; }
    .hot-grid { grid-template-columns: 1fr; }
    .nav { display: none; }
    .profile-header { flex-direction: column; align-items: center; text-align: center; }
    .profile-name-row { justify-content: center; }
    .profile-meta { justify-content: center; flex-wrap: wrap; }
    .profile-content { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
}

/* ===== 楼中楼回复 ===== */
.sub-replies-toggle {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--gray-200);
}
.sub-replies-link {
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
}
.sub-replies-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}
.sub-replies-container {
    margin-top: 10px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
}
.sub-replies-list {
    margin-bottom: 10px;
}
.sub-reply-item {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-200);
}
.sub-reply-item:last-child {
    border-bottom: none;
}
.sub-reply-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
}
.sub-reply-content {
    flex: 1;
    min-width: 0;
}
.sub-reply-username {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-right: 6px;
}
.sub-reply-text {
    font-size: 13px;
    color: var(--gray-700);
    word-break: break-word;
}
.sub-reply-text p {
    margin: 0;
    display: inline;
}
.sub-reply-time {
    display: block;
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 2px;
}
.sub-reply-empty {
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
    padding: 8px;
}
.sub-reply-form {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.sub-reply-textarea {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
    transition: var(--transition);
}
.sub-reply-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    white-space: nowrap;
}
.sub-reply-btn {
    font-size: 13px;
    color: var(--gray-600);
    cursor: pointer;
}

/* ===== 帖子点评 ===== */
.comments-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.thread-content-card .comments-section,
.classic-post-body .comments-section {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    border-top: 1px solid var(--gray-200);
    margin-top: 16px;
    /* 左右内边距与卡片内正文对齐（.thread-header 为 24px），避免点评内容贴卡片左边缘 */
    padding: 16px 24px 0;
}
.comments-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}
.comments-list {
    margin-bottom: 12px;
}
.comment-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
    object-fit: cover;
}
.comment-content {
    flex: 1;
    min-width: 0;
}
.comment-username {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin-right: 8px;
}
.comment-text {
    font-size: 14px;
    color: var(--gray-700);
    word-break: break-word;
}
.comment-text p {
    margin: 0;
    display: inline;
}
.comment-time {
    display: block;
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 2px;
}
.comment-empty {
    text-align: center;
    font-size: 13px;
    color: var(--gray-500);
    padding: 16px;
}
.comment-form {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-100);
}
.comment-form textarea {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    resize: vertical;
    font-family: inherit;
    transition: var(--transition);
}
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}
.comments-pagination {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 12px;
}
.comments-pagination .page-btn {
    padding: 4px 10px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    font-size: 13px;
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
}
.comments-pagination .page-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.comments-pagination .page-btn:hover:not(.active) {
    background: var(--gray-100);
}

/* ===== 通用模态框 ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}
.modal-dialog {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    max-height: min(80vh, calc(100% - 40px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: auto;
}
.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0 4px;
}
.modal-close:hover {
    color: var(--gray-800);
}
.modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}
.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 模态框内的回复表单 */
#sub-reply-modal .sub-reply-form,
#comment-modal .comment-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-200);
}
#sub-reply-modal .sub-reply-textarea,
#comment-modal textarea {
    width: 100%;
    flex: none;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    transition: var(--transition);
}
#sub-reply-modal .sub-reply-textarea:focus,
#comment-modal textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* 点评模态框内的分页 */
#comment-modal .comments-pagination {
    margin-top: 8px;
    margin-bottom: 4px;
}

@media (max-width: 640px) {
    .modal-overlay {
        padding: 10px;
    }
    .modal-dialog {
        max-height: 90vh;
        max-height: min(90vh, calc(100% - 20px));
    }
    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ================================================
   Discuz! 统一发帖按钮样式
   ================================================ */
.dz-post-btn {
    display: inline-block;
    padding: 0 20px;
    height: 30px;
    line-height: 30px;
    min-width: 60px;
    text-align: center;
    color: #fff !important;
    font-size: 14px;
    font-weight: 600;
    font-family: "Microsoft YaHei", Arial, sans-serif;
    text-decoration: none;
    text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.25);
    background: linear-gradient(to bottom, #4A90D9 0%, #2B5F99 100%);
    border: 1px solid #1E4470;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
    vertical-align: middle;
    letter-spacing: normal;
    transition: all 0.15s;
}

.dz-post-btn:hover {
    background: linear-gradient(to bottom, #5BA0E8 0%, #3B6FA9 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    text-decoration: none;
}

.dz-post-btn:active {
    background: linear-gradient(to bottom, #2B5F99 0%, #4A90D9 100%);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2) inset;
}

.dz-post-btn.dz-post-btn-sm {
    height: 26px;
    line-height: 26px;
    padding: 0 14px;
    min-width: 50px;
    font-size: 13px;
    border-radius: 3px;
}

/* ===== 帖子内容中的附件卡片 ===== */
.post-file-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin: 10px 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    max-width: 560px;
}

.post-file-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.post-file-card + .post-file-card {
    margin-top: 8px;
}

.post-file-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: var(--radius-sm);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

.post-file-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.post-file-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-file-size {
    font-size: 12px;
    color: var(--gray-500);
}

.post-file-download {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: var(--primary);
    color: var(--white) !important;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
}

.post-file-download:hover {
    background: var(--primary-hover);
    color: var(--white) !important;
}

@media (max-width: 480px) {
    .post-file-card {
        padding: 12px 14px;
        gap: 12px;
    }
    .post-file-icon {
        width: 42px;
        height: 42px;
        font-size: 10px;
    }
    .post-file-download {
        padding: 7px 12px;
        font-size: 12px;
    }
}

/* ===== 板块页：帖子列表表格（default 主题） ===== */
.thread-table {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin: 16px 0 24px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.thread-table-header {
    display: grid;
    grid-template-columns: 1fr 100px 90px 130px;
    gap: 12px;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(180deg, #fafcff 0%, #f3f7fc 100%);
    border-bottom: 1px solid var(--gray-200);
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
}

.thread-table.has-mod-col .thread-table-header,
.thread-table:has(.td-mod) .thread-table-header {
    grid-template-columns: 1fr 100px 90px 130px 180px;
}
.thread-table.has-batch .thread-table-header,
.thread-table:has(.td-check) .thread-table-header {
    grid-template-columns: 40px 1fr 100px 90px 130px;
}
.thread-table.has-batch.has-mod-col .thread-table-header,
.thread-table:has(.td-check):has(.td-mod) .thread-table-header {
    grid-template-columns: 40px 1fr 100px 90px 130px 180px;
}

.thread-table-header .th-mod { width: auto; text-align: center; }
.th-check,
.td-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
}
.td-check .batch-check,
.th-check .batch-check-all-input,
.batch-check-all .batch-check-all-input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.thread-row {
    display: grid;
    grid-template-columns: 1fr 100px 90px 130px;
    gap: 12px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s ease;
    position: relative;
}

.thread-table:has(.td-mod) .thread-row,
.thread-table.has-mod-col .thread-row {
    grid-template-columns: 1fr 100px 90px 130px 180px;
}
.thread-table.has-batch .thread-row,
.thread-table:has(.td-check) .thread-row {
    grid-template-columns: 40px 1fr 100px 90px 130px;
}
.thread-table.has-batch.has-mod-col .thread-row,
.thread-table:has(.td-check):has(.td-mod) .thread-row {
    grid-template-columns: 40px 1fr 100px 90px 130px 180px;
}

.thread-row:last-child { border-bottom: none; }
.thread-row:hover { background: linear-gradient(90deg, #f8fbff 0%, #fcfdff 100%); }

/* 主列：头像 + 标题信息 */
.td-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.td-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--white);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.td-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.td-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
    transition: color 0.2s ease;
}
.td-title:hover { color: var(--primary); }
.thread-class-badge {
    align-self: flex-start;
}

/* 作者列 */
.td-author {
    font-size: 13px;
    color: var(--gray-600);
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 回复/浏览列 */
.td-stats {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    font-size: 13px;
    color: var(--gray-600);
    font-variant-numeric: tabular-nums;
}
.td-stats .td-separator { color: var(--gray-300); }

/* 时间列 */
.td-time {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 操作列 */
.td-mod {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.list-mod-bar {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    border-radius: 4px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
}
.list-mod-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 3px;
    font-size: 13px;
    color: var(--gray-600);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    user-select: none;
}
.list-mod-btn:hover { background: var(--gray-200); color: var(--gray-900); text-decoration: none; }
.list-mod-del { color: var(--danger) !important; }
.list-mod-del:hover { background: #fee2e2 !important; color: #991b1b !important; }
.list-mod-approve { color: #16a34a !important; font-weight: 700; }
.list-mod-approve:hover { background: #dcfce7 !important; color: #15803d !important; }
.list-mod-reject { color: #dc2626 !important; font-weight: 700; }
.list-mod-reject:hover { background: #fee2e2 !important; color: #b91c1c !important; }

/* 待审核行高亮 */
.thread-row[data-status="pending"] {
    background: linear-gradient(90deg, #fffbeb 0%, #fff 100%);
}
.thread-row[data-status="pending"]:hover {
    background: linear-gradient(90deg, #fef3c7 0%, #fffbeb 100%);
}
.thread-status-pending {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}

/* 批量操作栏 */
.batch-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding: 12px 20px;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
    border-bottom: 1px solid #dbeafe;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    font-size: 13px;
    color: var(--gray-700);
}
.batch-check-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
}
.batch-count {
    padding: 2px 8px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 4px;
    font-size: 12px;
}
.batch-count .batch-count-num {
    color: var(--primary);
    font-weight: 700;
    padding: 0 2px;
}
.batch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
}
.batch-btn {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 10px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    border: 1px solid var(--gray-300);
    background: #fff;
    color: var(--gray-700);
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}
.batch-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-900);
}
.batch-btn-default:active { transform: translateY(1px); }
.batch-btn-approve {
    background: #16a34a;
    color: #fff;
    border-color: #15803d;
}
.batch-btn-approve:hover {
    background: #15803d;
    border-color: #166534;
    color: #fff;
}
.batch-btn-reject {
    background: #dc2626;
    color: #fff;
    border-color: #b91c1c;
}
.batch-btn-reject:hover {
    background: #b91c1c;
    border-color: #991b1b;
    color: #fff;
}
.batch-btn-danger {
    background: #ef4444;
    color: #fff;
    border-color: #dc2626;
}
.batch-btn-danger:hover {
    background: #dc2626;
    border-color: #b91c1c;
    color: #fff;
}

/* 空状态 */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--gray-500);
    font-size: 14px;
}

/* 响应式：窄屏隐藏次要列 */
@media (max-width: 860px) {
    .thread-table-header,
    .thread-row,
    .thread-table.has-mod-col .thread-table-header,
    .thread-table:has(.td-mod) .thread-table-header,
    .thread-table:has(.td-mod) .thread-row,
    .thread-table.has-mod-col .thread-row,
    .thread-table.has-batch .thread-table-header,
    .thread-table.has-batch .thread-row,
    .thread-table:has(.td-check) .thread-table-header,
    .thread-table:has(.td-check) .thread-row,
    .thread-table.has-batch.has-mod-col .thread-table-header,
    .thread-table.has-batch.has-mod-col .thread-row {
        grid-template-columns: 1fr 90px;
    }
    .thread-table-header .th-author,
    .thread-table-header .th-stats,
    .thread-table-header .th-time,
    .thread-table-header .th-mod,
    .thread-table-header .th-check,
    .thread-row .td-author,
    .thread-row .td-stats,
    .thread-row .td-time,
    .thread-row .td-mod,
    .thread-row .td-check {
        display: none;
    }
    .batch-toolbar {
        padding: 10px 12px;
        gap: 8px 12px;
    }
    .batch-actions {
        width: 100%;
        margin-left: 0;
    }
}

/* ========== 回复可见提示框（全局渲染内容） ========== */
.reply-hidden-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    padding: 10px 14px;
    background: var(--gray-50);
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    color: var(--gray-500);
    font-size: 14px;
    line-height: 1.5;
    user-select: none;
}
.reply-hidden-box .reply-hidden-icon {
    font-size: 15px;
    line-height: 1;
}
.pcb-body .reply-hidden-box,
.classic-post-content .reply-hidden-box,
.thread-body .reply-hidden-box {
    display: flex;
}


/* ===== 首页轮播图背景 ===== */
.hero { position: relative; overflow: hidden; }
.hero-slides { position: absolute; inset: 0; z-index: 0; }
.hero-slide-bg {
    position: absolute; inset: 0; display: block;
    background-size: cover; background-position: center;
    opacity: 0; visibility: hidden;
    transition: opacity .8s ease, visibility 0s linear .8s;
}
.hero-slide-bg.is-active { opacity: 1; visibility: visible; z-index: 1; transition: opacity .8s ease; }
.hero-slide-shade { position: absolute; inset: 0; z-index: 2; background: rgba(13, 20, 40, .55); pointer-events: none; }
/* 文字容器不拦截点击，空白区域点击穿透到背景链接；按钮/链接本身仍可点 */
.hero-carousel .container { position: relative; z-index: 3; pointer-events: none; }
.hero-carousel .container a,
.hero-carousel .container button { pointer-events: auto; }
.hero-slide-dots {
    position: absolute; right: 20px; bottom: 14px; z-index: 4;
    display: flex; gap: 8px;
}
.hero-slide-dot {
    width: 10px; height: 10px; padding: 0; border-radius: 50%;
    border: none; cursor: pointer;
    background: rgba(255, 255, 255, .4);
    transition: background .3s ease;
}
.hero-slide-dot.is-active { background: rgba(255, 255, 255, .95); }

/* ================================================
   板块名后的今日新帖数量（纯文本，无背景）
   ================================================ */
.dz-newcount {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    font-weight: 400;
    color: var(--gray-500, #999);
    line-height: 1.4;
    vertical-align: 1px;
    white-space: nowrap;
}

/* ================================================
   点评弹窗增强：快捷短语 / 字数统计 / 积分赠送 / 行内提示
   ================================================ */
#comment-modal .comment-modal-editor {
    flex-shrink: 0;
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200, #e9ecef);
    background: var(--gray-50, #f8f9fa);
}
.comment-quick-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.comment-quick-chip {
    border: 1px solid var(--primary-light, #e8f0fe);
    background: var(--primary-light, #e8f0fe);
    color: var(--primary, #1a73e8);
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.comment-quick-chip:hover {
    background: var(--primary, #1a73e8);
    border-color: var(--primary, #1a73e8);
    color: #fff;
}
.comment-input-wrap {
    position: relative;
}
#comment-modal .comment-input-wrap textarea {
    width: 100%;
    padding: 10px 12px 26px;
    border: 1px solid var(--gray-300, #dee2e6);
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#comment-modal .comment-input-wrap textarea:focus {
    outline: none;
    border-color: var(--primary, #1a73e8);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.12);
}
.comment-counter {
    position: absolute;
    right: 10px;
    bottom: 8px;
    font-size: 11px;
    color: var(--gray-400, #adb5bd);
    pointer-events: none;
    background: rgba(255, 255, 255, 0.85);
    padding: 0 2px;
    border-radius: 4px;
}
#comment-modal .comment-counter span {
    color: var(--primary, #1a73e8);
    font-weight: 600;
}
.comment-gift-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 10px;
    background: #fff;
    border: 1px dashed var(--gray-300, #dee2e6);
    border-radius: 8px;
}
.comment-gift-label {
    font-size: 13px;
    color: var(--warning, #fd7e14);
    font-weight: 600;
    white-space: nowrap;
}
.comment-gift-select {
    height: 28px;
    padding: 0 6px;
    border: 1px solid var(--gray-300, #dee2e6);
    border-radius: 6px;
    font-size: 13px;
    color: inherit;
    background: #fff;
    font-family: inherit;
}
.comment-gift-select:focus {
    outline: none;
    border-color: var(--primary, #1a73e8);
}
.comment-gift-input {
    width: 90px;
    height: 28px;
    padding: 0 8px;
    border: 1px solid var(--gray-300, #dee2e6);
    border-radius: 6px;
    font-size: 13px;
    color: inherit;
    font-family: inherit;
    box-sizing: border-box;
}
.comment-gift-input:focus {
    outline: none;
    border-color: var(--primary, #1a73e8);
}
.comment-gift-balance {
    font-size: 12px;
    color: var(--gray-500, #999);
}
.comment-gift-balance b {
    color: var(--warning, #fd7e14);
}
#comment-modal .modal-footer {
    align-items: center;
}
.comment-modal-msg {
    display: none;
    font-size: 12.5px;
    color: var(--warning, #fd7e14);
    margin-right: auto;
}
.comment-modal-msg.ok {
    color: var(--success, #198754);
}
.comment-modal-msg.err {
    color: var(--danger, #dc3545);
}
.comment-gift-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    background: #fff7e8;
    border: 1px solid #f5d9a8;
    border-radius: 999px;
    color: #d48806;
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    vertical-align: 1px;
    white-space: nowrap;
}
@media (max-width: 600px) {
    .comment-quick-row { gap: 6px; }
    .comment-quick-chip { padding: 3px 10px; }
}
