/* 论坛前台样式 */
.navbar {
  position: sticky; top: 0; z-index: 500; height: 66px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { max-width: 1200px; height: 100%; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 26px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -.4px; flex: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2563eb, #06b6d4); color: #fff; font-size: 18px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .28);
}
.brand span:last-child { background: linear-gradient(90deg, #1d4ed8, #0891b2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link { padding: 8px 13px; border-radius: 9px; color: var(--text-soft); font-size: 14px; font-weight: 500; transition: .15s; }
.nav-link:hover, .nav-link.active { background: var(--primary-light); color: var(--primary-dark); }
.nav-search { flex: 1; max-width: 320px; position: relative; margin-left: auto; }
.nav-search input { width: 100%; height: 38px; padding: 0 14px 0 38px; border: 1px solid var(--border); border-radius: 999px; background: #f7f8fb; outline: none; font-size: 13px; }
.nav-search input:focus { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.nav-search .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; }
.nav-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.user-menu { position: relative; }
.user-trigger { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; background: transparent; border: 1px solid transparent; }
.user-trigger:hover { background: #f6f7fb; border-color: var(--border); }
.user-trigger .uname { font-size: 13px; font-weight: 600; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown { position: absolute; right: 0; top: calc(100% + 10px); width: 190px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.dropdown.open { display: block; }
.dropdown-item { display: block; width: 100%; text-align: left; padding: 9px 12px; border: none; border-radius: 8px; background: transparent; font-size: 13px; color: var(--text-soft); }
.dropdown-item:hover { background: var(--primary-light); color: var(--primary-dark); }
.dropdown-divider { height: 1px; background: var(--border); margin: 5px 4px; }

.main-container { max-width: 1200px; margin: 0 auto; padding: 26px 24px 42px; }

/* Hero */
.hero {
  position: relative; overflow: hidden; border-radius: 14px; padding: 40px 44px; margin-bottom: 22px;
  background: linear-gradient(120deg, #1d4ed8 0%, #2563eb 45%, #0891b2 100%); color: #fff;
  box-shadow: 0 10px 28px rgba(37, 99, 235, .18);
}
.hero::before { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px); background-size: 20px 20px; opacity: .5; }
.hero::after { content: ''; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(255, 255, 255, .08); right: -60px; top: -130px; }
.hero-content { position: relative; z-index: 1; max-width: 620px; }
.hero h1 { font-size: 32px; letter-spacing: -.6px; margin-bottom: 10px; }
.hero p { font-size: 15px; color: rgba(255, 255, 255, .82); line-height: 1.8; margin-bottom: 22px; }
.hero-actions { display: flex; gap: 11px; flex-wrap: wrap; }
.hero .btn-primary { background: #fff; color: var(--primary-dark); box-shadow: 0 6px 16px rgba(0, 0, 0, .12); }
.hero .btn-primary:hover { background: #f4f4ff; }
.hero .btn-outline { background: rgba(255, 255, 255, .13); color: #fff; border-color: rgba(255, 255, 255, .42); }
.hero .btn-outline:hover { background: rgba(255, 255, 255, .22); }
.hero-stats { position: absolute; right: 42px; bottom: 32px; z-index: 1; display: flex; gap: 34px; }
.hero-stat { text-align: center; }
.hero-stat b { display: block; font-size: 26px; line-height: 1.2; }
.hero-stat span { font-size: 12px; color: rgba(255, 255, 255, .72); }

/* 区块标题 */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 15px; }
.section-head h2 { font-size: 19px; display: flex; align-items: center; gap: 9px; }
.section-head h2::before { content: ''; width: 4px; height: 18px; border-radius: 3px; background: linear-gradient(#2563eb, #06b6d4); }
.section-head .more { font-size: 13px; color: var(--primary); font-weight: 600; }

/* 板块网格 */
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.category-card {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: .2s ease; cursor: pointer;
}
.category-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15, 23, 42, .08); border-color: #bfdbfe; }
.cat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 23px; flex: none; }
.cat-icon img, .rail-icon img, .board-header .cat-icon img { width: 100% !important; height: 100% !important; max-width: 100%; max-height: 100%; }
.cat-icon svg, .rail-icon svg { max-width: 100%; max-height: 100%; }
.category-card h3 { font-size: 15px; margin-bottom: 4px; }
.category-card p { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.cat-meta { margin-top: 9px; font-size: 11px; color: var(--text-muted); }

/* 首页三栏：左侧板块 / 中间帖子 / 右侧信息 */
.home-layout { display: grid; grid-template-columns: 214px minmax(0, 1fr) 286px; gap: 18px; align-items: start; margin-top: 22px; }
.board-rail { position: sticky; top: 82px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.rail-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px 12px; border-bottom: 1px solid var(--border); }
.rail-head h2 { font-size: 15px; }
.rail-head a { font-size: 12px; color: var(--primary); font-weight: 600; white-space: nowrap; }
.rail-head a:hover { text-decoration: underline; }
.rail-list { padding: 8px; }
.board-rail-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; transition: .15s; }
.board-rail-item:hover { background: var(--primary-light); }
.rail-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; flex: none; }
.rail-text { min-width: 0; }
.rail-text b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-text span { font-size: 11px; color: var(--text-muted); }
.rail-arrow { margin-left: auto; color: #cbd5e1; font-size: 18px; }
.main-posts { min-width: 0; }

/* 内容两栏 */
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; margin-top: 26px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.panel-head h3 { font-size: 15px; display: flex; align-items: center; gap: 7px; }
.panel-head h3 svg { color: var(--primary); flex: none; }
.tabs { display: flex; gap: 4px; }
.tab { padding: 6px 13px; border: none; border-radius: 8px; background: transparent; color: var(--text-muted); font-size: 13px; }
.tab.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 600; }

/* 帖子列表 */
.post-list { display: flex; flex-direction: column; }
.post-item { display: flex; gap: 14px; padding: 17px 20px; border-bottom: 1px solid #f1f2f6; transition: .15s; cursor: pointer; }
.post-item:last-child { border-bottom: none; }
.post-item:hover { background: #fafbff; }
.post-main { flex: 1; min-width: 0; }
.post-title { font-size: 15px; font-weight: 650; margin-bottom: 6px; display: flex; align-items: center; gap: 7px; line-height: 1.5; }
.post-title a:hover { color: var(--primary); }
.post-excerpt { font-size: 12.5px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 9px; }
.post-meta { display: flex; align-items: center; gap: 13px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.post-meta .author { color: var(--text-soft); font-weight: 500; }
.post-meta .avatar { margin-right: 5px; vertical-align: middle; }
.pin-tag { background: #fef2f2; color: #ef4444; font-size: 10px; padding: 1px 6px; border-radius: 5px; font-weight: 700; flex: none; }
.post-stats { display: flex; gap: 16px; align-items: center; color: var(--text-muted); font-size: 12px; flex: none; padding-top: 3px; }
.post-stats span { display: flex; align-items: center; gap: 4px; }

.side-card { margin-bottom: 18px; }
.side-card .panel-head { padding: 14px 17px; }
.rank-list { padding: 8px 17px 14px; }
.rank-item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed #eef0f5; }
.rank-item:last-child { border-bottom: none; }
.rank-num { width: 19px; height: 19px; border-radius: 6px; background: #f1f2f7; color: var(--text-muted); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; margin-top: 2px; }
.rank-item:nth-child(1) .rank-num { background: #fee2e2; color: #dc2626; }
.rank-item:nth-child(2) .rank-num { background: #ffedd5; color: #ea580c; }
.rank-item:nth-child(3) .rank-num { background: #fef9c3; color: #ca8a04; }
.rank-item a { font-size: 13px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rank-item a:hover { color: var(--primary); }
.rank-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 16px 17px; }
.stat-box { background: #f8f9fc; border-radius: 10px; padding: 12px; text-align: center; }
.stat-box b { display: block; font-size: 20px; color: var(--primary-dark); }
.stat-box span { font-size: 11px; color: var(--text-muted); }
.rule-list { padding: 14px 17px 17px; font-size: 12.5px; color: var(--text-soft); line-height: 2; }
.rule-list b { color: var(--text); }
.link-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 15px 17px; }
.link-list a { padding: 5px 10px; border: 1px solid var(--border); border-radius: 7px; font-size: 12px; color: var(--text-soft); background: #fafbfc; transition: .15s; }
.link-list a:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* 面包屑 / 板块头 */
.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 7px; }
.board-header { display: flex; align-items: center; gap: 16px; padding: 22px; margin-bottom: 20px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.board-header .cat-icon { width: 58px; height: 58px; font-size: 29px; }
.board-header h1 { font-size: 21px; margin-bottom: 4px; }
.board-header p { font-size: 13px; color: var(--text-muted); }

/* 帖子详情 */
.post-detail { padding: 26px 30px; }
.post-detail h1 { font-size: 25px; line-height: 1.45; margin-bottom: 15px; }
.detail-meta { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.detail-meta .author-name { color: var(--text); font-weight: 600; }
.detail-body { padding: 26px 0 30px; font-size: 15px; line-height: 2; color: #374151; min-height: 160px; word-break: break-word; }
.detail-actions { display: flex; gap: 10px; align-items: center; padding-top: 18px; border-top: 1px solid var(--border); }
.like-btn.liked { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.comment-section { margin-top: 20px; }
.comment-form { padding: 20px; border-bottom: 1px solid var(--border); }
.comment-form textarea { min-height: 88px; }
.comment-form-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.comment-form-foot span { font-size: 12px; color: var(--text-muted); }
.comment-list { padding: 4px 20px 10px; }
.comment-item { display: flex; gap: 13px; padding: 18px 0; border-bottom: 1px solid #f1f2f6; }
.comment-item:last-child { border-bottom: none; }
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.comment-head .name { font-weight: 600; font-size: 13px; }
.comment-head .time { font-size: 11px; color: var(--text-muted); }
.comment-text { font-size: 14px; line-height: 1.85; color: #374151; word-break: break-word; }

/* 个人中心 */
.profile-header { display: flex; align-items: center; gap: 18px; padding: 24px; background: linear-gradient(120deg, #1d4ed8, #0891b2); border-radius: var(--radius); color: #fff; margin-bottom: 20px; }
.profile-header .avatar { width: 68px; height: 68px; font-size: 28px; border: 3px solid rgba(255, 255, 255, .55); }
.profile-header h1 { font-size: 22px; margin-bottom: 3px; }
.profile-header p { font-size: 13px; color: rgba(255, 255, 255, .8); }
.profile-stats { display: flex; gap: 28px; margin-left: auto; }
.profile-stats div { text-align: center; }
.profile-stats b { display: block; font-size: 22px; }
.profile-stats span { font-size: 12px; color: rgba(255, 255, 255, .75); }
.profile-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-info { padding: 20px; }
.profile-info h3 { font-size: 14px; margin-bottom: 14px; }
.info-row { display: flex; justify-content: space-between; font-size: 13px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--text-muted); }

/* 认证表单 */
.auth-box { padding: 6px 2px; }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.auth-switch a { color: var(--primary); font-weight: 600; cursor: pointer; }

@media (max-width: 1100px) {
  .home-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .board-rail { position: static; }
  .home-layout .side-bar { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .home-layout .side-card { margin-bottom: 0; }
}
@media (max-width: 980px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .side-bar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .side-card { margin-bottom: 0; }
  .hero-stats { display: none; }
}
@media (max-width: 720px) {
  .nav-inner { padding: 0 12px; gap: 10px; }
  .brand { font-size: 16px; gap: 7px; }
  .brand-mark { width: 30px; height: 30px; font-size: 16px; border-radius: 8px; }
  .nav-links { display: none; }
  .nav-search { max-width: none; }
  .nav-search input { height: 34px; font-size: 12px; padding-left: 34px; }
  .nav-actions { gap: 6px; }
  .nav-actions .btn { padding: 7px 10px; font-size: 12px; }
  .user-trigger .uname { display: none; }
  .main-container { padding: 14px 12px 50px; }
  .hero { padding: 24px 18px; margin-bottom: 16px; }
  .hero h1 { font-size: 22px; }
  .hero p { font-size: 13px; margin-bottom: 18px; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero-actions .btn { display: flex; justify-content: center; }
  .section-head { margin: 20px 0 12px; }
  .section-head h2 { font-size: 17px; }
  .category-grid { grid-template-columns: 1fr; }
  .category-card { padding: 14px; gap: 11px; }
  .cat-icon { width: 40px; height: 40px; font-size: 20px; border-radius: 11px; }
  .home-layout { grid-template-columns: 1fr; }
  .board-rail { position: static; }
  .rail-head { padding: 12px 14px 10px; }
  .rail-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; }
  .board-rail-item { padding: 8px; gap: 7px; }
  .rail-icon { width: 30px; height: 30px; font-size: 15px; }
  .rail-text b { font-size: 12px; }
  .rail-arrow { display: none; }
  .home-layout .side-bar { grid-template-columns: 1fr; }
  .side-bar { grid-template-columns: 1fr; }
  .panel-head { padding: 13px 14px; }
  .tab { padding: 5px 9px; font-size: 12px; }
  .post-item { padding: 14px; gap: 10px; }
  .post-title { font-size: 14px; }
  .post-excerpt { font-size: 12px; }
  .post-meta { gap: 9px; font-size: 11px; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-stats { margin-left: 0; width: 100%; justify-content: space-around; }
  .profile-header { padding: 18px; flex-wrap: wrap; }
  .post-detail { padding: 18px 14px; }
  .post-detail h1 { font-size: 20px; }
  .post-stats { display: none; }
  .detail-meta { flex-wrap: wrap; gap: 8px; }
  .detail-body { font-size: 14px; }
  .comment-form { padding: 14px; }
  .comment-list { padding: 4px 14px 10px; }
  .board-header { padding: 16px; gap: 12px; }
  .board-header .cat-icon { width: 46px; height: 46px; font-size: 24px; }
  .board-header h1 { font-size: 18px; }
  .breadcrumb { font-size: 12px; margin-bottom: 14px; }
}
@media (max-width: 480px) {
  .nav-inner { padding: 0 10px; gap: 8px; }
  .brand { font-size: 14px; }
  .nav-search input { padding-left: 30px; }
  .hero-actions { grid-template-columns: 1fr; }
  .rail-text span { display: none; }
  .post-item { padding: 12px; }
  .comment-form-foot { flex-direction: column; align-items: flex-start; gap: 8px; }
  .detail-actions { flex-wrap: wrap; }
}
