:root {
  --brand: #15803d;        /* 主色:学院绿(区别于 acca红/cfa藏青/ideasing黑) */
  --brand-dark: #166534;   /* 更深:悬停/渐变 */
  --navy: #14532d;         /* 深墨绿 */
  --ink: #18181b;
  --muted: #6b7280;
  --line: #e6e8ec;
  --bg: #f4f7f4;
  --card: #ffffff;
  --accent: #b8860b;       /* 点缀:暗金(徽章/精华) */
  --ok: #1f8a52;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 15px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- 顶栏 ---- */
.navbar {
  background: linear-gradient(100deg, var(--brand-dark), var(--brand));
  color: #fff;
  box-shadow: var(--shadow);
}
.nav-inner {
  max-width: 1040px; margin: 0 auto; padding: 0 16px;
  height: 58px; display: flex; align-items: center; gap: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 19px; white-space: nowrap; flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo .badge {
  background: #fff; color: var(--brand); border-radius: 6px;
  padding: 2px 8px; font-weight: 800; letter-spacing: .5px; font-size: 15px;
}
.logo-site {
  color: #fff; opacity: .82; font-size: 12.5px; font-weight: 500;
  border: 1px solid rgba(255,255,255,.4); border-radius: 20px; padding: 2px 10px;
  margin-left: 2px;
}
.logo-site:hover { opacity: 1; text-decoration: none; background: rgba(255,255,255,.12); }
.nav-search { margin-left: 10px; }
.nav-search input {
  width: 180px; padding: 7px 14px; border: none; border-radius: 20px;
  background: rgba(255,255,255,.18); color: #fff; font-size: 13px; transition: width .2s, background .2s;
}
.nav-search input::placeholder { color: rgba(255,255,255,.7); }
.nav-search input:focus { outline: none; width: 230px; background: rgba(255,255,255,.28); }
.nav-spacer { flex: 1; }
.nav-user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.nav-user a { color: #fff; opacity: .95; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px;
}
a.avatar:hover { text-decoration: none; opacity: .9; }

/* ---- 布局 ---- */
.container { max-width: 1040px; margin: 22px auto; padding: 0 16px; }
.breadcrumb { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card + .card { margin-top: 18px; }

/* ---- 版块分组 ---- */
.group-title {
  font-size: 15px; font-weight: 700; color: var(--navy);
  padding: 12px 16px; background: #fbfbfc; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.group-title::before {
  content: ''; width: 4px; height: 15px; background: var(--brand); border-radius: 2px;
}
.cat-row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.cat-row:last-child { border-bottom: none; }
.cat-icon {
  width: 42px; height: 42px; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--navy), #334366);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; letter-spacing: .3px;
}
.cat-main { flex: 1; min-width: 0; }
.cat-main .name { font-weight: 600; font-size: 15px; }
.cat-main .desc { color: var(--muted); font-size: 13px; margin-top: 1px; }
.cat-stat { color: var(--muted); font-size: 13px; text-align: center; min-width: 70px; }
.cat-stat b { display: block; color: var(--ink); font-size: 15px; }

/* ---- 主题列表 ---- */
.list-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--line); background: #fbfbfc;
}
.list-head h2 { margin: 0; font-size: 16px; color: var(--navy); }
.thread-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.thread-row:last-child { border-bottom: none; }
.thread-row:hover { background: #fafbfc; }
.thread-main { flex: 1; min-width: 0; }
.thread-title { font-weight: 600; font-size: 15px; display: block; }
.thread-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.thread-meta .cat-tag { color: var(--navy); }
.thread-stat { color: var(--muted); font-size: 12.5px; text-align: center; min-width: 56px; }
.thread-stat b { display: block; color: var(--ink); }

.tag {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 1px 6px; border-radius: 4px; margin-right: 6px; vertical-align: 1px;
}
.tag.pin { background: #ededed; color: var(--brand); }
.tag.essence { background: #fff4d9; color: #a8780d; }

/* ---- 主题详情 / 帖子 ---- */
.post {
  display: flex; gap: 14px; padding: 18px 16px; border-bottom: 1px solid var(--line);
}
.post:last-child { border-bottom: none; }
.post-side { width: 92px; flex-shrink: 0; text-align: center; }
.post-side .avatar { width: 48px; height: 48px; font-size: 20px; margin: 0 auto 6px; }
.post-side .uname { font-weight: 600; font-size: 13px; word-break: break-all; }
.post-side .ulevel { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.post-body { flex: 1; min-width: 0; }
.post-body .ptime { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.post-body .ptext { white-space: pre-wrap; word-wrap: break-word; }
.post-title {
  font-size: 21px; font-weight: 700; color: var(--ink);
  padding: 16px 16px 0; margin: 0; line-height: 1.4;
}

/* ---- 表单 / 按钮 ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--brand); color: #fff; border: none;
  padding: 9px 18px; border-radius: 8px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .15s; white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.ghost:hover { background: #f5f5f5; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sm { padding: 6px 12px; font-size: 13px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: var(--navy); }
.field input, .field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
}
.field textarea { min-height: 180px; resize: vertical; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(17,17,17,.1);
}

.form-wrap { max-width: 440px; margin: 40px auto; }
.form-wrap.wide { max-width: 720px; }
.form-wrap .pad { padding: 24px; }
.form-wrap h1 { font-size: 22px; margin: 0 0 4px; color: var(--navy); }
.form-wrap .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.form-foot { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 16px; }

.msg { padding: 10px 12px; border-radius: 8px; font-size: 13.5px; margin-bottom: 14px; display: none; }
.msg.show { display: block; }
.msg.error { background: #fdeaea; color: #b3261e; }
.msg.ok { background: #e7f6ee; color: var(--ok); }

/* ---- 分页 ---- */
.pager { display: flex; justify-content: center; gap: 6px; padding: 16px; }
.pager a, .pager span {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #fff; font-size: 13.5px; color: var(--ink);
}
.pager a:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.pager .cur { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager .disabled { opacity: .45; pointer-events: none; }

/* ---- 其它 ---- */
.empty { text-align: center; color: var(--muted); padding: 50px 16px; font-size: 14px; }
.loading { text-align: center; color: var(--muted); padding: 40px 16px; }
.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 28px 16px 40px; max-width: 1040px; margin: 0 auto; }
.footer-main { font-size: 13px; color: var(--ink); }
.footer-main a { color: var(--brand); }
.footer-sub { margin-top: 8px; line-height: 1.7; color: var(--muted); max-width: 760px; margin-left: auto; margin-right: auto; }

/* 首页 hero */
.hero { padding: 26px 20px; margin-bottom: 18px; border-radius: var(--radius);
  background: linear-gradient(100deg, var(--navy), #2d4066); color: #fff; box-shadow: var(--shadow); }
.hero h1 { margin: 0 0 6px; font-size: 23px; }
.hero p { margin: 0; opacity: .9; font-size: 14px; }
.hero-search { display: flex; gap: 8px; margin-top: 16px; max-width: 560px; }
.hero-search input { flex: 1; padding: 11px 16px; border: none; border-radius: 10px; font-size: 14.5px; }
.hero-search input:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.hero-search .btn { background: #fff; color: var(--brand); }
.hero-search .btn:hover { background: #f3f3f3; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 22px;
  padding-top: 18px; border-top: 1px solid rgba(255,255,255,.18); }
.hero-stats .stat { display: flex; flex-direction: column; }
.hero-stats .stat b { font-size: 22px; font-weight: 800; letter-spacing: .5px; }
.hero-stats .stat span { font-size: 12.5px; opacity: .72; margin-top: 2px; }

/* 版块页标题 */
.cat-h1 { margin: 0; font-size: 18px; color: var(--navy); }
.cat-h1-desc { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* 搜索页 */
.search-page-form { display: flex; gap: 8px; margin-bottom: 16px; }
.search-page-form input {
  flex: 1; padding: 11px 16px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: #fff;
}
.search-page-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(17,17,17,.1); }
.search-snippet { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.6; }
.search-snippet mark, .thread-title mark { background: #fff2b8; color: inherit; padding: 0 1px; border-radius: 2px; }

@media (max-width: 680px) {
  .nav-search { display: none; }
}

/* 用户中心 */
.profile-card {
  display: flex; align-items: center; gap: 18px; padding: 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.profile-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff; font-weight: 700; font-size: 28px;
  display: flex; align-items: center; justify-content: center;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 19px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-meta { color: var(--muted); font-size: 13px; margin-top: 4px; }

.tabs { display: flex; border-bottom: 1px solid var(--line); background: #fbfbfc; }
.tab {
  border: none; background: none; padding: 13px 18px; font-size: 14px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; font-family: inherit;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab span { font-weight: 400; font-size: 12px; }
.pw-form { padding: 20px; max-width: 400px; }
.reply-box { padding: 16px; }
.reply-box h3 { margin: 0 0 12px; font-size: 15px; color: var(--navy); }
.login-hint { padding: 20px 16px; text-align: center; color: var(--muted); font-size: 14px; }

/* ---- 管理员 ---- */
.admin-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px; background: #fbf3f5; border-bottom: 1px solid var(--line);
}
.admin-tag {
  font-size: 11px; font-weight: 700; color: #fff; background: var(--brand);
  padding: 2px 8px; border-radius: 4px; margin-right: 4px;
}
.admin-danger { color: #b3261e; border-color: #e3b4b0; }
.admin-danger:hover { background: #fdeaea; }
.post-edit { font-size: 12px; color: var(--navy); margin-left: 8px; }
.post-edit:hover { color: var(--brand); text-decoration: underline; }
.edited { color: var(--muted); font-size: 12px; }
.edit-box { margin-top: 6px; }
.edit-box .edit-title { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; margin-bottom: 8px; }
.edit-box .edit-text { width: 100%; min-height: 120px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; line-height: 1.6; resize: vertical; }
.edit-box .edit-title:focus, .edit-box .edit-text:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(17,17,17,.1); }
.edit-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.post-del { font-size: 12px; color: #b3261e; margin-left: 8px; }
.post-del:hover { text-decoration: underline; }

/* 文字按钮(后台邀请码等) */
.link-btn { background: none; border: none; color: var(--navy, #1a1a1a); font-size: 13px; cursor: pointer; padding: 2px 4px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: #b3261e; }

/* 隐藏块 / 门控内容 */
.gated { margin: 10px 0; }
.gated.open { background: #f0f9f1; border: 1px dashed #9ccfa3; border-radius: 8px; padding: 10px 14px; }
.gated.locked { background: #fbf3f5; border: 1px dashed #e3b4b0; border-radius: 8px; padding: 14px; color: var(--muted); font-size: 13.5px; text-align: center; }
.gated.locked.big { padding: 28px 16px; font-size: 14.5px; }
.gated.locked a { color: var(--brand); font-weight: 600; }
.lock-ic { margin-right: 4px; }
.field-hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; line-height: 1.6; }
.field-hint code { background: #f0f1f3; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ================= 后台管理 ================= */
.admin-wrap { max-width: 1100px; margin: 22px auto; padding: 0 16px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.admin-head h1 { margin: 0; font-size: 22px; color: var(--navy); }
.admin-sub { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 14px; }
.stat-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 16px 18px; display: flex; align-items: center; gap: 14px;
  position: relative; overflow: hidden;
}
.stat-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.stat-card.s1::before { background: #111111; } .stat-card.s2::before { background: #525252; }
.stat-card.s3::before { background: #a3a3a3; } .stat-card.s4::before { background: #737373; }
.stat-card.s5::before { background: #e06c2f; }
.stat-ico {
  width: 46px; height: 46px; border-radius: 12px; background: #f4f5f7;
  display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0;
}
.stat-num { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 3px; }

/* 管理卡片 */
.admin-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); margin-top: 20px; overflow: hidden; }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-card-head h2 { margin: 0; font-size: 16px; color: var(--navy); }
.admin-search input { width: 260px; max-width: 60vw; padding: 8px 12px; border: 1px solid var(--line); border-radius: 20px; font-size: 13.5px; background: #fbfbfc; }
.admin-search input:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(17,17,17,.08); }

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table th { background: #fbfbfc; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: none; letter-spacing: .2px; white-space: nowrap; }
.admin-table tbody tr:hover { background: #fafbfc; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted); }
.admin-table .nowrap { white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.admin-table .muted { color: var(--muted); }
.ta-r { text-align: right; } .ta-c { text-align: center; }

/* 用户单元格 */
.u-cell { display: flex; align-items: center; gap: 10px; }
.u-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-dark)); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.u-name { font-weight: 600; color: var(--ink); }
.u-mail { color: var(--muted); font-size: 12px; }
.u-me { font-size: 10px; background: var(--navy); color: #fff; border-radius: 4px; padding: 0 5px; vertical-align: 1px; }

.badge-role { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: #eef0f3; color: var(--navy); white-space: nowrap; }
.badge-role.admin { background: #ededed; color: var(--brand); }
.badge-role.owner { background: #111111; color: #fff; }

.admin-foot { text-align: center; color: var(--muted); font-size: 12px; padding: 22px 16px 40px; }

/* 设置行 + 开关 */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; }
.setting-name { font-weight: 600; color: var(--ink); font-size: 14.5px; }
.setting-desc { color: var(--muted); font-size: 12.5px; margin-top: 3px; max-width: 640px; line-height: 1.6; }
.switch { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider { position: absolute; cursor: pointer; inset: 0; background: #ccd0d6; border-radius: 26px; transition: .25s; }
.switch-slider::before { content: ''; position: absolute; height: 20px; width: 20px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: .25s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .switch-slider { background: var(--ok); }
.switch input:checked + .switch-slider::before { transform: translateX(22px); }
.switch input:disabled + .switch-slider { opacity: .6; }
.lang-select { flex-shrink: 0; padding: 7px 30px 7px 12px; border: 1px solid var(--line, #e3e3e3); border-radius: 8px; background: #fff; color: var(--ink); font-size: 13.5px; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23888' stroke-width='1.6' d='M2.5 4.5L6 8l3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; transition: border-color .2s; }
.lang-select:hover { border-color: var(--brand, #4a6cf7); }
.lang-select:focus { outline: none; border-color: var(--brand, #4a6cf7); }
.lang-select:disabled { opacity: .6; cursor: default; }

/* ---- 分享栏 ---- */
.share-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 16px; border-top: 1px solid var(--line); background: #fbfbfc; }
.share-label { color: var(--muted); font-size: 13px; }
.share-btn { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 20px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.share-btn:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.share-btn.wa:hover { border-color: #25d366; color: #128c3e; }
.share-btn.wx:hover { border-color: #09b83e; color: #09b83e; }
.share-btn.wb:hover { border-color: #e6162d; color: #e6162d; }
.share-btn.fav { border-color: var(--accent); color: #a8780d; margin-right: auto; }
.share-btn.fav.on { background: #fff4d9; border-color: var(--accent); color: #a8780d; }
.share-btn.fav:hover { border-color: var(--accent); color: #a8780d; }

/* 微信二维码弹窗 */
.wx-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 999; }
.wx-pop { background: #fff; border-radius: 12px; padding: 24px; text-align: center; max-width: 300px; }
.wx-title { font-weight: 700; font-size: 16px; color: var(--navy); margin-bottom: 14px; }
.wx-tip { color: var(--muted); font-size: 12.5px; margin: 12px 0 16px; line-height: 1.6; }

@media (max-width: 640px) {
  .cat-stat, .thread-stat { display: none; }
  .post-side { width: 64px; }
  .post-side .avatar { width: 38px; height: 38px; font-size: 16px; }
  .nav-inner { gap: 8px; padding: 0 12px; height: 54px; }
  .logo { font-size: 17px; gap: 7px; }
  .logo .badge { font-size: 13px; padding: 2px 6px; }
  .logo-site { display: none; }          /* 移动端隐藏官网胶囊 */
  .nav-user { gap: 10px; font-size: 13px; }
  .nav-user .btn.sm { padding: 6px 10px; }
  .btn-label { display: none; }          /* "+发帖" 只留 "+" */
  .nav-user .btn.sm .plus { font-size: 17px; line-height: 1; }
}
@media (max-width: 400px) {
  .nav-user { gap: 8px; }
  .nav-link-text { font-size: 12.5px; }
}

/* ====================================================================
   可复用排版模版:顶栏菜单 / Banner / 公告 / 三栏 / 热门 / 移动端导航
   结构与类名固定;品牌色走 --brand。其它站原样复制本段。
   ==================================================================== */

/* ---- 顶栏菜单(桌面)---- */
.nav-menu { display: flex; align-items: center; gap: 2px; margin-left: 6px; }
.nav-menu-item {
  color: #fff; opacity: .9; font-size: 14px; font-weight: 500;
  padding: 7px 13px; border-radius: 18px; white-space: nowrap;
}
.nav-menu-item:hover { opacity: 1; background: rgba(255,255,255,.14); text-decoration: none; }
.nav-menu-item.active { background: rgba(255,255,255,.22); opacity: 1; font-weight: 600; }

/* ---- Banner + 广告行 ---- */
/* --banner-h 由后台配置注入(SSR 内联到 .banner-row)。
   有广告:banner 与广告列等高 = --banner-h;广告列内 2 个广告各占一半。
   无广告:banner 单列居中,高度 = --banner-h。 */
.banner-row { --banner-h: 380px; display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 16px; }
.banner-row.has-ad { grid-template-columns: minmax(0,2.6fr) minmax(0,1fr); }
.banner-box {
  position: relative; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
  height: var(--banner-h); background: #e9ebef;
}
.banner-slide { display: none; position: absolute; inset: 0; }
.banner-slide:first-child, .banner-slide.on { display: block; }
.banner-box[data-single] .banner-slide { display: block; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-slide .bn-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 18px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #fff;
  font-size: 18px; font-weight: 700; line-height: 1.35;
}
.banner-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 7px; }
.bn-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.55); cursor: pointer; transition: all .2s; }
.bn-dot.on { background: #fff; width: 20px; border-radius: 5px; }

.ad-box { display: flex; flex-direction: column; gap: 14px; height: var(--banner-h); }
.ad-slot { position: relative; flex: 1 1 0; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: #e9ebef; min-height: 0; }
.ad-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-slot .ad-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff;
  font-size: 13px; font-weight: 600; line-height: 1.3;
}

/* ---- 公告条 ---- */
.announce {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  padding: 11px 16px; border-radius: 10px; background: #fff7e6; border: 1px solid #ffe3a3;
  color: #8a6d3b; font-size: 13.5px;
}
.announce .ann-ic { flex-shrink: 0; }
.announce .ann-label { font-weight: 700; color: #b25e00; flex-shrink: 0; }
.announce .ann-text { flex: 1; min-width: 0; }
.announce .ann-btn {
  flex-shrink: 0; background: var(--brand); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 5px 12px; border-radius: 16px;
}
.announce .ann-btn:hover { background: var(--brand-dark); text-decoration: none; }

/* ---- 三栏布局 ---- */
.layout-3col {
  display: grid; grid-template-columns: 190px minmax(0,1fr) 260px; gap: 16px; align-items: start;
}
.col-main { min-width: 0; }

/* 左侧类目栏 */
.side-nav { padding: 6px; position: sticky; top: 16px; }
.side-row {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px;
  color: var(--ink); font-size: 14px; font-weight: 500;
}
.side-row:hover { background: var(--bg); text-decoration: none; }
.side-row.active { background: var(--bg); color: var(--brand); font-weight: 700; }
.side-row .side-ic { width: 18px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; color: var(--muted); }
.side-row.active .side-ic, .side-row:hover .side-ic { color: var(--brand); }
.side-row.sub { font-size: 13.5px; font-weight: 400; color: var(--muted); padding: 7px 12px; }
.side-row.sub:hover, .side-row.sub.active { color: var(--brand); }
.side-row.sub .side-ic { font-size: 14px; }
.side-group {
  font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .4px;
  padding: 12px 12px 5px; margin-top: 4px; border-top: 1px solid var(--line);
}

/* 右侧:发帖按钮 + 热门话题 */
.aside { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; }
.post-cta {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 15px;
  padding: 13px; border-radius: 12px; box-shadow: var(--shadow);
}
.post-cta:hover { background: var(--brand-dark); text-decoration: none; }
.post-cta .plus { font-size: 18px; line-height: 1; }
.aside-hot { padding-bottom: 6px; }
.aside-head { font-weight: 700; font-size: 15px; color: var(--navy); padding: 13px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 7px; }
.aside-head .ah-ic { display: inline-flex; font-size: 16px; color: var(--brand); }
.hot-row { display: flex; align-items: center; gap: 10px; padding: 9px 16px; }
.hot-row:hover { background: #fafbfc; text-decoration: none; }
.hot-row .hot-n {
  width: 20px; height: 20px; flex-shrink: 0; border-radius: 5px; background: #eef0f3; color: var(--muted);
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.hot-row .hot-n.top { background: var(--brand); color: #fff; }
.hot-row .hot-title { flex: 1; min-width: 0; font-size: 13.5px; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-row:hover .hot-title { color: var(--brand); }
.hot-row .hot-cnt { flex-shrink: 0; font-size: 12px; color: var(--muted); }
.empty.sm { padding: 20px 16px; font-size: 13px; }

/* 顶栏头像下拉菜单(悬停/点击展开) */
.user-menu { position: relative; display: inline-flex; }
.avatar-btn { position: relative; background: none; border: none; padding: 0; cursor: pointer; display: inline-flex; }
.avatar-btn .avatar { width: 30px; height: 30px; }
.avatar-dot {
  position: absolute; top: -2px; right: -2px; width: 9px; height: 9px;
  background: #e0245e; border-radius: 6px; border: 1.5px solid var(--brand);
}
.user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16,24,40,.18); padding: 6px; z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .15s, transform .15s;
}
.user-menu:hover .user-dropdown, .user-menu.open .user-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.user-dropdown::before { content: ''; position: absolute; top: -8px; right: 0; left: 0; height: 8px; } /* 悬停缓冲,防抖 */
.user-dropdown .ud-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-dropdown .ud-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.user-dropdown .ud-email { color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-all; }
/* 带 .user-dropdown 前缀,优先级盖过顶栏的 .nav-user a{color:#fff}(否则白底白字看不清) */
.user-dropdown a.ud-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 8px;
  color: var(--ink); font-size: 14px; opacity: 1;
}
.user-dropdown a.ud-item:hover { background: var(--bg); text-decoration: none; color: var(--brand); }
.user-dropdown .ud-ic { display: inline-flex; align-items: center; justify-content: center; width: 20px; color: var(--muted); flex-shrink: 0; }
.user-dropdown a.ud-item:hover .ud-ic { color: var(--brand); }
.user-dropdown .ud-dot { width: 8px; height: 8px; background: #e0245e; border-radius: 6px; margin-left: auto; }

/* 未读红点(底部导航 msg 项图标右上角) */
.bn-dot-unread {
  position: absolute; top: -3px; right: -6px; min-width: 8px; height: 8px;
  background: #e0245e; border-radius: 6px; border: 1.5px solid #fff;
}
.bn-item .bn-ic { position: relative; }

/* 通知 / 站内信列表 */
.nf-row { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.nf-row:last-child { border-bottom: none; }
.nf-row.unread { background: #f7f9ff; }
.nf-badge { flex-shrink: 0; align-self: flex-start; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 12px; }
.nf-reply { background: #eef4ff; color: #2b5fd0; }
.nf-pm { background: #fdeef5; color: #c0356e; }
.nf-system { background: #eef0f3; color: #555; }
.nf-main { flex: 1; min-width: 0; }
.nf-head { font-weight: 600; font-size: 14.5px; }
.nf-head .nf-sub { color: var(--muted); font-weight: 400; }
.nf-body { color: var(--ink); font-size: 13.5px; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.nf-meta { color: var(--muted); font-size: 12px; margin-top: 5px; }
.nf-meta .nf-link { margin-left: 8px; color: var(--brand); font-weight: 600; }

/* 登录门禁块 */
.login-gate { text-align: center; padding: 44px 20px; }
.login-gate .lg-ic { font-size: 34px; }
.login-gate .lg-tx { color: var(--muted); font-size: 14px; margin: 10px 0 18px; }

/* ---- 移动端快捷菜单(图标格,桌面隐藏)---- */
.m-menu { display: none; }

/* ---- 移动端底部导航(桌面隐藏)---- */
.bottom-nav { display: none; }

/* 中等屏:收窄右栏 */
@media (max-width: 1040px) {
  .layout-3col { grid-template-columns: 170px minmax(0,1fr) 230px; gap: 12px; }
}
/* 平板:去掉右栏,发帖/热门并入主列下方由 aside 自然折行 */
@media (max-width: 880px) {
  .layout-3col { grid-template-columns: 160px minmax(0,1fr); }
  .aside { display: none; }
  .nav-menu { display: none; }           /* 顶栏菜单让位搜索,移动端走 m-menu */
}

/* 手机:单列 + 顶部 m-menu + 底部导航 */
@media (max-width: 680px) {
  .layout-3col { grid-template-columns: 1fr; gap: 0; }
  .side-nav { display: none; }
  .banner-row.has-ad { grid-template-columns: 1fr; }
  .ad-box { flex-direction: row; height: auto; }
  .ad-slot { aspect-ratio: 4 / 3; }
  .banner-box { height: auto; aspect-ratio: 16 / 9; }
  .container.home { margin-top: 12px; padding-bottom: 72px; } /* 给底部导航留位 */

  .m-menu {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
    margin-bottom: 16px;
  }
  .m-menu-item {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 12px 4px; background: var(--card); border: 1px solid var(--line);
    border-radius: 12px; color: var(--ink);
  }
  .m-menu-item:hover { text-decoration: none; }
  .m-menu-ic { font-size: 22px; color: var(--navy); display: inline-flex; }
  .m-menu-tx { font-size: 11.5px; color: var(--muted); text-align: center;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: #fff; border-top: 1px solid var(--line); height: 58px;
    box-shadow: 0 -2px 10px rgba(16,24,40,.06); padding-bottom: env(safe-area-inset-bottom);
  }
  .bn-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    color: var(--muted); font-size: 0;
  }
  .bn-item:hover { text-decoration: none; }
  .bn-item .bn-ic { font-size: 21px; display: inline-flex; align-items: center; justify-content: center; }
  .bn-item .bn-tx { font-size: 10.5px; }
  .bn-item.active { color: var(--brand); }  /* SVG 用 currentColor,激活自动变主题色 */
  .bn-add {
    flex: 0 0 auto; width: 52px; height: 52px; margin: -16px 8px 0; border-radius: 50%;
    background: #1877ff; color: #fff; box-shadow: 0 4px 12px rgba(24,119,255,.4);
    align-self: center;
  }
  .bn-add .bn-plus { font-size: 30px; line-height: 1; font-weight: 300; }
  .bn-add:hover { background: #0f63e6; }

  .footer { padding-bottom: 72px; }
}
