:root {
  --ink: #141b2d;
  --ink-2: #2d3a52;
  --ink-soft: #566279;
  --ink-mute: #8b95a8;
  --line: #e4e7ef;
  --line-soft: #eef1f6;
  --bg: #f4f5f8;
  --card: #ffffff;
  --brand: #16305c;
  --brand-dark: #0f2142;
  --brand-soft: #eaeff7;
  --navy: #16305c;
  --navy-deep: #0b1a33;
  --accent: #c8553d;
  --accent-soft: #fbeeea;
  --ok: #2f7d4f;
  --ok-soft: #e9f5ed;
  --warn: #9a6a12;
  --warn-soft: #fdf3e0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 27, 45, .05), 0 10px 30px rgba(20, 27, 45, .055);
  --shadow-lift: 0 2px 6px rgba(20, 27, 45, .07), 0 18px 44px rgba(20, 27, 45, .09);
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  /* 标题用衬线体，拉开与正文的层次，带西方现代编辑设计的味道。
     拉丁字形优先 Optima/Palatino（mac）与 Palatino Linotype（Win），
     中文回退到各平台自带衬线：Songti SC（mac）、Source Han Serif / 思源宋体、SimSun（Win） */
  --font-display: "Optima", "Palatino Linotype", "Book Antiqua", Palatino, Georgia,
    "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", "Source Han Serif CN",
    "SimSun", "STSong", serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.35; font-weight: 600; }
p { margin: 0 0 .8em; }

/* ------------------------------ 顶栏 ------------------------------ */

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .5px;
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
/* 站内顶栏为浅色底，校徽保留原朱红色 */
.logo-mark {
  width: 28px;
  height: 28px;
  flex: none;
  object-fit: contain;
}
.logo-name { line-height: 1; }
.logo .badge-unofficial {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 2px 6px;
  margin-left: 8px;
  vertical-align: middle;
}

.nav { display: flex; gap: 2px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--ink-soft);
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 14.5px;
}
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

.topbar-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; white-space: nowrap; }

.bell { position: relative; color: var(--ink-soft); font-size: 13.5px; padding: 4px 6px; letter-spacing: .3px; }
.bell:hover { color: var(--navy); text-decoration: none; }
.bell .dot {
  position: absolute; top: 0; right: 0;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--accent); color: #fff;
  border-radius: 8px; font-size: 10px; line-height: 16px; text-align: center;
}

/* ------------------------------ 布局 ------------------------------ */

.wrap { max-width: 1120px; margin: 0 auto; padding: 30px 20px 72px; }
.layout { display: grid; grid-template-columns: 1fr 300px; gap: 26px; align-items: start; }
/* grid 的 1fr 默认 min-width:auto，内部横向滚动容器会把整列撑宽并挤出侧栏 */
.layout > main { min-width: 0; }
.layout-narrow { max-width: 760px; margin: 0 auto; }

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  transition: box-shadow .3s cubic-bezier(.2, .7, .3, 1), transform .3s cubic-bezier(.2, .7, .3, 1);
}
.card:hover { box-shadow: var(--shadow-lift); }
.card-tight { padding: 18px 20px; }

/* 板块小标题：衬线体 + 深蓝 + 放大字号，下方细金线收束 */
.card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .4px;
  color: var(--navy);
  margin: 0 0 18px;
  padding-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.card h2 .more {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 400;
  font-family: var(--font);
  color: var(--ink-mute);
  letter-spacing: .3px;
  transition: color .2s;
}
.card h2 .more:hover { color: var(--navy); text-decoration: none; }

.disclaimer {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
  border-radius: 0 8px 8px 0;
  padding: 11px 16px;
  font-size: 12.5px;
  letter-spacing: .2px;
  margin-bottom: 20px;
}

/* ------------------------------ 列表 ------------------------------ */

.post-item {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--line-soft);
  color: inherit;
  transition: padding-left .25s cubic-bezier(.2, .7, .3, 1);
}
.post-item:last-child { border-bottom: none; }
.post-item:hover { text-decoration: none; padding-left: 6px; }
.post-item:hover .post-title { color: var(--navy); }

.post-title { display: block; font-size: 16px; font-weight: 600; margin-bottom: 5px; line-height: 1.55; letter-spacing: .2px; }
.post-excerpt { display: block; color: var(--ink-soft); font-size: 13.5px; margin-bottom: 8px; line-height: 1.75; }
.post-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  font-size: 12px; color: var(--ink-mute); letter-spacing: .3px;
}
.post-meta .sep { color: var(--line); }

/* 列表项缩略图：有图附件时左图右文 */
.post-item-thumb { display: flex; gap: 14px; align-items: flex-start; }
.post-item-main { flex: 1; min-width: 0; }
.post-thumb {
  width: 92px; height: 92px; flex: none; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg);
}
.tag-attach { background: var(--brand-soft); color: var(--navy); }

/* 用户头像：有自定义图用图，否则名称首字 + 稳定配色 */
.user-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  color: #fff; font-family: var(--font-display); font-size: 15px; font-weight: 600;
  letter-spacing: 0; user-select: none;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-avatar-img { background: var(--line); }
.user-avatar-anon { background: linear-gradient(135deg, #9aa3b2 0%, #6f7889 100%); }
.user-avatar-xs { width: 20px; height: 20px; font-size: 10px; }
.user-avatar-sm { width: 26px; height: 26px; font-size: 12px; }
.user-avatar-lg { width: 46px; height: 46px; font-size: 19px; }
.user-avatar-xl { width: 68px; height: 68px; font-size: 27px; }

.ua-1 { background: linear-gradient(135deg, #16305c 0%, #2a4a7a 100%); }
.ua-2 { background: linear-gradient(135deg, #1f5f4a 0%, #3c8268 100%); }
.ua-3 { background: linear-gradient(135deg, #7a3b2e 0%, #a85c43 100%); }
.ua-4 { background: linear-gradient(135deg, #4a3a6b 0%, #6f5a99 100%); }
.ua-5 { background: linear-gradient(135deg, #8a6a14 0%, #b89230 100%); }
.ua-6 { background: linear-gradient(135deg, #1d4f63 0%, #367489 100%); }

/* 列表项内的作者小头像 */
.post-author-inline { display: inline-flex; align-items: center; gap: 5px; }

/* 帖子详情页作者行 */
.post-author { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.post-author-main { min-width: 0; }
.post-author-name {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 14.5px; font-weight: 600; color: var(--ink); margin-bottom: 3px;
}
.post-author .post-meta { margin: 0; }

/* 评论带头像 */
.comment-with-avatar { display: flex; gap: 11px; align-items: flex-start; }
.comment-main { flex: 1; min-width: 0; }

/* 个人中心头部 */
.me-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.me-head-main { min-width: 0; flex: 1; }
.me-avatar-tools { display: flex; gap: 8px; margin: 10px 0 6px; flex-wrap: wrap; }

/* 顶栏用户入口 */
.topbar-me {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 3px 10px 3px 3px; border-radius: 999px;
  font-size: 13px; color: var(--ink-2); border: 1px solid var(--line);
  transition: border-color .2s, background .2s;
}
.topbar-me:hover { text-decoration: none; border-color: var(--navy); background: var(--brand-soft); }

/* 发帖时的附件选择 */
.attach-picker { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; font-size: 12.5px; max-width: 320px;
}
.attach-chip-kind {
  font-size: 11px; padding: 1px 6px; border-radius: 5px;
  background: var(--brand-soft); color: var(--navy); flex: none;
}
.attach-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip-size { color: var(--ink-mute); flex: none; }
.attach-chip-x {
  border: none; background: none; cursor: pointer; color: var(--ink-mute);
  font-size: 16px; line-height: 1; padding: 0 2px; flex: none;
}
.attach-chip-x:hover { color: var(--accent); }

/* 帖子正文下的附件展示 */
.attach-block { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.attach-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
}
.attach-img {
  display: block; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg); aspect-ratio: 4 / 3;
}
.attach-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-video {
  width: 100%; max-height: 460px; border-radius: 10px;
  background: #000; border: 1px solid var(--line);
}
.attach-files { display: flex; flex-direction: column; gap: 8px; }
.attach-file {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: inherit; font-size: 13.5px;
}
.attach-file:hover { text-decoration: none; border-color: var(--navy); background: var(--brand-soft); }
.attach-file-ext {
  font-family: var(--font-display); font-size: 11px; font-weight: 600; letter-spacing: .5px;
  padding: 4px 8px; border-radius: 6px; background: var(--navy); color: #fff; flex: none;
}
.attach-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-file-size { color: var(--ink-mute); font-size: 12px; flex: none; }

.rank-list { counter-reset: rank; }
.rank-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 13px 0; border-bottom: 1px solid var(--line-soft); color: inherit;
  transition: padding-left .25s cubic-bezier(.2, .7, .3, 1);
}
.rank-item:last-child { border-bottom: none; }
.rank-item:hover { text-decoration: none; padding-left: 6px; }
/* 榜单序号：改用衬线数字 + 深蓝描边，去掉彩色方块的廉价感 */
.rank-no {
  flex: none; width: 26px;
  background: none; color: var(--ink-mute);
  font-family: var(--font-display);
  font-size: 17px; font-weight: 600; text-align: left; line-height: 1.4;
  border-bottom: 1px solid var(--line);
}
.rank-item:nth-child(1) .rank-no,
.rank-item:nth-child(2) .rank-no,
.rank-item:nth-child(3) .rank-no { color: var(--navy); border-bottom-color: var(--navy); }
.rank-body { flex: 1; min-width: 0; }
.rank-title { font-size: 14.5px; font-weight: 500; line-height: 1.55; }
.rank-item:hover .rank-title { color: var(--navy); }

/* ------------------------------ 标签 ------------------------------ */

.tag {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 3px;
  padding: 1px 8px;
  font-size: 11.5px;
  letter-spacing: .3px;
  margin-right: 5px;
  transition: border-color .2s, color .2s;
}
.tag:hover { text-decoration: none; border-color: var(--navy); color: var(--navy); }
.tag-board { background: var(--brand-soft); border-color: #d6dfee; color: var(--navy); }
.tag-anon { background: #f0eef6; border-color: #e0dcec; color: #6b5b8f; }
.tag-pin { background: var(--accent-soft); border-color: #f0d8d0; color: var(--accent); }
.tag-featured { background: var(--warn-soft); border-color: #f0e2c4; color: var(--warn); }
.tag-ok { background: var(--ok-soft); border-color: #cfe7d8; color: var(--ok); }
.tag-pending { background: var(--warn-soft); border-color: #f0e2c4; color: var(--warn); }
.tag-verify { background: var(--ok-soft); border-color: #cfe7d8; color: var(--ok); font-size: 11px; }

/* ------------------------------ 按钮 / 表单 ------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--navy); color: #fff;
  border: 1px solid var(--navy);
  border-radius: 7px;
  padding: 9px 18px;
  font-size: 13.5px; font-family: var(--font); font-weight: 500;
  letter-spacing: .4px;
  cursor: pointer; transition: background .2s, border-color .2s, transform .2s;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: var(--card); color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); border-color: #cfd8e0; }
.btn-danger { background: var(--accent); border-color: var(--accent); }
.btn-danger:hover { background: #a84631; }
.btn-sm { padding: 4px 10px; font-size: 13px; border-radius: 6px; }
.btn-block { width: 100%; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 5px; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--ink-mute); margin-top: 4px; }

input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--font);
  background: var(--card);
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 90, 143, .1);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.7; }

.checkline { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--ink-soft); }
.checkline input { margin-top: 4px; flex: none; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.chip {
  padding: 5px 12px; border-radius: 16px; font-size: 13px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-soft); cursor: pointer;
}
.chip:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ------------------------------ 提示 ------------------------------ */

.msg { padding: 10px 14px; border-radius: 8px; font-size: 13.5px; margin-bottom: 14px; }
.msg-error { background: var(--accent-soft); color: #8c3d2a; border: 1px solid #f0d8d0; }
.msg-ok { background: var(--ok-soft); color: #1f5c38; border: 1px solid #cfe7d8; }
.msg-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #f0e2c4; }

.empty { text-align: center; color: var(--ink-mute); padding: 40px 20px; font-size: 14px; }

/* ------------------------------ 其他 ------------------------------ */

.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.board-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; color: inherit; background: var(--card);
  transition: border-color .25s, box-shadow .25s, transform .25s cubic-bezier(.2, .7, .3, 1);
}
.board-card:hover {
  border-color: var(--navy); text-decoration: none;
  box-shadow: 0 8px 22px rgba(20, 27, 45, .07); transform: translateY(-2px);
}
.board-card .name { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--navy); margin-bottom: 4px; letter-spacing: .3px; }
.board-card .desc { font-size: 12.5px; color: var(--ink-mute); line-height: 1.6; }

/* 版面标题区：未选版面时展开网格，选中后收起成横向切换条 */
.board-head-title {
  font-family: var(--font-display); font-size: 21px; font-weight: 600;
  color: var(--navy); letter-spacing: .6px; margin: 12px 0 3px;
}
.board-head-desc { font-size: 13px; color: var(--ink-mute); margin: 0; line-height: 1.7; }

.board-switch {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
}
.board-switch-item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 7px;
  font-size: 12.5px; color: var(--ink-soft); border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s;
}
.board-switch-item:hover {
  text-decoration: none; background: var(--brand-soft); color: var(--navy);
}
.board-switch-item.on {
  background: var(--navy); color: #fff; border-color: var(--navy);
}
.board-switch-item.on:hover { background: var(--navy); color: #fff; }
.board-switch-item.on .tag { background: rgba(255, 255, 255, .18); color: #fff; }

/* 版面下的社区横条 */
.strip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.strip-head h2 { margin: 0; }
.space-strip {
  display: flex; gap: 10px; margin-top: 12px;
  overflow-x: auto; padding-bottom: 4px;
  scrollbar-width: thin;
}
.space-strip::-webkit-scrollbar { height: 6px; }
.space-strip::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.space-pill {
  display: flex; align-items: center; gap: 11px; flex: none; width: 228px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: inherit;
  transition: border-color .2s, box-shadow .2s, transform .2s cubic-bezier(.2, .7, .3, 1);
}
.space-pill:hover {
  text-decoration: none; border-color: var(--navy);
  box-shadow: 0 6px 18px rgba(20, 27, 45, .07); transform: translateY(-1px);
}
.space-pill-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.space-pill-name {
  font-family: var(--font-display); font-size: 14.5px; font-weight: 600; color: var(--navy);
  display: flex; align-items: center; gap: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.space-pill-meta { font-size: 12px; color: var(--ink-mute); }

/* 侧栏版面目录：板块名同样用深蓝衬线，与卡片标题呼应 */
.board-row { padding: 10px 0; }
.board-row-name {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: .3px;
  margin-bottom: 2px;
}
.board-row-desc { font-size: 12px; color: var(--ink-mute); line-height: 1.6; }
.board-row:hover .board-row-name { color: var(--brand-dark); }

.memory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.memory-card {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); color: inherit;
  transition: border-color .25s, box-shadow .25s, transform .25s cubic-bezier(.2, .7, .3, 1);
}
.memory-card:hover {
  border-color: var(--navy); text-decoration: none;
  box-shadow: 0 10px 26px rgba(20, 27, 45, .08); transform: translateY(-2px);
}
.memory-cover {
  height: 124px; background: linear-gradient(135deg, var(--navy) 0%, #2b4a7d 55%, #4a6b9c 100%);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, .92); font-family: var(--font-display); font-size: 15px; letter-spacing: 3px;
}
.memory-body { padding: 12px 14px; }

.comment { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: none; }
.comment.folded { opacity: .55; }
.comment-head { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-mute); margin-bottom: 5px; }
.comment-author { font-weight: 600; color: var(--ink); }
.comment-body { font-size: 14.5px; white-space: pre-wrap; word-break: break-word; }

.article-body { font-size: 15.5px; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.action-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 1px solid var(--line); border-radius: 18px;
  padding: 5px 14px; font-size: 13px; color: var(--ink-soft);
  cursor: pointer; font-family: var(--font);
}
.action-btn:hover { border-color: var(--brand); color: var(--brand); }
.action-btn.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.stat {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px;
}
.stat .num { font-size: 22px; font-weight: 700; line-height: 1.2; }
.stat .label { font-size: 12.5px; color: var(--ink-mute); }
.stat.alert .num { color: var(--accent); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--ink-soft); background: var(--bg); font-size: 13px; }
tr.urgent td { background: var(--accent-soft); }
code.code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 13px; font-family: ui-monospace, Menlo, Consolas, monospace; }

.pager { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }

.auth-page { max-width: 420px; margin: 50px auto; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
.auth-tabs button {
  flex: 1; padding: 9px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink-soft); cursor: pointer; font-family: var(--font); font-size: 14px;
}
.auth-tabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }

.site-footer {
  border-top: 1px solid var(--line); margin-top: 30px; padding: 20px;
  text-align: center; font-size: 12.5px; color: var(--ink-mute);
}

.modal-mask {
  position: fixed; inset: 0; background: rgba(22, 32, 44, .45);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal { background: var(--card); border-radius: var(--radius); padding: 22px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }

/* ------------------------------ 社区 Space ------------------------------ */

/* 预置头像/封面：纯 CSS 色块，不依赖外部图片 */
.av-p1 { background: linear-gradient(135deg, #16305c, #3a5c94); }
.av-p2 { background: linear-gradient(135deg, #8d6d0c, #cca11d); }
.av-p3 { background: linear-gradient(135deg, #2f5d4a, #4e8c6a); }
.av-p4 { background: linear-gradient(135deg, #8c3d2a, #c8553d); }
.av-p5 { background: linear-gradient(135deg, #4a3a6b, #7a63a8); }
.av-p6 { background: linear-gradient(135deg, #2b4a5e, #4d7f99); }

.cv-c1 { background: linear-gradient(120deg, #16305c 0%, #2a4a7a 60%, #4a6b9c 100%); }
.cv-c2 { background: linear-gradient(120deg, #6b5410 0%, #a8861a 55%, #cca11d 100%); }
.cv-c3 { background: linear-gradient(120deg, #1f4436 0%, #356b52 60%, #5c9a77 100%); }
.cv-c4 { background: linear-gradient(120deg, #6b2a1c 0%, #a8422e 60%, #d4745c 100%); }
.cv-c5 { background: linear-gradient(120deg, #332a52 0%, #574285 60%, #8470b8 100%); }
.cv-c6 { background: linear-gradient(120deg, #17333f 0%, #2d5e73 60%, #58909f 100%); }

.space-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  border-radius: 9px; color: #fff;
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
}
.space-avatar-lg { width: 62px; height: 62px; border-radius: 15px; font-size: 27px; }
.space-avatar-xl { width: 78px; height: 78px; border-radius: 18px; font-size: 34px; }

/* 自定义上传的头像与背景 */
.space-avatar-img { overflow: hidden; background: var(--line); }
.space-avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.space-cover-img { background-size: cover; background-position: center; background-color: var(--navy); }

/* 版主换图控件 */
.space-image-tools {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
}
.space-image-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap;
}
.space-image-label {
  font-family: var(--font-display); font-size: 14px; color: var(--navy);
  min-width: 68px;
}
.hint-ok { color: var(--ok); }
.hint-error { color: var(--accent); }

/* 后台图片巡查 */
.img-patrol {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px;
}
.img-patrol-item {
  display: flex; gap: 12px; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.img-patrol-thumb {
  width: 92px; height: 92px; flex: none; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line); background: var(--bg);
}
.img-patrol-meta {
  display: flex; flex-direction: column; gap: 6px; justify-content: space-between;
  font-size: 13px; min-width: 0;
}
.img-patrol-meta .btn { align-self: flex-start; }
.img-patrol-ext {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 13px; color: var(--navy);
  background: var(--brand-soft); text-decoration: none;
}

/* 发现页头图 */
.discover-head {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 58%, #2a4a7a 100%);
  border-color: transparent; color: #fff; padding: 32px;
  box-shadow: 0 2px 6px rgba(11, 26, 51, .18), 0 18px 44px rgba(11, 26, 51, .22);
}
.discover-head:hover { box-shadow: 0 2px 6px rgba(11, 26, 51, .18), 0 18px 44px rgba(11, 26, 51, .22); }
.discover-kicker {
  font-family: var(--font-display); font-size: 12px; letter-spacing: 5px;
  color: rgba(255, 255, 255, .6); margin-bottom: 10px;
}
.discover-title {
  font-family: var(--font-display); font-size: 40px; font-weight: 600;
  letter-spacing: 7px; line-height: 1.1; color: #fff; margin: 0 0 14px;
}
.discover-desc {
  max-width: 620px; font-size: 13.5px; line-height: 1.85;
  color: rgba(255, 255, 255, .78); margin: 0 0 20px;
}
.discover-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.discover-actions .btn-ghost {
  background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .34);
}
.discover-actions .btn-ghost:hover { background: rgba(255, 255, 255, .18); color: #fff; }

/* 发现页卡片流 */
.space-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(226px, 1fr)); gap: 16px;
}
.space-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card);
  transition: border-color .25s, box-shadow .25s, transform .25s cubic-bezier(.2, .7, .3, 1);
}
.space-card:hover {
  border-color: var(--navy); box-shadow: 0 10px 26px rgba(20, 27, 45, .09); transform: translateY(-2px);
}
.space-card-link { display: block; color: inherit; text-align: center; padding: 0 16px 14px; }
.space-card-link:hover { text-decoration: none; }
.space-cover { display: block; height: 72px; margin: 0 -16px 0; }
.space-card .space-avatar-lg {
  margin: -31px auto 10px; display: flex;
  border: 3px solid var(--card); box-shadow: 0 2px 8px rgba(20, 27, 45, .14);
}
.space-card-name {
  display: block; font-family: var(--font-display); font-size: 17px; font-weight: 600;
  color: var(--navy); letter-spacing: .3px; margin-bottom: 6px;
}
.space-card-desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 12.5px; color: var(--ink-soft); line-height: 1.65; min-height: 2.6em; margin-bottom: 8px;
}
.space-card-meta { display: block; font-size: 11.5px; color: var(--ink-mute); letter-spacing: .3px; }
.space-card-foot { margin-top: auto; padding: 0 16px 16px; text-align: center; }
.space-card-foot .btn { width: 100%; }

/* 我的社区 */
.mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.mine-item {
  display: flex; align-items: center; gap: 12px; color: inherit;
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.mine-item:hover { border-color: var(--navy); text-decoration: none; box-shadow: 0 6px 18px rgba(20, 27, 45, .06); }
.mine-item-body { min-width: 0; }
.mine-item-name {
  font-family: var(--font-display); font-size: 15.5px; font-weight: 600; color: var(--navy);
  display: flex; align-items: center; gap: 6px;
}
.mine-item-meta { font-size: 12px; color: var(--ink-mute); }

.apply-status { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.apply-status-title { font-size: 12.5px; color: var(--ink-mute); letter-spacing: .4px; margin-bottom: 8px; }
.apply-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 5px 0; font-size: 13.5px; }
.apply-row-name { font-weight: 500; }
.apply-row-note { font-size: 12.5px; color: var(--ink-soft); }

/* 社区主页 */
.space-head { padding: 0; overflow: hidden; }
.space-head-cover { height: 132px; }
.space-head-body {
  display: flex; align-items: flex-start; gap: 18px; padding: 0 26px 22px; flex-wrap: wrap;
}
.space-head-body .space-avatar-xl {
  margin-top: -32px; display: flex; flex: none;
  border: 4px solid var(--card); box-shadow: 0 3px 12px rgba(20, 27, 45, .16);
}
.space-head-main { flex: 1; min-width: 220px; padding-top: 14px; }
.space-head-name {
  font-family: var(--font-display); font-size: 26px; font-weight: 600; color: var(--navy);
  letter-spacing: .5px; margin: 0 0 6px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.space-head-desc { font-size: 13.5px; color: var(--ink-soft); line-height: 1.75; margin: 0 0 10px; }
.space-head-meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-mute);
}
.space-head-actions {
  display: flex; flex-direction: column; gap: 8px; padding-top: 16px; align-items: stretch;
}
.space-head-actions .hint { font-size: 12px; color: var(--ink-mute); text-align: center; }

/* 标签栏 */
.space-tabs {
  display: flex; gap: 4px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}
.space-tab {
  background: none; border: none; cursor: pointer;
  font-family: var(--font-display); font-size: 16px; font-weight: 600;
  color: var(--ink-mute); letter-spacing: .3px;
  padding: 8px 14px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; transition: color .2s, border-color .2s;
}
.space-tab:hover { color: var(--ink-2); }
.space-tab.on { color: var(--navy); border-bottom-color: var(--navy); }

.space-post { position: relative; }
.space-manage {
  display: flex; gap: 6px; justify-content: flex-end;
  padding: 0 0 12px; margin-top: -8px;
}
.tag-space { background: #eef2f8; border-color: #d6dfee; color: var(--navy); font-weight: 500; }

.space-about { font-size: 13.5px; }
.about-row {
  display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); line-height: 1.7;
}
.about-row:last-child { border-bottom: none; }
.about-key { flex: none; width: 92px; color: var(--ink-mute); font-size: 12.5px; }

/* 创建申请弹窗里的预置选择 */
.modal-note { font-size: 12.5px; color: var(--ink-mute); margin: -6px 0 16px; line-height: 1.7; }
.preset-row { display: flex; gap: 8px; flex-wrap: wrap; }
.preset { border: 2px solid transparent; cursor: pointer; padding: 0; border-radius: 9px; }
.preset-avatar { width: 38px; height: 38px; }
.preset-cover { width: 54px; height: 32px; border-radius: 7px; }

/* ------------------------------ 清爽蓝紫主题 ------------------------------ */
:root {
  --ink: #111827;
  --ink-2: #374151;
  --ink-soft: #4b5563;
  --ink-mute: #9ca3af;
  --line: #e8edf5;
  --line-soft: #f1f4f8;
  --bg: #f8f9fa;
  --brand: #3157d5;
  --brand-dark: #2445b8;
  --brand-soft: #eef2ff;
  --navy: #3157d5;
  --navy-deep: #243b8a;
  --ok: #5263a8;
  --ok-soft: #f0efff;
  --radius: 18px;
  --shadow: 0 4px 20px rgba(31, 45, 85, .055);
  --shadow-lift: 0 10px 28px rgba(31, 45, 85, .10);
}
body { color: var(--ink); }
.topbar { border: 0; box-shadow: 0 2px 12px rgba(31,45,85,.055); }
.nav a { border-radius: 999px; }
.nav a.active { background: transparent; color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); border-radius: 0; }
.card { border: 0; border-radius: 18px; box-shadow: var(--shadow); }
.card:hover { box-shadow: var(--shadow-lift); }
.card h2 { color: var(--ink); border: 0; font-family: var(--font); font-size: 22px; font-weight: 700; }
.post-title { color: var(--ink); font-size: 22px; font-weight: 700; }
.article-body, .comment-body { color: var(--ink-soft); line-height: 1.7; }
.post-meta, .comment-head { color: var(--ink-mute); font-size: 12px; }
.tag, .chip, .action-btn { border: 0; border-radius: 999px; }
.tag { background: #f1f3f8; color: #526078; }
.tag-board, .tag-space, .tag-attach { background: #edf2ff; color: #3853a7; }
.tag-anon { background: #f3efff; color: #674da0; }
.tag-verify, .tag-ok { background: #edf4ff; color: #405b9b; }
.btn { border: 0; border-radius: 999px; background: var(--brand); box-shadow: 0 4px 12px rgba(49,87,213,.18); }
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn-ghost { background: #f3f4f6; color: var(--ink-soft); box-shadow: none; }
input[type=text], input[type=password], input[type=number], select, textarea { border: 1px solid transparent; border-radius: 12px; background: #f3f4f6; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(49,87,213,.12); }
.comment { padding: 16px 12px; margin: 5px 0; border: 0; border-radius: 14px; }
.comment:nth-child(even) { background: #f8f9fc; }
.actions { border: 0; padding-top: 12px; }
.action-btn { padding: 7px 14px; color: var(--ink-soft); transition: color .18s, background .18s, transform .18s; }
.action-btn:hover { color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.action-btn.on { color: var(--brand); background: var(--brand-soft); }
.post-page { max-width: 1120px; }
.post-page .comment-toolbar { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.post-page .comment-toolbar h2 { margin: 0; padding: 0; font-size: 20px; gap: 0; }
.post-page #commentCount { margin-left: 2px; color: #9ca3af; font-size: 13px; font-weight: 400; }
.post-page .comment-sort { display: inline-flex; align-items: center; gap: 10px; color: #c4c9d2; font-size: 14px; }
.post-page .comment-sort button { border: 0; padding: 0; background: transparent; color: #9ca3af; font: inherit; cursor: pointer; }
.post-page .comment-sort button.active { color: #374151; font-weight: 600; }
.post-page #postBox { max-width: 800px; margin: 0 auto 18px; }
.post-page #commentCard { width: 100%; padding: 26px 30px; }
.post-page #commentList { width: 100%; }
.post-page .comment { align-items: flex-start; gap: 14px; padding: 20px 8px; margin: 0; border-radius: 0; }
.post-page .comment-thread { border-bottom: 1px solid #f0f2f6; }
.post-page .comment-thread:last-child { border-bottom: 0; }
.post-page .comment-replies { margin: 0 0 12px 52px; padding-left: 14px; border-left: 2px solid #eef1f6; }
.post-page .comment-replies .comment { padding: 12px 8px; }
.post-page .comment-replies .comment-thread { border: 0; }
.post-page .thread-toggle { border: 0; background: transparent; color: var(--brand); padding: 5px 8px; font: inherit; font-size: 13px; cursor: pointer; }
.post-page .comment + .comment { border-top: 1px solid #f0f2f6; }
.post-page .comment-main { min-width: 0; }
.post-page .comment-head { min-height: 28px; }
.post-page .comment-body { font-size: 15px; line-height: 1.75; }
.post-page .comment-actions { display: flex; gap: 8px; margin-top: 8px; }
.post-page .comment-actions .action-btn { padding: 3px 8px; font-size: 12px; }
.post-page .replying-to { color: var(--brand); font-size: 13px; cursor: pointer; margin-bottom: 8px; }
.answer-author { display: inline-flex; align-items: center; gap: 6px; color: inherit; }
.post-page #commentCard > div:last-child { border: 0 !important; border-top: 1px solid #edf0f5 !important; margin-top: 18px !important; padding-top: 18px !important; }
.post-page #replyBox textarea { min-height: 110px !important; padding: 16px 18px; }
@media (max-width: 640px) {
  .post-page #commentCard { padding: 20px 16px; }
  .post-page #postBox { width: 100%; }
  .post-page .comment { gap: 10px; padding-inline: 0; }
}
.preset.on { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(22, 48, 92, .12); }

@media (max-width: 640px) {
  .discover-title { font-size: 30px; letter-spacing: 4px; }
  .space-head-actions { width: 100%; }
}

/* ------------------------------ 十大榜单 ------------------------------ */

.topten-head {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 58%, #2a4a7a 100%);
  border-color: transparent;
  color: #fff;
  padding: 34px 32px 30px;
  box-shadow: 0 2px 6px rgba(11, 26, 51, .18), 0 18px 44px rgba(11, 26, 51, .22);
}
.topten-head:hover { box-shadow: 0 2px 6px rgba(11, 26, 51, .18), 0 18px 44px rgba(11, 26, 51, .22); }
.topten-kicker {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 5px;
  color: rgba(255, 255, 255, .6);
  margin-bottom: 10px;
}
.topten-title {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 600;
  letter-spacing: 8px;
  line-height: 1.1;
  color: #fff;
  margin: 0 0 14px;
}
.topten-desc {
  max-width: 620px;
  font-size: 13.5px;
  line-height: 1.85;
  color: rgba(255, 255, 255, .78);
  margin: 0;
}
.topten-meta {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: 12px;
  letter-spacing: .4px;
  color: rgba(255, 255, 255, .55);
}

.ten-item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
  color: inherit;
  transition: padding-left .25s cubic-bezier(.2, .7, .3, 1);
}
.ten-item:last-child { border-bottom: none; }
.ten-item:hover { text-decoration: none; padding-left: 6px; }
.ten-item:hover .ten-title { color: var(--navy); }

/* 名次：大号衬线数字，前三名加重 */
.ten-no {
  flex: none;
  width: 52px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  color: var(--line);
  letter-spacing: -1px;
}
.ten-item:nth-child(1) .ten-no,
.ten-item:nth-child(2) .ten-no,
.ten-item:nth-child(3) .ten-no { color: var(--navy); }

.ten-body { flex: 1; min-width: 0; }
.ten-title {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .2px;
  margin-bottom: 5px;
}
.ten-excerpt {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 热度分：右侧衬线数字，弱化但可查 */
.ten-score {
  flex: none;
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--ink-mute);
  padding-top: 4px;
  letter-spacing: .5px;
}

/* 榜首：加一条深蓝左边线强调 */
.ten-item-first {
  border-left: 2px solid var(--navy);
  padding-left: 16px;
  margin-left: -18px;
}
.ten-item-first:hover { padding-left: 22px; }

@media (max-width: 640px) {
  .topten-title { font-size: 34px; letter-spacing: 5px; }
  .topten-head { padding: 26px 22px; }
  .ten-no { width: 40px; font-size: 24px; }
  .ten-score { display: none; }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .nav { overflow-x: auto; }
  .topbar-inner { gap: 14px; }
}

/* 手机端将导航独立成第二行，避免品牌、导航和账户操作挤在同一行 */
@media (max-width: 640px) {
  .topbar-inner {
    height: auto;
    min-height: 58px;
    padding: 8px 14px 0;
    gap: 0;
    flex-wrap: wrap;
  }
  .logo { min-width: 0; flex: 1 1 auto; gap: 7px; font-size: 16px; }
  .logo-mark { width: 25px; height: 25px; }
  .logo .badge-unofficial { margin-left: 2px; font-size: 10px; }
  .topbar-right { gap: 6px; font-size: 12px; }
  .topbar-right .btn { padding: 6px 9px; }
  .topbar-me span { max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
  .nav {
    order: 3;
    flex: 0 0 calc(100% + 28px);
    width: calc(100% + 28px);
    margin: 7px -14px 0;
    padding: 0 10px;
    border-top: 1px solid var(--line-soft);
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .nav a { padding: 9px 11px; font-size: 13.5px; }
  .wrap { padding: 20px 12px 48px; }
  .card { padding: 19px 16px; }
  .site-footer { padding: 18px 14px; }
}
