/* ==========================================================================
   天地一栗的网站 · 设计系统
   风格：极简现代（白底、大标题、细线分隔、大量留白）
   依赖：无。纯手写 CSS，无需构建，双击 HTML 即可查看。
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* 颜色 */
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --bg-sink: #f4f4f4;
  --ink: #111111;
  --ink-2: #3d3d3d;
  --ink-3: #6b6b6b;
  --ink-4: #9a9a9a;
  --line: #e8e8e8;
  --line-strong: #d0d0d0;
  --accent: #a04a1e;        /* 栗色：取自站名，克制使用 */
  --accent-soft: #fdf5ef;
  --warn-bg: #fffaf0;
  --warn-line: #ecd9b0;
  --warn-ink: #7a5a1e;

  /* 排版 */
  --font-sans: system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  /* 尺度 */
  --max: 1040px;
  --radius: 12px;
  --radius-sm: 8px;
  --gap: 24px;

  /* 动效 */
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* ---------- 2. 重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; display: block; }

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}

a:hover { color: var(--accent); }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection {
  background: var(--ink);
  color: #fff;
}

/* ---------- 3. 布局 ---------- */
.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

.section { padding: 64px 0; }
.section + .section { border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.section-title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.section-link {
  font-size: 0.875rem;
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
}

.section-link:hover { border-color: var(--accent); }

/* ---------- 4. 顶部导航 ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--ink);
  color: #fff;
  font-size: 0.8125rem;
  line-height: 1;
  flex: none;
}

.brand:hover { color: var(--ink); }
.brand:hover .brand-mark { background: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.9375rem;
}

.nav-link {
  color: var(--ink-3);
  padding: 4px 0;
  border-bottom: 1.5px solid transparent;
}

.nav-link:hover { color: var(--ink); }

.nav-link.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ---------- 5. 首屏 ---------- */
.hero { padding: 96px 0 72px; }

.eyebrow {
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  margin-bottom: 20px;
}

.display {
  font-size: clamp(2.75rem, 8.5vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.display-sub {
  margin-top: 22px;
  max-width: 34em;
  font-size: 1.0625rem;
  color: var(--ink-2);
}

.lead {
  margin-top: 16px;
  max-width: 36em;
  color: var(--ink-3);
}

.quote {
  margin-top: 20px;
  padding-left: 16px;
  border-left: 2px solid var(--line-strong);
  color: var(--ink-4);
  font-size: 0.9375rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-sm { padding: 7px 15px; font-size: 0.875rem; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* ---------- 7. 数字条 ---------- */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.stat-num {
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--ink-4);
  letter-spacing: 0.04em;
}

/* ---------- 8. 卡片网格 ---------- */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, 0.35);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-desc {
  font-size: 0.9375rem;
  color: var(--ink-3);
  flex: 1;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--ink-4);
  font-family: var(--font-mono);
}

.tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 0.75rem;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ---------- 9. 关于我 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 48px;
  align-items: start;
}

/* 介绍没填的时候，JS 会把空的介绍块收掉、并给容器加上 is-single（首页的 .about-grid
   和关于页的 .grid-2 各一处）。
   为什么要专门写这一条：grid 的列是**写死的模板**，把子元素 display:none 之后
   列本身还在 —— 剩下那张表会孤零零贴着半边，看着像排版坏了。 */
.about-grid.is-single,
.grid-2.is-single {
  grid-template-columns: 1fr;
}

.prose { color: var(--ink-2); }
.prose p + p { margin-top: 14px; }
.prose strong { font-weight: 600; color: var(--ink); }

.kv { display: grid; gap: 14px; margin-top: 8px; }

.kv-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
}

.kv-key { color: var(--ink-4); font-size: 0.8125rem; }

/* ---------- 10. 页头（内页） ---------- */
.page-head { padding: 72px 0 40px; }

.page-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.page-desc {
  margin-top: 16px;
  max-width: 40em;
  color: var(--ink-3);
}

/* ---------- 11. 筛选芯片 ---------- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 0 28px;
  border-top: 1px solid var(--line);
}

.chip {
  padding: 6px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.875rem;
  color: var(--ink-3);
  cursor: pointer;
  transition: all 0.16s var(--ease);
}

.chip:hover { border-color: var(--ink-3); color: var(--ink); }

.chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ---------- 12. 论坛：工具条 ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* 左侧需要 flex:1 撑开：否则它作为一个「可换行的 flex 容器」，
   自身宽度会塌缩到最宽的那个子元素，导致搜索框和下拉框永远排不到一行 */
.toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.toolbar-right {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  flex: 0 0 auto;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  transition: border-color 0.16s var(--ease);
}

.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.06);
}

.textarea { min-height: 140px; resize: vertical; line-height: 1.7; }

/* 表单内控件占满整行；工具条内则按内容宽度排成一行 */
.toolbar-left .input-search {
  width: auto;
  flex: 1 1 240px;
  max-width: 340px;
  min-width: 0;
}

.toolbar-left .select {
  width: auto;
  flex: 0 0 auto;
  min-width: 150px;
  cursor: pointer;
}

.select { cursor: pointer; }

/* ---------- 13. 论坛：帖子列表 ---------- */
.post-list { border-top: 1px solid var(--line); }

.post {
  display: flex;
  gap: 18px;
  padding: 24px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.16s var(--ease);
}

.post:hover { background: var(--bg-soft); }

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: var(--bg-sink);
  border: 1px solid var(--line);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-2);
}

.post-main { min-width: 0; flex: 1; }

.post-title {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.post:hover .post-title { color: var(--accent); }

.post-excerpt {
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 0.9375rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--ink-4);
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-strong);
  flex: none;
}

.badge {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid #f0ded0;
  color: var(--accent);
  font-size: 0.75rem;
  white-space: nowrap;
}

.pin {
  font-size: 0.75rem;
  color: var(--ink-4);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ---------- 14. 论坛：帖子详情 ---------- */
.detail-head {
  padding: 28px 0 24px;
  border-bottom: 1px solid var(--line);
}

.detail-title {
  font-size: clamp(1.5rem, 3.4vw, 2.125rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.detail-body {
  padding: 28px 0;
  font-size: 1.0625rem;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.reply {
  display: flex;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.reply-body { min-width: 0; flex: 1; }
.reply-name { font-size: 0.9375rem; font-weight: 600; }
.reply-text {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 0.9375rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ---------- 15. 表单 ---------- */
.form { display: grid; gap: 20px; max-width: 720px; }

.field { display: grid; gap: 8px; }

.label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
}

.hint { font-size: 0.8125rem; color: var(--ink-4); }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ---------- 16. 提示条 ---------- */
.notice {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 0.875rem;
  color: var(--ink-3);
  line-height: 1.65;
}

.notice-warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn-ink);
}

.notice strong { color: inherit; font-weight: 600; }

/* ---------- 17. 空状态 ---------- */
.empty {
  padding: 72px 0;
  text-align: center;
  color: var(--ink-4);
}

.empty-title {
  font-size: 1.0625rem;
  color: var(--ink-2);
  margin-bottom: 8px;
  font-weight: 600;
}

/* ---------- 18. 页脚 ---------- */
.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--line);
  padding: 40px 0 56px;
  font-size: 0.875rem;
  color: var(--ink-4);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: baseline;
  justify-content: space-between;
}

.footer-links { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-links a { color: var(--ink-3); }

/* ---------- 19. 工具类 ---------- */
.mono { font-family: var(--font-mono); font-size: 0.875rem; }
.muted { color: var(--ink-4); }
.hidden { display: none !important; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  z-index: 99;
}

.skip-link:focus { left: 12px; top: 12px; color: #fff; }

/* ---------- 20. 入场动画（纯 CSS，尊重系统偏好） ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.rise { animation: rise 0.6s var(--ease) both; }
.rise-1 { animation-delay: 0.04s; }
.rise-2 { animation-delay: 0.1s; }
.rise-3 { animation-delay: 0.16s; }
.rise-4 { animation-delay: 0.22s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 21. 响应式 ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 64px 0 48px; }
  .section { padding: 48px 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats { gap: 32px; }
  .nav-inner { height: 58px; }
  .nav-links { gap: 18px; font-size: 0.875rem; }
  .brand span:not(.brand-mark) { display: none; }
  .kv-row { grid-template-columns: 1fr; gap: 2px; }
  .toolbar-left .input-search { max-width: none; width: 100%; }
  .toolbar-left .select { width: 100%; }
  .toolbar-left, .toolbar-right { width: 100%; }
  .post { gap: 14px; }
  .avatar { width: 36px; height: 36px; font-size: 0.875rem; }
  .nav-login { padding: 5px 12px; font-size: 0.8125rem; }
}

/* ==========================================================================
   22. 登录 / 注册
   说明：本轮只做「界面」。不校验、不存状态、不伪造登录结果。
   ========================================================================== */

.auth-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 56px;
  align-items: start;
}

.auth-aside-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}

.auth-aside p { color: var(--ink-3); }

.list-check {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.list-check li {
  position: relative;
  padding-left: 24px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.list-check li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.auth-card {
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

.auth-card-head {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* --- 标签切换 --- */
.tabs {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--line);
  margin: 20px 0 26px;
}

.tab {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0 0 12px;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink-4);
  cursor: pointer;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.tab:hover { color: var(--ink-2); }

.tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* --- 卡片内表单 --- */
.auth-form { display: grid; gap: 18px; }

.btn-block {
  width: 100%;
  justify-content: center;
}

/* 输入框 + 右侧按钮（获取验证码） */
.field-inline {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.field-inline .input {
  flex: 1 1 auto;
  min-width: 0;
}

.field-inline .btn { flex: 0 0 auto; }

/* 输入框内右侧文字按钮（显示密码） */
.field-wrap { position: relative; }
.field-wrap .input { padding-right: 66px; }

.field-suffix {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  font-size: 0.8125rem;
  color: var(--ink-3);
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}

.field-suffix:hover { background: var(--bg-sink); color: var(--ink); }

.checkline {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.875rem;
  color: var(--ink-3);
  line-height: 1.6;
}

.checkline input {
  flex: none;
  margin-top: 5px;
  width: 15px;
  height: 15px;
  accent-color: var(--ink);
}

.auth-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
}

.auth-foot a {
  color: var(--ink-3);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 1px;
}

.auth-foot a:hover { color: var(--accent); border-color: var(--accent); }

/* 页面级提示（验证码未真发、演示说明等） */
.inline-note {
  font-size: 0.8125rem;
  color: var(--accent);
}

@media (max-width: 900px) {
  .auth-grid { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 680px) {
  .auth-card { padding: 24px 20px; }
  .tabs { gap: 20px; }
}

/* ==========================================================================
   23. 登录状态（导航）、演示标识、个人中心
   ========================================================================== */

/* --- 导航右侧：未登录是「登录」按钮，已登录变成昵称 + 下拉菜单 --- */

/*
 * [data-nav-auth] 这个 span 里装的是"登录按钮"，或者登录后的"铃铛 + 用户菜单"。
 * 它默认是 inline，而铃铛是 inline-grid、.nav-user 是块级 div——
 * 块级元素在一个 inline 容器里会另起一行，结果是导航被撑成两行高：
 * 铃铛在上面一行，用户名在下面一行，两个还叠在一起。
 * 所以这里必须显式摆成一行。flex: none 是防止它被挤扁。
 */
[data-nav-auth] {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 18px;
}

.nav-user { position: relative; }

.nav-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.875rem;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 0.16s var(--ease);
}

.nav-user-btn:hover { border-color: var(--ink-3); }

.nav-user-btn .avatar {
  width: 26px;
  height: 26px;
  font-size: 0.8125rem;
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.nav-user-caret { font-size: 0.625rem; color: var(--ink-4); line-height: 1; }

.nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  z-index: 40;
  min-width: 172px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 44px -18px rgba(0, 0, 0, 0.42);
  display: grid;
  gap: 2px;
}

.nav-menu a,
.nav-menu button {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 7px;
  background: none;
  text-align: left;
  font-size: 0.875rem;
  color: var(--ink-2);
  cursor: pointer;
}

.nav-menu a:hover,
.nav-menu button:hover { background: var(--bg-sink); color: var(--ink); }

/* --- 演示模式标识 --- */
.demo-pill {
  padding: 2px 9px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--ink-4);
  white-space: nowrap;
}

.demo-pill:hover { border-color: var(--accent); color: var(--accent); }

/* --- 已登录时的卡片内容 --- */
.auth-aside-user {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 20px;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 1.125rem;
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.auth-aside-name { font-size: 1.0625rem; font-weight: 600; }

/* --- 演示账号一键填入 --- */
.demo-accounts {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.demo-accounts-head {
  margin-bottom: 10px;
  font-size: 0.8125rem;
  letter-spacing: 0.03em;
  color: var(--ink-4);
}

.demo-account {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}

.demo-account:hover { border-color: var(--ink); background: var(--bg-soft); }

.demo-account-role {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.6875rem;
}

.demo-account-mail {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-2);
}

.demo-account-note {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--ink-4);
}

/* --- 表单错误提示 --- */
.form-error {
  padding: 11px 14px;
  border: 1px solid #f2d3d0;
  border-radius: 8px;
  background: #fdf1f0;
  color: #a3231a;
  font-size: 0.875rem;
  line-height: 1.6;
}

/* --- 小标签与文字按钮
       （原先定义在 admin.css 里，前台也要用，这里也放一份，两处保持一致） --- */
.link-btn {
  padding: 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  font-size: 0.875rem;
  color: var(--ink-3);
  cursor: pointer;
  white-space: nowrap;
}

.link-btn:hover { color: var(--accent); border-bottom-color: var(--accent); }
.link-btn-danger:hover { color: #b3261e; border-bottom-color: #b3261e; }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 0.75rem;
  color: var(--ink-3);
  white-space: nowrap;
}

.pill-warn { background: #fff8e8; border-color: #f0dcb0; color: #8a6100; }
.pill-ok { background: #f1f8f2; border-color: #cfe6d5; color: #256b3a; }
.pill-danger { background: #fdf1f0; border-color: #f2d3d0; color: #a3231a; }
.pill-admin { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill-mod { background: var(--accent-soft); border-color: #f0ded0; color: var(--accent); }

/* --- 内容面板（不带悬停效果的大块容器，例如说明页里的清单） --- */
.panel {
  margin-bottom: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}

/* --- 个人中心 --- */
.me-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.me-head-info { min-width: 0; }
.me-name { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.015em; }
.me-mail { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--ink-4); }
.me-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

@media (max-width: 680px) {
  .nav-user-name { display: none; }
  .nav-menu { right: auto; left: 0; }
  .demo-accounts { margin-top: 20px; }
}

/* ==========================================================================
   24. 深色主题
   --------------------------------------------------------------------------
   因为所有颜色从一开始就集中在 :root 里，换主题只需要覆盖那十几个变量。
   切换按钮写在导航里，偏好存在 localStorage，只在加载了主题脚本的页面生效。
   ========================================================================== */

html[data-theme="dark"] {
  --bg: #0f0f11;
  --bg-soft: #17171a;
  --bg-sink: #202024;
  --ink: #f2f2f3;
  --ink-2: #c8c8ce;
  --ink-3: #9999a3;
  --ink-4: #6d6d78;
  --line: #26262c;
  --line-strong: #3b3b44;
  --accent: #e28a52;        /* 深色底上栗色要提亮，否则对比度不够 */
  --accent-soft: #2b1f18;
  --warn-bg: #2a2214;
  --warn-line: #4a3d20;
  --warn-ink: #e3c580;
}

/* 主色被反转的地方：深色下"深底白字"要变成"浅底深字"，否则白字白底看不清 */
html[data-theme="dark"] .btn-primary,
html[data-theme="dark"] .btn-primary:hover,
html[data-theme="dark"] .brand-mark,
html[data-theme="dark"] .nav-user-btn .avatar,
html[data-theme="dark"] .avatar-lg,
html[data-theme="dark"] .pill-admin,
html[data-theme="dark"] .chip.is-active,
html[data-theme="dark"] .skip-link,
html[data-theme="dark"] .profile-avatar,
html[data-theme="dark"] .todo-none { color: var(--bg); }

html[data-theme="dark"] ::selection { background: var(--ink); color: var(--bg); }

html[data-theme="dark"] .nav-menu { background: var(--bg-soft); }

html[data-theme="dark"] .pill,
html[data-theme="dark"] .pill-ok,
html[data-theme="dark"] .pill-warn,
html[data-theme="dark"] .pill-danger,
html[data-theme="dark"] .pill-mod { background: var(--bg-sink); border-color: var(--line-strong); color: var(--ink-2); }

html[data-theme="dark"] .pill-warn { color: #e3c580; }
html[data-theme="dark"] .pill-danger { color: #ff9c8f; }
html[data-theme="dark"] .pill-mod { color: var(--accent); }

html[data-theme="dark"] .form-error {
  background: #241a18;
  border-color: #5a2f2a;
  color: #ff9c8f;
}

html[data-theme="dark"] .badge {
  background: var(--accent-soft);
  border-color: #4a3226;
  color: var(--accent);
}

html[data-theme="dark"] .avatar { background: var(--bg-sink); border-color: var(--line-strong); color: var(--ink-2); }

/* 图片与封面在深色下稍微压一点亮度，避免刺眼 */
html[data-theme="dark"] .video-thumb-img { filter: brightness(0.92); }

/* --- 导航栏里的搜索入口 --- */
/* 为什么用图标而不是再加一个「搜索」文字链接：导航已经有五个文字项了，
   再加一个会挤（手机上更明显）。图标是内联 SVG，不引外部资源，跟随 currentColor。 */
.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--ink-3);
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.nav-icon:hover { border-color: var(--line); color: var(--ink); }

.nav-icon.is-active {
  color: var(--ink);
  border-color: var(--line);
}

.nav-icon svg { display: block; }

/* --- 主题切换按钮 --- */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-3);
  font-size: 0.8125rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease), transform 0.25s var(--ease);
}

.theme-toggle:hover { border-color: var(--ink-3); color: var(--ink); transform: rotate(180deg); }

/* --- toast（提示消息），从 auth-ui.js 里搬出来，这样深色下也能用 --- */
.toast-wrap {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
  pointer-events: none;
}

.toast {
  max-width: 340px;
  padding: 11px 16px;
  border-radius: 9px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.875rem;
  line-height: 1.55;
  box-shadow: 0 12px 34px -14px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.toast.is-in { opacity: 1; transform: none; }

.toast-error {
  background: #fdf1f0;
  border: 1px solid #f2d3d0;
  color: #a3231a;
}

html[data-theme="dark"] .toast-error {
  background: #241a18;
  border-color: #5a2f2a;
  color: #ff9c8f;
}

/* ==========================================================================
   25. UP主名片区
   ========================================================================== */

.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  flex: none;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  overflow: hidden;
}

.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }

.profile-name {
  font-size: clamp(2rem, 5.5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.profile-bio {
  margin-top: 14px;
  max-width: 36em;
  font-size: 1.0625rem;
  color: var(--ink-2);
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

/* ==========================================================================
   26. 视频卡片
   ========================================================================== */

.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.video-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.video-card:hover {
  border-color: var(--ink);
  transform: translateY(-3px);
  box-shadow: 0 14px 36px -22px rgba(0, 0, 0, 0.5);
}

.video-thumb {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-sink);
}

.video-thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 没有封面图时画的占位块；有真实封面时它是盖在上面的播放标识 */
.video-thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.75rem;
  /* 加一点投影：真实封面可能是浅色的，纯白三角会看不清 */
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

.video-thumb-tag {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
}

.video-dur {
  position: absolute;
  right: 9px;
  bottom: 9px;
  padding: 1px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.76);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.video-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px 16px;
  flex: 1;
}

.video-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  font-size: 0.8125rem;
  color: var(--ink-4);
}

/* ==========================================================================
   27. 站内作品卡片（点一下去B站）

   这一节以前是"站内播放弹窗"的样式（.modal / .modal-box / .modal-player …）。
   现在不弹窗了：卡片本身就是 <a href>，点了直接在新标签打开B站。
   旧样式已经删掉——留着没人用的 CSS 只会让后面的人以为还有这个功能。
   ========================================================================== */

/* 卡片现在是 <a>，链接默认带下划线，这里去掉。
   （排版、颜色、flex 都由上面的 .video-card 管，不用重复写。） */
a.video-card {
  text-decoration: none;
}

/* 键盘用户 Tab 到卡片时要看得见焦点。
   用 :focus-visible 而不是 :focus——鼠标点一下不该留下一个框。 */
a.video-card:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ==========================================================================
   28. 作品页工具条与响应式
   ========================================================================== */

.wall-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.wall-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.wall-toolbar-left .input-search {
  width: auto;
  flex: 1 1 240px;
  max-width: 340px;
  min-width: 0;
}

.wall-toolbar-left .select {
  width: auto;
  flex: 0 0 auto;
  min-width: 140px;
  cursor: pointer;
}

.wall-count {
  font-size: 0.8125rem;
  color: var(--ink-4);
  white-space: nowrap;
}

@media (max-width: 980px) {
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .profile-hero { grid-template-columns: 1fr; gap: 22px; }
  .profile-avatar { width: 84px; height: 84px; font-size: 1.875rem; }
  .profile-stats { gap: 28px; }
}

@media (max-width: 680px) {
  .video-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 12px; font-size: 0.8125rem; }
  .theme-toggle { width: 26px; height: 26px; font-size: 0.75rem; }
  .wall-toolbar-left .input-search { max-width: none; width: 100%; flex-basis: 100%; }
  .wall-toolbar-left .select { width: 100%; }
  .wall-toolbar-left { width: 100%; }
}

/* ==========================================================================
   29. 交互层（参考成熟网站的做法）
   --------------------------------------------------------------------------
   这一节的东西来自：
     · B站 App / YouTube —— 移动端底部标签栏、骨架屏、无限滚动、已看标记
     · 知乎 / V2EX     —— 乐观点赞动效、最后回复信息
     · YouTube 网页    —— 返回顶部、阅读进度条
     · Discourse       —— 键盘快捷键提示
   每个组件上面都写了"为什么这样做"，改动时请保留理由。
   ========================================================================== */

:root {
  /* 顶栏与底栏的底色单独抽出来：深色主题下必须跟着变，
     否则会出现"深色页面顶着一个浅色导航条"*/
  --nav-bg: rgba(255, 255, 255, 0.88);
  --skeleton-shine: rgba(255, 255, 255, 0.55);
  --overlay: rgba(0, 0, 0, 0.74);
}

html[data-theme="dark"] {
  --nav-bg: rgba(15, 15, 17, 0.88);
  --skeleton-shine: rgba(255, 255, 255, 0.07);
  --overlay: rgba(0, 0, 0, 0.82);
}

/* 顶栏和后台顶栏都改用变量 */
.site-nav { background: var(--nav-bg); }

/* ---------- 29.1 骨架屏（B站/YouTube：加载时给形状，不给"正在加载"四个字） ---------- */

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--bg-sink);
  border-radius: var(--radius-sm);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.sk-line { height: 12px; border-radius: 4px; }
.sk-line + .sk-line { margin-top: 9px; }
.sk-line.w40 { width: 40%; }
.sk-line.w60 { width: 60%; }
.sk-line.w80 { width: 80%; }
.sk-circle { width: 42px; height: 42px; border-radius: 50%; flex: none; }

/* 骨架卡片：和真实视频卡片同尺寸，加载完不会跳版 */
.sk-card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sk-thumb { aspect-ratio: 16 / 9; border-radius: 0; }
.sk-card-body { padding: 14px 16px 16px; }

/* 骨架帖子行 */
.sk-row { display: flex; gap: 18px; padding: 24px 4px; border-bottom: 1px solid var(--line); }
.sk-row-main { flex: 1; min-width: 0; }

/* ---------- 29.2 移动端底部标签栏（B站 App / YouTube） ---------- */

.tabbar { display: none; }

@media (max-width: 680px) {
  /* 顶部只留品牌、主题、登录；栏目交给底部栏。这样 5 个栏目在手机上不用挤成一团 */
  .nav-links .nav-link { display: none; }

  .tabbar {
    /* 用 flex 而不是"grid + 写死列数"：
       2026-09-27 加「工具」这一项时踩到了 —— 原来写的是 repeat(5, 1fr)，
       第 6 个 tab 直接换行到第二排，手机上看着像坏掉了。
       改成 flex + 每项 flex:1 之后，tab 数量再怎么变都不会换行。 */
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--line);
    /* 适配 iPhone 底部小黑条，不然会被挡住 */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .tab-item {
    /* min-width:0 是必须的：flex 子项默认 min-width:auto，内容不肯缩就会被撑破 */
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 9px 0 8px;
    font-size: 0.6875rem;
    color: var(--ink-4);
    -webkit-tap-highlight-color: transparent;
  }

  .tab-item svg { width: 21px; height: 21px; display: block; }
  .tab-item.is-active { color: var(--ink); }
  .tab-item.is-active svg { transform: translateY(-1px); }
  .tab-item:active { opacity: 0.6; }

  /* 给底部栏让出位置，否则最后一段内容永远被压住 */
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- 29.3 返回顶部（YouTube/知乎：滚过一屏才出现） ---------- */

.to-top {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 55;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.45);
}

.to-top.is-on { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--ink); color: var(--ink); }

@media (max-width: 680px) {
  /* 移动端要让开底部标签栏 */
  .to-top { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); right: 14px; }
}

/* ---------- 29.4 阅读进度条（长文章/详情页，滚起来才知道还有多长） ---------- */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 70;
  height: 2px;
  width: 0;
  background: var(--accent);
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ---------- 29.5 点赞动效（知乎/B站：点下去要有反馈，而不是整块重绘） ---------- */

@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.pop { animation: pop 0.32s var(--ease); }

/* 点赞按钮激活态 */
.btn-like-on {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
}

/* ---------- 29.6 已看标记 / 小角标（B站：看过的不再重复推荐） ---------- */

.watched-pill {
  position: absolute;
  left: 10px;
  bottom: 9px;
  padding: 1px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.6875rem;
}

.video-card.is-watched .video-thumb-img,
.video-card.is-watched .video-thumb-fallback { opacity: 0.62; }

/* ---------- 29.7 列表渐进出现（新加载的一页淡入，避免"啪"地跳出来） ---------- */

@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.enter { animation: riseIn 0.34s var(--ease) both; }

/* ---------- 29.8 加载更多 / 到底了（B站/YouTube 的无限滚动收尾） ---------- */

.list-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 28px 0 8px;
  font-size: 0.8125rem;
  color: var(--ink-4);
}

.list-foot .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--ink-2);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 29.9 发帖表单：字数统计 + 表情 + 草稿提示 ---------- */

.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.char-count { font-size: 0.75rem; color: var(--ink-4); font-variant-numeric: tabular-nums; }
.char-count.is-warn { color: var(--accent); }
.char-count.is-over { color: #b3261e; font-weight: 600; }

.emoji-bar { display: flex; flex-wrap: wrap; gap: 4px; }

.emoji-bar button {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.emoji-bar button:hover { background: var(--bg-sink); border-color: var(--line); }

.draft-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 0.8125rem;
  color: var(--ink-3);
}

/* ---------- 29.10 键盘快捷键提示（Discourse 那种"按 ? 看帮助"） ---------- */

.kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-align: center;
  color: var(--ink-3);
}

/* ---------- 29.11 帖子列表里的"最后回复"（V2EX/Discourse 的关键信息） ---------- */

.last-reply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-4);
}

.last-reply b { font-weight: 500; color: var(--ink-2); }

/* ---------- 29.12 工具条在手机上可以横向滑动（筛选很多时不要换行成三排） ---------- */

.chips { scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

@media (max-width: 680px) {
  .chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 18px;
    -webkit-overflow-scrolling: touch;
  }
  .chip { flex: none; }
}

/* ---------- 29.13 尊重"减少动效"偏好（无障碍，别为了好看让人难受） ---------- */

@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
  .enter, .pop, .rise { animation: none !important; }
  .to-top { transition: none; }
}

/* ==========================================================================
   30. 楼层号 / 引用回复 / 站内通知 / 全站搜索
   ========================================================================== */

/* ---------- 30.0 锚点跳转不要被 sticky 导航盖住 ----------
   顶部导航是 position:sticky，占着 64px 高。如果直接跳到 #login、#about、
   #notifications 这类锚点，目标的标题会被导航条压住看不见。
   scroll-margin-top 就是给浏览器留出这段偏移。 */
[id] { scroll-margin-top: 84px; }

@media (max-width: 680px) {
  [id] { scroll-margin-top: 72px; }
}

/* ---------- 30.1 楼层号（V2EX/Discourse 那种 #1 #2） ---------- */

.reply-floor {
  display: inline-block;
  min-width: 28px;
  /* 不要在这里加 margin-right：.reply-head 是 flex + gap:8px，
     两个一叠加间距就变成 16px，楼层号和昵称会离得很远。间距交给 gap 统一管。 */
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--bg-sink);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ink-4);
  text-align: center;
  white-space: nowrap;
}

.reply-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- 30.2 引用块（显示在某条回复里） ---------- */

.reply-quote {
  display: block;
  width: 100%;
  margin: 8px 0 8px;
  padding: 9px 13px;
  border: 0;
  border-left: 3px solid var(--line-strong);
  border-radius: 0 6px 6px 0;
  background: var(--bg-soft);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-3);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}

.reply-quote:hover { border-left-color: var(--accent); color: var(--ink-2); }
.reply-quote b { font-weight: 500; color: var(--ink-2); }

/* ---------- 30.3 引用条（回复表单上方“正在回复 #3 楼”） ---------- */

.quote-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: var(--bg-soft);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--ink-3);
}

.quote-bar-text { flex: 1; min-width: 0; }
.quote-bar b { color: var(--ink-2); font-weight: 500; }

/* ---------- 30.4 点引用跳到那一楼时闪一下 ---------- */

@keyframes flashTarget {
  0%, 100% { background: transparent; }
  25% { background: var(--accent-soft); }
}

.reply.is-flash { animation: flashTarget 1.3s var(--ease); }

/* ---------- 30.5 站内通知 ---------- */

/* 导航栏里的小铃铛。移动端不显示（顶栏放不下），改在底部「我的」标签上点红点 */
.nav-bell {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg);
  color: var(--ink-3);
  cursor: pointer;
}

.nav-bell:hover { border-color: var(--ink-3); color: var(--ink); }

.nav-bell-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 2px solid var(--bg);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  line-height: 12px;
  text-align: center;
  font-family: var(--font-sans);
}

@media (max-width: 680px) {
  .nav-bell { display: none; }
  /* 底部「我的」标签上有个小红点，提示有未读 */
  .tab-item { position: relative; }
  .tab-item[data-unread]::after {
    content: "";
    position: absolute;
    top: 7px;
    right: 50%;
    margin-right: -18px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
  }
}

.notice-item {
  display: flex;
  gap: 14px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}

.notice-item:last-child { border-bottom: 0; }

.notice-item-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 9px;
  border-radius: 50%;
  background: transparent;
}

.notice-item.is-unread .notice-item-dot { background: var(--accent); }
.notice-item.is-unread .notice-item-title { font-weight: 600; }

.notice-item-main { flex: 1; min-width: 0; }

.notice-item-title {
  display: block;
  font-size: 0.9375rem;
  color: var(--ink);
  line-height: 1.55;
}

.notice-item a.notice-item-title:hover { color: var(--accent); }

.notice-item-excerpt {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--ink-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 30.6 全站搜索页 ---------- */

.search-box {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 24px;
}

.search-box .input {
  flex: 1 1 auto;
  font-size: 1.0625rem;
  padding: 13px 18px;
}

.search-box .btn { flex: 0 0 auto; padding-left: 26px; padding-right: 26px; }

.search-count {
  font-size: 0.8125rem;
  color: var(--ink-4);
  white-space: nowrap;
}

/* 搜索结果里高亮命中的字 */
mark.hl {
  padding: 0 2px;
  border-radius: 3px;
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 680px) {
  .search-box { flex-direction: column; }
  .search-box .btn { width: 100%; justify-content: center; }
}

/* ==========================================================================
   31. 关于页的 QQ 群卡片
   --------------------------------------------------------------------------
   为什么二维码和群号都放：
     · 手机上扫码最快
     · 桌面浏览器扫不了码，只能搜群号
     · 二维码可能会过期（QQ 有时会失效），群号不会
   三件事都照顾到，比只放一个稳。
   ========================================================================== */

.qq-card {
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}

.qq-card-qr { flex: none; text-align: center; }

.qq-card-qr img {
  display: block;
  width: 200px;
  height: 200px;
  border-radius: 10px;
  background: #fff;
  /* 二维码必须留白边（quiet zone）才能被扫出来，
     所以给一圈白底 + 内边距，深色模式下也不要让它贴边 */
  padding: 8px;
  border: 1px solid var(--line);
}

.qq-card-qr .hint { margin-top: 10px; }

.qq-card-info { flex: 1; min-width: 220px; }

.qq-card-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.qq-card-num { font-size: 0.9375rem; color: var(--ink-2); margin-bottom: 8px; }

/* 能点就复制的元素（QQ 号没法做成链接，腾讯的协议链接浏览器基本都拦） */
.qq-card-num .mono,
[data-copy] {
  cursor: pointer;
  border-bottom: 1px dashed var(--ink-4);
}

[data-copy]:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* 长得像按钮、但其实是"点一下复制"的 span */
.btn-copy {
  /* 复用 .btn 的外观，这里只补一个手型光标 */
  cursor: pointer;
}

@media (max-width: 620px) {
  .qq-card { flex-direction: column; align-items: flex-start; gap: 20px; }
  .qq-card-qr { width: 100%; text-align: left; }
}

/* ==========================================================================
   32. 举报弹层
   --------------------------------------------------------------------------
   为什么不用 window.prompt / confirm：
     · 理由要从 7 个选项里挑，prompt 只能手打，打错就报"理由不合法"
     · "其它"要求写说明，需要两个输入框，prompt 只有一行
     · prompt 会阻塞整个页面，连里面的内容都复制不出来

   几个刻意的细节：
     · 默认**不选中**任何理由 —— 默认选中第一条，手快的人会提交一个自己
       没看过的理由，版主收到的举报质量就完了
     · 被举报的原文截一段显示在顶部，用户能确认"我报的是这条"
     · 焦点管理：打开时进第一个单选项，关闭时还给触发它的那个按钮
       （不还回去的话，键盘用户会被扔回页面开头，要重新 Tab 一圈）
   ========================================================================== */

.report-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 17, 17, 0.5);
  /* 弹层内部滚动，页面本身不跟着动（手机上尤其明显） */
  overflow-y: auto;
  animation: report-fade 0.14s var(--ease);
}

.report-modal.hidden { display: none; }

@keyframes report-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.report-card {
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px 26px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

.report-title {
  margin: 0 0 6px;
  font-size: 1.1875rem;
  font-weight: 700;
}

.report-sub {
  margin: 0 0 18px;
  padding: 10px 12px;
  border-left: 3px solid var(--line);
  background: var(--bg-soft);
  border-radius: 0 6px 6px 0;
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.6;
  /* 长正文不能把弹层撑爆，最多显示三行 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.report-reasons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.report-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.report-option:hover { border-color: var(--ink-4); background: var(--bg-soft); }

/* 选中态跟着输入框走：用 :has 再加一条兼容分支，老浏览器至少不会错位 */
.report-option:has(input:checked) {
  border-color: var(--ink);
  background: var(--bg-soft);
  font-weight: 600;
}

/* 键盘 Tab 到这里时要看得见（鼠标用户看不到这个圈，符合预期） */
.report-option:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.report-option input { margin: 0; flex: none; }

.report-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* 「取消」在视觉上要弱于「提交举报」—— 这是个不可逆的对外动作，
   不该让两个按钮长得一样重 */
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-2);
}

.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }

/* 提交区的错误提示。刻意用红色文字而不是弹 toast：
   表单错误要留在表单旁边，弹 toast 的话用户一低头就没了 */
#report-error {
  margin-top: 8px;
  color: #b3261e;
  font-size: 0.875rem;
}

/* 举报过的按钮：变灰、不能再点 */
.link-btn.is-reported,
.btn.is-reported {
  opacity: 0.5;
  cursor: default;
}

@media (max-width: 480px) {
  /* 手机上两列会把"与主题无关"挤成两行，一列更清爽 */
  .report-reasons { grid-template-columns: 1fr; }
  .report-card { padding: 20px 18px 16px; }
}

html[data-theme="dark"] .report-modal { background: rgba(0, 0, 0, 0.65); }
html[data-theme="dark"] .report-card { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); }
html[data-theme="dark"] #report-error { color: #f2b8b5; }

/* ==========================================================================
   33. 帖子/回复里的图片与头像
   ========================================================================== */

/* 正文里的图。
   为什么不给固定高度：截图、竖屏照片、长图三种比例都有，
   定死高度不是裁掉内容就是把图压变形。限宽 + 自动高度是唯一不出错的做法。 */
.body-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 14px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
}

/* 图还没加载出来时先占一点高度，避免它一出现就把下面的文字顶走 */
.body-img:not([src]) { min-height: 60px; }

/* 头像换成图片时：色块那套 padding/字号都不要了，直接让图铺满圆 */
.avatar-img { padding: 0; overflow: hidden; }
.avatar-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 编辑器工具栏（插图按钮 + 提示）。
   margin-top 给 10px：它紧跟在 emoji-bar 下面，两个都是"副操作"，
   贴太近会让人分不清哪个属于哪个 */
.editor-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.editor-tools .hint { margin: 0; }

/* 上传失败的提示要显眼：它就在按钮右边，用户点了按钮之后的反馈落在这儿，
   不标红的话很容易被当成普通说明跳过 */
.editor-tools .hint.is-error { color: #b3261e; }

html[data-theme="dark"] .editor-tools .hint.is-error { color: #f2b8b5; }

/* ---------- 个人中心的换头像 ---------- */

.avatar-editor {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.avatar-editor-preview {
  flex: none;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
  color: var(--ink-2);
}

.avatar-editor-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avatar-editor-actions { flex: 1; min-width: 220px; }
.avatar-editor-actions .hint { display: block; margin-top: 8px; }
.avatar-editor-actions .hint.is-error { color: #b3261e; }

html[data-theme="dark"] .avatar-editor-actions .hint.is-error { color: #f2b8b5; }

/* ==========================================================================
   36. 登录 / 注册浮窗
   --------------------------------------------------------------------------
   和举报弹层（第 32 节）是同一套做法：fixed 遮罩 + 居中卡片 + 内部滚动。
   刻意保持一致，两个弹层长得不一样会显得这个站是拼出来的。

   为什么高度用 max-height 而不是写死：
     注册表单比登录表单长（四个输入框 + 条款），
     写死高度要么把注册表单截掉，要么让登录卡片空一大块。
   为什么手机上给接近满屏：
     一弹键盘就只剩一半高度，居中卡片会被顶得看不到输入框 ——
     这是手机上最容易被忽略、也最容易让人放弃注册的一点。
   ========================================================================== */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 210;                 /* 比举报弹层（200）高：登录浮窗可能从举报流程里弹出来 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 17, 17, 0.5);
  overflow-y: auto;
  animation: report-fade 0.14s var(--ease);
}

.auth-modal.hidden { display: none; }

.auth-modal-card {
  position: relative;
  width: 100%;
  max-width: 420px;              /* "小浮窗"：比举报弹层的 460 窄一点 */
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px 26px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
}

/* 关闭按钮：右上角一个圆形小按钮。
   为什么不用一个"取消"文字按钮：浮窗里已经有主按钮了，
   再加一个同等重量的按钮会让人犹豫点哪个。 */
.auth-modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font-size: 1.375rem;
  line-height: 1;
  cursor: pointer;
}

.auth-modal-x:hover { background: var(--bg-soft); color: var(--ink); }

.auth-modal-head { margin-bottom: 18px; padding-right: 34px; }

.auth-modal-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  font-weight: 700;
}

.auth-modal-sub {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.6;
}

/* 浮窗里的表单：字段间距比整页版紧一点，小卡片才不至于太长 */
.auth-modal-card .field { margin-bottom: 14px; }
.auth-modal-card .tabs { margin-bottom: 16px; }

/* 浮窗里的"打开新页面"链接也要走浮窗（data-auth-goto），
   所以它们看起来要像按钮式的文字链，不像会跳走的东西 */
.auth-modal-card .auth-foot a { cursor: pointer; }

/* ---- 手机：接近满屏 ---- */
@media (max-width: 560px) {
  .auth-modal {
    padding: 0;
    align-items: flex-start;   /* 从顶部开始，键盘弹出时内容不会跳 */
  }

  .auth-modal-card {
    max-width: none;
    width: 100%;
    min-height: 100vh;         /* 满屏，像一个真正的页面 */
    max-height: none;
    border: 0;
    border-radius: 0;
    padding: 22px 18px 28px;
    box-shadow: none;
  }

  /* 满屏时右上角那个叉太靠边了，往里收一点 */
  .auth-modal-x { top: 16px; right: 10px; }
}

html[data-theme="dark"] .auth-modal { background: rgba(0, 0, 0, 0.65); }
html[data-theme="dark"] .auth-modal-card { box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6); }

/* ---------- 16. 工具页：CPS 测试 ---------- */
/* 只服务 tools.html。颜色全部走上面的设计令牌，
   所以浅色/深色主题自动跟着变，不用再写第二份。 */

.cps { margin-top: 8px; }

/* --- 选项栏 --- */
.cps-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 32px;
  margin-bottom: 20px;
}

.cps-group { display: flex; align-items: center; gap: 12px; }

.cps-label { font-size: 0.875rem; color: var(--ink-3); white-space: nowrap; }

/* 分段选择器：一组按钮拼成一条 */
.cps-seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-soft);
}

.cps-seg button {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 0.875rem;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.cps-seg button:last-child { border-right: 0; }
.cps-seg button:hover { background: var(--bg-sink); }
.cps-seg button.is-on { background: var(--accent); color: #fff; }
.cps-seg button:disabled { opacity: 0.45; cursor: not-allowed; }
/* 深色主题下栗色是提亮版，白字对比度不够，改用深字 */
html[data-theme="dark"] .cps-seg button.is-on { color: #1a0e06; }

/* --- 点击区 --- */
.cps-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 260px;
  padding: 32px 20px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
  cursor: pointer;
  outline: none;
  /* 触屏上双击缩放会打断连点；点的时候也不该选中文字 */
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.cps-stage:hover,
.cps-stage:focus-visible { border-color: var(--accent); }
.cps-stage.is-running {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent-soft);
}
.cps-stage.is-done { border-style: solid; }

.cps-big {
  font-size: 4rem;                                   /* 老浏览器兜底 */
  font-size: clamp(2.5rem, 9vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;                /* 数字跳动时宽度不抖 */
}
.cps-big.is-run,
.cps-big.is-done { color: var(--accent); font-family: var(--font-mono); }

.cps-sub { font-size: 0.9375rem; color: var(--ink-3); }
.cps-note { font-size: 0.875rem; color: var(--ink-4); text-align: center; }

/* --- 结果 --- */
.cps-result { margin-top: 24px; }

.cps-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.cps-stat {
  padding: 18px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  text-align: center;
}
.cps-stat b {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.cps-stat span {
  display: block;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--ink-3);
}

.cps-actions { margin-top: 18px; }

/* --- 本机记录 --- */
.cps-rows {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.cps-row {
  display: grid;
  grid-template-columns: 96px 132px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}
.cps-row:last-child { border-bottom: 0; }
.cps-row.is-best { background: var(--accent-soft); }

.cps-row-time { color: var(--ink-4); font-family: var(--font-mono); font-size: 0.8125rem; }
.cps-row-mode { color: var(--ink-3); }
.cps-row-num {
  font-family: var(--font-mono);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cps-row-sub { color: var(--ink-4); font-size: 0.8125rem; text-align: right; }

/* --- 说明里那个水平列表 --- */
.cps-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--ink-3);
  font-size: 0.9375rem;
  line-height: 1.9;
}
.cps-list .mono { color: var(--accent); }

/* --- 小屏：选项铺满一行，记录改成两列 --- */
/* 断点用 680px，和站点自己那个移动端断点保持一致（不然 700px 左右会出现"两套都不生效"的缝） */
@media (max-width: 680px) {
  .cps-controls { gap: 14px 20px; }

  /* 这一段是修横向溢出的关键：
     flex 子项默认 min-width:auto —— 分段选择器里四个按钮不肯缩，
     就把整个页面撑得比屏幕还宽（实测 2026-09-27）。
     加上 min-width:0 之后按钮才肯等比收缩。 */
  .cps-group { width: 100%; min-width: 0; flex-wrap: wrap; }
  .cps-seg { flex: 1 1 auto; min-width: 0; }
  .cps-seg button { flex: 1 1 0; min-width: 0; padding: 10px 4px; font-size: 0.8125rem; }

  .cps-stage { min-height: 200px; }
  .cps-big { font-size: 3rem; }

  .cps-stats { gap: 8px; }
  .cps-stat { padding: 14px 6px; }
  .cps-stat b { font-size: 1.375rem; }
  .cps-stat span { font-size: 0.75rem; }

  .cps-row { grid-template-columns: 1fr auto; row-gap: 4px; }
  .cps-row-time { grid-column: 1; grid-row: 1; }
  .cps-row-num { grid-column: 2; grid-row: 1; text-align: right; }
  .cps-row-mode { grid-column: 1; grid-row: 2; }
  .cps-row-sub { grid-column: 2; grid-row: 2; }
}

