/* ============================================
   5000言 v2 主题样式
   设计法则：零下划线、零边框、纯背景色分层
   药丸交互 · 背景色分层卡片 · 日夜双模式
   ============================================ */

/* ===== 1. 全局变量 - 深色主题（默认） ===== */
:root {
  /* 页面底色层级 — 夜读暖棕（与浅色米黄纸张同色温） */
  --bg-primary: #171410;
  --bg-secondary: #201c17;
  --bg-tertiary: #2b261f;
  --bg-surface: #1c1814;

  /* 卡片 — 加深与 surface/primary 的区分度 */
  --bg-card: #252018;
  --bg-card-hover: #2a251d;

  /* 交互态 */
  --bg-hover: rgba(232, 228, 220, 0.06);
  --bg-active: rgba(61, 165, 94, 0.14);

  /* 文字 — 暖灰白，柔和防眩光 */
  --text-primary: #e8e4dc;
  --text-secondary: #c6c1b5;
  --text-muted: #928c7e;
  --text-dim: #807a6d;

  /* 历史兼容变量（老站模板引用：田字格/搜索框/工具页） */
  --text-heading: #e8e4dc;
  --border: rgba(232, 228, 220, 0.10);
  --border-light: rgba(232, 228, 220, 0.05);
  --border-subtle: rgba(232, 228, 220, 0.08);

  /* 历史命名别名：部分模板/JS 误写 --card-bg，统一指向 --bg-card */
  --card-bg: var(--bg-card);
  --bg-secondary-hover: rgba(232, 228, 220, 0.06);

  /* 强调色（深森林绿系 — 暗色模式下需稍亮以保证可读性） */
  --accent: #3da55e;
  --accent-hover: #4fb572;
  --accent-rgb: 61, 165, 94;
  --accent-bg: rgba(61, 165, 94, 0.14);
  --accent-bg-hover: rgba(61, 165, 94, 0.22);

  /* 成功/点赞高亮色 */
  --success: #3da55e;
  --success-rgb: 61, 165, 94;

  /* 危险色 */
  --danger: #ef4444;
  --danger-hover: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.12);

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.4);

  /* 圆角 */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 36px;
  --space-2xl: 48px;

  /* 特殊区域 */
  --header-bg: rgba(23, 20, 16, 0.85);
  --header-blur: 12px;
  --footer-bg: #0e0c08;

  /* 表单 */
  --input-bg: #100e0b;
  --input-focus-bg: #131110;

  /* 顶部导航专用变量 */
  --topbar-bg: rgba(23, 20, 16, 0.85);
  --topbar-tab-bg: rgba(255, 255, 255, 0.04);
  --topbar-dropdown-bg: #1c1813;
  --topbar-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);

  /* 过渡 */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* 字体（英文优先 + 中文兜底：英文落西方字体更专业，中文正确回退到中文字体） */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;

  /* 阅读字体（正文默认衬线，用户可在阅读设置切换） */
  --font-read: "Songti SC", "SimSun", "宋体", "Noto Serif CJK SC", "Source Han Serif CN", serif;

  /* 阅读设置变量（JS 驱动）：新增正文区块只要用 var() 引用即自动跟随，无需改 JS */
  /* 默认值必须与 reading-settings.js 的 DEFAULTS 一致：「重置为默认」会 removeProperty 回落到这里，
     两侧不同步会出现面板显示 18px、正文实际 16px 的错位 */
  /* --read-bg 不预定义：保持未定义态，body/卡片等通过 var(--read-bg, 默认背景) 回退；JS 设置亮度时覆盖 */
  --read-font-size: 18px;
  --read-line-height: 1.9;
  --read-para-margin: 1.25em;

  /* 加载骨架 */
  --shimmer: linear-gradient(105deg, var(--bg-secondary) 0%, #241f19 45%, var(--bg-secondary) 90%);
}

/* ===== 浅色主题 ===== */
html.light {
  /* 页面底色 — 暖白纸色，平滑递进 */
  --bg-primary: #f5f2ed;
  --bg-secondary: #eeebe4;
  --bg-tertiary: #e5e0d8;
  --bg-surface: #f1ede7;

  /* 卡片 — 不透明纯色，避免毛玻璃透出底下内容 */
  --bg-card: #ffffff;
  --bg-card-hover: #f7f5f0;

  /* 交互态 */
  --bg-hover: rgba(0, 0, 0, 0.05);
  --bg-active: rgba(27, 107, 58, 0.10);

  /* 文字 — 微微柔化，保持可读性 */
  --text-primary: #1e2024;
  --text-secondary: #3d4148;
  --text-muted: #666b73;
  --text-dim: #7d848e;

  /* 历史兼容变量（老站模板引用：田字格/搜索框/工具页） */
  --text-heading: #1e2024;
  --border: rgba(0, 0, 0, 0.10);
  --border-light: rgba(0, 0, 0, 0.05);
  --border-subtle: rgba(0, 0, 0, 0.08);

  /* 历史命名别名：部分模板/JS 误写 --card-bg，统一指向 --bg-card */
  --card-bg: var(--bg-card);
  --bg-secondary-hover: rgba(0, 0, 0, 0.05);

  /* 强调色 — 翠绿系，hover 比常态更亮 */
  --accent: #1b6b3a;
  --accent-hover: #238b4a;
  --accent-rgb: 27, 107, 58;
  --accent-bg: rgba(27, 107, 58, 0.08);
  --accent-bg-hover: rgba(27, 107, 58, 0.15);

  /* 成功/点赞高亮色 */
  --success: #27ae60;
  --success-rgb: 39, 174, 96;

  /* 危险色 — hover 比常态更亮 */
  --danger: #dc2626;
  --danger-hover: #ef4444;
  --danger-bg: rgba(220, 38, 38, 0.08);

  /* 阴影 — 平滑阶梯 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.10);

  /* 特殊区域 */
  --header-bg: rgba(245, 242, 237, 0.92);
  --footer-bg: #e8e0d6;

  /* 表单 */
  --input-bg: #f1ede7;
  --input-focus-bg: #f5f2ed;

  /* 顶栏 */
  --topbar-bg: rgba(245, 242, 237, 0.85);
  --topbar-tab-bg: rgba(0, 0, 0, 0.04);
  --topbar-dropdown-bg: #ffffff;
  --topbar-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);

  /* 加载骨架 */
  --shimmer: linear-gradient(105deg, #e5e0d8 0%, #ede8e0 50%, #e5e0d8 100%);
}

/* ===== 2. 全局基础 ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 日夜主题切换平滑过渡：仅背景/文字/边框色（可合成属性，开销小）；尊重系统减弱动效 */
@media (prefers-reduced-motion: no-preference) {
  *, *::before, *::after {
    transition: background-color 0.28s ease, color 0.28s ease, border-color 0.28s ease;
  }
}
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--read-bg, var(--bg-primary));
  color: var(--text-primary);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
}
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
a:hover {
  color: var(--accent-hover);
}

/* 移动端点击反馈统一收口（2026-10-17）：
   -webkit-tap-highlight-color 不继承、只对「可激活元素」自身生效（iOS/WebKit 系）——
   非语义容器（[role]/[tabindex]/[onclick]）必须显式命中，否则 iOS 点击出现灰块；
   user-select:none 消除 iOS 15.4+ 文本选择重绘残影（仅组件级元素，正文链接 a 保持可选中） */
a, button,
input[type="button"], input[type="submit"],
[role="button"], [role="link"], [tabindex="0"], [onclick] {
  -webkit-tap-highlight-color: transparent;
}
button, [role="button"], [role="link"], [tabindex="0"], [onclick] {
  -webkit-user-select: none;
  user-select: none;
}
::selection {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ===== 复选框 & 单选框 全局美化 ===== */
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

/* ===== 文本输入框 & 文本域 全局美化 ===== */
/* 排除顶部导航栏高度自定义的搜索框 */
input:not([type="checkbox"]):not([type="radio"]):not(.topbar-search-input),
textarea, select {
  background: var(--input-bg);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.875rem;
  outline: none;
  transition: background var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus {
  background: var(--input-focus-bg);
}
input::placeholder, textarea::placeholder {
  color: var(--text-dim);
}
button {
  border: none;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: all var(--transition);
}
table {
  border-collapse: collapse;
  width: 100%;
}
th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 16px;
  background: var(--bg-tertiary);
}
td {
  padding: 10px 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== 3. 容器布局 ===== */
.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (max-width: 640px) {
  .container { padding: 0 0.8rem; }
}

/* ===== 4. 顶部导航栏 ===== */
.topbar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.8rem;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.5rem 0;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 72rem; /* 与 .container 内容区严格同宽同缘，logo 与正文左缘对齐 */
}
/* 阅读页（带 300px 右侧边栏）：顶栏对齐“阅读区 + 间距 + 侧边栏”总宽 */
@media (min-width: 768px) {
  .page-chapter .topbar {
    max-width: min(calc(min(100ch, 96rem) + 24px + 300px), 98vw);
    padding: 0.8rem clamp(1.5rem, 3vw, 1.5rem) 0 clamp(2.25rem, 4.5vw, 2.875rem);
  }
}
.topbar-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.topbar-logo:hover { transform: scale(1.04); }
.topbar-logo-text {
  font-family: var(--font);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap; /* 防止移动端窄屏挤压导致“5000言”换行 */
}
/* 数字与汉字视觉重心微调：数字 glyph 顶沿高于汉字，translateY 下移约1px 使两者齐平 */
.topbar-logo-num{display:inline-block;transform:translateY(0.05em);}

/* ===== 4b. 左右分区 ===== */
.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
  min-width: 0;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ===== 4c. 移动端自适应：文字 logo 常显，首页药丸隐藏 ===== */
/* 移动端：隐藏首页导航项（文字 logo 已提供首页入口），文字 logo 直接显示 */
@media (max-width: 640px) {
  .topbar-logo-text { font-size: 1.2rem; }
  .topbar .nav-pill-home { display: none; }
}
/* 药丸宽度的分档收紧统一放在 §22 的媒体查询里（≤640 / ≤430 / ≤360），
   这里不再保留早期「按类名逐级收窄」的写法：pill-compact / pill-super-compact /
   pill-icon-hidden 三个类从 2026-11-06 起全站无任何地方 add（导航改纯文字后
   图标隐藏也失效），留着只会让人以为还有一条可调的旋钮。 */

/* ===== 5. 顶部导航链接 ===== */
.topbar-nav { display: flex; gap: 2px; }

/* ===== 6. 顶部搜索框（桌面端） ===== */
.topbar-search-desktop { display: none; }
@media (min-width: 768px) {
  .topbar-search-desktop {
    display: block;
    /* 768–900 平板区间顶栏横向溢出修复（2026-10-23）：
       左侧 logo + 4 个药丸（≈348px，flex-shrink:0）+ 搜索 320 + 右侧 86 + 两个 gap 32
       = 786 > 720 可用宽 → 页面出现横向滚动条。改为可收缩：空间充足时仍是 320，
       临界区间只让出 72px，最低 200px（再窄输入框本身就不够用了）。 */
    width: 320px;
    flex-shrink: 1;
    min-width: 200px;
  }
  .topbar-search-desktop form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
  }
  .topbar-search-input-wrap {
    position: relative;
    display: inline-flex;
    flex: 1;
    min-width: 0;
    background: var(--topbar-tab-bg);
    border-radius: var(--radius-full);
    padding-left: 36px;
    height: 38px;
    transition: background 0.2s;
  }
  .topbar-search-input-wrap:focus-within {
    background: var(--input-bg);
  }
  .topbar-search-inner-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 0.82rem;
    pointer-events: none;
  }
  .topbar-search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    min-width: 0;
    padding: 0 4px 0 0;
  }
  .topbar-search-input::placeholder {
    color: var(--text-dim);
    font-size: 0.82rem;
  }
  .topbar-search-clear-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: var(--topbar-tab-bg);
    color: var(--text-muted);
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.6) rotate(-90deg);
    transition: all 0.25s cubic-bezier(0.22,1,0.36,1);
    z-index: 2;
  }
  .topbar-search-clear-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) scale(1) rotate(0deg);
  }
  .topbar-search-clear-btn:hover {
    background: rgba(239,68,68,0.15);
    color: var(--danger);
    transform: translateY(-50%) scale(1.1) rotate(0deg);
  }
  .topbar-search-btn {
    flex-shrink: 0;
    height: 36px;
    padding: 0 18px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
  }
  .topbar-search-btn:hover { filter: brightness(1.1); }
}

/* 移动端搜索图标链接 */
.topbar-search-mobile {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: all 0.2s;
}
.topbar-search-mobile:hover {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ===== 7. 顶部右侧操作区 ===== */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* ===== 8. 主导航（文字优先，无外层托盘/无图标，对齐 hanzi/poet 观感） ===== */
.nav-pills {
  display: flex;
  gap: 4px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  width: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-pills::-webkit-scrollbar { display: none; }
/* 仍有溢出且未滑到最右时（topbar-adapt.js 加 .is-overflow）：
   右缘渐隐，提示还能左滑；滚到最右会撤掉，不会蒙住最后一项。 */
.nav-pills.is-overflow {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.nav-pill {
  padding: 0.5rem 0.625rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}
.nav-pill:hover { color: var(--text-primary); background: var(--topbar-tab-bg); }
.nav-pill.active {
  color: var(--accent);
  background: transparent;
  font-weight: 600;
}
/* 去掉托盘后滚动容器会裁掉外描边，改用内描边保留键盘焦点可见性 */
.nav-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
/* 旧静态缓存 HTML 仍带 <i> 图标，用 CSS 兜底隐藏；新渲染已不再输出图标 */
.nav-pill i { display: none; }

/* 字词通典项英文副标 Zidian（2026-09-18）：默认 hidden，topbar-adapt.js 按浏览器语言显示；
   移动端（≤640px）空间紧张不显示，与首页项隐藏策略一致 */
.nav-pill-en { font-size: 0.75rem; font-weight: 500; opacity: 0.75; }
@media (max-width: 640px) { .nav-pill-en { display: none; } }

/* ===== 9. 主题切换按钮 ===== */
.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--topbar-tab-bg);
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
}
.theme-btn:hover {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ===== 10. 头像下拉菜单 ===== */
.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  position: relative;
  height: 38px;
}
/* 头像区点击（div 容器 + JS 绑定，非语义元素不在上方收口清单内，需显式关闭 tap 高亮） */
.topbar-user,
.topbar-user * {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
.topbar-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28);
}
.topbar-user-placeholder {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--topbar-tab-bg);
  flex-shrink: 0;
}
html.light .topbar-user-placeholder {
  background: var(--topbar-tab-bg);
}
.topbar-user-icon { font-size: 18px; color: var(--text-muted); }
.topbar-user-name { display: none; }
.topbar-avatar-wrap {
  position: relative;
  z-index: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: all 0.2s;
  /* 2026-11-16：元素由 div 改为 a（脚本未就绪时原生跳转兜底），需重置链接默认样式 */
  display: block;
  text-decoration: none;
  color: inherit;
}

/* 桌面端悬停交互（头像背景/下拉桥接区/下拉展开；2026-10-17 收进正向媒体查询，
   触屏点击不再触发悬停样式闪现，与每日一言卡同策略） */
@media (hover: hover) and (pointer: fine) {
  .topbar-avatar-wrap:hover {
    background: var(--accent-bg);
  }
  /* hover 显示下拉桥接区（仅登录态） */
  .topbar-user.logged-in::after {
    content: '';
    position: absolute;
    inset: -8px -12px -60px;
    pointer-events: auto;
  }
  .topbar-user.logged-in:hover .topbar-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
    visibility: visible;
  }
}

/* 下拉菜单（2026-10-03 改右对齐：原 left:50%+translateX(-50%) 居中展开，头像贴近视口右缘时
   163px 宽下拉右缘超出视口约 39px，撑出全站横向滚动条且窄屏 hover 时菜单被裁） */
.topbar-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--topbar-dropdown-bg);
  border-radius: 18px;
  padding: 6px;
  min-width: 170px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px) scale(0.96);
  transform-origin: top right;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  transition-delay: 0.2s;
  visibility: hidden;
  box-shadow: var(--topbar-shadow);
  z-index: 100;
}
.topbar-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 10px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  border-radius: var(--radius-full);
  transition: all 0.2s;
}
.topbar-dropdown-item:hover {
  background: var(--accent-bg);
  color: var(--accent);
}
.topbar-dropdown-divider {
  height: 3px;
  background: rgba(255,255,255,0.05);
  margin: 4px 8px;
  border-radius: 2px;
}
html.light .topbar-dropdown-divider {
  background: rgba(0,0,0,0.04);
}
.topbar-dropdown-username {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 8px 12px 4px;
}

/* ===== 11. 搜索历史下拉面板 ===== */
.search-history-panel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9998;
  min-width: 300px;
  max-width: 420px;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.search-history-panel.show {
  pointer-events: auto;
  opacity: 1;
  transform: scale(1);
}
.search-history-inner {
  background: var(--topbar-dropdown-bg);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--topbar-shadow);
}
.search-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}
.search-history-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
  opacity: 0.6;
  font-weight: 400;
}
.search-history-clear:hover {
  color: var(--danger);
  background: rgba(239,68,68,0.1);
  opacity: 1;
}
.search-history-list {
  padding: 2px 2px 6px;
}
/* 最近搜索词条容器：JS 将词条包在 .search-history-tags 内，flex+gap 必须定义在这里 */
.search-history-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}
.search-history-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid transparent;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.25s ease;
}
.search-history-tag:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.search-history-tag-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-history-tag-del {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0.65rem;
  padding: 2px 4px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.search-history-tag:hover .search-history-tag-del { opacity: 0.8; }
.search-history-tag-del:hover { opacity: 1; }
.search-history-empty {
  color: var(--text-muted);
  cursor: default;
  font-size: 0.78rem;
  width: 100%;
  text-align: center;
  padding: 10px 8px;
}
.search-history-hot {
  border-top: 1px solid var(--border-subtle, rgba(128,128,128,0.15));
  margin-top: 10px;
  padding: 10px 2px 0;
}
html.light .search-history-hot {
  border-top-color: var(--border-subtle, rgba(216,211,202,0.4));
}
.search-history-hot-header {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0 6px 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.search-history-hot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 2px 2px;
}
.search-history-hot-tag {
  background: rgba(var(--accent-rgb), 0.08);
  border-radius: var(--radius-full);
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 6px 14px;
  text-decoration: none;
  transition: all 0.25s ease;
  border: 1px solid transparent;
}
.search-history-hot-tag:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
@media (max-width: 767px) {
  .search-history-panel {
    left: 50% !important;
    transform: translateX(-50%) scale(0.95) !important;
    width: calc(100vw - 32px) !important;
    max-width: 420px;
  }
  .search-history-panel.show {
    transform: translateX(-50%) scale(1) !important;
  }
  /* 移动端无悬停：隐藏单条删除按钮，只保留“清空” */
  .search-history-tag-del { display: none; }
}

/* ===== 12. 卡片（从用户中心复用） ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.8rem 2rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}
html.light .card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}
.card-hd {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-hd i { color: var(--accent); font-size: 0.9rem; }

@media (max-width: 640px) {
  .card {
    padding: 1.3rem 1rem;
    border-radius: var(--radius-lg);
  }
  .card:hover { transform: none; }
}

/* ===== 13. 表单（从用户中心复用） ===== */
.field { margin-bottom: 1.2rem; }
.field-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.field-row .label {
  min-width: 80px;
  text-align: right;
  margin-bottom: 0;
  flex-shrink: 0;
}
.field-row .input { flex: 1; }
.label {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 600;
  padding-left: 2px;
}
.input {
  width: 100%;
  padding: 0.72rem 1.2rem;
  border-radius: var(--radius-full);
  border: none;
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.92rem;
  outline: none;
  transition: background 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}
.input:hover { background: var(--input-focus-bg); }
.input:focus {
  background: var(--input-focus-bg);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}
.input::placeholder { color: var(--text-dim); }
.input:disabled {
  opacity: 0.5;
  background: var(--bg-hover);
  cursor: not-allowed;
}
.row { display: flex; gap: 0.6rem; }
.row .input { flex: 1; }

@media (max-width: 640px) {
  .field-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .field-row .label { text-align: left; min-width: auto; }
}

/* ===== 14. 按钮（从用户中心复用） ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.btn--pri {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.25);
}
.btn--pri:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.35);
}
.btn--pri:active { transform: scale(0.96); }
.btn--ghost {
  background: var(--topbar-tab-bg);
  color: var(--text-muted);
}
.btn--ghost:hover {
  background: var(--accent-bg);
  color: var(--accent);
}
.btn--danger {
  background: rgba(239,68,68,0.1);
  color: var(--danger-hover);
}
.btn--danger:hover {
  background: rgba(239,68,68,0.18);
  color: #fca5a5;
}
.btn--sm {
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
}

/* ===== 15. 列表项（从用户中心复用） ===== */
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
  border-radius: 14px;
  transition: background 0.2s;
}
.item + .item { margin-top: 2px; }
.item:hover { background: var(--bg-hover); }
.item-title {
  color: var(--text-primary);
  text-decoration: none;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}
.item-title:hover { color: var(--accent); }
.item-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-left: 0.6rem;
  white-space: nowrap;
}

/* ===== 16. 消息提示（从用户中心复用） ===== */
.msg {
  padding: 0.75rem 1.3rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}
.msg--err {
  background: var(--danger-bg);
  color: var(--danger);
}
.msg--ok {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ===== 17. 空状态（从用户中心复用） ===== */
.empty {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-dim);
}
.empty i {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
  display: block;
  opacity: 0.35;
}

/* ===== 18. 头像上传（从用户中心复用） ===== */
.avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}
.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s;
  color: #fff;
  font-size: 1.3rem;
  opacity: 0;
}
.avatar-wrap:hover .avatar-overlay {
  background: rgba(0, 0, 0, 0.4);
  opacity: 1;
}

/* ===== 19. 预设头像网格 ===== */
.preset-avatar-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
.preset-avatar-item {
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden;
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
}
.preset-avatar-item:hover {
  border-color: var(--accent);
  transform: scale(1.1);
}
.preset-avatar-item.active { border-color: var(--accent); }
.preset-avatar-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 480px) {
  .preset-avatar-grid { grid-template-columns: repeat(4, 1fr); gap: 3px; }
  .preset-avatar-item { width: 30px; height: 30px; }
}

/* ===== 20. 密码可见切换 ===== */
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 2.8rem; }
.pwd-toggle {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.pwd-toggle:hover {
  color: var(--text-secondary);
  background: var(--bg-hover);
}

/* ===== 21. 底部 ===== */
.footer-bar {
  text-align: center;
  padding: 3rem 0 2.5rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  opacity: 0.35;
}

/* ===== 22. 响应式辅助 ===== */
@media (max-width: 640px) {
  .topbar-wrap { margin-bottom: 0.4rem; }
  .topbar {
    flex-wrap: nowrap;
    /* 与 .container 的 0.8rem 左右留白一致，logo/右侧图标与正文边缘对齐 */
    padding: 0.5rem 0.8rem;
    gap: 0.25rem;
  }
  .topbar-logo { flex-shrink: 1; min-width: 0; }
  .topbar-logo-text { font-size: 1.12rem; }
  /* 移动端点击头像跳转用户中心，不显示下拉 */
  .topbar-user::after { display: none; }
  .topbar-user .topbar-dropdown { display: none !important; }
  /* 导航区：占满左区剩余空间，允许横向滚动兜底（绝不裁切/压扁）；381-640 档用 4px 间距 */
  .nav-pills {
    flex: 1;
    min-width: 0;
    gap: 4px;
    padding: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
  }
  /* 381-640px 档：与内容区同留白后仍有约 20px 余量，字号提到 14.4px、间距 4px；
     垂直 padding 微收以保持顶栏高度不变；≤380px 档另有独立紧凑规则 */
  .nav-pill { padding: 0.35rem 0.6rem; font-size: 0.9rem; flex-shrink: 0; }
  /* 左侧：logo + 导航紧凑靠拢，充分利用宽度 */
  .topbar-left { gap: 0.35rem; min-width: 0; flex: 1; flex-shrink: 1; }
  /* 右侧操作区统一：搜索/日夜/头像同尺寸（28px）、紧凑间距（6px）、去圆底外圈（纯图标风格） */
  .topbar-right { flex-shrink: 0; gap: 6px; }
  .topbar-search-mobile,
  .theme-btn {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    background: transparent;
  }
  .topbar-user { height: 28px; }
  .topbar-user-avatar,
  .topbar-user-placeholder { width: 28px; height: 28px; }
  .topbar-user-placeholder { background: transparent; }
  html.light .topbar-user-placeholder { background: transparent; }
  .topbar-user-icon { font-size: 13px; }
}

/* 小而常见的手机（≤430px：iPhone 12/13/14 的 390、Plus 的 414/428）：
   实测 381-430 这段若用宽松档，导航会溢出（390 超出 34px、414 超出 10px，
   最后一项被整个切掉），而 375 落在这档反而刚好——宽度更大却更紧，观感很怪。
   这里把紧凑参数扩到 430，让主流小屏一致。 */
@media (max-width: 430px) {
  .topbar { padding: 0.5rem 0.8rem; gap: 0.2rem; }
  .topbar-left { gap: 0.25rem; }
  .topbar-logo-text { font-size: 1.04rem; }
  .nav-pills { gap: 2px; padding: 0; }
  .nav-pill { padding: 0.32rem 0.36rem; font-size: 0.86rem; }
  /* 右侧同步收紧：按钮 24px、间距 4px，避免挤压导航 */
  .topbar-right { gap: 4px; }
  .topbar-search-mobile,
  .theme-btn { width: 24px; height: 24px; font-size: 0.75rem; }
  .topbar-user,
  .topbar-user-avatar,
  .topbar-user-placeholder { width: 24px; height: 24px; }
  .topbar-user-icon { font-size: 12px; }
}

/* 超窄屏（≤360px，老旧小屏机）：在紧凑档上再收一档，
   保证导航 4 项（工具/字词通典/讨论/书评）在 320px 也能完整放下 */
@media (max-width: 360px) {
  .topbar { padding: 0.5rem 0.6rem; gap: 0.15rem; }
  .topbar-left { gap: 0.2rem; }
  .topbar-logo-text { font-size: 1rem; }
  .nav-pills { gap: 1px; padding: 0; }
  .nav-pill { padding: 0.3rem 0.26rem; font-size: 0.82rem; }
  .topbar-right { gap: 3px; }
  .topbar-search-mobile,
  .theme-btn { width: 22px; height: 22px; font-size: 0.7rem; }
  .topbar-user,
  .topbar-user-avatar,
  .topbar-user-placeholder { width: 22px; height: 22px; }
  .topbar-user-icon { font-size: 11px; }
}

/* 搜索入口互斥铁律：<768px 桌面搜索框隐藏，必定显示移动搜索图标 */
/* 修复 641-767px 空隙：此前两个断点不一致导致该区间桌面搜索框和移动图标同时隐藏，搜索不可用 */
@media (max-width: 767px) {
  .topbar-search-mobile { display: flex; }
}

/* ===== 24. 分类区块 - 书签卡片风格 ===== */
.categories-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.category-block {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}
/* 扁平容器：卡片列表直接铺在页面背景上，避免同色卡片套同色卡片 */
.category-block--flat {
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.category-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.category-block-title {
  margin: 0 0 0.6rem 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

/* 标题后紧跟列表时加大间距 */
.category-block-title + .category-list,
.category-block-title + .category-list-grid,
.category-block-title + .category-list-stack {
  margin-top: 0.8rem;
}

/* 列表结束后下一个标题 —— 加大段间间距，避免视觉拥挤 */
.category-list + .category-block-title,
.category-list-grid + .category-block-title,
.category-list-stack + .category-block-title {
  margin-top: 1.6rem;
}

.category-block-more {
  font-size: 0.78rem;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}
.category-block-more:hover {
  background: var(--accent-bg);
  color: var(--accent-hover);
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-item {
  margin: 0;
  padding: 0;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  transition: background var(--transition), transform var(--transition);
}
.category-item:hover {
  background: var(--bg-hover);
  transform: translateX(3px);
}

.category-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(43, 38, 31, 0.55);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.25s ease;
}
html.light .category-link {
  background: var(--bg-surface);
}
.category-link:hover {
  background: var(--accent-bg);
  color: var(--accent-hover);
  transform: translateY(-2px) scale(1.02);
}

@media (max-width: 640px) {
  .category-block {
    padding: 14px 16px;
    border-radius: var(--radius);
  }
  .category-block-header {
    margin-bottom: 0.6rem;
  }
  .category-block-title {
    font-size: 0.9rem;
  }
  .category-link {
    padding: 6px 12px;
    font-size: 0.84rem;
    border-radius: 8px;
  }
  .category-list {
    gap: 6px;
  }
}

/* ===== 24b. 首页板块网格化（仅 .page-home 生效：移动端等分铺满，消除行尾空白） ===== */
/* 板块标题图标（桌面+移动通用，弱化点缀不抢文字） */
.page-home .category-block-title i,
.page-home .section-header i {
  color: var(--accent);
  font-size: 0.85em;
  margin-right: 0.45rem;
  opacity: 0.92;
}
/* 每日一言为无标题深色卡（刻意与其他白卡板块区分，不加标题不加间距规则） */

/* 首页板块容器对齐栏目页 .book-section：统一留白与阴影层级，消除两套卡片观感差异（2026-10-20） */
.page-home .category-block {
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  /* 首页板块手机端留白与 book-section 一致（上方通用 .category-block 规则优先级较低，需显式声明） */
  .page-home .category-block {
    padding: 14px 16px;
  }
  /* 书单板块：两列等宽；分类板块：三列等宽（首页名称以 2-6 字为主） */
  .page-home .category-list-2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .page-home .category-list-3col {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .page-home .category-item {
    overflow: visible;
  }
  .page-home .category-item:hover {
    transform: none;
  }
  /* 入口块：整格铺满 + 居中文字，触达面积大于胶囊；超长名以省略号兜底 */
  .page-home .category-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    padding: 8px 6px;
    font-size: 0.85rem;
    border-radius: 10px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .page-home .category-link:hover {
    transform: none;
  }

  /* 随机推荐：双列紧凑卡片（10 条竖排大卡占屏过多） */
  .page-home .random-reads-section .article-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .page-home .random-reads-section .article-link {
    padding: 10px 12px;
  }
  .page-home .random-reads-section .article-title {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
  }
  .page-home .random-reads-section .article-meta {
    font-size: 0.7rem;
  }
  /* 有图卡：移动端双列内改竖排（图置顶通栏） */
  .page-home .random-reads-section .article-item.has-image .article-link {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0;
  }
  .page-home .random-reads-section .article-item.has-image .article-thumbnail {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius) var(--radius) 0 0;
  }
  .page-home .random-reads-section .article-item.has-image .article-content {
    padding: 10px 12px;
  }
}

/* ===== 25. 头部横幅（head.htm 复用） ===== */
.headimg {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: var(--radius-xl);
  margin-bottom: 0.9rem;
}
.headimg h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}
.headimg-desc {
  margin-top: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== 26. 每日一言卡片（2026-10-16 整体换血：名句线数据源，点卡直跳详情） ===== */
.wisdom-section {
  margin-bottom: 1rem;
}
.wisdom-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
/* 卡片整体点击收口（2026-10-17 补）：tap 高亮不继承、iOS 命中「手指下最具体的文本/元素节点」，
   卡片 div 本体虽命中全局清单，点正文文字时子元素仍会画灰块 → 与头像区 .topbar-user * 同模式显式覆盖全部后代；
   touch-action:manipulation 与 a/button 对齐，消除触屏点击的默认反馈路径 */
.wisdom-card,
.wisdom-card * {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
.wisdom-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.wisdom-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.wisdom-quote-cn {
  color: var(--text-primary);
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "Songti SC", "SimSun", serif;
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.85;
  letter-spacing: 0.02em;
  text-wrap: pretty;
  transition: opacity 0.22s ease;
}
/* 悬停浮现的「读全诗/读全词/读原文」提示（语义按来源类型区分，文本由 JS 写入；悬停规则见节末 hover 块） */
.wisdom-hint {
  font-size: 0.8rem;
  color: var(--accent);
  margin-left: 0.4em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.wisdom-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0.9rem;
  width: 100%;
}
.wisdom-source-line {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.22s ease;
}
/* 换一句：名句与出处同步淡出淡入 */
.wisdom-card.wisdom-fading .wisdom-quote-cn,
.wisdom-card.wisdom-fading .wisdom-source-line {
  opacity: 0;
}
.wisdom-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.wisdom-more-link {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-decoration: none;
  white-space: nowrap;
  margin-right: 6px;
  transition: color 0.2s ease;
}
.wisdom-btn {
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
/* 「换一句」图标旋转一下 */
.wisdom-btn.refreshing .fa-sync-alt {
  animation: wisdom-spin 0.45s ease;
}
@keyframes wisdom-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 悬停交互统一启用条件：仅「悬停能力 + 精确指针」设备（2026-10-17）
   触屏点击时浏览器会对 :hover 做瞬时应用（iOS 浮起-回弹抖动、Android 粘滞高亮），
   造成卡片闪动 / 「读原文」提示闪现 / 按钮高亮滞留 → 全部 hover 规则由正向媒体查询包裹。
   加 (pointer: fine) 再排除异常报告 hover:hover 但实为触摸主的设备（真实鼠标/触屏笔记本不受影响） */
@media (hover: hover) and (pointer: fine) {
  .wisdom-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
  }
  .wisdom-card:hover .wisdom-hint {
    opacity: 1;
  }
  .wisdom-more-link:hover {
    color: var(--accent);
  }
  .wisdom-btn:hover {
    background: var(--accent-bg);
    color: var(--accent);
  }
}

/* ===== 27. 随机推荐文章 ===== */
.random-reads-section {
  margin-bottom: 1.5rem;
}
.random-reads-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}
.random-reads-section .icon-btn {
  background: none;
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}
.random-reads-section .icon-btn:hover {
  background: var(--accent-bg);
  color: var(--accent);
  transform: rotate(180deg);
}
.random-reads-section .article-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.random-reads-section .article-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.25s ease;
}
.random-reads-section .article-item:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.random-reads-section .article-link {
  color: inherit;
  display: block;
  padding: 14px 18px;
  text-decoration: none;
}
.random-reads-section .article-item.has-image .article-link {
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 12px 16px;
}
.random-reads-section .article-item.has-image { padding: 0; }
.random-reads-section .article-title {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
.random-reads-section .article-meta {
  color: var(--text-muted);
  font-size: 0.78rem;
  display: block;
  margin-top: 4px;
}
.random-reads-section .article-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.random-reads-section .article-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-tertiary);
}
.random-reads-section .article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-thumbnail img.lazy-img:not(.lazy-img--loaded) {
  animation: wu-shimmer 1.1s ease-in-out infinite;
  background-image: var(--shimmer);
  background-size: 200% 100%;
  border-radius: 6px;
}
.article-thumbnail img.lazy-img.lazy-img--loaded {
  animation: none;
  background-image: none;
  border-radius: 6px;
}

/* 通用懒加载骨架 — 确保所有 lazy-img 都有脉冲占位 */
img.lazy-img:not(.lazy-img--loaded) {
  animation: wu-shimmer 1.1s ease-in-out infinite;
  background-image: var(--shimmer);
  background-size: 200% 100%;
  min-height: 60px;
  width: 100%;
}
img.lazy-img.lazy-img--loaded {
  animation: none;
  background-image: none;
  min-height: 0;
}

/* ===== 28. 底部 ===== */
.footer {
  background: var(--footer-bg);
  margin-top: 2.5rem;
  padding: 2.5rem 0 1.5rem;
}
.footer-content {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
}
.footer-brand h3 {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 700;
}
.footer-brand p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 380px;
  margin: 0;
}
.footer-proofread {
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 1.5rem;
  padding-top: 1rem;
}
.footer-proofread p {
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.7;
  max-width: 100%;
  margin: 0;
}
html.light .footer-proofread {
  border-top-color: rgba(0,0,0,0.06);
}
.footer-nav {
  display: flex;
  gap: 2.5rem;
}
.footer-nav-section h4 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.footer-nav-link {
  color: var(--text-dim);
  font-size: 0.85rem;
  text-decoration: none;
  line-height: 2;
  transition: color 0.2s;
}
.footer-nav-link:hover {
  color: var(--accent);
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 1.5rem;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  font-size: 0.8rem;
}
.footer-bottom, .footer-bottom a {
  color: var(--text-dim);
}
html.light .footer-bottom {
  border-top-color: rgba(0,0,0,0.06);
}
.footer-online {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--text-dim);
}
.footer-online span {
  font-weight: 600;
  color: var(--accent);
}

@media (max-width: 640px) {
  .wisdom-card {
    padding: 16px 16px 13px;
    border-radius: var(--radius);
  }
  .wisdom-quote-cn {
    font-size: 1rem;
    line-height: 1.8;
  }
  .wisdom-footer {
    margin-top: 0.75rem;
    gap: 8px;
  }
  .wisdom-source-line {
    font-size: 0.72rem;
  }
  .wisdom-more-link {
    font-size: 0.7rem;
    margin-right: 2px;
  }
  .wisdom-btn {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
  .random-reads-section .article-link {
    padding: 12px 14px;
  }
  .random-reads-section .article-title {
    font-size: 0.88rem;
  }
  .footer {
    padding: 1.5rem 0 1rem;
    margin-top: 1.5rem;
  }
  .footer-content {
    flex-direction: column;
    gap: 1.2rem;
  }
  .footer-nav {
    gap: 1.5rem;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    text-align: left;
  }
  .footer-online {
    margin-top: 0;
  }
}

/* ===== 29. 通用辅助样式 ===== */
.mobile-only { display: none; }
@media (max-width: 640px) {
  .mobile-only { display: block; }
}

/* 搜索框清除按钮 */
.search-clear-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: var(--topbar-tab-bg);
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}
.search-clear-btn.visible {
  opacity: 1;
  pointer-events: auto;
}
.search-clear-btn:hover {
  background: var(--danger-bg);
  color: var(--danger);
}
.search-clear-btn--mobile {
  opacity: 1;
  pointer-events: auto;
}

/* 分页 */
.la-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 1.5rem;
}
.la-pagination a, .la-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  min-width: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.la-pagination a:hover {
  background: var(--accent);
  color: #fff;
}
.la-pagination .thisclass {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ===== 下拉加载更多（移动端） ===== */
.lmore-sentinel {
  text-align: center;
  padding: 1rem 0;
  clear: both;
}
.lmore-loading {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.lmore-loading i {
  font-size: 0.75rem;
}
.lmore-complete {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 0.5rem 0;
}
.lmore-complete .lmore-text {
  display: inline;
}
.lmore-error {
  color: var(--danger);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.lmore-error .lmore-retry {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 4px;
  transition: background 0.2s;
}
.lmore-error .lmore-retry:hover {
  background: rgba(var(--accent-rgb), 0.1);
}

/* 评论分页（interaction.js） */
.comment-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 1rem 0 0.5rem;
  flex-wrap: wrap;
}
.comment-pagination .page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-decoration: none;
  transition: all 0.2s;
}
.comment-pagination .page-btn:hover {
  background: var(--accent);
  color: #fff;
}
.comment-pagination .page-btn--loadmore {
  border: 1px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0 18px;
  height: 38px;
  border-radius: 50px;
  gap: 4px;
}
.comment-pagination .page-btn--loadmore:hover {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.05);
  color: var(--accent);
}
.comment-pagination .current-page.page-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
}
.comment-pagination .page-info {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin: 0 2px;
}
.comment-pagination .page-ellipsis {
  color: var(--text-muted);
  padding: 0 4px;
  font-size: 0.82rem;
  letter-spacing: 1px;
}

/* 移动端隐藏桌面分页 */
@media (max-width: 767px) {
  .pc-pagination {
    display: none !important;
  }
}

/* ===== 30. 搜索页面（search.htm） ===== */

/* 栏目匹配卡片系统 */
.search-cards-wrapper { margin-bottom: 1.5rem; }
.search-tier { margin-bottom: 1rem; }
.search-tier:last-child { margin-bottom: 0; }
.search-tier-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.search-tier-books .search-tier-label { color: var(--accent); }
.search-tier-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.search-tier-grid-books { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.search-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 18px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: all 0.25s ease;
}
.search-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.search-card-book {
  background: var(--bg-card);
  padding: 14px 16px;
}
.search-card-book:hover {
  background: var(--bg-card-hover);
}
.search-card-name {
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.2s;
}
.search-card-book .search-card-name { font-size: 0.95rem; }
.search-card:hover .search-card-name { color: var(--accent); }
.search-card-desc {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.search-card-link-hint {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 2px;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s, transform 0.2s;
}
.search-card:hover .search-card-link-hint { opacity: 1; transform: translateX(0); }

/* 板块直达（2026-09-04 改版：行式条目卡替代原网格小卡——类别色标 + 主副信息单行 + 常显操作；
   区块带标题行与栏目组同款，与上方栏目网格卡形态区隔） */
.board-direct { margin-bottom: 1.5rem; }
.board-direct-list { display: flex; flex-direction: column; gap: 8px; }
.board-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}
.board-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.board-card-badge {
  flex-shrink: 0;
  min-width: 36px;
  text-align: center;
  padding: 3px 0;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.badge-poet { color: #818cf8; background: rgba(129, 140, 248, 0.14); }   /* 诗人：靛 */
.badge-shici { color: #f59e0b; background: rgba(245, 158, 11, 0.15); }   /* 诗词：琥珀 */
.badge-hanzi { color: #10b981; background: rgba(16, 185, 129, 0.14); }   /* 汉字：翠 */
.badge-chengyu { color: #a855f7; background: rgba(168, 85, 247, 0.14); } /* 成语：紫 */
.badge-ciyu { color: #0ea5e9; background: rgba(14, 165, 233, 0.14); }    /* 词语：天蓝 */
.badge-shiju { color: #ec4899; background: rgba(236, 72, 153, 0.14); }  /* 诗句：玫红 */
.board-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.board-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}
.board-card:hover .board-card-name { color: var(--accent); }
.board-card-meta {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-card-go {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  opacity: 0.9;
  transition: opacity 0.2s;
}
.board-card:hover .board-card-go { opacity: 1; }
.board-card-go i { font-size: 0.72rem; }

/* 精确匹配顶部栏目卡片 */
.search-exact-match {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.search-exact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), rgba(var(--accent-rgb), 0.02));
}
.search-exact-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
}
.search-exact-body { flex: 1; min-width: 0; }
.search-exact-name {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
}
.search-exact-desc {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.search-exact-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 10px 20px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s;
}
.search-exact-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }

/* 精确匹配栏目的子栏目按钮 */
.search-subcats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
html.light .search-subcats {
  border-top-color: rgba(0,0,0,0.06);
}
.search-subcats-label {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 4px;
}
.search-subcat-btn {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(var(--accent-rgb), 0.06);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}
.search-subcat-btn:hover { background: var(--accent); color: #fff; }

/* 文章搜索结果列表 */
.search-articles-wrap {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
  padding: 6px 0;
}
.search-article-item { background: transparent; }
.search-article-item:nth-child(even) { background: rgba(var(--accent-rgb), 0.03); }
html.dark .search-article-item:nth-child(even) { background: rgba(var(--accent-rgb), 0.05); }
.search-article-link {
  color: inherit;
  display: block;
  padding: 18px 24px;
  text-decoration: none;
  transition: background 0.2s;
}
.search-article-link:hover { background: rgba(var(--accent-rgb), 0.06); }
.search-article-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.search-article-title {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  transition: color 0.2s;
}
.search-article-link:hover .search-article-title { color: var(--accent); }
.search-article-source {
  color: var(--text-muted);
  font-size: 0.75rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.search-article-content {
  display: flex;
  gap: 14px;
}
.search-article-item.has-image .search-article-content {
  align-items: flex-start;
}
.search-article-text {
  flex: 1;
  min-width: 0;
}
.search-article-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* 搜索关键词高亮 */
.search-highlight {
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 500;
}
html.light .search-highlight {
  background: rgba(180, 83, 9, 0.12);
  color: #92400e;
}
.search-snippet-label{
  display: inline-block;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  margin-right: 4px;
  letter-spacing: 0.05em;
}

/* 热门搜索区块 */
.search-hot-section {
  margin-bottom: 1.5rem;
}
.search-hot-section .category-block-header {
  margin-bottom: 1rem;
}
.search-hot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.search-hot-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-hover);
  border-radius: 50px;
  color: var(--text-primary);
  font-size: 0.88rem;
  padding: 8px 18px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.search-hot-tag:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

/* 热门搜索「查看更多」：默认隐藏第33+个词，展开后显示 */
.search-hot-tag-more { display: none; }
.search-hot-section.expanded .search-hot-tag-more { display: inline-flex; }
.search-hot-section.expanded .search-hot-more-btn { display: none; }
.search-hot-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 14px auto 0;
  padding: 7px 18px;
  border: 1px dashed var(--border);
  border-radius: 50px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.search-hot-more-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.06);
}

/* 搜索页移动端适配：热门图书 2 列提高密度、卡片紧凑 */
@media (max-width: 768px) {
  .search-tier-grid-books { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .search-card-book { padding: 10px 12px; }
  .search-card-book .search-card-name { font-size: 0.88rem; }
  .search-card-desc { -webkit-line-clamp: 2; }
  .search-card-link-hint { display: none; }
  .search-hot-tags { gap: 8px; }
  .search-hot-tag { padding: 6px 12px; font-size: 0.8rem; }
  .search-hot-more-btn { margin: 12px auto 0; padding: 6px 14px; font-size: 0.8rem; }
  /* 板块直达行式卡：紧凑 + 右侧只留箭头（窄屏省空间） */
  .board-direct-list { gap: 6px; }
  .board-card { padding: 10px 12px; gap: 10px; }
  .board-card-badge { min-width: 32px; font-size: 0.68rem; }
  .board-card-go-label { display: none; }
}
.search-article-content .article-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-tertiary);
}
.search-article-content .article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 6px;
}

/* ===== 32. 面包屑导航 ===== */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.8rem;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition);
}
.breadcrumb a:hover {
  color: var(--accent-hover);
}

/* ===== 33b. 工具页通用布局（2026-10-23） =====
   适用于 /tools/ 下「内容型」工具（随机诗词、随机学成语、繁简转换、中文转拼音）。
   桌面：正文 + 264px 侧栏（同源工具出口）；窄屏：单列回落，侧栏移到正文下方，
   不隐藏任何出口（移动端用户同样需要工具间跳转）。
   视觉：纯背景色块分层、零边框、无伪封面——与全站基准语言 .category-link 一致。 */
.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.tool-main { min-width: 0; }
.tool-aside { min-width: 0; }
@media (min-width: 1024px) {
  .tool-shell { grid-template-columns: minmax(0, 1fr) 264px; }
  .tool-aside { position: sticky; top: 84px; }
}
.tool-aside-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}
.tool-aside-list { display: grid; gap: 8px; }
.tool-aside-item {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bg-card);
  text-decoration: none;
  transition: background 0.18s ease;
}
.tool-aside-item:hover,
.tool-aside-item:focus-visible { background: var(--accent-bg); }
.tool-aside-name {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}
.tool-aside-desc {
  display: block;
  margin-top: 3px;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.tool-aside-note {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.tool-aside-note a { color: var(--accent); text-decoration: none; }
.tool-aside-note a:hover { text-decoration: underline; }
/* 有侧栏的工具页正文容器：与侧栏同一栅格行，内容不溢出 */
.tool-page-wrap { padding: 22px 0 40px; }
/* 独立 PHP 工具页（public/apps/*）的返回条：由 top.htm 按路径注入，
   与顶部导航同宽同缘；下方工具主体自带上下 margin，故这里不加底部间距 */
.tool-crumb-bar { padding-top: 14px; }
.tool-crumb-bar .breadcrumb { margin-bottom: 0; padding: 0; }
@media (max-width: 600px) {
  .tool-page-wrap { padding: 14px 0 30px; }
  .tool-shell { gap: 16px; }
}

/* ===== 33. 栏目头部卡片 ===== */
.category-header {
  /* position:relative 保留：头卡内仍有绝对定位的子元素（.category-texture、
     校订气泡等）依赖它做包含块，与已下线的竖排题词无关 */
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.8rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
}
.category-info {
  position: relative;
}
/* 层级靠字号建立，不靠颜色：绿色是强调色，h1 用它等于把最重要的
   东西涂成提示色。与 .category-header--reading 同一套语言（2026-10-29） */
.category-title {
  color: var(--text-primary);
  /* 标题统一到宋体（--font-read）：.book-section-title / .chapter-index-title / .book-group-title
     本来就是宋体，而栏目标题和文章标题此前走 body 的苹方，同一页混用两套字体（2026-10-29） */
  font-family: var(--font-read);
  font-size: clamp(1.45rem, 3.4vw, 1.85rem);
  /* 宋体只有 400/700 两档：写 600 会被浏览器匹配到 Bold(700) 变成粗黑块，
     写 500 落到 Regular(400)，取书籍标题的轻姿态 */
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.02em;
  margin: 0 0 0.6rem;
}
.category-description-wrapper {
  /* 2rem（2026-10-30）：与下方 .subcategory-tags 拉开距离。
     旧值 0.8rem 与 tags 的 margin-top 0.8rem 折叠后只剩 12.8px，
     读者把「展开」按钮当成了导航的第一个栏目。 */
  margin-bottom: 2rem;
}
.category-description-wrapper .category-description {
  /* 间距统一交给 wrapper 的 2rem 一处控制。
     书站风格段里的 .category-description 带 margin-bottom:20px !important（全局无前缀），
     不覆盖就会与 2rem 叠加成 52px，按钮离下方导航反而更远。 */
  margin-bottom: 0 !important;
}
.category-description {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 0.8rem;
  position: relative;
}
.category-description img,
.category-description video {
  border-radius: var(--radius);
  height: auto;
  max-width: 100%;
}

/* 内容截断 + 展开按钮：已统一为 [data-collapse] 通用组件（scripts 见 collapse.js，样式见本节 33b）。
   旧的 .category-description.truncate + .category-expand-btn（字符数阈值 + 渐变色带）于 2026-10-30 下线，
   list_article.htm / diy.htm 已一并改为 data-collapse="3"，此处不再保留旧样式。 */

/* daohang 书栏目「开始阅读」CTA（daohang_read_btn 变量输出；未映射栏目无输出） */
.daohang-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  padding: 11px 24px;
  margin: 0.55rem 0 0.3rem;
  text-decoration: none;
  transition: all 0.25s ease;
}
.daohang-read-btn:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-sm);
  color: #fff;
  transform: translateY(-1px);
}
.daohang-read-btn .daohang-read-arrow {
  font-size: 0.8rem;
  transition: transform 0.25s ease;
}
.daohang-read-btn:hover .daohang-read-arrow {
  transform: translateX(3px);
}

/* 子栏目标签（药丸风格） */
.subcategory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}
.subcategory-tag {
  display: inline-block;
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 14px;
  text-decoration: none;
  transition: all 0.25s ease;
}
.subcategory-tag:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

/* ===== 33b. 通用行数折叠（书首页 / 列表页 / 栏目导语描述区，3 行；评论区已改为按段落折叠，见 .collapsible-content） ===== */
/* 判定逻辑见 /static/frontend/js/modules/collapse.js：
   按“渲染行数”而非字数，data-collapse="N" 表示最多显示 N 行；
   未超出 N 行不折叠、不生成按钮（短描述完整展示，不会被误截）。 */
[data-collapse] {
  overflow-wrap: break-word;
  word-break: break-word;
}
[data-collapse].is-collapsed {
  position: relative;
  overflow: hidden;
  transition: max-height 0.3s ease;
  /* 收尾用「文字蒙版」而不是盖一层渐变底色：底色版需要跟容器实际色一致，
     卡片/无卡片导语/深色模式三处只要差一点都不协调（旧版靠 --collapse-fade 打补丁）；
     蒙版直接淡出文字本身，任何底色上都干净，不会出现一道白带。2026-10-30
     淡出区 2.4em → 1.4em（2026-10-30 二改）：2.4em 约等于 1.6 行，第三行只剩上半截，
     视觉上文字比容器边界早了 35px 就“消失”，按钮因此显得离正文很远、离导航很近。 */
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.4em), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 1.4em), transparent);
}
[data-collapse].is-expanded {
  -webkit-mask-image: none;
  mask-image: none;
}
/* 展开/收起：🔴 2026-10-30 从「药丸 + 底色」改为文字链
   旧样式 background:var(--bg-hover) + border-radius:var(--radius-full) + padding:7px 15px
   与同一个 header 里的 .subcategory-tag（药丸 + 同底色 + padding:5px 14px）完全同质，
   两者相距又只有 12.8px → 读者把「展开」当成第 N 个栏目。
   改成绿色文字链后：① 与栏目胶囊形态不同；② 与正文同左边缘，归属描述块；
   ③ 与 /luxian/ 题解的 .expand-btn（同样是 accent 文字 + hover 下划线）语言一致。 */
.collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.6;
  margin-top: 6px;
  padding: 0;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}
/* 箭头向下=可展开，向上=可收起；用旋转而不是换字符，切换时不跳字宽 */
.collapse-toggle::after {
  content: '›';
  display: inline-block;
  font-size: 1.05em;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 0.2s ease;
}
.collapse-toggle[aria-expanded="true"]::after {
  transform: rotate(-90deg);
}
.collapse-toggle:hover {
  background: none;
  color: var(--accent);
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}
@media (max-width: 767px) {
  .collapse-toggle {
    font-size: 0.78rem;
    margin-top: 8px;
  }
}

/* 书首页章节卡片：两列（心经/金刚经首页同款密度） */
.category-card-grid--book {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}
.category-card-grid--book .category-card {
  padding: 16px 20px;
  gap: 7px;
}
.category-card-grid--book .category-card-name {
  font-family: var(--font-read);
  font-size: 1.02rem;
  letter-spacing: 0.03em;
}
.category-card-grid--book .category-card-desc {
  font-size: 0.8rem;
  line-height: 1.7;
  -webkit-line-clamp: 2;
}
@media (max-width: 560px) {
  .category-card-grid--book {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* ===== 33c. 章节索引（全文列出型书首页：每章一块 + 全部篇目） ===== */
/* 适用 typetemp/{id}.htm 中“多章节 arclist”结构（茶经/茶文化/道德经等 A 类模板） */
.chapter-index {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chapter-index-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-sm);
}
.chapter-index-head {
  margin-bottom: 12px;
}
.chapter-index-title {
  font-family: var(--font-read);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
  margin: 0;
}
.chapter-index-title a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-primary);
  transition: color var(--transition);
}
.chapter-index-title a::after {
  content: '›';
  font-family: var(--font);
  font-size: 1.15rem;
  line-height: 1;
  color: var(--text-dim);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--transition), transform var(--transition);
}
.chapter-index-title a:hover {
  color: var(--accent);
}
.chapter-index-title a:hover::after {
  opacity: 1;
  transform: translateX(0);
}
/* 章节题解：通栏完整展示（勿用 ch 限宽 / line-clamp，中文按 ch 计算会提前折行） */
.chapter-index-desc {
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 5px 0 0;
}
.chapter-index-list {
  display: grid;
  /* auto-fit：容器只有 1 条时自动折叠空列、拉满全宽（auto-fill 会留下半宽空白） */
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 6px 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.chapter-index-link {
  display: block;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.87rem;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--transition), color var(--transition);
}
.chapter-index-link:hover {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ===== 33c-1. 章节索引 / 分组书目悬停反馈（PC 精细指针） ===== */
/* 茶经式书首页的“悬停舒适感”覆盖全部 typetemp：
   卡片浮起 + 标题变色；仅标题本身是链接时才显示箭头，纯文本标题不伪装成可点击。
   移动端触摸不启用，避免 hover 粘滞。 */
.chapter-index-section,
.book-section {
  transition: box-shadow var(--transition, 0.2s ease), transform var(--transition, 0.2s ease);
}
.chapter-index-link,
.book-chapters a {
  transition: background var(--transition, 0.2s ease), color var(--transition, 0.2s ease), transform var(--transition, 0.2s ease);
}
.book-section-title a {
  transition: color var(--transition, 0.2s ease);
}
.book-section-title a::after {
  content: '›';
  display: inline-block;
  font-size: 1.15em;
  line-height: 1;
  margin-left: 6px;
  color: var(--text-dim);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--transition, 0.2s ease), transform var(--transition, 0.2s ease);
}
@media (hover: hover) and (pointer: fine) {
  .chapter-index-section:hover,
  .book-section:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(var(--accent-rgb), 0.18);
    transform: translateY(-2px);
  }
  .chapter-index-section:hover .chapter-index-title,
  .book-section:hover .book-section-title {
    color: var(--accent);
  }
  .chapter-index-section:hover .chapter-index-title a,
  .book-section:hover .book-section-title a {
    color: var(--accent);
  }
  .chapter-index-title a:hover::after,
  .book-section-title a:hover::after {
    opacity: 1;
    transform: translateX(0);
  }
  .chapter-index-link:hover,
  .book-chapters a:hover {
    transform: translateX(2px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .chapter-index-section,
  .book-section {
    transition: none;
  }
  .chapter-index-section:hover,
  .book-section:hover {
    transform: none;
  }
}
/* 卷名型索引（后汉书等，模板加 .chapter-index-list--wrap）：条目是短标题，换行显示完整，
   避免「卷二十二 …列传」在窄列里被截成省略号；长摘句型索引（茶经）不加此类，保持单行 */
.chapter-index-list--wrap .chapter-index-link {
  white-space: normal;
  word-break: break-word;
}
@media (max-width: 640px) {
  .chapter-index {
    gap: 10px;
  }
  .chapter-index-section {
    border-radius: var(--radius);
    padding: 14px 15px 16px;
  }
  .chapter-index-head {
    margin-bottom: 10px;
  }
  .chapter-index-title {
    font-size: 1rem;
  }
  .chapter-index-desc {
    font-size: 0.76rem;
  }
  .chapter-index-list {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 5px 8px;
  }
  .chapter-index-link {
    padding: 7px 10px;
    font-size: 0.84rem;
  }
}

/* ===== 33d. 小说章节目录（四大名著式：多列密集索引） ===== */
/* 适用单 arclist 平铺型小说模板（三国/水浒/红楼/西游、公案侠义等） */
.novel-chapter-grid {
  counter-reset: novel-chapter;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.novel-chapter {
  counter-increment: novel-chapter;
  min-width: 0;
  /* flex 壳 + 子项拉伸：长回目（如「消渴小便不利淋病脉证并治第十三」）换行成两行时，
     同行其余卡片不会被落下 23px 只剩单行高，白色块同排等高，不出现底边锯齿 */
  display: flex;
}
.novel-chapter-link {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-read);
  font-size: 0.87rem;
  letter-spacing: 0.02em;
  line-height: 1.55;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.novel-chapter-link::before {
  content: counter(novel-chapter);
  flex: 0 0 2.1em;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 600;
  /* inherit：序号行盒与标题首行同高，标题折行时序号仍与第一行对齐 */
  line-height: inherit;
  color: var(--text-dim);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.novel-chapter-link:hover {
  background: var(--accent-bg);
  color: var(--accent);
  transform: translateY(-1px);
}
.novel-chapter-link:hover::before {
  color: var(--accent);
}
/* 长回目（章回体 18-30 字，如「第一回 宴桃园豪杰三结义 斩黄巾英雄首立功」）：
   4 列时列宽仅 256px，几乎每条回目都要折成两行，折点落在两半句中间，断句碎、心流断。
   改 2 列（minmax 420px：容器 1046px 时恰为 2×520px），每回完整一行；
   平板/手机宽度不足两列时自动退为 1 列。2026-10-28 读者来信修复 */
.novel-chapter-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
}
@media (max-width: 640px) {
  .novel-chapter-grid {
    grid-template-columns: 1fr;
    gap: 5px;
  }
  .novel-chapter-link {
    padding: 8px 10px;
    font-size: 0.84rem;
  }
}

/* ===== 33d-2. 章节详解（章名 + 副题 + 摘要，孝经 / 女孝经） ===== */
.novel-chapter-item {
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  padding: 8px 16px;
  transition: background var(--transition);
}
.novel-chapter-item:hover {
  background: var(--accent-bg);
}
.novel-chapter-detail {
  display: block;
  width: 100%;
  padding: 4px 0;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: normal;
  word-break: break-word;
}
.novel-chapter-name {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.55;
}
.novel-chapter-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.novel-chapter-desc {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.65;
}
.novel-chapter-item:hover .novel-chapter-name {
  color: var(--accent);
}

/* ===== 33d2. 中国朝代顺序表（1225 中国历史时间轴） ===== */
/* 搜索结果里「朝代顺序 / 年表 / 时间表」类查询要的是一张表，该页此前没有 table。
   视觉沿用全站规则：不加边框线，用表头底色 + 斑马纹分层；
   外层包横向滚动容器，保证窄屏下表格可滑动而不撑破布局。 */
.dynasty-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px 22px;
  margin-bottom: 12px;
}
.dynasty-card-title {
  font-family: var(--font-read);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}
.dynasty-card-note {
  margin: 0 0 14px;
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--text-secondary);
}
.dynasty-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.dynasty-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.86rem;
  line-height: 1.7;
}
.dynasty-table th,
.dynasty-table td {
  padding: 9px 12px;
  text-align: left;
  white-space: nowrap;
}
.dynasty-table thead th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
}
.dynasty-table thead th:first-child { border-radius: 8px 0 0 8px; }
.dynasty-table thead th:last-child  { border-radius: 0 8px 8px 0; }
.dynasty-table tbody th {
  font-weight: 600;
  color: var(--text-primary);
}
.dynasty-table tbody td {
  color: var(--text-secondary);
}
.dynasty-table tbody tr:nth-child(odd) {
  background: var(--bg-surface);
}

/* 典籍列（中国历史时间轴）：朝代名旁边直接给出该朝可读的书。
   纯背景色块、零边框，与全站卡片语言一致。 */
.dynasty-books {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.dynasty-books a {
  padding: 1px 8px;
  background: var(--bg-card);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.dynasty-books a:hover {
  background: var(--accent-bg);
  color: var(--accent-hover);
}

/* 合并版：表格同时承载索引与各朝概况（末列多为整段文字）。
   数值列保持 nowrap 便于横向比对，只让「概况」列换行。 */
.dynasty-table--full {
  min-width: 760px;
}
.dynasty-table--full th,
.dynasty-table--full td {
  vertical-align: top;
}
.dynasty-table--full .dynasty-table-desc {
  white-space: normal;
  min-width: 340px;
  line-height: 1.8;
  color: var(--text-secondary);
}
/* 全局 th（style-v2 第 274 行）自带 bg-tertiary 底、uppercase、0.75rem，
   会连行首单元格一起染色 —— 整列变色、又和行斑马纹打架。
   这里去掉底色与小字号，层级只靠字重/颜色表达，底色统一交给整行。 */
.dynasty-table--full tbody th {
  background: transparent;
  font-size: 0.88rem;
  letter-spacing: 0;
  text-transform: none;
}
/* 朝代名是链接：只靠 hover 变色时，用户根本看不出能点（触屏更是零反馈）。
   常驻「链接色 + 尾随箭头」表明可点，hover/focus 再叠底色。
   padding 用负 margin 抵消，不改变列宽与对齐。 */
.dynasty-table--full tbody th a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  margin: -1px -6px;
  border-radius: 6px;
  color: var(--accent);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.dynasty-table--full tbody th a::after {
  content: "›";
  font-size: 1.1em;
  line-height: 1;
  color: var(--accent);
  opacity: 0.7;
  transition: transform var(--transition), opacity var(--transition);
}
.dynasty-table--full tbody th a:hover,
.dynasty-table--full tbody th a:focus-visible {
  background: var(--accent-bg);
  color: var(--accent);
}
.dynasty-table--full tbody th a:hover::after,
.dynasty-table--full tbody th a:focus-visible::after {
  transform: translateX(2px);
  opacity: 1;
}

@media (max-width: 640px) {
  .dynasty-card { padding: 16px 16px 18px; }
  .dynasty-table { font-size: 0.82rem; }
  .dynasty-table th,
  .dynasty-table td { padding: 8px 10px; }
}

/* 窄屏（含平板）：每行竖着展开成一张小卡，避免六列横向拖拽；
   用 data-label 把被隐藏的表头补回字段名。 */
@media (max-width: 760px) {
  .dynasty-table--full { min-width: 0; }
  .dynasty-table--full thead { display: none; }
  .dynasty-table--full,
  .dynasty-table--full tbody,
  .dynasty-table--full tr,
  .dynasty-table--full th,
  .dynasty-table--full td {
    display: block;
    width: auto;
    white-space: normal;
  }
  .dynasty-table--full tr {
    padding: 12px 14px;
    margin-bottom: 8px;
    border-radius: var(--radius);
    background: var(--bg-surface);
  }
  .dynasty-table--full tbody th {
    padding: 0 0 6px;
    font-size: 1rem;
  }
  .dynasty-table--full td {
    padding: 2px 0;
    font-size: 0.84rem;
  }
  .dynasty-table--full td[data-label]::before {
    content: attr(data-label) "：";
    color: var(--text-muted);
  }
  .dynasty-table--full .dynasty-table-desc {
    min-width: 0;
    margin-top: 6px;
    padding-top: 6px;
    line-height: 1.75;
  }
}

/* ===== 33d3. 中国历史大事记时间线（1224 中国大事记） ===== */
/* 原内容是 200 个 <div>+<strong> 流水账（零标题、零列表、200 处 &nbsp; 空行），
   搜索引擎无法切分主题，90 天曝光为 0。现改为「时代 h2 + 事件 ul/li」，
   视觉沿用全站规则：不加边框线，用背景色分层，年份与事件一眼可扫。 */
.timeline-intro {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 18px;
}
.timeline-intro p { margin: 0 0 8px; }
.timeline-intro p:last-child { margin-bottom: 0; }
.timeline-intro a { color: var(--accent); }

.timeline-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.timeline-toc a {
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.84rem;
  text-decoration: none;
  transition: background .18s ease, color .18s ease;
}
.timeline-toc a:hover {
  background: var(--accent-bg);
  color: var(--accent);
}

.timeline-period {
  font-family: var(--font-read);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 26px 0 4px;
  scroll-margin-top: 72px;
}
.timeline-period:first-of-type { margin-top: 0; }
.timeline-range {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.timeline-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius);
  background: var(--bg-surface);
}
.timeline-list li:nth-child(even) { background: transparent; }
/* 时间用强调色、事件用次要正文色：两项不再只靠字重区分 */
.timeline-list strong {
  flex: 0 0 auto;
  min-width: 8em;
  font-weight: 600;
  color: var(--accent);
}
.timeline-list span { color: var(--text-secondary); }

@media (max-width: 640px) {
  .timeline-intro { padding: 14px 16px; }
  .timeline-period { font-size: 1.04rem; }
  .timeline-list li { flex-direction: column; gap: 2px; padding: 10px 13px; }
  .timeline-list strong { min-width: 0; }
}

/* ===== 33e. 分组书目（卷/篇标题 + 题解 + 篇目网格） ===== */
/* 适用“手工分组 / 分节简介 / 子栏目导航 / 章句全文”类模板：
   book-section = 一页书的一个卷（可带题解），book-chapters = 该卷篇目 */
.book-sections {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.book-section {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-sm);
}
.book-section-title {
  font-family: var(--font-read);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.3;
  margin: 0 0 10px;
  color: var(--text-primary);
}
.book-section-title a {
  color: inherit;
}
.book-section-title a:hover {
  color: var(--accent);
}
/* 无子篇目的“单卷”卡片（山海经卷六~卷十八这类：卷本身就是一篇）：
   只有标题，收紧上下留白；整卡可点（a::after 铺满卡片，不新增标签） */
.book-section--leaf {
  position: relative;
  padding: 13px 20px 14px;
  transition: background var(--transition);
}
.book-section--leaf .book-section-title {
  margin-bottom: 0;
}
.book-section--leaf .book-section-title a::after {
  content: '';
  position: absolute;
  inset: 0;
}
.book-section--leaf:hover {
  background: var(--bg-card-hover);
}
.book-section-desc {
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.8;
  margin: 0 0 12px;
}
.book-section-desc p {
  margin: 0 0 0.6em;
}
.book-section-desc p:last-child {
  margin-bottom: 0;
}
.book-chapters {
  display: grid;
  /* auto-fit：单条容器自动拉满（auto-fill 会在右侧留半宽空白，如孙子兵法每篇 1 条）
     列宽下限 180px（2026-10-30）：原 150px 在 1132px 容器里塞 7 列，
     内经等 8-12 字的篇名被挤成一行 + 省略号，内容直接看不到。 */
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
/* 同行卡片等高：篇名折行时不让相邻卡片矮一截 */
.book-chapters li {
  display: flex;
  min-width: 0;
}
.book-chapters a {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.87rem;
  line-height: 1.5;
  text-decoration: none;
  /* 篇名一律允许折行（宁可两行也不丢字）——旧版 PC 端 nowrap+ellipsis 会吞掉后半句 */
  white-space: normal;
  overflow-wrap: break-word;
  transition: background var(--transition), color var(--transition);
}
/* 长章句列表（论语等整章原文作标题）：单列 + 允许换行 */
.book-chapters--text {
  grid-template-columns: 1fr;
}
.book-chapters--text a {
  white-space: normal;
  word-break: break-word;
  line-height: 1.75;
  padding: 10px 14px;
}
.book-chapters a:hover {
  background: var(--accent-bg);
  color: var(--accent);
}
/* 分部大标题（如《本草纲目》部名）：无卡片，居中分隔 */
.book-group-title {
  text-align: center;
  font-family: var(--font-read);
  font-size: 1.06rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin: 14px 0 0;
  padding: 6px 0;
}
.book-group-title a { color: inherit; }
.book-group-title a:hover { color: var(--accent); }
/* 长篇名（书信/带副题的篇目）：单列允许换行，不丢字 */
.book-chapters--wide {
  grid-template-columns: 1fr;
  gap: 4px;
}
.book-chapters--wide a {
  white-space: normal;
  word-break: break-word;
  padding: 7px 12px;
}
/* 整句型索引（三字经等，单条 12-20 字）：多列网格 + 允许换行。
   默认 .book-chapters 的 nowrap/ellipsis 是为 2-6 字的篇名设计的，
   整句标题在 150px 列里会被省略号吞掉半句（2026-10-27 三字经 PC 端反馈） */
.book-chapters--wrap {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.book-chapters--wrap a {
  white-space: normal;
  word-break: break-word;
  line-height: 1.65;
}
/* 手机端改单列：24 字整句在 157px 双列里要折 3 行、断句碎 */
@media (max-width: 640px) {
  .book-chapters--wrap {
    grid-template-columns: 1fr;
  }
}
/* 章句全文（道德经 81 章）：宽屏双栏，正文阅读优先 */
.book-section--scripture .book-section-body {
  column-gap: 30px;
}
@media (min-width: 1000px) {
  .book-section--scripture .book-section-body {
    column-count: 2;
  }
}
.book-section.book-section--scripture .category-item {
  break-inside: avoid;
  overflow: visible;
  border-radius: 0;
  margin: 0 0 12px;
  padding: 0;
  background: transparent;
}
.book-section.book-section--scripture .category-item:hover {
  background: transparent;
  transform: none;
}
.book-section.book-section--scripture .category-link {
  display: block;
  background: transparent;
  padding: 0;
  white-space: normal;
  word-break: break-word;
  color: var(--text-secondary);
  font-size: 0.87rem;
  line-height: 1.85;
}
.book-section.book-section--scripture .category-link:hover {
  background: transparent;
  color: var(--accent);
  transform: none;
}
@media (max-width: 640px) {
  .book-sections {
    gap: 10px;
  }
  .book-section {
    border-radius: var(--radius);
    padding: 14px 15px 16px;
  }
  .book-section-title {
    font-size: 1rem;
  }
  .book-chapters {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 5px;
  }
  .book-chapters a {
    padding: 7px 10px;
    font-size: 0.84rem;
  }
  .book-chapters--wide {
    grid-template-columns: 1fr;
  }
  /* 整章原文型列表（论语/孙子兵法）：手机上必须通栏，否则长文被挤进半宽列、右侧留白 */
  .book-chapters--text {
    grid-template-columns: 1fr;
  }
}

/* ===== 33d-1. 书站目录：块对齐 + 目录卡用底色分层（2026-10-27 起，2026-11-16 定稿） ===== */
/* ① 这里不再给 .book-section 设内边距（2026-11-16 删除死规则）：
   2026-10-27 写过 `.category-header + .toc-compact .book-section { padding: 1.5rem 1.8rem }`，
   想消掉页头与区块 9px 的内容线差——但它从未生效：文末 v3 规范的
   `.book-section { padding: 0 !important }` 优先级更高，实测两端 left 都等于容器内缘。
   现在按「块对齐」：页头文字 / 卷名 / 题解 / 卡片块共用同一条左基准线
   （PC 154 / 移动 12.8），卡片内文字靠卡片自身 padding 内缩（PC +20 / ≤560 +14）。 */
/* ② 目录卡底色 + 边界（2026-11-16 三次修正，最终态）：
   2026-10-27 曾用 --bg-surface，它与 v3 页面底 --bg-primary 只差 4 个色阶，
   触屏（无 hover）上看不见卡片边界；2026-11-16 首修改成 --bg-card 但把阴影也去掉了，
   于是「卷名贴 0、卡片无边界、题解被单独挪到 20px」，读者眼里成了三条错开的线。
   正解是「块对齐」：卷名 / 题解 / 卡片块左边缘同一条线，卡片内文字靠自身内边距内缩。
   因此这里同时给回浅阴影（--shadow-sm，与 .category-card 基准语言一致），
   让「卡片是一块」这件事在无 hover 时也成立；仍不加边框。 */
.book-section:has(> .category-card-grid--book) .category-card-grid--book .category-card {
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.book-section:has(> .category-card-grid--book) .category-card-grid--book .category-card:hover {
  background: var(--accent-bg);
  box-shadow: var(--shadow);
}
/* ③ 修饰类 .category-card-grid--book{margin:0} 写在基础类之前，同特异性被后者覆盖，
   实际网格带 0.8rem/1.2rem 外边距（区块底部留白比顶部多 19px）→ 提高特异性归零。 */
.book-section > .category-card-grid--book {
  margin: 0;
}
/* ④ 区块头成组（2026-11-16 三次修正）：
   卷名（h2 1.3rem 深色）与题解（0.84rem 次级色）是「标题 + 副标题」一对，
   两者间距必须小于「题解 → 卡片列表」的 12px，否则读者会把题解当成列表的一部分。
   只在 shouye.htm / diy.htm 书站首页生效（.category-header 相邻 .toc-compact），
   不波及其它用 .book-section 的列表模板。
   ⚠️ 题解不要再加 padding-left：它属于区块头，与卷名、卡片块同一条左基准线；
      卡片内文字的内缩由卡片自身 padding 承担（PC 20 / ≤560 14）——这是两件事。 */
.category-header + .toc-compact .book-section-title {
  margin-bottom: 6px !important;
}
/* 手机单列：卡片退化为通栏条，收紧内边距与圆角（底色/阴影沿用上方规则） */
@media (max-width: 560px) {
  .book-section:has(> .category-card-grid--book) .category-card-grid--book .category-card {
    padding: 13px 14px;
    gap: 6px;
    border-radius: 10px;
  }
  /* 触屏 hover 粘滞：保持底色，不做位移 */
  .book-section:has(> .category-card-grid--book) .category-card-grid--book .category-card:hover {
    transform: none;
  }
}

/* 子栏目卡片网格（sub_channel_nav 输出） */
.category-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin: 0.8rem 0 1.2rem;
}
.category-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  background: var(--bg-card);
  border-radius: var(--radius);
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}
.category-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.category-card-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
}
.category-card-desc {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ===== 34. 列表项（la-list） ===== */
.la-list-wrap {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 标准列表项 — 卡片风格 */
.la-item {
  display: block;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  contain: layout style;
}
.la-item:last-child {
  margin-bottom: 0;
}
.la-item:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

/* 带缩略图的列表项 */
.la-item.has-image {
  padding: 0;
}
.la-item.has-image .la-item-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
}
.la-item.has-image .la-item-image {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-tertiary);
}
.la-item.has-image .la-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.la-item.has-image .la-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.la-item-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.la-item-sub {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  flex: 0 1 auto;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.la-item-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-top: 0.35rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* ===== 34.1 图书分类页：完整书卡区（book_category_list.htm） ===== */
/* 书卡：占满宽度的大块图书展示，简介完整可读，整卡即为入口 */
.book-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 1.4rem;
}
.book-card {
  display: block;
  padding: 22px 26px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: inherit;
  text-decoration: none;
  transition: all 0.25s ease;
  min-width: 0;
}
.book-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.book-card-name {
  display: block;
  color: var(--accent);
  font-size: clamp(1.25rem, 2.5vw, 1.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}
.book-card:hover .book-card-name {
  color: var(--accent-hover, var(--accent));
}
.book-card-sub {
  display: block;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 8px;
}
.book-card-desc {
  display: block;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.75;
}

/* 图书分类页“分类套分类”分组（关汉卿/杂剧等顶层卡片自身不挂书、按子分类聚合展示） */
.book-group {
  grid-column: 1 / -1;
}
.book-group-title {
  display: inline-block;
  margin: 0.6rem 0 0.8rem;
  padding-left: 0.7rem;
  border-left: 4px solid var(--accent);
  color: var(--accent);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
}
.book-group-title:hover {
  color: var(--accent-hover, var(--accent));
}
.book-group-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 1.4rem;
}

/* 图书分类页移动端：单列大卡片，简介完整 */
@media (max-width: 640px) {
  .book-card-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .book-card {
    padding: 16px 18px;
  }
  .book-card-name { font-size: clamp(1.15rem, 5vw, 1.35rem); }
  .book-card-desc { font-size: 0.85rem; }
  .book-group-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* 诗词列表 —— 居中、大间距，不截断 */
.la-item-desc.poem-preview {
  font-size: 0.92rem;
  line-height: 1.8;
  text-align: center;
  color: var(--text-muted);
  margin-top: 0.2rem;
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* ===== 35. 栏目介绍正文（fengmian.htm） ===== */
.category-block-text {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.8;
}
.category-block-text img,
.category-block-text video {
  border-radius: var(--radius);
  height: auto;
  max-width: 100%;
  margin: 0.5rem 0;
}
/* 内容区表格（富文本内嵌：水浒 108 将、曾国藩纪年表、度量衡对照等）。
   老内容自带内联 <style>，写死了 1px 灰边框 + 13px 小字，暗色主题下白框很扎眼。
   这里统一成与「中国朝代顺序表」同一套视觉：无边框，靠表头底色与隔行底色分层。
   注意：内容里的内联样式同名选择器权重更低，类选择器可直接覆盖，无需 !important。 */
.category-block-text table {
  width: 100%;
  max-width: 100%;
  border: 0;
  border-collapse: collapse;
  margin: 0.9rem 0 1.2rem;
  font-size: 0.88rem;
  line-height: 1.7;
}
/* 老内容的 <style> 同时给 tr 加了 1px 灰边框，必须一并清掉，
   否则只剩横线、没有竖线，网格看起来是断的。 */
.category-block-text table tr {
  border: 0;
}
/* 1) 基础：无边框；单元格不加底色，底色统一交给整行斑马纹 */
.category-block-text table th,
.category-block-text table td {
  border: 0;
  padding: 9px 12px;
  text-align: left;
  vertical-align: top;
}
/* 2) 内容自带的单元格底色一律清掉（度量衡对照的内联 .jz-dl 给 td 刷了 --bg-surface，
      权重 0,1,2，与单类选择器同权、且在文档里更靠后，必须用 0,1,3 / 0,2,3 才压得住） */
.category-block-text table tbody td {
  background: transparent;
}
.category-block-text table tbody tr > td {
  background: transparent;
}
/* 3) 表头：<th> 与老表格的 <td><strong> 同等对待（水浒 108 将、曾国藩纪年表） */
.category-block-text table thead th,
.category-block-text table tbody tr:first-child > td {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.84rem;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}
/* 4) 隔行：沿用「中国朝代顺序表」同一套（整行 --bg-surface，无边框）。
      取偶数行：老表格的表头占着 tbody 第 1 行，从偶数行开始，第一条数据行才有底色。 */
.category-block-text table tbody tr:nth-child(even) {
  background: var(--bg-surface);
}
/* 偶数行的单元格同样要透明，否则会盖住刚上好的行色（权重高于内联 .jz-dl 的 0,2,3） */
.category-block-text table tbody tr:nth-child(even) > td {
  background: transparent;
}
/* 5) 表头在 <thead> 里的表格（度量衡对照 5 张表）：tbody 首行是普通数据，不能套表头样式 */
.category-block-text table thead + tbody tr:first-child > td {
  background: transparent;
  color: inherit;
  font-weight: 400;
  font-size: inherit;
  white-space: normal;
}
/* 上面的还原会连首列字重一起冲掉，这里按原文意图给回来 */
.category-block-text table thead + tbody tr td:first-child {
  color: var(--text-primary);
  font-weight: 600;
}
/* 6) 首列是行标识（排位/年龄/单位），用主色 + 字重区分 */
.category-block-text table td:first-child {
  color: var(--text-primary);
  font-weight: 600;
}

@media (max-width: 760px) {
  /* 7 列长表在手机上若强行铺满，每列只剩 30-40px，人名会被折成竖条；
     叠卡又会变成 109 张卡片。折中：内容块横向滑动，表格保持可读列宽。 */
  .category-block-text {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .category-block-text table {
    min-width: 620px;
    font-size: 0.82rem;
  }
  .category-block-text table th,
  .category-block-text table td {
    padding: 7px 9px;
  }
}

@media (max-width: 640px) {
  .category-header {
    padding: 1rem 1.2rem;
    border-radius: var(--radius-lg);
  }
  /* 小屏不直接吃基础的 23.2px 下限：320px 下 21 字的长栏目名会占 4 行，
     20.8px 起步、640px 处与基础规则无缝衔接 */
  .category-title {
    font-size: clamp(1.3rem, 6vw, 1.45rem);
  }
  .category-description {
    font-size: 0.82rem;
  }
  .subcategory-tag {
    font-size: 0.74rem;
    padding: 4px 11px;
  }
  .la-item {
    padding: 0.8rem 1rem;
    margin-bottom: 0.4rem;
    border-radius: var(--radius-sm);
  }
  .la-item:hover {
    transform: translateX(2px);
  }
  .la-item-title {
    font-size: 0.9rem;
  }
  .la-item-desc {
    font-size: 0.82rem;
  }
  .breadcrumb {
    margin: 0.8rem 0 0.5rem;
    font-size: 0.78rem;
  }
  .category-block-text {
    font-size: 0.88rem;
  }
}

/* ===== 36. TOC 紧凑包装器（diy.htm / shouye.htm） ===== */
.toc-compact {
  padding: 0.8rem 0;
}

/* ===== 37. 分类区块变体 ===== */

/* 网格布局 —— 药丸密集排列 */
.category-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.category-list-grid .category-item {
  width: 100%;
}
.category-list-grid .category-link {
  width: 100%;
  justify-content: center;
  text-align: center;
}

/* 亡佚篇：淡灰不可点（图书封面目录用） */
.category-list-grid .category-item-lost {
  display: flex;
  justify-content: center;
  text-align: center;
  width: 100%;
}
.category-list-grid .category-lost-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(43, 38, 31, 0.3);
  border-radius: 10px;
  color: var(--text-tertiary);
  font-size: 0.92rem;
  white-space: nowrap;
}
html.light .category-list-grid .category-lost-label {
  background: var(--bg-hover);
  color: #9aa0a6;
}
html.dark .category-list-grid .category-lost-label {
  color: #6a6f76;
}
@media (max-width: 640px) {
  .category-list-grid .category-lost-label {
    padding: 6px 12px;
    font-size: 0.84rem;
    border-radius: 8px;
  }
}

/* 纵向堆叠 */
.category-list-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* 分组区块（标题 + 子列表，带分割线） */
.category-list-section {
  margin-bottom: 1.2rem;
}
.category-list-section:last-child {
  margin-bottom: 0;
}
.category-list-section > .category-block-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0;
  color: var(--text-primary);
}
html.dark .category-list-section > .category-block-title {
  border-bottom-color: transparent;
}
.category-list-section > .category-block-title:first-child {
  margin-top: 0;
}
.category-list-section > .category-item {
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  padding: 8px 16px;
}
.category-list-section > .category-item:hover {
  background: var(--accent-bg);
  transform: translateX(3px);
}
.category-list-section > .category-item .category-link {
  background: transparent;
  padding: 4px 0;
  width: 100%;
  white-space: normal;
  word-break: break-word;
}
.category-list-section > .category-item .category-link:hover {
  background: transparent;
  transform: none;
  box-shadow: none;
}

/* 二级标题 —— 翠绿左竖线 */
.category-subtitle {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  margin: 0.5rem 0;
  padding-left: 0.5rem;
  border-left: 3px solid var(--accent);
}

/* 分组包装器 */
.category-group {
  margin-bottom: 1.1rem;
}
.category-group:last-child {
  margin-bottom: 0;
}

/* 提示/说明框 —— 翠绿左边框 */
.category-block-tip {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1.5rem;
}
.category-block-tip-wrap {
  margin-bottom: 1.5rem;
}
.category-block-tip-wrap .category-block-tip {
  margin-bottom: 0;
}

/* 按钮式链接 */
.category-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: var(--bg-card);
  border-radius: var(--radius-full);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.2rem;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}
.category-link-button:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

/* ===== 38. 图文内容 ===== */

/* 随机/特殊 —— 居中、楷体 */
.suiji {
  text-align: center;
  padding: 0.6rem 0;
}
.suiji .category-link {
  font-family: "KaiTi", "STKaiti", "楷体", serif;
  font-size: 1.15rem;
  padding: 8px 24px;
}

/* 居中图文 */
.content-figure {
  margin: 1rem 0;
  text-align: center;
}
.content-figure img {
  border-radius: var(--radius);
  max-width: 100%;
  height: auto;
}
.img-note {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.25rem;
}

/* ===== 39. 列表组（内容卡片，如1225.htm历代版图） ===== */
.list-group-flush {
  list-style: none;
  padding: 0;
  margin: 0 0 0.6rem;
}
.list-group-item-action {
  display: block;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
}
.list-group-item-action:hover {
  background: var(--bg-card-hover);
  transform: translateX(3px);
  box-shadow: var(--shadow);
}
.list-group-item-action h5 {
  margin: 0 0 0.15rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent);
}
.list-group-item-action .text-muted {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.list-group-item-action p {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* ===== 40. 常用工具类 ===== */
.d-flex { display: flex !important; }
.w-100 { width: 100% !important; }
.text-center { text-align: center !important; }
.text-muted { color: var(--text-muted) !important; }
.stow_home { position: relative; }

/* ===== category-block 内段落通用间距 ===== */
.category-block > p {
  margin-bottom: 1em;
  line-height: 1.8;
  color: var(--text-secondary);
}
.category-block > p:last-child {
  margin-bottom: 0;
}

/* ===== 41. 阅读页布局 ===== */
/* 阅读页基础宽度：45em（每行约45字，中文35-45字最佳单行字数区间的上限）+ 侧边内边距 */
.reading-page {
  --read-max: 55em;
  margin: 0 auto;
  max-width: min(calc(var(--read-max) + 3rem), 98vw);
  padding: 28px clamp(14px, 3vw, 22px) 56px;
  width: 100%;
}
.reading-layout {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: flex-start;
}
.reading-measure {
  margin: 0;
  max-width: var(--read-max);
  width: 100%;
  min-width: 0;
}
.reading-page--chapter .reading-measure {
  padding: 0 clamp(12px, 2vw, 22px) 28px;
}
/* 栏目页与内容页同宽同边距：避免移动端卡片贴屏、PC 端因侧栏挤压变窄 */
.reading-page--category .reading-measure {
  padding: 0 clamp(12px, 2vw, 22px) 28px;
}

/* ===== 42. 文章头部 ===== */
.article-header {
  margin-bottom: 16px;
  padding-bottom: 16px;
}
.article-header--chapter h1 {
  color: var(--text-primary);
  font-family: var(--font-read);
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  /* 宋体只有 400/700 两档，600 会落 Bold；改 500 落 Regular（同 .category-title） */
  font-weight: 500;
  /* 负字距是给苹方这类字面偏宽的无衬线用的；宋体字面窄、带衬线装饰，
     再收 0.025em 会粘连，改为轻微放开 */
  letter-spacing: 0.01em;
  line-height: 1.3;
  text-wrap: pretty;
  margin: 0;
}

/* 标题展开/折叠 */
.title-expand-wrapper {
  position: relative;
}
.title-expand-text {
  overflow: hidden;
  padding-right: 1.6em;
}
.title-expand-text.collapsed {
  display: block;
  max-height: calc(1.3 * clamp(1.55rem, 3vw, 1.9rem) * 2);
  overflow: hidden;
}
.title-expand-text.expanded {
  max-height: none;
  overflow: visible;
}
.title-expand-btn {
  background: none;
  border: none;
  bottom: 0;
  color: var(--accent);
  cursor: pointer;
  display: none;
  font-size: 0.85em;
  line-height: 1;
  padding: 2px 4px;
  position: absolute;
  right: 0;
  transition: transform 0.2s ease;
}
.title-expand-btn.visible {
  display: inline-block;
}
.title-expand-btn.expanded i {
  transform: rotate(180deg);
}

/* 文章简介/说明 */
.article-description {
  background: var(--read-bg, var(--accent-bg));
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.925rem;
  line-height: 1.75;
  margin: 1.25em 0 1.75em;
  padding: 0.9em 1.1em;
  text-wrap: pretty;
}
.article-description:empty {
  display: none;
}

/* PC端文章底部操作按钮（PC/移动端均显示在文章下方） */
.article-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  margin: 24px 0;
}
/* 文章级校订记录入口：低权重浅灰小字，margin-right:auto 推到左侧（与右侧收藏/复制两端布局） */
.article-fixes-entry {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-dim);
  background: none;
  border: none;
  border-radius: 0;
  padding: 2px 0;
  cursor: pointer;
  user-select: none;
  transition: color .15s ease;
  line-height: 1.6;
}
.article-fixes-entry:hover,
.article-fixes-entry:focus {
  color: var(--text-muted);
  outline: none;
}
.article-fixes-entry b {
  font-weight: 500;
  color: var(--text-muted);
}
.article-action-btn {
  align-items: center;
  background: var(--read-bg, var(--bg-surface));
  border: none;
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  font-size: 18px;
  height: 42px;
  justify-content: center;
  text-decoration: none;
  transition: all var(--transition);
  width: 42px;
}
.article-action-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}
.fav-star.wq-faved {
  color: var(--accent) !important;
}

/* ===== 43. 阅读正文样式 ===== */
.reading-content {
  -webkit-font-smoothing: antialiased;
  color: var(--text-primary);
  font-family: var(--font-read);
  font-size: var(--read-font-size);
  font-weight: 400;
  line-height: var(--read-line-height);
  letter-spacing: 0.02em;
  background-color: var(--read-bg, transparent);
}
.reading-content p {
  margin-bottom: var(--read-para-margin);
  text-align: justify;
  text-justify: inter-ideographic;
  text-align-last: left;
  text-wrap: pretty;
}
.reading-content > p:first-of-type {
  text-indent: 0;
}
.reading-content h2 {
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 2.2em 0 0.75em;
  padding: 0.45em 0.7em 0.45em 0.6em;
  text-wrap: balance;
}
.reading-content h3 {
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 2.2em 0 0.75em;
  text-wrap: balance;
}
.reading-content img,
.reading-content video {
  border-radius: var(--radius);
  height: auto;
  max-width: 100%;
}
.reading-content figure {
  margin: 2.5em 0;
  padding: 0;
  text-align: center;
}
.reading-content figure img {
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: block;
  height: auto;
  margin: 0 auto;
  max-width: 100%;
}
.reading-content figcaption {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  letter-spacing: 0.01em;
  line-height: 1.6;
  margin-top: 1em;
  text-align: center;
}
.reading-content img.lazy-img:not(.lazy-img--loaded) {
  animation: wu-shimmer 1.1s ease-in-out infinite;
  background-image: var(--shimmer);
  background-size: 200% 100%;
  min-height: 72px;
  width: 100%;
  border-radius: var(--radius);
}
.reading-content img.lazy-img.lazy-img--loaded {
  animation: none;
  background: none;
  min-height: 0;
}
.reading-content .content-image {
  animation: wu-shimmer 1.5s ease-in-out infinite;
  background-image: var(--shimmer);
  background-size: 200% 100%;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: block;
  margin: 2em auto;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.reading-content .content-image.lazy-img--loaded {
  animation: none;
  background: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  opacity: 1;
}
.reading-content .content-image:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  transform: translateY(-2px);
}
.reading-content .content-image.lazy-img--error {
  opacity: 0.3;
}
/* 栏目导语图（只有 content-image、没有 lazy-img，不参与懒加载占位符）：
   直接显示。否则等不到 lazy-img--loaded，会被上面规则永久压在 opacity:0 */
.reading-content img.content-image:not(.lazy-img) {
  animation: none;
  background-image: none;
  opacity: 1;
}

/* 生僻字小图（<10KB，计算机无法输入的字以图片代替，如伤寒论"其人即图"）：
   作为文字内联显示——不居中、不占整行，与前后文字保持和谐；
   图片本身为黑字透明 PNG，夜间模式用 invert 反色为白字适配深色背景 */
.reading-content img.rare-char-img {
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: inline-block;
  height: 1.15em;
  margin: 0 0.1em;
  max-width: none;
  opacity: 1;
  padding: 0;
  vertical-align: -0.2em;
  width: auto;
}
html.dark .reading-content img.rare-char-img {
  filter: invert(1);
}

/* 行内数学符号图（分数/根号/竖式，九章算术等）：
   与生僻字图的区别是高度不压成一行（竖式可达 200px+，压成 1.15em 会糊成一条线）；
   同为本体黑字透明图，夜间 invert 反白。必须定义在 rare-char-img 之后以覆盖其 height。 */
.reading-content img.math-inline {
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: inline-block;
  height: auto;
  margin: 0 0.12em;
  max-height: none;
  max-width: 100%;
  opacity: 1;
  padding: 0;
  vertical-align: middle;
  width: auto;
}
html.dark .reading-content img.math-inline {
  filter: invert(1);
}

/* 内容图片悬停效果 */
.grap img {
  transition: box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  cursor: default;
  will-change: box-shadow, transform;
}
.grap img:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transform: scale(1.01);
  opacity: 0.98;
}
.grap img[src]:not([src$=".gif"]):hover {
  transform: scale(1);
}
.grap img[data-wuqianyan] {
  opacity: 1;
}

/* ===== 43b. 诗歌版式（neirong_shi.htm） ===== */
.poem-verse {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 34em;
  margin: 1.2em auto;
  padding: 1em 1.5em;
  background: var(--read-bg, var(--bg-surface));
  border-radius: var(--radius);
}
.poem-verse p,
.poem-verse div {
  text-align: left;
  margin-bottom: 0.4em;
  font-size: calc(var(--read-font-size) * 1.1);
  line-height: var(--read-line-height);
  letter-spacing: 0.04em;
  font-family: var(--font-read), "STKaiti", "KaiTi", "楷体", serif;
  font-weight: 400;
}
.poem-verse p:last-child,
.poem-verse div:last-child {
  margin-bottom: 0;
}

/* ===== 44. 顶部书籍导航栏 ===== */
.top-book-nav {
  align-items: center;
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  padding: 12px 0 16px 0;
  position: relative;
}
.top-book-nav-back {
  align-items: center;
  color: var(--text-secondary);
  display: inline-flex;
  flex-shrink: 0;
  font-size: 16px;
  height: 32px;
  justify-content: center;
  text-decoration: none;
  transition: color var(--transition);
  width: 32px;
}
.top-book-nav-back:hover {
  color: var(--accent);
}
.top-book-nav-name-link {
  flex: 1;
  min-width: 0;
  text-decoration: none;
}
.top-book-nav-name-link:hover .top-book-nav-name {
  color: var(--accent);
}
.top-book-nav-name {
  color: var(--text-primary);
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
  white-space: nowrap;
}
.top-book-nav-buttons {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
}
.top-book-nav-btn {
  align-items: center;
  background: transparent;
  border-radius: 50%;
  color: var(--text-muted);
  display: inline-flex;
  font-size: 14px;
  height: 36px;
  justify-content: center;
  text-decoration: none;
  transition: all var(--transition);
  width: 36px;
}
.top-book-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
}
.top-book-nav-btn.disabled {
  cursor: not-allowed;
  opacity: 0.3;
  pointer-events: none;
}
.top-book-nav-btn.disabled:hover {
  background: transparent;
  color: var(--text-muted);
}

/* ===== 45. 章节导航 ===== */
.chapter-navigation {
  margin: 36px 0 48px;
  padding: 0;
}
.chapter-nav-wrapper {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* ===== 45b. 延伸阅读（《中华上下五千年》→ 站内已收录典籍） =====
   纯背景色分层、零边框：外层 bg-surface 比正文深一级，卡片 bg-card 再亮一级，
   hover 切 accent-bg——与全站 .category-link 同一套语言。 */
.ext-read {
  margin: 0 0 44px;
  padding: 20px 22px 22px;
  background: var(--bg-surface);
  border-radius: 14px;
}
.ext-read-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.ext-read-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.ext-read-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}
.ext-read-item:hover {
  background: var(--accent-bg);
  transform: translateY(-1px);
}
.ext-read-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ext-read-item:hover .ext-read-name {
  color: var(--accent-hover);
}
.ext-read-desc {
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-muted);
}
@media (max-width: 640px) {
  .ext-read {
    margin-bottom: 32px;
    padding: 16px 16px 18px;
    border-radius: 12px;
  }
  .ext-read-list {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ext-read-item {
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
    padding: 11px 13px;
  }
  .ext-read-name {
    flex: 0 0 auto;
    font-size: 0.9rem;
  }
  .ext-read-desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* 大事记分段落延伸：每个时代段落末尾的一行典籍入口（与上方事件列表同背景色系） */
.era-books {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 26px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: 10px;
}
.era-books-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.era-books a {
  padding: 1px 9px;
  background: var(--bg-card);
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}
.era-books a:hover {
  background: var(--accent-bg);
  color: var(--accent-hover);
}
.prenext-link {
  align-items: center;
  background: var(--read-bg, var(--bg-surface));
  border-radius: var(--radius);
  color: var(--text-secondary);
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  letter-spacing: 0.06em;
  min-width: min(100%, 220px);
  padding: 13px 22px;
  text-decoration: none;
  transition: all var(--transition);
}
.prenext-link:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}
.prenext-link.disabled {
  cursor: not-allowed;
  opacity: 0.4;
  pointer-events: none;
}
.prenext-link.disabled:hover {
  background: var(--bg-surface);
  color: var(--text-secondary);
  transform: none;
}

/* ===== 46. PC右侧侧边栏 ===== */
.pc-right-sidebar {
  display: none;
  flex-shrink: 0;
  width: 300px;
}
.pc-sidebar-section {
  background: var(--read-bg, var(--bg-surface));
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pc-sidebar-section + .pc-sidebar-section {
  margin-top: 12px;
}
.pc-sidebar-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 14px 16px 10px;
}
.pc-sidebar-section-title--clickable {
  cursor: pointer;
  color: var(--accent);
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.9rem;
}
.pc-sidebar-section-title--clickable:hover {
  color: var(--accent);
  opacity: 0.85;
}
.pc-sidebar-chapters {
  max-height: 400px;
  overflow-y: auto;
  font-size: 14px;
  padding: 4px 0 8px 0;
}
.pc-sidebar-chapters::-webkit-scrollbar {
  display: none;
}
.pc-sidebar-chapters {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
/* 打赏侧边栏按钮 — 纯背景色分层，左文案右累计人数 */
.donate-sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: var(--accent-bg);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.donate-sidebar-btn:hover {
  background: var(--accent-bg-hover);
  color: var(--accent-hover);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.donate-sidebar-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* ===== 47. 移动端章节侧边栏 ===== */
.chapter-sidebar {
  background: var(--bg-surface);
  bottom: 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  left: 0;
  position: fixed;
  top: 0;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: min(360px, 85vw);
  z-index: 200;
}
.chapter-sidebar.open {
  transform: translateX(0);
}
/* 深色模式下侧边栏需要纯色背景，避免半透明玻璃效果导致文字看不清 */
:root .chapter-sidebar { background: #171410; }
/* 浅色模式恢复原背景 */
html.light .chapter-sidebar { background: var(--bg-surface); }
.chapter-sidebar-overlay {
  background: rgba(0, 0, 0, 0.5);
  bottom: 0;
  left: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  right: 0;
  top: 0;
  transition: opacity 0.3s ease;
  z-index: 199;
}
.chapter-sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* 侧边栏列表 */
.chapter-sidebar-list {
  -ms-overflow-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 0 0 20px 0;
  scrollbar-width: none;
}
.chapter-sidebar-list::-webkit-scrollbar {
  display: none;
}
.chapter-sidebar-list h3 {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  padding: 0 16px;
}

/* 图书信息头 */
.chapter-sidebar-book-info {
  background: var(--bg-hover);
  padding: 20px;
}
.chapter-sidebar-book-link {
  color: var(--text-primary);
  display: block;
  text-decoration: none;
}
.chapter-sidebar-book-name {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

/* 分组头 */
.chapter-sidebar-group-header {
  align-items: center;
  background: transparent;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
  transition: background 0.2s;
  user-select: none;
}
.chapter-sidebar-group-header:hover {
  background: var(--bg-hover);
}
.chapter-sidebar-group.current > .chapter-sidebar-group-header {
  background: var(--bg-hover);
}
.chapter-sidebar-group-title {
  color: var(--text-primary);
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}
.chapter-sidebar-group-title:hover {
  color: var(--accent);
}
.chapter-sidebar-group-icon {
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 12px;
  margin-left: 8px;
  transition: transform 0.3s ease;
}
.chapter-sidebar-group-icon.rotated {
  transform: rotate(-90deg);
}
.chapter-sidebar-group.expanded .chapter-sidebar-group-icon {
  transform: rotate(0deg);
}
.chapter-sidebar-group-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.chapter-sidebar-group-content:not(.collapsed) {
  max-height: none;
}
.chapter-sidebar-group-content.collapsed {
  max-height: 0;
}

/* 侧边栏条目 */
.chapter-sidebar-item {
  align-items: center;
  background: transparent;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.chapter-sidebar-item:hover {
  background: var(--bg-hover);
  transform: translateX(3px);
}
.chapter-sidebar-item.active {
  background: var(--bg-hover);
  transform: translateX(3px);
}
.chapter-sidebar-item-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.chapter-sidebar-item-title {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chapter-sidebar-item.active .chapter-sidebar-item-title {
  color: var(--accent);
  font-weight: 600;
}

/* 子分组 */
.chapter-sidebar-subgroup {
  margin-left: 12px;
}
.chapter-sidebar-subgroup-header {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  text-transform: uppercase;
}
.chapter-sidebar-subgroup-title {
  color: var(--text-muted);
  text-decoration: none;
}

/* 子层级缩进 */
.chapter-sidebar-item-child-2 { padding-left: 28px; }
.chapter-sidebar-item-child-3 { padding-left: 44px; }
.chapter-sidebar-item-child-4 { padding-left: 60px; }
.chapter-sidebar-item-child-5 { padding-left: 76px; }

/* 层级背景色区分 */
.chapter-sidebar-group-root-articles > .chapter-sidebar-group-content .chapter-sidebar-item {
  background: transparent;
}
.chapter-sidebar-group-root-articles > .chapter-sidebar-group-content .chapter-sidebar-item:hover {
  background: var(--bg-hover);
}

/* L1分组背景 */
.chapter-sidebar-group:not(.chapter-sidebar-subgroup-level) > .chapter-sidebar-group-content {
  background: var(--bg-hover);
}
html.dark .chapter-sidebar-group:not(.chapter-sidebar-subgroup-level) > .chapter-sidebar-group-content {
  background: rgba(255, 255, 255, 0.03);
}
/* L2子分组背景 */
.chapter-sidebar-subgroup-level > .chapter-sidebar-group-content {
  background: var(--bg-hover);
}
/* L3更深层背景 */
.chapter-sidebar-subgroup-level .chapter-sidebar-subgroup-level > .chapter-sidebar-group-content {
  background: var(--bg-surface);
}

/* ===== 48. 移动端底部导航栏 ===== */
.bottom-nav-bar {
  background: var(--bg-surface);
  bottom: 0;
  left: 0;
  position: fixed;
  right: 0;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  will-change: transform;
  z-index: 100;
}
.bottom-nav-bar.visible {
  transform: translateY(0);
}
.bottom-nav-inner {
  align-items: center;
  display: flex;
  gap: 4px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1200px;
  padding: 8px 16px;
}
.bottom-nav-left {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 0;
}
.bottom-nav-right {
  align-items: center;
  display: flex;
  gap: 0;
}
.bottom-nav-icon {
  align-items: center;
  background: transparent;
  border-radius: 50%;
  color: var(--text-secondary);
  display: inline-flex;
  flex-shrink: 0;
  font-size: 19px;
  height: 42px;
  justify-content: center;
  text-decoration: none;
  transition: all var(--transition);
  width: 42px;
}
.bottom-nav-icon:hover {
  background: var(--bg-hover);
  color: var(--accent);
}
.bottom-nav-icon:active {
  transform: scale(0.9);
}
.bottom-nav-icon.disabled {
  cursor: not-allowed;
  opacity: 0.3;
  pointer-events: none;
}
.bottom-nav-actions {
  align-items: center;
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}
.bottom-nav-chapter-nav {
  display: flex;
  flex-shrink: 0;
  gap: 4px;
  margin-left: auto;
}
.bottom-nav-actions .bottom-nav-icon {
  font-size: 18px;
  height: 40px;
  width: 40px;
}

/* ===== 49. 阅读页响应式 ===== */

/* 移动端 ≤767px */
@media (max-width: 767px) {
  /* 左右内边距归零：水平留白全部交给 .reading-measure 的 clamp(12px,2vw,22px)，
     与 .container（≤640px 时 0.8rem=12.8px）对齐，最大化利用屏幕宽度 */
  .reading-page {
    max-width: 100%;
    padding: 0 0 40px;
  }
  /* 阅读内页：收紧顶部与导航栏的间距 */
  .page-chapter .topbar-wrap {
    margin-bottom: 0.15rem;
  }
  .page-chapter .topbar {
    margin-bottom: 0.15rem;
  }
  .page-chapter .reading-page {
    padding-top: 4px;
  }
  .reading-layout {
    gap: 0;
  }
  .pc-right-sidebar {
    display: none;
  }
  /* 移动端隐藏顶部书籍导航栏：书名链接与面包屑重复，翻章按钮与底部固定导航重复（PC 保留） */
  .top-book-nav {
    display: none;
  }
  /* 移动端字号与 PC 同为 18px（2026-10-30）：这里曾是 15px，与 reading-settings.js 的
     DEFAULTS.fontSize=18 形成两套默认——脚本内联 18px、面板「恢复默认」却回落到 15px，
     表现为「点恢复默认字变小、刷新又变大」。默认值只保留 JS 一份，这里与 :root 保持一致。 */
  .reading-content {
    font-size: var(--read-font-size);
  }
  .reading-content h2 {
    font-size: 1.25rem;
  }
  .reading-content h3 {
    font-size: 1.1rem;
  }
  .chapter-navigation {
    margin: 24px 0 32px;
  }
  .prenext-link {
    flex: 1;
    padding: 11px 16px;
    font-size: 12px;
    min-width: 0;
  }
  .chapter-nav-wrapper {
    gap: 8px;
  }
  /* 诗歌/注释：移动端紧凑 */
  .poem-verse {
    padding: 0.75em 1em;
    margin: 1em auto;
  }
  .poem-verse p,
  .poem-verse div {
    font-size: 1em;
  }
  .annotation-block {
    padding: 0.85em 1em;
  }
  /* 底部导航栏 */
  .bottom-nav-right {
    gap: 0;
  }
  .bottom-nav-left {
    gap: 0;
  }
  .bottom-nav-bar .bottom-nav-chapter-nav {
    gap: 0;
  }
  .bottom-nav-actions {
    gap: 2px;
  }
  .article-actions {
    margin: 16px 0;
  }
}

/* PC端 ≥768px：隐藏底部导航栏 */
@media (min-width: 768px) {
  .bottom-nav-bar {
    display: none !important;
  }
}

/* PC阅读侧边栏 ≥1024px */
@media (min-width: 1024px) {
  /* PC大屏：右侧目录吸顶常驻，顶部书籍导航栏功能完全重复，隐藏（768-1023 保留为唯一非滚动翻章入口） */
  .top-book-nav {
    display: none;
  }
  .pc-right-sidebar {
    display: flex;
    width: 300px;
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 100px);
    overflow: hidden;
    flex-direction: column;
    gap: 12px;
  }
  .pc-sidebar-section {
    flex-shrink: 0;
  }
  .pc-sidebar-section:first-child {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 40vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .pc-sidebar-chapters {
    flex: 1 1 auto;
    min-height: 100px;
    max-height: 35vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .pc-sidebar-chapters::-webkit-scrollbar {
    display: none;
  }

  /* PC侧边栏内章节列表 — 更紧凑的子样式 */
  .pc-sidebar-chapters .chapter-sidebar-book-info {
    display: none;
  }
  .pc-sidebar-chapters .chapter-sidebar-group-header,
  .pc-sidebar-chapters .chapter-sidebar-subgroup-header {
    padding: 10px 16px 6px;
    cursor: pointer;
    background: transparent !important;
    transition: background 0.15s;
  }
  .pc-sidebar-chapters .chapter-sidebar-group-header:hover,
  .pc-sidebar-chapters .chapter-sidebar-subgroup-header:hover {
    background: var(--bg-hover) !important;
  }
  .pc-sidebar-chapters .chapter-sidebar-subgroup {
    margin-left: 0;
  }
  .pc-sidebar-chapters .chapter-sidebar-item {
    padding: 8px 16px 8px 20px;
    font-size: 13px;
    line-height: 1.5;
    background: transparent;
    transition: all 0.15s;
  }
  .pc-sidebar-chapters .chapter-sidebar-item-title {
    font-size: 13px;
    font-weight: 400;
  }
  .pc-sidebar-chapters .chapter-sidebar-item:hover {
    background: var(--bg-hover);
  }
  .pc-sidebar-chapters .chapter-sidebar-item.active {
    background: rgba(var(--accent-rgb), 0.08);
    border-radius: 6px;
  }
  .pc-sidebar-chapters .chapter-sidebar-item.active .chapter-sidebar-item-title {
    color: var(--accent);
    font-weight: 600;
  }

  .reading-layout {
    gap: 24px;
  }
  /* 内容页/栏目页有侧边栏时：var(--read-max)阅读区 + 300px侧边栏 + 间距，不超导航栏宽度 */
  .reading-page--chapter,
  .reading-page--category {
    max-width: min(calc(var(--read-max) + 24px + 300px), 98vw);
  }
}

/* 极小屏幕 */
@media (max-width: 400px) {
  .bottom-nav-bar .bottom-nav-inner {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .bottom-nav-bar .bottom-nav-right {
    flex-shrink: 0;
  }
}

@media (max-width: 340px) {
  .bottom-nav-actions {
    gap: 2px !important;
  }
}

/* ===== 50. 阅读设置面板 ===== */
.reading-settings-wrap {
  display: inline-flex;
  position: relative;
}
.reading-settings-panel {
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  max-height: 80vh;
  opacity: 0;
  overflow-y: auto;
  padding: 16px 18px 14px;
  position: fixed;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  visibility: hidden;
  will-change: opacity, transform;
  width: 340px;
  z-index: 1001;
}
.reading-settings-panel.open {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}
.reading-settings-overlay {
  background: rgba(0, 0, 0, 0.3);
  bottom: 0;
  left: 0;
  opacity: 0;
  position: fixed;
  right: 0;
  top: 0;
  transition: opacity 0.25s, visibility 0.25s;
  visibility: hidden;
  z-index: 1000;
}
.reading-settings-overlay.open {
  opacity: 1;
  visibility: visible;
}
.reading-settings-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}
.reading-settings-title {
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.reading-settings-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: color 0.2s;
}
.reading-settings-close:hover {
  color: var(--text-primary);
}
.reading-settings-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 设置分组 */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.settings-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.settings-slider-row {
  align-items: center;
  display: flex;
  gap: 10px;
}
.settings-size-icon {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.settings-size-icon-lg {
  font-size: 22px;
}
.settings-line-icon {
  color: var(--text-muted);
  font-size: 13px;
}

/* 滑块 */
.settings-slider {
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-hover);
  border-radius: 6px;
  cursor: pointer;
  flex: 1;
  height: 6px;
  outline: none;
}
html.light .settings-slider {
  background: rgba(0, 0, 0, 0.08);
}
.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  height: 20px;
  transition: transform 0.15s, box-shadow 0.15s;
  width: 20px;
}
.settings-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transform: scale(1.15);
}
.settings-slider::-webkit-slider-thumb:active {
  transform: scale(0.9);
  background: var(--accent-hover);
}
.settings-slider::-moz-range-thumb {
  background: var(--accent);
  border: none;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  height: 20px;
  width: 20px;
}
.settings-value-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

/* 字体选择按钮 */
.settings-font-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.settings-font-btn,
.settings-theme-btn {
  background: var(--bg-surface);
  border: none;
  border-radius: 50px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 14px;
  transition: all var(--transition);
}
.settings-font-btn:hover,
.settings-theme-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
  transform: translateY(-1px);
}
.settings-font-btn:active,
.settings-theme-btn:active {
  transform: scale(0.95);
}
.settings-font-btn.active,
.settings-theme-btn.active {
  background: var(--accent);
  color: #fff;
}

/* 主题选项布局 */
.settings-theme-options {
  display: flex;
  gap: 8px;
}
.settings-theme-btn {
  flex: 1;
  text-align: center;
}

/* 语言切换按钮 */
.settings-lang-options {
  display: flex;
  gap: 8px;
}
.settings-lang-btn,
.settings-note-btn {
  background: var(--bg-surface);
  border: none;
  border-radius: 50px;
  color: var(--text-primary);
  cursor: pointer;
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 6px 14px;
  transition: all var(--transition);
}
.settings-lang-btn:hover,
.settings-note-btn:hover {
  background: var(--bg-hover);
  color: var(--accent);
  transform: translateY(-1px);
}
.settings-lang-btn:active,
.settings-note-btn:active {
  transform: scale(0.95);
}
.settings-lang-btn.active,
.settings-note-btn.active {
  background: var(--accent);
  color: #fff;
}

/* 重置区域 */
.settings-section-reset {
  background: var(--bg-surface);
  border-radius: 12px;
  margin-top: 4px;
  padding: 12px 14px;
}
.settings-reset-btn {
  align-items: center;
  background: var(--bg-hover);
  border: none;
  border-radius: 50px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  font-size: 0.82rem;
  gap: 6px;
  justify-content: center;
  padding: 8px 16px;
  transition: all var(--transition);
  width: 100%;
}
.settings-reset-btn:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}
.settings-reset-btn:active {
  transform: scale(0.95);
}

/* 移动端阅读设置面板 */
@media (max-width: 767px) {
  .reading-settings-panel {
    padding: 12px 14px 12px;
    border-radius: 16px;
    width: 300px;
  }
  .reading-settings-title {
    font-size: 0.95rem;
  }
  .reading-settings-body {
    gap: 12px;
  }
  .settings-section {
    gap: 5px;
  }
  .settings-label {
    font-size: 0.78rem;
  }
  .settings-slider-row {
    gap: 6px;
  }
  .settings-font-options {
    gap: 5px;
  }
  .settings-font-btn {
    font-size: 0.78rem;
    padding: 5px 9px;
  }
  .settings-section-reset {
    padding: 10px 12px;
  }
}

/* ============================================================
   交互组件样式 — 评论 & 论道（统一）
   对齐老站 .feedbacks / .wqy-pl / .yidong-pinglun
   ============================================================ */

/* ---- 评论区容器 ---- */
.interaction-section { margin-top: 2rem; }
/* 评论区跟随背景亮度（默认透明，亮度调整时统一明暗） */
.wqy-pl { background-color: var(--read-bg, transparent); }
/* PC评论框与下方间距 */
.wqy-pl-box { margin-bottom: 1.5rem; }
/* 评论统计头部 */
.comment-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem !important;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle, rgba(128,128,128,0.15));
}
.comment-header-row .comment-count-label {
  color: var(--text-muted); font-size: 14px;
}
.comment-header-row .comment-count-num {
  color: var(--accent); font-weight: 700; font-size: 15px;
}
#dingweimiaodian { color: var(--text-primary); font-size: 14px; text-decoration: none; }

/* ---- 排序/计数行（对齐 .sort-label / .sort-active） ---- */
.sort-tabs { display: flex; gap: 0.5rem; align-items: center; }
.sort-tab {
  font-size: 13px; color: var(--text-muted);
  cursor: pointer; padding: 3px 10px; border-radius: 6px;
  transition: all 0.2s ease; background: none; border: none;
}
.sort-tab:hover { background-color: rgba(var(--success-rgb,46,160,67), 0.08); }
.sort-tab.active {
  background-color: rgba(var(--success-rgb,46,160,67), 0.1);
  color: var(--success, #2ea043); font-weight: 600;
}

/* AI 注显示开关（游客偏好，localStorage 记忆；对齐 sort-tab 视觉） */
.ai-note-toggle {
  font-size: 13px; color: var(--text-muted);
  cursor: pointer; padding: 3px 10px; border-radius: 6px;
  transition: all 0.2s ease; background: none; border: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.ai-note-toggle:hover { background-color: rgba(var(--success-rgb,46,160,67), 0.08); }
.ai-note-toggle.off { opacity: 0.5; }

/* ---- PC发布框（对齐 .wqy-pl-box） ---- */
.wqy-pl .b-head-img {
  float: left; width: 42px; height: 42px;
  border-radius: 50%; object-fit: cover; margin-right: 10px;
}
.wqy-pl .baoguo { width: 100%; }
.wqy-pl .b-box-textarea .b-box-content {
  background-color: var(--bg-tertiary);
  border: none; border-radius: 12px;
  color: var(--text-primary); font-size: 14px;
  min-height: 80px; outline: none;
  overflow-y: auto; padding: 12px;
}
.wqy-pl .b-submit-button {
  display: flex; flex-direction: column;
  padding: 6px 0 0;
  position: relative;
}
.wqy-pl .b-submit-button-toolbar {
  display: flex; align-items: center;
  justify-content: space-between;
}
.wqy-pl .b-submit-button input {
  background-color: var(--accent); border: none;
  border-radius: 10px; color: #fff; cursor: pointer;
  font-size: 14px; height: 34px; text-align: center;
  transition: opacity 0.2s ease; width: 64px; flex-shrink: 0; margin-left: auto;
}
.wqy-pl .b-submit-button input:hover { opacity: 0.85; }
.wqy-pl .b-submit-button input:active { opacity: 1; transform: scale(0.97); }

/* 表情按钮（全局复用：文章评论/论道发布框/移动弹窗统一样式） */
.emoji-trigger {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.3em; padding: 4px 6px;
}
.emoji-trigger:hover { color: var(--accent); }

/* PC发布框内表情弹出 */
.wqy-pl .b-tuzki {
  margin: 0; max-height: 0; overflow-y: auto;
  padding: 0 6px; width: 75%;
  transition: max-height 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}
.wqy-pl .b-tuzki.active {
  margin-top: 8px; max-height: 300px; padding: 8px 6px;
}
.wqy-pl .b-tuzki img {
  cursor: pointer; height: 22px; margin: 2px;
  object-fit: contain; width: 22px;
}

/* ---- 登录遮罩（未登录时覆盖发布框） ---- */
.login-mask {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(128,128,128,0.12); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px; cursor: pointer;
  transition: opacity 0.25s;
}
.login-mask-content {
  text-align: center; color: var(--text-secondary);
  background: var(--card-bg); padding: 0.5rem 1.2rem;
  border-radius: 50px; font-size: 0.85rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.12);
  display: flex; align-items: center; gap: 0.4rem;
}
.login-mask-content i { color: var(--text-muted); }

/* ---- PC端隐藏移动端元素 ---- */
.wqy-pl .d-none { display: none !important; }
.wqy-pl input[type="radio"] { display: none; }

/* ===== 评论列表（对齐 .feedbacks） ===== */
.feedbacks .comment-block {
  padding: 0.45rem 0; position: relative;
}
.feedbacks .comment-block + .comment-block {
  margin-top: 0.45rem; padding-top: 0.45rem;
  border-top: 1px solid var(--border-subtle, rgba(216,211,202,0.4));
}

/* 头像（对齐 .face 45px） */
.feedbacks .face {
  border-radius: 50%; float: left;
  height: 45px; margin-right: 10px;
  object-fit: cover; width: 45px;
}
.feedbacks .face-placeholder {
  border-radius: 50%; float: left;
  height: 45px; margin-right: 10px; width: 45px;
  background: var(--bg-tertiary);
  display: flex; align-items: center;
  justify-content: center;
  color: var(--text-muted); font-size: 1rem;
}

.feedbacks .media-body { overflow: hidden; }

/* 用户名 + 时间行 */
.feedbacks .media-body .feedback-infos .name {
  color: var(--text-secondary); font-size: 14px; font-weight: 400;
  display: flex; align-items: center; gap: 3px;
}
.feedbacks .time-ip {
  color: var(--text-muted); font-size: 12px; margin-top: 2px;
}

/* 楼层标识 */
.p_floor {
  color: var(--text-muted); font-size: 12px;
  font-weight: normal;
}

/* msg 左缩进对齐头像，重置全局msg的padding */
.feedbacks .msg { margin-left: calc(45px + 10px); padding: 0; border-radius: 0; margin-bottom: 0; }

/* 评论内容气泡 */
.feedbacks .msg .feedback-content {
  background: var(--bg-tertiary); border-radius: 10px;
  color: var(--text-primary); font-size: 15px;
  line-height: 1.7; margin-top: 2px;
  padding: 10px 14px; word-break: break-word;
}
.feedbacks .msg .feedback-content img {
  height: auto; max-height: 18px; max-width: 18px;
  vertical-align: middle;
}

/* 操作按钮行 */
.feedbacks .feedback-action {
  font-size: 13px; margin-top: 8px; padding-left: 10px;
  color: var(--text-muted); display: flex;
  justify-content: space-between; align-items: center;
}
.feedbacks .feedback-action .action-left {
  align-items: center; color: var(--text-muted);
  display: flex; flex-wrap: wrap; font-size: 13px; gap: 0.5rem;
}
.feedbacks .feedback-action .action-left a,
.feedbacks .feedback-action .action-left a:link,
.feedbacks .feedback-action .action-left a:visited {
  color: var(--text-muted) !important;
  font-size: 13px; text-decoration: none !important;
}

/* ===== 置顶评论块（通知跳转 - 仅闪两下期间可见） ===== */
.pinned-comment {
  margin-bottom: 1.2rem;
}
/* 目标高亮闪烁 */
.highlighted-target {
  border-radius: 8px;
  padding: 6px 8px;
  margin: 4px -8px;
}
/* 评论定位闪两下动画 */
@keyframes commentFlash {
  0%, 100% { background-color: transparent; }
  15%  { background-color: rgba(39, 174, 96, 0.22); }
  30%  { background-color: transparent; }
  45%  { background-color: rgba(39, 174, 96, 0.22); }
  60%  { background-color: transparent; }
}
.comment-flash {
  animation: commentFlash 1.8s ease-in-out;
  border-radius: 8px;
}
.feedbacks .feedback-action .action-left a:hover {
  color: var(--accent) !important;
}
.commentVote { cursor: pointer; }
.commentVote:hover { opacity: 0.8; }
.feedbacks .feedback-action .action-left .commentVote.liked,
.feedbacks .huifu .reply-item .action-left .commentVote.liked { color: var(--success) !important; }

/* ===== 评论内容过长收起/展开（.collapsible-content 双版本切换，对齐老站 pinglun.js） ===== */
.text-lvse { color: var(--accent); }
.collapsible-content .content-short,
.collapsible-content .content-full {
  word-break: break-all;
  word-wrap: break-word;
}
/* 评论折叠：固定 5 行截断（JS 按实际渲染行数实测），段落/换行保留为 .comment-para，无渐隐遮罩 */
/* 换行规则沿用下方气泡规则（word-break: break-word），不在单词中间硬断 */
.feedbacks .collapsible-content .comment-para {
  margin: 0 0 0.5em;
}
.feedbacks .collapsible-content .comment-para:last-child {
  margin-bottom: 0;
}
.collapsible-content .content-toggle {
  margin-top: 8px;
  text-align: left;
}
/* 文章区块（展开全部/收起）按钮紧贴内容主体 */
.b-block .collapsible-content .content-toggle {
  margin-top: 2px;
}
/* 折叠内容末段 p 下边距清零（含内联样式），避免与按钮 margin-top 塌陷导致间距过大 */
.b-block .collapsible-content .content-short p:last-child,
.b-block .collapsible-content .content-full p:last-child {
  margin-bottom: 0 !important;
}
.collapsible-content .expand-btn,
.collapsible-content .collapse-btn {
  background-color: rgba(var(--accent-rgb), 0.08);
  border-radius: 6px;
  color: var(--accent);
  cursor: pointer;
  display: inline-block;
  font-size: 14px;
  padding: 3px 10px;
  transition: all 0.2s ease;
  user-select: none;
}
.collapsible-content .expand-btn:hover,
.collapsible-content .collapse-btn:hover {
  background-color: rgba(var(--accent-rgb), 0.15);
  text-decoration: none;
  transform: translateY(-1px);
}
@media (max-width: 767px) {
  .collapsible-content .expand-btn,
  .collapsible-content .collapse-btn {
    font-size: 13px;
    padding: 3px 8px;
  }
}

/* .collapsible-content 内 .content-short/.content-full 继承 .feedback-content 气泡样式 */
/* -- 一级评论 -- */
.feedbacks .msg .collapsible-content .content-short,
.feedbacks .msg .collapsible-content .content-full {
  background: var(--bg-tertiary);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.7;
  margin-top: 2px;
  padding: 10px 14px;
  word-break: break-word;
}
.feedbacks .msg .collapsible-content .content-short img,
.feedbacks .msg .collapsible-content .content-full img {
  height: auto;
  max-height: 18px;
  max-width: 18px;
  vertical-align: middle;
}
/* -- 子回复 -- */
.feedbacks .huifu .reply-item .collapsible-content .content-short,
.feedbacks .huifu .reply-item .collapsible-content .content-full {
  background: var(--bg-tertiary);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.7;
  margin-top: 2px;
  padding: 6px 10px;
  word-break: break-word;
}
.feedbacks .huifu .reply-item .collapsible-content .content-short img,
.feedbacks .huifu .reply-item .collapsible-content .content-full img {
  height: auto;
  max-height: 18px;
  max-width: 18px;
  vertical-align: middle;
}
/* -- 移动端适配 -- */
@media (max-width: 767px) {
  .feedbacks .msg .collapsible-content .content-short,
  .feedbacks .msg .collapsible-content .content-full {
    padding: 10px 12px;
    font-size: 14px;
  }
  .feedbacks .huifu .reply-item .collapsible-content .content-short,
  .feedbacks .huifu .reply-item .collapsible-content .content-full {
    padding: 6px 8px;
    font-size: 15px;
  }
}
/* -- 暗色模式 -- */
html.dark .feedbacks .msg .collapsible-content .content-short,
html.dark .feedbacks .msg .collapsible-content .content-full,
html.dark .feedbacks .huifu .reply-item .collapsible-content .content-short,
html.dark .feedbacks .huifu .reply-item .collapsible-content .content-full {
  background-color: var(--bg-tertiary, #2a2f37);
}

/* 删除按钮 */
.delete-comment-icon {
  color: var(--text-muted); cursor: pointer;
  font-size: 14px; padding: 2px 6px;
  border-radius: 4px; transition: color 0.2s;
}
.delete-comment-icon:hover { color: #dc3545; }

/* ===== 子回复（对齐 .huifu + B站风格紧凑化） ===== */
/* 展开/收起子回复按钮 */
.mobile-reply-toggle {
  cursor: pointer; margin: 2px 0;
  display: inline;
}
.mobile-reply-toggle .reply-count {
  color: var(--accent); font-size: 13px; font-weight: 400;
  padding-left: 12px;
}
.mobile-reply-toggle:hover .reply-count { opacity: 0.75; }

/* 子回复容器 */
.mobile-replies-container {
  margin-top: 2px; display: none;
}
.mobile-replies-container.open { display: block; background: var(--bg-secondary); border-radius: 8px; overflow: hidden; }

/* 子回复头部 */
.mobile-replies-header {
  font-size: 13px; color: var(--text-muted);
  padding: 4px 0 2px 0; font-weight: 400;
  margin-bottom: 2px;
}

/* 子回复列表（对齐 .huifu + B站风格紧凑化） */
.feedbacks .huifu {
  margin-left: calc(45px + 10px); padding: 0;
  margin-top: 3px;
}
.feedbacks .huifu .reply-item {
  padding: 4px 10px; display: flex;
  align-items: center; flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle, rgba(216,211,202,0.08));
}
.feedbacks .huifu .reply-item:last-child { border-bottom: none; }
.feedbacks .huifu .reply-item .face {
  border-radius: 50%; height: 30px; margin-right: 8px;
  object-fit: cover; width: 30px; flex-shrink: 0;
}
.feedbacks .huifu .reply-item .face-placeholder {
  border-radius: 50%; height: 30px; margin-right: 8px;
  width: 30px; flex-shrink: 0;
  background: var(--bg-tertiary);
  display: flex; align-items: center;
  justify-content: center;
  color: var(--text-muted); font-size: 0.7rem;
}
.feedbacks .huifu .reply-item .media-body {
  flex-shrink: 0; overflow: visible;
}
.feedbacks .huifu .reply-item .media-body .feedback-infos .name {
  display: flex; align-items: center;
  flex-wrap: wrap; white-space: nowrap;
  font-size: 13px;
}
.feedbacks .huifu .reply-item .msg {
  margin-left: 0; margin-top: 4px;
  width: 100%; flex: 0 0 100%;
}
.feedbacks .huifu .reply-item .feedback-content {
  background: var(--bg-tertiary); border-radius: 8px;
  color: var(--text-primary); font-size: 15px;
  line-height: 1.7; margin-top: 0;
  padding: 6px 10px; word-break: break-word;
}
.feedbacks .huifu .reply-item .feedback-content img {
  height: auto; max-height: 18px; max-width: 18px;
  vertical-align: middle;
}
.feedbacks .huifu .reply-item .feedback-action {
  padding-left: 8px; margin-top: 6px;
}
.feedbacks .huifu .reply-item .action-left {
  align-items: center; color: var(--text-muted);
  display: flex; flex-wrap: wrap; font-size: 13px; gap: 0.5rem;
}
.feedbacks .huifu .reply-item .action-left a,
.feedbacks .huifu .reply-item .action-left a:link,
.feedbacks .huifu .reply-item .action-left a:visited {
  color: var(--text-muted) !important;
  font-size: 13px; text-decoration: none !important;
}
.feedbacks .huifu .reply-item .action-left a:hover {
  color: var(--accent) !important;
}

/* 回复-to文字 */
.feedbacks .reply-to-text {
  color: var(--success); font-size: 13px; font-weight: 400;
}
.feedbacks .reply-to-text::before {
  content: '回复 '; color: var(--text-muted);
  font-size: 13px; font-weight: 400;
}

/* ===== PC 回复框（对齐 .box-huifu） ===== */
.box-huifu { margin-top: 6px; margin-left: calc(45px + 10px); clear: both; }
.box-huifu .b-box-textarea .b-box-content {
  background-color: var(--bg-tertiary);
  border: none; border-radius: 8px;
  color: var(--text-primary); font-size: 13px;
  min-height: 60px; outline: none;
  padding: 8px;
}
.box-huifu .b-submit-button {
  display: flex; flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 0; position: relative;
}
.box-huifu .b-submit-button input {
  border: none; border-radius: 8px;
  color: #fff; cursor: pointer;
  font-size: 13px; height: 28px;
  text-align: center; transition: opacity 0.2s ease;
  width: 50px; background-color: var(--accent);
}
.box-huifu .b-submit-button input:hover { opacity: 0.85; }
.box-huifu .b-submit-button input:active { opacity: 1; transform: scale(0.97); }
/* 子回复内的回复框不需要全局margin-left（父容器.huifu已有缩进） */
.feedbacks .huifu .box-huifu,
.feedbacks .huifu .reply-item + .box-huifu {
  margin-left: 0;
}

/* ===== 移动端评论弹窗（对齐 .yidong-pinglun） ===== */
.yidong-pinglun {
  display: none; position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999; background: var(--bg-primary);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  padding-bottom: env(safe-area-inset-bottom);
  animation: slideUp 0.25s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.yidong-pinglun .baoguo {
  background-color: var(--bg-primary);
  position: relative;
}
.yidong-pinglun .b-box-textarea {
  background-color: var(--bg-primary);
  border: none; box-shadow: none;
}
.yidong-pinglun .b-box-textarea .b-box-content {
  background-color: var(--bg-primary);
  border: none; border-radius: 8px;
  font-size: 14px; line-height: 1.5;
  max-height: 150px; min-height: 63px;
  outline: none; overflow-y: auto;
  padding: 10px 12px;
}
/* contenteditable placeholder 显示」 */
.b-box-content[placeholder]:empty::before,
.wqy-pl .b-box-content[placeholder]:empty::before {
  content: attr(placeholder);
  color: var(--text-dim);
  pointer-events: none;
}
.yidong-pinglun .b-submit-button {
  align-items: center;
  background-color: var(--bg-primary);
  border: none; box-shadow: none;
  display: flex; flex-wrap: wrap;
  justify-content: space-between;
  padding: 6px 12px 8px; position: relative;
}
.yidong-pinglun .b-submit-button input {
  background-color: var(--accent);
  border: none; border-radius: 8px;
  color: #fff; cursor: pointer;
  flex-shrink: 0; font-size: 13px;
  height: 32px; margin-top: 0;
  text-align: center; width: 56px;
}
.yidong-pinglun .b-submit-button .b-left-actions {
  align-items: center; display: flex; gap: 2px;
}
.yidong-pinglun .b-submit-button .b-left-actions a,
.yidong-pinglun .b-submit-button .b-left-actions button {
  align-items: center; display: inline-flex;
  height: 32px; justify-content: center;
  text-decoration: none; width: 32px;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 1.3em;
}
.yidong-pinglun .b-tuzki {
  background-color: var(--bg-primary);
  flex: 0 0 100%; max-height: 0;
  order: 3; overflow-y: auto;
  padding: 0 12px; position: relative;
  transition: max-height 0.3s ease, padding 0.3s ease;
  z-index: 1;
}
.yidong-pinglun .b-tuzki.active {
  max-height: 50vh; padding: 12px;
}
.yidong-pinglun .b-tuzki img {
  cursor: pointer; height: 22px; margin: 3px;
  object-fit: contain; opacity: 0.7;
  transition: opacity 0.15s; width: 22px;
}
.yidong-pinglun .b-tuzki img:hover { opacity: 1; }

/* 移动端回复按钮（底部输入框触发器） */
.mobile-comment-trigger {
  display: none; align-items: center; gap: 10px;
  background: var(--bg-secondary); border-radius: 50px;
  padding: 10px 16px; cursor: pointer;
  color: var(--text-muted); font-size: 14px;
  margin-top: 1rem;
}
.mobile-comment-trigger i { font-size: 1.2em; }

/* ===== 加载中 ===== */
.feedbacks .spinner-wrap {
  text-align: center; padding: 16px 0;
  color: var(--text-muted); font-size: 13px;
}

/* ===== 分页 ===== */
.comment-pagination {
  display: flex; align-items: center;
  justify-content: center; gap: 0.5rem;
  padding: 1rem 0; font-size: 13px; color: var(--text-muted);
}
.comment-pagination a {
  padding: 0.3rem 0.9rem; border-radius: 50px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.8rem; text-decoration: none;
  cursor: pointer; transition: all 0.15s;
}
.comment-pagination a:hover {
  background: var(--bg-secondary-hover); color: var(--accent);
}
.comment-pagination .current-page {
  color: var(--success); font-weight: 600;
  padding: 3px 7px;
}

/* ===== 结构化区块（PHP structureArticle 输出） ===== */

/* 对照切换栏：对齐英文版分段控件（.sz-seg）的语言 —— 凹槽容器 + 中性色高亮。
   英文版实测：容器 --bg-secondary + padding 3px + gap 2px + radius 999px；
   选中项 --bg-tertiary + --text-primary + weight 400，零阴影、零强调色。
   旧版是「4 个独立胶囊 + accent 100% 实心 + 白字 + 600 + 阴影」，
   强调色用量过重、控件抢走正文注意力，且独立胶囊读作「一排按钮」而非「一组选择」（2026-10-29） */
.read-mode-bar {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin: 0 0 24px;
  background: var(--bg-secondary);
  border-radius: 999px;
}
.read-mode-bar button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
  font-weight: 400;
}
.read-mode-bar button:hover { background: var(--bg-hover); color: var(--text-primary); }
.read-mode-bar button.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== 蒙学注音（全站唯一规范，2026-10-27 固化）=====
   固定字位 + rt 绝对定位：长音节（shèng/zhǎng/chuáng）不撑宽字格，句内字距均匀。
   在役场景：文章页注音块 / 诗词详情 / 千字文·增广贤文·弟子规首页 / 格言联璧【注音】段。
   各场景只覆盖 p 的 font-size、line-height、padding-top；ruby 与 rt 一律继承本块，
   禁止再各写一套（历史上有过 inline ruby + font-size:0、1.9em 字位等 4 套参数，已收敛）。===== */
.mengxue-ruby { display: block; }
.mengxue-ruby p { margin: 0; text-align: center; }
.mengxue-ruby ruby {
  display: inline-block;
  position: relative;
  width: 1.62em;             /* 一格一字，宽度恒定 */
  text-align: center;
  vertical-align: bottom;
  font-family: "STKaiti", "KaiTi", "楷体", "Songti SC", serif;
  font-weight: 500;
}
.mengxue-ruby rt {
  position: absolute;
  left: 50%;
  top: -.95em;
  transform: translateX(-50%);
  font-size: .53em;
  line-height: 1;
  letter-spacing: 0;         /* 继承字距会撑宽拼音，与邻格相撞 */
  white-space: nowrap;
  color: var(--text-muted, #6e685c);
  font-weight: 400;
}
.mengxue-ruby .zg-ph { display: inline-block; }
@media (max-width: 480px) { .mengxue-ruby ruby { width: 1.72em; } }
/* 散文注音变体（故事正文等长段落，2026-10-28）：字位自适应 + 左对齐。
   诗行需固定字位（width:1.62em）保证句内字距均匀；散文沿用固定字位会字距过宽、
   手机每行只剩十几字且居中导致行首参差 → 阅读困难。
   除 width/text-align 外，ruby/rt 的楷体、字号、颜色、绝对定位一律继承基线。 */
.mengxue-ruby--prose p { text-align: left; line-height: 2.2; margin: 0 0 .6em; }
.mengxue-ruby--prose ruby { width: auto; padding: 0 .1em; }

/* 对照段：原文无底 / 译文极浅灰圆弧底块（排版与原文一致，仅背景区分） */
.para-yuanwen { margin-bottom: 0.4em; }
.para-fanyi {
  background: rgba(128, 128, 128, 0.07);
  border-radius: 8px;
  padding: 4px 12px;
  color: var(--text-secondary);
  margin: 0 0 1.4em;
}
html.dark .para-fanyi { background: rgba(255, 255, 255, 0.05); }

/* 三态模式：对照模式全部显示；原文模式隐藏译文；译文模式隐藏原文 */
html.mode-original .para-fanyi,
html.mode-original .b-block[data-section="翻译"] { display: none; }
html.mode-original .para-yuanwen { margin-bottom: 1.6em; }
html.mode-translation .para-yuanwen { display: none; }
/* 题解是读前导读，只在默认「对照」完整视图显示；切「原文」「译文」「注释对照」时隐藏，
   避免一块上百字的导读压在看单一文本的视图顶部、挤占正文位置 */
html.mode-original .article-lead,
html.mode-translation .article-lead,
html.mode-note-compare .article-lead { display: none; }

/* 注释对照模式（read-mode-bar 第4按钮，2026-08-15）：仅显示注释对照面板，隐藏正文对照段与正文区块 */
#note-compare-panel { display: none; }
html.mode-note-compare .para-yuanwen,
html.mode-note-compare .para-fanyi,
html.mode-note-compare .b-block { display: none; }
html.mode-note-compare #note-compare-panel { display: block; }
html.mode-note-compare #note-compare-panel .b-block,
html.mode-note-compare #note-compare-panel .para-yuanwen { display: block; }

/* 通用区块卡片（轻通栏：浅灰圆弧通栏底 + 绿字标题，可点击折叠） */
.b-block { margin-bottom: 32px; }
.b-block-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700; color: var(--accent);
  font-family: var(--font-read);
  background: rgba(128, 128, 128, 0.05);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
  cursor: pointer; user-select: none;
  transition: opacity 0.15s;
}
html.dark .b-block-title { background: rgba(255, 255, 255, 0.05); }
.b-block-title:hover { opacity: 0.75; }
.b-arrow { margin-left: auto; font-size: 11px; color: var(--text-muted); transition: transform 0.2s; }
.b-block.collapsed .b-arrow { transform: rotate(-90deg); }
.b-block.collapsed .b-body { display: none; }
.b-body { color: var(--text-secondary); font-size: var(--read-font-size); line-height: var(--read-line-height); }

/* 文章引言（原【题解】，2026-10-27）：读前说明不是正文章节，用淡底色块与下方对照正文分层，
   不加边框/标题条/折叠箭头（全站视觉：用背景色表示层级）。
   「题解」二字绝对定位骑在卡片上边缘，不占正文空间；朗读由 tts-reader 跳过，
   正文段落保留 data-section 供朗读分块。 */
.article-lead {
  position: relative;
  background: var(--accent-bg);
  border-radius: var(--radius);
  /* 上内距 1.15em：标签一半高出卡片，正文起点要避开这半个标签 */
  padding: 1.15em 1.15em 0.9em;
  /* 上外边距 1em：给高出卡片的那半个标签留出空间，不压上方元素 */
  margin-top: 1em;
  margin-bottom: 1.75em;
}
/* 标签骑边：底色取阅读区背景色，正好“切开”卡片色块的上缘 */
.article-lead-tag {
  position: absolute;
  top: 0;
  left: 1.15em;
  transform: translateY(-50%);
  padding: 0 0.45em;
  border-radius: 4px;
  background: var(--read-bg, var(--bg-primary));
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  line-height: 1.6;
  white-space: nowrap;
}
.article-lead-body p {
  margin-bottom: 0.85em;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.9;
  text-align: justify;
  text-justify: inter-ideographic;
  text-align-last: left;
}
/* 折叠：题解超过 4 行默认收起（行数由 interaction.js 实测，见 data-collapse-lines）。
   按钮在题解卡内改为轻量文字链：去底色、小字、绿色文字（hover 下划线），
   并与正文隔开一行呼吸空间——此前贴着正文、又与卡片同为绿色底块，成了页面最抢眼的地方 */
.article-lead-body p:last-child { margin-bottom: 0.4em; }
.article-lead .content-toggle { margin-top: 1em; margin-bottom: 0; }
.article-lead .expand-btn,
.article-lead .collapse-btn {
  background: none;
  margin-left: -8px;
  padding: 3px 8px;
  color: var(--accent);
  font-size: 0.78rem;
  opacity: 0.85;
}
.article-lead .expand-btn:hover,
.article-lead .collapse-btn:hover {
  background: none;
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
  transform: none;
}

/* 区块内容形态：短句 chips / 词条条目 */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 1em; }
.chip-row span { background: var(--bg-tertiary); color: var(--text-secondary); border-radius: 999px; padding: 4px 14px; font-size: 14px; }
.entry-item { margin-bottom: 8px; }
.entry-item b { color: var(--text-primary); font-weight: 600; }

/* 多组注释块的分组标题（第 N 则 · 原文首句）——2026-11-10：
   多组文章各组编号都从 ① 重算，靠这行标题把「哪几条注释属于哪一段原文」说清楚。
   底色浅块分层，不用边框/竖条（遵守全站视觉铁律）。 */
.note-group-title {
  margin: 22px 0 10px; padding: 5px 12px;
  font-size: 13px; color: var(--text-secondary);
  background: var(--bg-tertiary); border-radius: 6px;
  font-family: var(--font-read); line-height: 1.65;
}
.note-group-title:first-child { margin-top: 0; }

/* 划词锚点 + 注释弹窗 */
.note-word {
  color: inherit; text-decoration: underline dotted;
  text-underline-offset: 3px; text-decoration-color: var(--text-muted);
  cursor: pointer; border-radius: 3px;
  transition: background 0.15s, text-decoration-color 0.15s;
}
.note-word:hover { text-decoration-color: var(--accent); background: var(--accent-bg); }
.note-popup {
  position: fixed; z-index: 10001; max-width: 360px; min-width: 260px;
  background: var(--bg-secondary); border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 14px 18px; display: none; font-size: 14px; line-height: 1.75; color: var(--text-primary);
  font-family: var(--font-read);
}
.note-popup.show { display: block; }
.note-popup-word { font-size: 17px; font-weight: 700; margin-bottom: 6px; color: var(--accent); }
.note-popup-explain { color: var(--text-secondary); }
/* 生僻字/书名内链（InlinkEngine 注入）+ 弹窗附加行 */
.note-popup-pinyin {
  color: var(--accent); font-size: 15px; margin: -2px 0 4px; font-weight: 600;
}
.note-popup-link {
  display: inline-block; margin-top: 8px; font-size: 13px; color: #fff;
  background: var(--accent); border-radius: 8px; padding: 3px 12px; text-decoration: none;
}
.note-popup-link:hover { opacity: 0.88; }
.inlink-book,
.inlink-poet {
  color: var(--accent); text-underline-offset: 3px;
  text-decoration-color: var(--accent); opacity: 0.95;
  cursor: pointer; font-weight: 500;
}
.inlink-book:hover,
.inlink-poet:hover { opacity: 1; text-decoration-color: var(--accent); }
/* 生僻字命中：与注释划词(.note-word)同风格，仅下划线用主色形成细微分区分 */
.inlink-word {
  color: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent);
  cursor: pointer; border-radius: 3px;
  transition: background 0.2s, text-decoration-color 0.2s;
}
.inlink-word:hover {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  background: var(--accent-bg);
}

/* ===== 收藏图标 ===== */
.wq-faved { color: #f0a500 !important; }

/* ===== 用户角色徽章（参考B站等大厂设计） ===== */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 5px;
  border-radius: 50px;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.6;
  margin-left: 5px;
  vertical-align: middle;
  flex-shrink: 0;
  letter-spacing: 0.02em;
  transition: all 0.2s;
}
/* 管理员：金色渐变徽章 */
.user-badge-admin {
  color: #b45309;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}
html.dark .user-badge-admin {
  color: #fbbf24;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18) 0%, rgba(245, 158, 11, 0.12) 100%);
}
.user-badge-admin::before {
  content: '\f005';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 8px;
}
/* 游客：灰色简约标签 */
.user-badge-guest {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.08);
}
html.dark .user-badge-guest {
  color: #9ca3af;
  background: rgba(156, 163, 175, 0.1);
}
/* 初来乍到：绿色 */
.user-badge-newcomer {
  color: #166534;
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
}
html.dark .user-badge-newcomer {
  color: #4ade80;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.18) 0%, rgba(34, 197, 94, 0.12) 100%);
}
.user-badge-newcomer::before {
  content: '\f135';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 7px;
  margin-right: 1px;
}
/* 活跃用户：蓝色 */
.user-badge-active {
  color: #1d4ed8;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}
html.dark .user-badge-active {
  color: #60a5fa;
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.18) 0%, rgba(59, 130, 246, 0.12) 100%);
}
.user-badge-active::before {
  content: '\f005';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 7px;
  margin-right: 1px;
}
/* 支持者：玫瑰金徽章（带边框，比初来乍到/活跃用户更有辨识度） */
.user-badge-supporter {
  color: #9d174d;
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  border: 1px solid rgba(157, 23, 77, 0.2);
  box-shadow: 0 1px 3px rgba(157, 23, 77, 0.12);
  font-weight: 500;
  padding: 0 6px;
}
html.dark .user-badge-supporter {
  color: #f9a8d4;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.2) 0%, rgba(236, 72, 153, 0.12) 100%);
  border: 1px solid rgba(244, 114, 182, 0.25);
  box-shadow: 0 1px 3px rgba(244, 114, 182, 0.08);
}
.user-badge-supporter::before {
  content: '\f004';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 7px;
  margin-right: 2px;
}

/* 管理员用户名高亮 */
.user-name-admin {
  color: #b45309 !important;
  font-weight: 600;
}
html.dark .user-name-admin {
  color: #fbbf24 !important;
}

/* 子回复分页 */
.reply-pagination {
  display: flex; align-items: center;
  gap: 0.3rem; padding: 8px 0 0;
  font-size: 13px; color: var(--text-muted);
}
.reply-pagination a {
  border-radius: 4px; color: var(--accent);
  padding: 3px 7px; text-decoration: none;
  font-weight: 500; transition: all 0.15s;
}
.reply-pagination a:hover {
  background: rgba(var(--accent-rgb), 0.08);
}
.reply-pagination .current-page {
  color: var(--success); font-weight: 600;
  padding: 3px 7px;
}
.reply-pagination .collapse-btn {
  color: var(--text-muted); cursor: pointer;
  margin-left: 8px; font-size: 13px;
  transition: color 0.15s;
}
.reply-pagination .collapse-btn:hover { color: var(--accent); }

/* 空状态 */
.empty-prompt-w { padding: 40px 0; text-align: center; }
.prompt-null-w { color: var(--text-muted); font-size: 15px; }

/* ===== Emoji 面板（fixed定位，PC端无滚动条，宽度由JS按列数计算） ===== */
.emoji-panel {
  position: fixed; z-index: 10000;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 0.5rem;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

/* ===== 响应式：768px以下 ===== */
@media (max-width: 767px) {
  /* PC发布框隐藏 */
  .wqy-pl .d-none.d-md-block { display: none !important; }

  /* 移动端触发按钮显示 */
  .mobile-comment-trigger { display: flex; }

  /* 调整头像尺寸 */
  .feedbacks .face,
  .feedbacks .face-placeholder {
    height: 38px; width: 38px;
  }
  .feedbacks .msg { margin-left: calc(38px + 10px); }
  /* 移动端子回复通栏：.huifu 无缩进，子回复内容与头像对齐 */
  .feedbacks .huifu { margin-left: 0; padding: 0; }
  .mobile-reply-toggle { margin-left: calc(38px + 10px); }
  .mobile-replies-container { margin-left: 0; }
  /* 子回复在.huifu内通栏，头像38px，内容区左侧对齐头像后 */
  .feedbacks .huifu .reply-item {
    padding-left: calc(38px + 10px);
  }
  .feedbacks .huifu .reply-item .msg {
    margin-left: calc(38px + 10px);
    width: calc(100% - 38px - 10px);
  }

  /* 内容气泡缩减间距 */
  .feedbacks .msg .feedback-content {
    padding: 10px 12px; font-size: 14px;
  }
  .feedbacks .huifu .reply-item .feedback-content {
    padding: 6px 8px; font-size: 15px;
  }

  /* emoji面板居中 */
  .emoji-panel {
    width: calc(100vw - 16px);
    max-width: 340px;
    left: 50% !important;
    transform: translateX(-50%);
  }
}

/* ===== 桌面端：显示.d-md-block ===== */
@media (min-width: 768px) {
  .wqy-pl .d-md-block { display: block !important; }
}

/* ============================================================
   日夜模式（html.dark）适配
   ============================================================ */
html.dark .wqy-pl .b-box-textarea .b-box-content,
html.dark .box-huifu .b-box-textarea .b-box-content,
html.dark .yidong-pinglun .b-box-textarea .b-box-content {
  background-color: var(--bg-tertiary) !important;
  border: none !important;
  color: var(--text-primary) !important;
}
html.dark .yidong-pinglun .baoguo {
  background-color: #1e2229;
  border-top-color: #3d444d;
}
html.dark .yidong-pinglun {
  background-color: #1e2229;
  border-top-color: #3d444d;
}
html.dark .yidong-pinglun .b-submit-button {
  background-color: #1e2229;
}
html.dark .yidong-pinglun .b-box-textarea {
  background-color: #1e2229;
}
html.dark .yidong-pinglun .b-box-textarea .b-box-content {
  background-color: #1e2229;
}
html.dark .yidong-pinglun .b-tuzki {
  background-color: #1e2229;
}
html.dark .b-head-img { opacity: 0.9; }
html.dark .feedbacks .huifu .reply-item {
  border-bottom-color: rgba(255,255,255,0.03);
}
html.dark .feedbacks .comment-block + .comment-block {
  border-top-color: rgba(255,255,255,0.05);
}
html.dark .box-huifu .baoguo { background-color: #2a2a2a; }
html.dark .emoji-panel {
  background: var(--card-bg, #1e2229);
  border-color: #3d444d;
}
html.dark .feedbacks .msg .feedback-content,
html.dark .feedbacks .huifu .reply-item .feedback-content {
  background-color: var(--bg-tertiary, #2a2f37);
}
html.dark .feedbacks .feedback-action .action-left .commentVote.liked,
html.dark .feedbacks .huifu .reply-item .action-left .commentVote.liked { color: #5cb88a !important; }
html.dark .feedbacks .reply-to-text { color: #5cb88a; }

/* ===== 首页收藏按钮（stow_home） ===== */
.stow_home {
  display: inline-flex;
  align-items: center;
}
.stow_home .btn {
  border: 1px solid var(--bg-hover);
  border-radius: var(--radius-full);
  padding: 4px 16px;
  font-size: 0.82rem;
  transition: all var(--transition);
  cursor: pointer;
  background: var(--bg-surface);
  color: var(--text-primary);
}
.stow_home .btn:hover {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.text-zhuse {
  color: var(--accent) !important;
}
.btn-success {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}
.btn-success:hover {
  background: var(--accent-hover) !important;
}

/* ===== 首页标题行：标题+收藏按钮同行 ===== */
.category-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.category-title-row .category-title {
  flex: 1;
  min-width: 0;
}
.category-title-row .stow_home {
  flex-shrink: 0;
}

/* ===== 已校订标识（书名旁低权重浅灰小字 + 点击气泡） ===== */
/* 标题行容器：h1 与「已校订」徽标同行，徽标不进 h1（避免运营标识污染标题文本）
   注：接在 .category-title-row .category-title{flex:1} 之后，故需压回 flex:0 1 auto，
   否则 h1 会撑满容器、把徽标顶到最右。 */
.category-title-line {
  display: flex;
  align-items: baseline;
  min-width: 0;
}
.category-title-line .category-title,
.category-title-row .category-title-line .category-title {
  flex: 0 1 auto;
  min-width: 0;
}

.proofread-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 0;
  font-size: 0.62rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--text-dim);
  background: none;
  border: none;
  border-radius: 0;
  vertical-align: middle;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color .15s ease;
}
.proofread-badge:hover,
.proofread-badge:focus {
  color: var(--text-muted);
  outline: none;
}
.proofread-tip {
  position: fixed;
  z-index: 100000;
  width: 220px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  font-size: 0.8rem;
  line-height: 1.6;
  animation: tipIn .18s ease;
}
.proofread-tip-title {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.84rem;
  margin-bottom: 6px;
}
.proofread-tip-item {
  color: var(--text-secondary);
}
.proofread-tip-stats {
  margin: 4px 0 6px;
  font-size: 0.82rem;
  color: var(--text-primary);
}
.proofread-tip-stats b {
  color: var(--accent);
}
.proofread-tip-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}
.proofread-tip-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
@keyframes tipIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 767px) {
  .proofread-badge {
    margin-left: 6px;
    font-size: 0.55rem;
  }
  .proofread-tip {
    width: 260px;
    max-width: calc(100vw - 32px);
  }
}

/* 文章级校订记录弹窗列表（复用 .proofread-tip 气泡样式） */
.article-fixes-tip {
  width: 360px;
  max-width: calc(100vw - 32px);
  max-height: 72vh;
  overflow-y: auto;
}
.article-fixes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.article-fixes-item {
  padding: 7px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}
.article-fixes-pair {
  font-size: 0.82rem;
  color: var(--text-primary);
}
.article-fixes-pair del {
  color: var(--text-muted);
  text-decoration: line-through;
}
.article-fixes-pair ins {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}
.article-fixes-ctx {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 2px;
}
.article-fixes-reason {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 2px;
}
@media (max-width: 767px) {
  .article-fixes-tip {
    width: 300px;
    max-width: calc(100vw - 32px);
  }
}

/* ===== 论道移动端固定底部触发栏 ===== */
.lundao-mobile-trigger {
  display: none;
}
@media (max-width: 767px) {
  .lundao-mobile-trigger {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0));
    background: var(--bg-card);
    border-top: 1px solid var(--bg-hover);
    font-size: 0.88rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition);
  }
  .lundao-mobile-trigger:hover,
  .lundao-mobile-trigger:active {
    color: var(--accent);
  }
  .lundao-mobile-trigger i {
    font-size: 1rem;
  }
  /* 论道页面底部留出触发栏空间 */
  .lundao-page {
    padding-bottom: 56px;
  }
}

/* ===== 评论区排版：对齐老站（.feedbacks 体系）+ B站风格紧凑化 ===== */
/* --- 一级评论：头像浮动 + margin对齐 --- */
.feedbacks .face {
  border-radius: 50%;
  float: left;
  height: 45px;
  margin-right: 10px;
  object-fit: cover;
  width: 45px;
}
.feedbacks .face-placeholder {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  float: left;
  margin-right: 10px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}
.feedbacks .media-body {
  overflow: hidden;
}
.feedbacks .media-body .feedback-infos .name {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
}
.feedbacks .msg {
  margin-left: calc(45px + 10px);
  padding: 0;
  border-radius: 0;
  margin-bottom: 0;
}
.feedbacks .msg .feedback-content {
  background: var(--bg-tertiary);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.7;
  margin-top: 2px;
  padding: 10px 14px;
}
.feedbacks .msg .feedback-content img {
  height: auto;
  max-height: 18px;
  max-width: 18px;
  vertical-align: middle;
}
.feedbacks .feedback-action {
  font-size: 13px;
  margin-top: 4px;
  padding-left: 10px;
}
.feedbacks .feedback-action > .d-flex {
  width: 100%;
}
.feedbacks .feedback-action .action-left {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 0.5rem;
}
.feedbacks .feedback-action .action-left span {
  font-size: 13px;
}
.feedbacks .feedback-action .action-left a,
.feedbacks .feedback-action .action-left a:link,
.feedbacks .feedback-action .action-left a:visited {
  color: var(--text-muted) !important;
  font-size: 13px;
  text-decoration: none !important;
}
.feedbacks .feedback-action .action-left a:hover {
  color: var(--accent) !important;
}
.commentVote:hover {
  opacity: 0.8;
}

/* --- 子回复区域（对齐老站 .huifu） --- */
.feedbacks .huifu {
  margin-left: calc(45px + 10px);
  padding: 0;
  margin-top: 2px;
}
.feedbacks .huifu .reply-item {
  padding: 3px 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle, rgba(128,128,128,0.08));
}
.feedbacks .huifu .reply-item:last-child { border-bottom: none; }
.feedbacks .huifu .reply-item .face {
  flex-shrink: 0;
  border-radius: 50%;
  height: 30px;
  margin-right: 8px;
  object-fit: cover;
  width: 30px;
  float: none;
}
.feedbacks .huifu .reply-item .face-placeholder {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 8px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.7rem;
  float: none;
}
.feedbacks .huifu .reply-item .media-body {
  flex-shrink: 0;
  overflow: visible;
}
.feedbacks .huifu .reply-item .media-body .feedback-infos .name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  white-space: nowrap;
  font-size: 13px;
}
.feedbacks .huifu .reply-item .msg {
  margin-left: 0;
  margin-top: 3px;
  width: 100%;
  flex: 0 0 100%;
}
.feedbacks .huifu .reply-item .feedback-content {
  background: var(--bg-tertiary);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.7;
  margin-top: 0;
  padding: 6px 10px;
}
.feedbacks .huifu .reply-item .feedback-content img {
  height: auto;
  max-height: 18px;
  max-width: 18px;
  vertical-align: middle;
}
.feedbacks .huifu .reply-item .feedback-action {
  padding-left: 8px;
  margin-top: 2px;
  font-size: 13px;
}
.feedbacks .huifu .reply-item .action-left {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 0.5rem;
}
.feedbacks .huifu .reply-item .action-left a,
.feedbacks .huifu .reply-item .action-left a:link,
.feedbacks .huifu .reply-item .action-left a:visited {
  color: var(--text-muted) !important;
  font-size: 13px;
  text-decoration: none !important;
}
.feedbacks .huifu .reply-item .action-left a:hover {
  color: var(--accent) !important;
}

/* --- 回复提示文字 --- */
.feedbacks .reply-to-text {
  color: var(--success);
  font-size: 13px;
  font-weight: 400;
}
.feedbacks .reply-to-text::before {
  content: '回复 ';
  color: var(--text-muted);
  font-size: 13px;
}

/* --- 操作按钮布局：删除按钮推到最右 --- */
.action-right {
  margin-left: auto;
  flex-shrink: 0;
}

/* --- 删除按钮 --- */
.delete-comment-icon {
  border-radius: 4px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  transition: all 0.2s;
}
.delete-comment-icon:hover {
  color: #dc3545;
}

/* --- 子回复展开/收起 --- */
.mobile-reply-toggle {
  cursor: pointer;
  display: inline;
  margin: 2px 0;
}
.mobile-reply-toggle .reply-count {
  color: var(--accent);
  font-size: 13px;
  padding-left: 12px;
}
.mobile-replies-container {
  margin-top: 2px;
}
.mobile-replies-header {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0 2px 0;
  font-weight: 400;
  margin-bottom: 2px;
}
@media (min-width: 576px) {
  .mobile-replies-header {
    display: none;
  }
}
.feedbacks .comment-block {
  padding-bottom: 0.35rem;
  position: relative;
}
.feedbacks .comment-block + .comment-block {
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border-subtle, rgba(216,211,202,0.4));
}

/* --- 移动端适配 --- */
@media (max-width: 768px) {
  .feedbacks .face {
    height: 36px;
    margin-right: 8px;
    width: 36px;
  }
  .feedbacks .face-placeholder {
    width: 36px;
    height: 36px;
    margin-right: 8px;
  }
  .feedbacks .msg {
    margin-left: calc(36px + 8px);
  }
  .feedbacks .huifu {
    margin-left: 0;
    padding: 0;
    margin-top: 2px;
  }
  .feedbacks .huifu .mobile-reply-toggle {
    margin-left: calc(36px + 8px);
  }
  .feedbacks .huifu .reply-item .face {
    height: 26px;
    margin-right: 6px;
    width: 26px;
  }
  .feedbacks .huifu .reply-item .face-placeholder {
    width: 26px;
    height: 26px;
    margin-right: 6px;
    font-size: 0.6rem;
  }
  .feedbacks .huifu .reply-item .msg {
    margin-left: 0;
  }
  .feedbacks .huifu .reply-item .feedback-content {
    font-size: 15px;
    padding: 6px 8px;
  }
  /* 移动端：.reply-item 改用浮动布局，与一级评论对齐 */
  .feedbacks .huifu .reply-item {
    display: block;
    padding: 3px 6px;
  }
  .feedbacks .huifu .reply-item .face,
  .feedbacks .huifu .reply-item .face-placeholder {
    float: left;
  }
  .feedbacks .huifu .reply-item .media-body {
    overflow: hidden;
  }
  .feedbacks .huifu .reply-item .msg {
    margin-left: calc(26px + 6px);
    width: auto;
    flex: none;
  }
}

/* ===== Back to Top ===== */
.back-to-top {
  align-items: center;
  background: var(--bg-card);
  border-radius: 50%;
  bottom: 24px;
  box-shadow: var(--shadow-lg);
  color: var(--text-heading);
  cursor: pointer;
  display: flex;
  font-size: 18px;
  height: 48px;
  justify-content: center;
  position: fixed;
  right: 20px;
  transition: transform 0.2s, background var(--transition), color var(--transition);
  width: 48px;
  z-index: 90;
}
.back-to-top:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-2px);
}
.back-to-top[hidden] { display: none; }

/* ===== 音频播放器（neirong_mp3.htm 道德经/三字经） ===== */
.reading-audio {
  text-align: center;
  padding: 0.75rem 0 0.5rem;
}
.reading-audio audio {
  width: 100%;
  max-width: 400px;
  height: 40px;
  border-radius: 20px;
  outline: none;
}
.reading-audio audio::-webkit-media-controls-panel {
  background: var(--bg-card);
  border-radius: 20px;
}



/* ===== 页面加载遮罩（工具页通用，CSS 变量自动适配暗色模式） ===== */
.page-loader-overlay {
  position: fixed; inset: 0; z-index: 99998;
  background: var(--bg-primary, #f8fafc);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
  transition: opacity 0.25s ease;
}
.page-loader-overlay.is-hidden {
  opacity: 0; pointer-events: none;
}
.page-loader-overlay .loader-spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border, #e2e8f0);
  border-top-color: var(--accent, #6366f1);
  border-radius: 50%;
  animation: page-loader-spin 0.8s linear infinite;
}
.page-loader-overlay .loader-text {
  color: var(--text-muted, #928c7e);
  font-size: 0.9rem;
  font-weight: 500;
}
@keyframes page-loader-spin { to { transform: rotate(360deg); } }

/* 图片加载骨架脉冲 — 日夜自适应 */
@keyframes wu-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ====================================
   伴读书童 AI 注样式 - 极简，仅徽章区分
   ==================================== */
.comment-block--ai {
  padding: 0.3rem 0;
  position: relative;
}

/* AI 徽章 — 浅绿底，与本站 accent-bg 一致 */
.user-badge-ai {
  color: var(--accent);
  background: var(--accent-bg);
  font-weight: 500;
  font-size: 0.72rem;
  padding: 1px 6px;
  border-radius: 4px;
  border: none;
}

/* ====================================
   评论操作行图标（点赞/回复）+ 点赞态实心
   ==================================== */
.feedbacks .feedback-action .action-left a,
.feedbacks .huifu .reply-item .action-left a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.feedbacks .feedback-action .action-left .commentVote.liked i,
.feedbacks .huifu .reply-item .action-left .commentVote.liked i {
  font-weight: 900;
}

/* ====================================
   PC 回复框浮层（日间/暗色统一层级，不再与页面背景融为一体）
   ==================================== */
.box-huifu {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 12px;
  box-shadow: var(--shadow-sm);
}
.box-huifu .baoguo {
  padding-top: 2px;
  padding-bottom: 2px;
}

/* ====================================
   评论加载失败重试
   ==================================== */
.comment-load-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.comment-load-error i {
  font-size: 1.6rem;
  opacity: 0.4;
}
.comment-retry-btn {
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.comment-retry-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* 评论空状态图标 */
.empty-prompt-w .empty-icon {
  display: inline-block;
  font-size: 1.8rem;
  color: var(--text-dim);
  opacity: 0.5;
  margin-bottom: 8px;
}

/* ====================================
   相关视频区块（B站嵌入） — 2026-09-20（2026-09-21 视觉升级）
   结构：.vsection 容器 + .vgrid 卡片网格 + .vplayer 播放器视图
   风格：与阅读页模块同语言——面板背景色分层（.vsection 面板 + .vcard 卡片两层），
         随阅读背景亮度自动跟随（var(--read-bg)）；零边框 · 药丸交互 · 日夜双主题
   布局：data-visible 1→单卡行式铺满 / 2→两列 / 3→三列 / 4→四列（桌面基准 4 列；≤900 平板 2 列 / ≤767 移动行式卡）
   ==================================== */
/* hidden 属性需压过组件自身 display（.vgrid 是 grid、.vplayer 是 block）——限定本组件，不外溢 */
.vsection [hidden] { display: none !important; }

/* 区块面板：背景降一档（项目「背景色分层」语言），卡片在面板内再浮起一层 */
.vsection {
  background: var(--read-bg, var(--bg-secondary));
  border-radius: var(--radius-lg);
  padding: 14px 16px 16px;
  margin: 4px 0 32px;
}
.vsection-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 10px;
}
.vsection-title {
  font-size: 0.92rem; font-weight: 600; margin: 0;
  color: var(--text-primary);
}
.vsection-src { font-size: 0.72rem; color: var(--text-dim); }
.vsection-right { display: flex; align-items: center; gap: 10px; }
/* 文字链按钮：inline-flex 垂直居中统一三按钮（含图标与文字），消除字符行高差异导致的高低不齐 */
.vrefresh {
  display: inline-flex; align-items: center; gap: 4px; line-height: 1.6;
  background: none; border: none; padding: 2px 6px; border-radius: var(--radius-xs);
  color: var(--accent); font-size: 0.78rem; font-family: inherit; cursor: pointer;
  transition: background var(--transition);
}
.vrefresh:hover { background: var(--accent-bg); }

/* --- 收起入口（收起态为一行，点击展开卡片区；图标色块 + 悬停动效，保证收起态依然醒目） --- */
.vintro {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 2px 0; border: none; background: none;
  font-family: inherit; font-size: 0.92rem; font-weight: 600;
  color: var(--text-primary); text-align: left; cursor: pointer;
}
.vintro-count { font-size: 0.76rem; color: var(--text-dim); font-weight: 400; }
.vintro-arrow {
  margin-left: auto; display: inline-flex; align-items: center;
  color: var(--text-dim);
  transition: transform var(--transition), color var(--transition);
}
.vintro:hover .vintro-arrow { transform: translateX(3px); color: var(--accent); }
.vsection--collapsed .vsection-head,
.vsection--collapsed .vgrid,
.vsection--collapsed .vplayer { display: none; }
.vsection:not(.vsection--collapsed) .vintro { display: none; }

/* --- 卡片网格（数量自适应：1 行式铺满 / 2 两列 / 3 三列 / 4 四列，数值由 JS 按批次维护；桌面基准 4 列——缩小封面权重、标题更突出） --- */
.vgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
/* 单卡占不满一行会显得空旷：少卡时放大铺满（桌面 / 平板） */
@media (min-width: 768px) {
  .vgrid[data-visible="1"] { grid-template-columns: 1fr; }
  .vgrid[data-visible="1"] .vcard { display: flex; align-items: stretch; }
  .vgrid[data-visible="1"] .vcover { flex: 0 0 46%; }
  .vgrid[data-visible="1"] .vbody { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 14px 20px; }
  .vgrid[data-visible="1"] .vtitle { font-size: 1rem; -webkit-line-clamp: 3; margin-bottom: 10px; }
  .vgrid[data-visible="2"] { grid-template-columns: repeat(2, 1fr); }
  .vgrid[data-visible="3"] { grid-template-columns: repeat(3, 1fr); }
}
/* 卡片在面板上浮起一层（背景色分层第三级） */
.vcard {
  background: var(--read-bg, var(--bg-card));
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition), background var(--transition), box-shadow var(--transition);
  outline: none;
}
.vcard:hover, .vcard:focus-visible {
  transform: translateY(-2px);
  background: var(--read-bg, var(--bg-card-hover));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}
/* 封面比例 8:5 = B站封面实际交付比例（实测 1728x1080 / 1332x833 均 1.6:1）：比例匹配 = cover 即完整显示，不裁切 */
.vcover {
  position: relative;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  background: var(--bg-tertiary);
}
.vcover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.35s ease;
}
.vcard:hover .vcover img { transform: scale(1.05); }
.vdur {
  position: absolute; right: 8px; bottom: 8px;
  background: rgba(0, 0, 0, 0.72); color: #fff;
  font-size: 0.7rem; font-variant-numeric: tabular-nums;
  padding: 2px 7px; border-radius: var(--radius-xs);
}
/* 播放按钮不再压住封面：默认隐藏，悬停/键盘聚焦时淡入（如 B站桌面端；触屏直接点卡片播放，不依赖此按钮） */
.vplay {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: background var(--transition), transform var(--transition), opacity var(--transition);
}
.vcard:hover .vplay, .vcard:focus-visible .vplay {
  opacity: 1;
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1);
}

.vbody { padding: 10px 12px 12px; }
.vtitle {
  font-size: 0.88rem; font-weight: 500; line-height: 1.5; margin: 0 0 6px;
  color: var(--text-primary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition);
}
.vcard:hover .vtitle { color: var(--accent); }
.vmeta {
  font-size: 0.72rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.vowner { color: var(--text-muted); }
.vsep { color: var(--text-dim); }

/* 批次轮换：隐藏非当前批卡片（.vgrid 前缀提升优先级，防 767px 媒体查询 .vcard{display:flex} 覆盖） */
.vgrid .vcard--off { display: none; }

/* --- 播放器视图 --- */
.vplayer { display: block; }
.vframe-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
}
.vframe-slot {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; display: block;
}
/* 播放器 iframe：四边拉伸（top/left/right/bottom:0）定尺寸，不用 height:100%——
   部分国产内核（华为 ArkWeb 实测 2026-09-21）把绝对定位 iframe 的百分比高度解析为 0，
   播放器区域整块空白；四边拉伸是 CSS2 基础行为，全内核兼容（JS 侧另有尺寸自检兜底） */
.vframe-slot iframe {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  width: auto; height: auto;
  border: 0; display: block;
}
/* 原生兜底播放器（iframe 被广告过滤折叠时切换为 <video> 直连流，2026-09-21）：与 iframe 同槽位铺满 */
.vframe-slot video {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  object-fit: contain; background: #000;
}
.vframe-loading {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: var(--shimmer);
  background-size: 200% 100%;
  animation: vshimmer 1.6s linear infinite;
  color: var(--text-muted); font-size: 0.82rem;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.vframe-wrap:not(.loading) .vframe-loading { opacity: 0; visibility: hidden; }
@keyframes vshimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.vspinner {
  width: 26px; height: 26px;
  border: 3px solid var(--bg-tertiary);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: vspin 0.8s linear infinite;
}
@keyframes vspin { to { transform: rotate(360deg); } }
.vframe-fail {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--bg-secondary);
  color: var(--text-muted); font-size: 0.88rem;
}
.vfail-msg { margin: 0; }

/* --- 播放器信息区 --- */
.vp-info { padding: 14px 4px 2px; }
.vp-title {
  font-size: 1rem; font-weight: 600; line-height: 1.55; margin: 0 0 8px;
  color: var(--text-primary);
}
.vp-meta {
  font-size: 0.78rem; color: var(--text-muted);
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px;
}
.vp-owner { color: var(--accent); font-weight: 500; }
.vp-dot { color: var(--text-dim); }
.vp-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.vp-note { font-size: 0.72rem; color: var(--text-dim); margin: 12px 0 0; line-height: 1.6; }

/* --- 视频块内药丸按钮（v- 前缀，不与全站任何类共用） --- */
.vbtn {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg-hover); color: var(--text-secondary);
  border: none; border-radius: var(--radius-full);
  padding: 7px 16px; font-size: 0.82rem; font-family: inherit;
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
  text-decoration: none;
}
.vbtn:hover { background: var(--bg-active); color: var(--accent); }
.vbtn-accent { background: var(--accent-bg); color: var(--accent); }
.vbtn-accent:hover { background: var(--accent-bg-hover); color: var(--accent-hover); }

/* --- 播放模式：面板内边距归零、视频嵌满面板顶部（顶部圆角由面板裁切）；信息区自带内边距 --- */
.vsection.playing { padding: 0; overflow: hidden; }
.vsection.playing .vsection-head { display: none; }
.vsection.playing .vframe-wrap { border-radius: 0; }
.vsection.playing .vplayer { padding-bottom: 8px; }
.vsection.playing .vp-info { padding: 14px 18px 0; }
.vsection.playing .vchapters { padding: 12px 18px 0; }
.vsection.playing .vmini { padding: 14px 18px 8px; }

/* --- 播放器下方：其他视频（横向小卡） --- */
.vmini {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 14px 2px 6px;
  margin-top: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.vmini:empty { display: none; }
.vmini-item {
  flex: 0 0 148px;
  scroll-snap-align: start;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: transform var(--transition);
  outline: none;
}
.vmini-item:hover { transform: translateY(-2px); }
.vmini-cover {
  position: relative;
  aspect-ratio: 8 / 5;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tertiary);
}
.vmini-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vmini-item.active .vmini-cover { box-shadow: 0 0 0 2px var(--accent); }
.vmini-dur {
  position: absolute; right: 5px; bottom: 5px;
  background: rgba(0, 0, 0, 0.72); color: #fff;
  font-size: 0.62rem; padding: 1px 5px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.vmini-title {
  font-size: 0.74rem; line-height: 1.45; margin-top: 6px;
  color: var(--text-secondary);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.vmini-item.active .vmini-title { color: var(--accent); }

/* --- 选集面板（多P 合集） --- */
.vchapters { padding: 12px 2px 2px; }
.vchapters-head {
  font-size: 0.8rem; color: var(--text-muted);
  display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px;
}
.vchapters-head b { color: var(--text-primary); font-weight: 600; font-size: 0.85rem; }
.vchapters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
  max-height: 152px;
  overflow-y: auto;
  padding-right: 2px;
}
.vchap {
  background: var(--bg-hover); border: none; border-radius: var(--radius-xs);
  color: var(--text-secondary); font-size: 0.78rem; font-family: inherit;
  padding: 8px 0; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.vchap:hover { background: var(--bg-active); color: var(--accent); }
.vchap.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }

/* --- 平板：2 列网格 --- */
@media (max-width: 900px) {
  .vgrid { grid-template-columns: repeat(2, 1fr); }
}

/* --- 移动端（≤767px，对齐阅读页断点）：行式卡 + 播放贴边 --- */
@media (max-width: 767px) {
  .vsection { padding: 12px; margin: 4px 0 24px; }
  .vsection-head { margin-bottom: 10px; }
  /* 卡片改行式（左封面右文字）：相比单列大卡纵向省 60% 空间；封面 110px（8:5 完整显示不裁切、垂直居中成缩略图）压低图片权重、文字区更宽 */
  .vgrid { grid-template-columns: 1fr; gap: 10px; }
  .vcard { display: flex; align-items: stretch; }
  .vcover { flex: 0 0 110px; aspect-ratio: 8 / 5; align-self: center; border-radius: var(--radius-xs); }
  .vbody { flex: 1; min-width: 0; padding: 6px 10px; display: flex; flex-direction: column; justify-content: center; }
  .vtitle { font-size: 0.84rem; margin-bottom: 4px; }
  .vmeta { font-size: 0.68rem; }
  /* 触屏无悬停：播放按钮不显示（B站移动端同款，封面保持干净；点卡片任意处即播放） */
  .vplay { display: none; }
  .vdur { font-size: 0.62rem; right: 5px; bottom: 5px; padding: 1px 5px; }
  /* 头部一行元素临界占满（实测 390 宽恰好排满 100%）：移动端隐藏来源说明、「全部」省略数量数字，给按钮留出呼吸空间 */
  .vsection-src { display: none; }
  .vall-n { display: none; }
  /* 播放器信息区收紧 */
  .vp-info { padding: 10px 2px 0; }
  .vp-title { font-size: 0.92rem; margin-bottom: 6px; }
  .vp-meta { font-size: 0.72rem; margin-bottom: 10px; }
  .vp-note { font-size: 0.66rem; margin-top: 8px; }
  .vmini { padding: 10px 2px 4px; gap: 8px; }
  .vmini-item { flex-basis: 118px; }
  .vmini-title { font-size: 0.68rem; margin-top: 4px; }
  .vbtn { padding: 6px 13px; font-size: 0.78rem; }
  .vrefresh { font-size: 0.74rem; }
  /* 播放模式：视频满宽贴边。负 margin = 补齐阅读容器内边距
     （移动端 reading-page 左右为 0，仅 reading-measure clamp(12px,2vw,22px)），实现真正的全宽播放；
     满宽时面板化样式（背景/圆角）让位给全宽视频 */
  .vsection.playing {
    margin-left: calc(0px - clamp(12px, 2vw, 22px));
    margin-right: calc(0px - clamp(12px, 2vw, 22px));
    border-radius: 0;
    background: transparent;
  }
  .vsection.playing .vp-info { padding: 12px 12px 0; }
  .vsection.playing .vmini { padding: 12px 12px 8px; }
  .vsection.playing .vchapters { padding: 12px 12px 0; }
  .vchapters-grid { grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; max-height: 120px; }
  .vchap { font-size: 0.72rem; padding: 7px 0; }
}

/* ===== 首页·休闲娱乐游戏卡片（2026-09-30 重构：零边框、纯背景色分层，与 hotbook/category-link 同语言；图标为游戏语义符号「将/黑白子/斗/龙/弈」，非装饰封面；2026-10-01 增成语接龙第4卡；2026-10-03 增围棋第5卡） ===== */
.game-grid {
  display: grid;
  /* 2026-10-03 用户指定：桌面固定一行 2 个（弃 auto-fit 一行 4 个，避免卡片过窄拥挤） */
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
/* 移动端单列（与站内区块断点对齐）
   单列必须写 minmax(0, 1fr)：裸 1fr 的最小值是 min-content，
   卡内不折行的长文本会把列撑出屏幕（实测 320px 下整页横向溢出 2px，
   340px 起才正常）。同 .uc-read-list 的处理。 */
@media (max-width: 767px) {
  .game-grid { grid-template-columns: minmax(0, 1fr); }
}
.game-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(43, 38, 31, 0.55);
  border-radius: 10px;
  text-decoration: none;
  transition: background var(--transition);
}
html.light .game-card { background: var(--bg-surface); }
.game-card:hover { background: var(--accent-bg); }
/* 图标基座：46px 色块（主题色微渐变模拟棋子光泽），汉字楷体优先（覆盖宋体栈，还原刻字韵味） */
.game-card-cover {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "STKaiti", "KaiTi", "楷体", var(--font-read), serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}
.game-card-cover.is-cchess { background: radial-gradient(circle at 50% 38%, rgba(181, 70, 47, 0.26), rgba(181, 70, 47, 0.13)); color: #c0553c; }
.game-card-cover.is-gomoku { background: radial-gradient(circle at 50% 38%, rgba(85, 107, 122, 0.28), rgba(85, 107, 122, 0.15)); }
.game-card-cover.is-ddz { background: radial-gradient(circle at 50% 38%, rgba(168, 128, 44, 0.28), rgba(168, 128, 44, 0.15)); color: #b0852f; }
/* 成语接龙：玉青（与成语站按钮 /jielong 入口同色语言） */
.game-card-cover.is-jielong { background: radial-gradient(circle at 50% 38%, rgba(78, 143, 114, 0.28), rgba(78, 143, 114, 0.15)); color: #4e8f72; }
/* 围棋：木褐（棋枰木色语言，区分于象棋赭红/五子棋青灰/斗地主琥珀金/接龙玉青） */
.game-card-cover.is-weiqi { background: radial-gradient(circle at 50% 38%, rgba(154, 107, 61, 0.30), rgba(154, 107, 61, 0.16)); color: #9a6b3d; }
/* 跳棋：湖蓝（棋盘蓝绿棋珠语言，区分于围棋木褐/五子棋青灰） */
.game-card-cover.is-tiaoqi { background: radial-gradient(circle at 50% 38%, rgba(64, 122, 170, 0.28), rgba(64, 122, 170, 0.15)); color: #407aaa; }
/* 华容道：赭石（曹操木块的暗赭石语言，区别于象棋赭红/围棋木褐） */
.game-card-cover.is-hrd { background: radial-gradient(circle at 50% 38%, rgba(146, 94, 62, 0.28), rgba(146, 94, 62, 0.15)); color: #925e3e; }
/* 飞花令：绯桃（花瓣绯色语言，区别于象棋赭红/跳棋湖蓝/接龙玉青） */
.game-card-cover.is-feihua { background: radial-gradient(circle at 50% 38%, rgba(210, 106, 136, 0.28), rgba(210, 106, 136, 0.14)); color: #d26a88; }
/* 猜谜：靛紫（灯谜纸签的墨色语言，区别于跳棋湖蓝/飞花令绯桃） */
.game-card-cover.is-caimi { background: radial-gradient(circle at 50% 38%, rgba(107, 95, 168, 0.28), rgba(107, 95, 168, 0.15)); color: #6b5fa8; }
/* 数独：青瓷（九宫格纸面的青灰语言，色相在青与蓝之间，与跳棋湖蓝/接龙玉青均不同类） */
.game-card-cover.is-sudoku { background: radial-gradient(circle at 50% 38%, rgba(47, 138, 138, 0.28), rgba(47, 138, 138, 0.15)); color: #2f8a8a; }
/* 五子棋：黑白双子球面质感（高光+边缘明暗，模拟真实棋子） */
.is-gomoku .game-card-glyph { display: inline-flex; align-items: center; gap: 4px; }
.is-gomoku .game-card-glyph i { display: block; width: 13px; height: 13px; border-radius: 50%; }
.is-gomoku .stone-black { background: radial-gradient(circle at 34% 28%, #5d554a 0%, #37312a 48%, #1d1a16 100%); }
.is-gomoku .stone-white { background: radial-gradient(circle at 34% 28%, #ffffff 0%, #f0e9d8 52%, #cbc0a3 100%); }
.game-card-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.game-card-name {
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
}
.game-card:hover .game-card-name { color: var(--accent-hover); }
.game-card-desc { color: var(--text-muted); font-size: 0.76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 防御性保留：旧缓存页（FastCGI/浏览器）可能残留箭头结构（首页重建后即无） */
.game-card-go { display: none; }

/* ===== 游戏页·底部「更多游戏」推荐块（2026-10-03）：完整复用 .game-grid/.game-card 视觉语言（零新增卡片样式），
   区块仅负责限宽居中 + 标题图标着色；5 页统一 720px（实测窄于 ~600px 时 2 列会因子卡片 nowrap 的 min-content 溢出，故不按页收窄）；
   width:100% 必需：doudizhu 页 body 为列向 flex，仅靠 margin:auto 会使区块收缩为 fit-content（实测仅 623px）；
   各游戏页排除当前游戏后展示其余 4 款 ===== */
.wg-more-games { width: 100%; max-width: 720px; margin: 28px auto 14px; padding: 0 14px; }
.wg-more-games .category-block-title i { color: var(--accent); font-size: 0.85em; margin-right: 0.45rem; }

/* ===== 首页·热门内容书卡网格（2026-09-30 重构：零边框零描边、纯背景色分层，对齐站内 category-link 语言） ===== */
.hotbook-grid {
  display: grid;
  /* 248+248+248+248+gap30 = 1022 ≤ 内容区 1048，确保 1280/1366/1920 均稳定 4 列（255 时会差 2px 掉到 3 列） */
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 10px;
}
.hotbook {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  background: rgba(43, 38, 31, 0.55);
  border-radius: 10px;
  text-decoration: none;
  transition: background var(--transition);
}
html.light .hotbook { background: var(--bg-surface); }
.hotbook:hover { background: var(--accent-bg); }
.hotbook-body { min-width: 0; display: flex; flex-direction: column; gap: 3px; justify-content: center; }
.hotbook-name-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.hotbook-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition);
}
.hotbook:hover .hotbook-name { color: var(--accent-hover); }
.hotbook-tag { flex: none; font-size: 0.66rem; color: var(--text-muted); }
.hotbook-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
/* 防御性保留：旧缓存页可能残留 .hotbook-hint 元素，禁止裸文本外露（首页静态重建后即无） */
.hotbook-hint { display: none; }

/* ===== 栏目阅读页（liebiao_read.htm，茶经试点）===== */
.category-header--reading {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 0.8rem;
  padding: 0.4rem 0 0.2rem;
}
.category-header--reading .category-title {
  color: var(--text-primary);
  font-size: clamp(1.45rem, 3.4vw, 1.85rem);
  letter-spacing: 0.02em;
  margin-bottom: 0.45rem;
}
.category-header--reading .category-description {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-bottom: 0;
}

/* 栏目题解：与正文同字号/行高，空段隐藏 */
.category-intro {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  /* 与 .la-item 同内边距：导语文字和下方篇目文字共用一条左基线 */
  padding: 1rem 1.25rem;
}
.category-intro > p,
.category-intro > div {
  margin: 0 0 var(--read-para-margin);
  text-align: justify;
}
.category-intro > p:last-child,
.category-intro > div:last-child {
  margin-bottom: 0;
}
.category-intro > p:empty,
.category-intro > div:empty {
  display: none;
}
/* 栏目无题解时不留空白卡片 */
.category-intro:empty {
  display: none;
}
.category-intro img {
  border-radius: var(--radius);
  height: auto;
  max-width: 100%;
}
@media (max-width: 640px) {
  /* 与 .la-item 的移动端内边距同步，避免导语文字比篇目文字多缩进 */
  .category-intro {
    padding: 0.8rem 1rem;
  }
}

/* 列表页无卡片导语（liebiao.htm）：与标题同左基线，无卡片、无分隔线 */
.category-intro--plain {
  background: none;
  border-radius: 0;
  box-shadow: none;
  color: var(--text-secondary);
  padding: 0 0 1rem;
  margin-bottom: 1.25rem;
}

/* 栏目文章列表：标题更醒目、摘要两行截断 */
.la-list-wrap--reading {
  margin-top: 0.2rem;
}
.la-list-wrap--reading .la-item-title {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 4px;
}
.la-list-wrap--reading .la-item-desc {
  color: var(--text-secondary);
  display: -webkit-box;
  font-size: 0.86rem;
  line-height: 1.65;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* 篇目导航：上一篇 / 全书目录 / 下一篇 */
.category-navigation {
  margin-top: 1.8rem;
}
.category-navigation .chapter-nav-wrapper {
  gap: 8px;
}
.prenext-home {
  background: var(--bg-hover);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  flex: none;
  font-size: 0.82rem;
  /* 覆盖 .prenext-link 的 220px 最小宽度，否则 PC 三件套会被挤成多行 */
  min-width: 0;
  padding: 8px 16px;
}
.prenext-home:hover {
  background: var(--accent-bg);
  color: var(--accent);
}

/* 移动端底栏只留箭头图标，避免长标题撑破 */
.bottom-nav-chapter-nav .prenext-link {
  font-size: 0;
  gap: 0;
}
.bottom-nav-chapter-nav .prenext-link i {
  font-size: 1rem;
}



/* 热门书卡·紧凑档（≤880px：网格至多 2 列的区间；纯色块零装饰，与同区块 category-list 同语言） */
@media (max-width: 880px) {
  .hotbook-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .hotbook { padding: 8px 10px; }
  .hotbook-body { gap: 2px; }
  .hotbook-name-row { flex-direction: column; align-items: flex-start; gap: 1px; }
  .hotbook-name {
    font-size: 0.8rem;
    line-height: 1.3;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .hotbook-tag { font-size: 0.6rem; }
  .hotbook-desc { display: none; }
}

/* ===== 分组锚点索引条（通用组件，2026-10-28） =====
   用法：<nav class="anchor-index" data-anchor-index data-anchor-scope=".book-sections"></nav>
   由 anchor-index.js 扫描 scope 内 section[id] 自动生成「名称 + 条数」链接。
   视觉：纯背景色块分层、零边框（全站铁律）；吸顶依赖祖先无 overflow。 */
.anchor-index {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px 0;
  background: var(--read-bg, var(--bg-primary));
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
/* JS 未生成链接时（无脚本/未初始化）不留空行 */
.anchor-index:empty { display: none; }
.anchor-index::-webkit-scrollbar { display: none; }
.anchor-index-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 11px;
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}
.anchor-index-link:hover { background: var(--accent-bg); color: var(--accent); }
.anchor-index-link.is-active { background: var(--accent); color: #fff; }
.anchor-index-link em {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 400;
  opacity: 0.72;
}
/* 无内容的占位字母（百家姓 E/I/R/U/V、组词造句 L/U/V）：只留格子不可点，真实反映收录范围 */
.anchor-index-disabled {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; padding: 6px 9px; border-radius: 8px;
  color: var(--text-dim, #6e685c); font-size: 0.84rem; font-weight: 600; opacity: 0.38;
}
/* 锚点落点避开吸顶条 */
.anchor-index-target { scroll-margin-top: 58px; }
@media (max-width: 767px) {
  .anchor-index-link { padding: 6px 9px; font-size: 0.8rem; }
  .anchor-index-disabled { min-width: 28px; padding: 6px 7px; font-size: 0.8rem; }
  .anchor-index-target { scroll-margin-top: 52px; }
}
/* ============================================================
   2026-10-30 · 新皮肤覆盖层（视觉向孙子兵法英文版对齐）
   ------------------------------------------------------------
   本段起是「覆盖层」：上方是原有规则，这里以同等或更高优先级改写。
   · 新增视觉调整 → 追加到本文件最末尾，不要回头改上方原有规则
   · 生效方式：不改模板、不新增文件，改完即生效
     （nginx 对本文件返回 Cache-Control: no-cache，浏览器每次回源校验）
   · 回滚：用 tast/backup/style-v2.css.20261030.bak 覆盖本文件

   【英文版的设计语言（实测提取）】
   · 强对比：h1 clamp(44,8vw,86)px vs kicker 12px —— 落差 7 倍
   · 零阴影、零边框，层级只靠背景色明度
   · 控件统一药丸形（radius 999px）
   · 卡片 bg-card，hover 升一档到 bg-tertiary，从不用强调色当 hover
   · 强调色只出现在 kicker 文字与 primary 按钮

   【中文版必须保留的】
   · 侧栏章节树 / 阅读设置 / 打赏 —— 全部保留，只减重
   · 条目分三形态（正文预览块 / 短标题 / 回目标题），不能一刀切

   【作用域（2026-10-30 上线前逐项核实）】
   · .topbar-wrap 仅存在于 top.htm（index.htm / search.htm / shouye.htm /
     hanzi/index.htm 四页引入）；hanzi 词条页与 poet 用 hz-topbar-wrap，互不影响
   · .settings-* 与 .reading-settings-* 仅被 reading_settings.htm 使用
   · .container 的 1180px 作用于全站容器，工具页内部各有更小的 max-width 包裹
   ============================================================ */

/* ---------- 0. 版心：1152 → 1180（对齐 --sz-maxw） ---------- */
.container { max-width: 1180px; }

/* ---------- 0b. 顶栏：从「裸浮的一排字」变「一层玻璃」 ---------- */
/* 「头重脚轻」的根源不只是宽度差 28px，而是顶栏完全没有载体：透明背景、无边框、无背景色，
   一排高密度控件（logo + 4 个药丸 + 搜索框 + 主题 + 头像）悬在页面最上方，
   而下方内容全是边界清晰的色块 —— 上面没有「层」，下面层层叠叠。

   英文版 .sz-head 的处理：sticky + 88% 主题底色 + blur(14px)，内部 .sz-head-in 限宽 1180。
   即「背景铺满视口、内容限宽版心」，滚动时正文从玻璃下面穿过。照此办理。 */
.topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 80;
  margin-bottom: 0 !important;
  background: color-mix(in srgb, var(--bg-primary) 88%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: background-color 0.28s ease;
}
/* 原来底边 padding 为 0，靠 .topbar-wrap 的 margin-bottom 撑开；改成玻璃条后两者对调 */
.topbar {
  padding-top: 0.7rem !important;
  padding-bottom: 0.7rem !important;
}

/* 栏目页顶栏与版心同宽。原 .topbar 把 72rem 写死，靠注释「与 .container 严格同宽」人工绑定，
   改一处漏一处就会出现「导航比内容窄 28px」。

   ⚠️ 必须排除文章页（body.page-chapter）：那里另有一套 max-width 公式，
   与 .reading-page 同源，且 padding-left 特意用 46px 去对齐正文左缘（.reading-measure）；
   强行拉成 1180 反而会把 logo 从正文左缘拉偏 10px、顶栏比正文框窄 24px。 */
body:not(.page-chapter) .topbar {
  max-width: 1180px !important;
}

/* 文章页顶栏：宽度与内边距改成与 .reading-page 同源。
   原公式用 100ch 去近似 .reading-page 的 55em，实测 ch=0.539em，
   得到 1186.5px 而正文页是 1204px（差 17.5，各让 8.75）；
   再叠加 padding 46/24 vs 22/22，内容区左缘差 32.75px、右缘差 10.75px，
   首屏看就是「导航比正文框窄一圈、logo 不对正文左缘」。
   改为同一套 max-width 公式 + 同一套内边距：
   · max-width = min(55em + 24 + 300, 98vw)，与 .reading-page--chapter 逐字一致
   · padding-left = 2×22，让 logo 落在正文文字左缘（.reading-measure 的 content box）
   · padding-right = 22，与 .reading-page 内容右缘齐平
   ⚠️ 55em 必须与 .reading-page 的 --read-max 保持同值（当前 55em）。 */
@media (min-width: 768px) {
  .page-chapter .topbar {
    max-width: min(calc(55em + 324px), 98vw) !important;
    padding-left: 44px !important;
    padding-right: 22px !important;
  }
}

/* 吸顶条高约 56px：锚点跳转必须让出这一段，否则目标标题会藏在导航下面 */
html {
  scroll-padding-top: 72px;
}

/* 导航项药丸化。原样式是 8px 圆角 + 选中换成 accent 绿字，
   英文版 .sz-nav a 是 999px 药丸、选中用 accent-bg 色块（.is-on）；
   全站视觉铁律也要求「用背景色表示层级」，只换字色不算分层。
   字重不动（.nav-pill 500 / .active 600）：拉丁字母 400 有 x-height 撑着，
   汉字 14px/400 会发虚，这一条不跟英文版。 */
.nav-pill {
  border-radius: 999px !important;
}
.nav-pill.active {
  color: var(--text-primary) !important;
  background: var(--accent-bg) !important;
}
.nav-pill.active:hover {
  color: var(--text-primary) !important;
  background: var(--accent-bg) !important;
}

/* 搜索按钮降权。原样式：实心 accent 绿底 + 白字 + 600 字重，是首屏唯一的实心色块；
   左边紧挨着同样实心的搜索输入框药丸，两块实心并排，成了顶栏里视觉最重的东西
   （比主导航还重，导航反而成了配角）。
   英文版顶栏里没有任何实心按钮，辅助链接一律 muted 文字。
   这里降成「文字按钮」：默认透明 + muted，hover 才上底色；高度/点击区不动。 */
.topbar-search-btn {
  background: transparent !important;
  color: var(--text-muted) !important;
  font-weight: 400 !important;
  padding: 0 12px !important;
  border-radius: 999px !important;
}
.topbar-search-btn:hover {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  filter: none !important;
}

/* ---------- 1. 页头：从「卡片」变「刊头」 ---------- */
/* 留白必须分三档。上一版用一条 70px 通吃，结果三种模板的「上面是什么」完全不同，
   于是同一块留白在一类页面上合适、在另一类上就成了断层（2026-10-30 修订）：
   · 书站首页 shouye.htm / 分类页 jszj.htm：顶栏 → 页头，中间没有别的层，留白自己给足
   · 栏目页 fengmian.htm（3851 个）/ diy / book_category_list / list_article：
     顶栏 → 面包屑 → 页头，面包屑已占一档呼吸位，页头再要满额就变成两道空
   · 阅读栏目页 liebiao / liebiao_shi / liebiao_read：顶栏 → 返回条 → 页头，
     这里的 h1 是「这一篇的名字」而不是「这本书的门面」，本质是页内标题，须紧凑
   上下比参考英文版 .sz-hero（78 : 48 ≈ 1.63）；中文标题字号比英文小一档，
   比例收到 1.4 左右——大留白配中小标题会显空。 */
.category-header:not(.category-header--reading) {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: clamp(30px, 3.8vw, 52px) 0 clamp(26px, 2.5vw, 36px) !important;
  margin-bottom: 0 !important;
  position: relative;
}
/* 前面紧邻面包屑：面包屑本身已有 0.3rem 内距 + 0.4rem 外距，
   再叠满额留白就是「面包屑—大空—标题」的断裂。这里只留一个组内间距。 */
.breadcrumb + .category-header {
  padding-top: clamp(16px, 2vw, 26px) !important;
}
/* 阅读模式栏目页：沿用原来的紧凑内距（0.4rem/0.2rem 偏挤，略放一档但不做成刊头） */
.category-header.category-header--reading {
  padding: 0.9rem 0 0.7rem !important;
}

/* ===== 栏目题词：横排副题（2026-10-30 三次返工，右侧竖排版已下线）=====
   竖排为什么下线 —— 实测数据，不是审美偏好：
   ① 体量失控：13 字雅称在 27px 字号下竖条约 449px 高，而 .category-header
      实测只有 289px —— 题词比它所属的区块还高 1.56 倍，溢出 160px 压到正文区，
      结构上已不是「角落印章」而是「页边的一条柱子」。英文版 .sz-hero-cn
      同元素仅 211px（.sz-hero 489px 的 43%），装得下才谈得上点缀。
   ② 同语言会被读：英文站的竖排中文对英文读者是异国符号，大脑归档为图形、
      不尝试阅读；中文站的竖排中文与正文同语言，大脑会去读，读到一半必须把视线
      从横向阅读流里折返 —— 这就是「扎眼 / 分散注意力」的物理原因，与位置无关。
      所以「贴到视口右缘 24px」解决不了它，那只是把柱子挪得更靠边。
   ③ 覆盖不均：3698 个栏目里仅 56 个有雅称（27%），其余页面没有这条竖线，
      同一套版式有的页有、有的页没有，本身就不一致。
   改横排后它进入阅读流：书名（是什么）→ 题词（一句定性）→ 简介（展开说）→ 导航，
   这正是书籍封面的层级（书名 / 副题 / 内容简介），不靠位置和留白硬撑。 */
.category-epigraph {
  /* 上边距由相邻块自己的间距扛：书目页 h1 是 margin:0，书站首页由
     .category-title-row 的 16px 兜底，两个 margin 折叠后取较大的那个。 */
  margin: 10px 0 18px;
  font-family: var(--font-read);
  font-size: 1rem;
  line-height: 1.9;
  /* 🔴 大字距是题词的唯一语汇：字号接近简介，语气不等于正文。
     不加引号、不加破折号、不加底色/边框 —— 全站铁律「背景色分层、禁多余线条」。 */
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-wrap: pretty;
}
/* 无雅称（73% 的栏目）→ 整块消失，外边距一并失效，
   标题→简介的间距与改动前完全一致，不产生空行 */
.category-epigraph:empty {
  display: none;
}

.category-title-row {
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.category-title {
  font-family: var(--font-read) !important;
  font-size: clamp(2.15rem, 4.6vw, 3.25rem) !important;
  font-weight: 500 !important;
  line-height: 1.12 !important;
  letter-spacing: -0.005em !important;
  color: var(--text-primary) !important;
  margin: 0 !important;
  text-wrap: balance;
}

/* 已校订徽章 → 英文版 kicker 语言：小字 + 大字距 + accent 文字 + 无底色。
   注意：该 badge 是 h1 的子元素（不是兄弟），只能改样式、不能挪位置 */
.proofread-badge {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin-left: 16px;
  color: var(--accent) !important;
  font-family: var(--font) !important;
  font-size: 0.72rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.18em !important;
  vertical-align: middle;
  white-space: nowrap;
}

/* 加入书架 → 英文版 .sz-btn 药丸（bg-tertiary + 中性字色，hover 才上 accent-bg） */
.stow_home .btn,
.stow_home button {
  border: none !important;
  border-radius: 999px !important;
  padding: 11px 20px !important;
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  font-size: 0.87rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.02em;
  box-shadow: none !important;
  transition: background 0.18s;
}
.stow_home .btn:hover,
.stow_home button:hover {
  background: var(--accent-bg) !important;
  color: var(--text-primary) !important;
}

/* 书籍简介 → 通欄（英文版 .sz-hero-sub 限宽 620px 是因为英文单行字符多，
   中文同长度信息只需一半宽度；限到 680px 会让简介变成窄窄一条、下方大片留白） */
.category-description {
  font-size: 1.05rem !important;
  line-height: 1.85 !important;
  color: var(--text-secondary) !important;
  max-width: none !important;
  margin-bottom: 20px !important;
  letter-spacing: 0.005em;
}

/* 子栏目 → 英文版 .sz-chips（药丸 + muted 字色，选中才用 accent-bg） */
.subcategory-tags {
  gap: 6px !important;
  margin-top: 0.4rem !important;
}
.subcategory-tag {
  background: var(--bg-secondary) !important;
  color: var(--text-muted) !important;
  border-radius: 999px !important;
  padding: 6px 14px !important;
  font-size: 0.8rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.06em;
  transition: background 0.18s, color 0.18s;
}
.subcategory-tag:hover {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
}

/* ---------- 2. 区块：三层 → 两层 ---------- */
/* 原来：页面底(#f5f2ed) → 白卡.book-section(#fff) → 米块(#f1ede7)
   现在：页面底 → 白块（单层浮起），配对暗色下「越靠上越亮」的正确方向 */
.book-section {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  margin-bottom: 42px !important;
}

/* 首个区块与页头之间需要额外一口气：容器卡片取消后，它上方只剩页头的 padding-bottom */
.book-sections > .book-section:first-child {
  margin-top: 22px !important;
}

/* 区块标题必须放大：卡片取消后，分组责任全落到标题上，17px 撑不住 */
.book-section-title {
  font-family: var(--font-read) !important;
  font-size: 1.3rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.03em !important;
  color: var(--text-primary) !important;
  margin: 0 0 14px !important;
  line-height: 1.35 !important;
}

/* ---------- 3. 条目：按形态分治 ---------- */
/* 3a. 正文预览块：孙子兵法这类「一条 = 一整篇正文」。
       内容是成段古文，本质是可点击的正文摘录，需要接近阅读级的行距与内边距 */
.book-chapters--text a {
  display: block;
  background: var(--bg-card) !important;
  border-radius: 14px !important;
  padding: 22px 26px !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-read) !important;
  font-size: 0.95rem !important;
  line-height: 2 !important;
  letter-spacing: 0.015em;
  transition: background 0.18s, color 0.18s;
}
.book-chapters--text a:hover {
  background: var(--bg-card-hover) !important;
  color: var(--text-primary) !important;
}

/* 3b. 短标题条目：普通 book-chapters（标题短、条目密） */
.book-chapters:not(.book-chapters--text) a {
  background: var(--bg-card) !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-read) !important;
  font-size: 0.92rem !important;
  line-height: 1.55 !important;
  transition: background 0.18s, color 0.18s;
}
.book-chapters:not(.book-chapters--text) a:hover {
  background: var(--bg-card-hover) !important;
  color: var(--text-primary) !important;
}

/* 3c. 回目标题：三国演义这类 .novel-chapter-link（两列宽条）
       hover 从「变绿 + 位移」改为「升一档底色」，与英文版 .sz-feat:hover 同语言 */
.novel-chapter-link {
  background: var(--bg-card) !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  color: var(--text-secondary) !important;
  font-family: var(--font-read) !important;
  font-size: 0.93rem !important;
  letter-spacing: 0.02em;
  transition: background 0.18s, color 0.18s !important;
}
.novel-chapter-link:hover {
  background: var(--bg-card-hover) !important;
  color: var(--text-primary) !important;
  transform: none !important;
}

/* ---------- 4. 文章页 ---------- */
/* 面包屑：原样式是「全绿色 + 500 字重」，一行小字里四五个绿块，
   是强调色滥用最明显的一处。英文版几乎不用绿色跑正文外的辅助信息 */
.breadcrumb {
  font-size: 0.8rem !important;
  padding: 0.3rem 0 !important;
  margin: 0 0 0.4rem !important;
}
.breadcrumb a {
  color: var(--text-muted) !important;
  font-weight: 400 !important;
}
.breadcrumb a:hover {
  color: var(--text-primary) !important;
}

/* 文章页顶部留白：原来直接顶到面包屑，没有喘息 */
.article-header--chapter {
  padding-top: clamp(18px, 2.6vw, 34px) !important;
  padding-bottom: 20px !important;
  margin-bottom: 12px !important;
}
/* 章节标题从 24.8~30.4px 抬到 28~36px：栏目页 h1 已经 52px，
   文章标题停在 30px 会让「进入正文」这一步显得降级过快 */
.article-header--chapter h1 {
  font-size: clamp(1.75rem, 3.2vw, 2.25rem) !important;
  line-height: 1.25 !important;
  letter-spacing: 0.005em !important;
}

/* ---------- 5. 侧栏：保留全部功能，只去掉容器感 ---------- */
.pc-sidebar-section {
  background: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 0 22px !important;
}

/* 侧栏分组标题 = kicker（小字 + 大字距 + muted）。
   ⚠️ 必须排除 --clickable：「阅读设置」不是标题，是一个入口/按钮。
   上一轮把 .pc-sidebar-section-title 一刀切成 muted 0.74rem，
   连它一起压了，等于把这个入口做没了（原样式是 accent 绿字 + 0.9rem 可点）。
   左内边距 12px：与章节条目的文字左缘对齐（条目有 12px 内边距才能做 hover 色块），
   否则侧栏里会出现三个不同的左缘（标题 0 / 条目 12 / 入口块 14）。 */
.pc-sidebar-section-title:not(.pc-sidebar-section-title--clickable) {
  color: var(--text-muted) !important;
  font-size: 0.74rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.18em !important;
  padding: 0 0 0 12px !important;
  margin-bottom: 10px !important;
}

/* 阅读设置入口：恢复成一个明确的「可点块」。
   用底色而不是绿字表达可点（全站视觉铁律：层级用背景色，不靠字色），
   hover 升一档底色，右侧一个 › 提示可展开。 */
.pc-sidebar-section-title--clickable {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-radius: 10px !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  padding: 11px 14px !important;
  margin: 0 !important;
  transition: background 0.18s, color 0.18s;
}
.pc-sidebar-section-title--clickable::after {
  content: '\203A';
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1;
}
.pc-sidebar-section-title--clickable:hover {
  background: var(--bg-card-hover) !important;
  color: var(--text-primary) !important;
  opacity: 1 !important;
}
.pc-sidebar-section-title--clickable:hover::after {
  color: var(--text-secondary);
}

/* 章节目录：容器卡片取消后，条目仍留着 16/20px 左内边距，与上面左缘为 0 的 kicker 标题参差；
   hover 用 bg-hover、选中用 accent 绿字 + 6px 圆角，
   与新版（bg-card 色块 + 10~12px 圆角 + accent-bg 选中）不是一套语言。 */
.pc-sidebar-chapters .chapter-sidebar-item,
.pc-sidebar-chapters .chapter-sidebar-group-header,
.pc-sidebar-chapters .chapter-sidebar-subgroup-header {
  padding-left: 12px !important;
  padding-right: 12px !important;
  border-radius: 8px !important;
}
.pc-sidebar-chapters .chapter-sidebar-item:hover,
.pc-sidebar-chapters .chapter-sidebar-group-header:hover,
.pc-sidebar-chapters .chapter-sidebar-subgroup-header:hover {
  background: var(--bg-card-hover) !important;
  /* 原样式 hover/active 带 transform: translateX(3px)，在无底色时代是「位移提示」，
     现在有了整块底色再位移就会左右多出 3px，色块对不齐；新语言只用颜色表状态 */
  transform: none !important;
}
.pc-sidebar-chapters .chapter-sidebar-item.active {
  background: var(--accent-bg) !important;
  border-radius: 8px !important;
  transform: none !important;
}
.pc-sidebar-chapters .chapter-sidebar-item.active .chapter-sidebar-item-title {
  color: var(--text-primary) !important;
  font-weight: 600 !important;
}
/* 卷名/分组标题：字号比条目更小、靠字距区分层级，不靠颜色变绿 */
.pc-sidebar-chapters .chapter-sidebar-group-header,
.pc-sidebar-chapters .chapter-sidebar-subgroup-header {
  color: var(--text-muted) !important;
  font-size: 0.72rem !important;
  letter-spacing: 0.12em !important;
}

/* 打赏入口：原样式是 accent-bg 底 + accent 绿字 + 投影 + 600 字重，
   是侧栏里唯一「发光」的东西；侧栏其它部分去掉卡片后，它反而更突出（头重脚轻的翻版）。
   降权但保留 CTA 分量：去投影、绿字改正文色、600 → 500，底色仍是 accent-bg
   （全侧栏唯一的强调色块，只此一块；hover 只提亮底色，不再位移/加阴影）。 */
.donate-sidebar-btn {
  background: var(--accent-bg) !important;
  color: var(--text-primary) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  font-weight: 500 !important;
  padding: 11px 14px !important;
  transform: none !important;
}
.donate-sidebar-btn:hover {
  background: var(--accent-bg-hover) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
  transform: none !important;
}
.donate-sidebar-btn i {
  color: var(--accent);
}

/* ---------- 5b. 阅读设置面板：旧弹窗换新皮 ---------- */
/* 结构固定（reading_settings.htm：字号/行距/段距/字体/亮度/主题/繁简 7 组），只改皮肤：
   · 分组标签原是 0.85rem/600/uppercase —— 汉字没有大小写，uppercase 白做，
     600 又把「标签」喊得比内容还响；改 kicker（0.72rem / 400 / 0.14em / muted）
   · 选中项原是实心 accent 绿底白字（settings-font-btn.active 等），
     新语言里选中态 = accent-bg 淡色块 + 正文色，实心绿只留给 primary 按钮
   · 未选中项原为 bg-surface，与面板底色（bg-card）几乎同色，看不出是按钮 */
.reading-settings-panel {
  background: var(--bg-card) !important;
  border-radius: 18px !important;
  padding: 18px 18px 14px !important;
  width: 360px !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34) !important;
}
.reading-settings-title {
  font-size: 1rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
}
.settings-label {
  color: var(--text-muted) !important;
  font-size: 0.72rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.14em !important;
  text-transform: none !important;
}
.settings-value-label {
  color: var(--text-muted) !important;
  font-size: 0.75rem !important;
  letter-spacing: 0.04em !important;
}
.settings-font-btn,
.settings-theme-btn,
.settings-lang-btn,
.settings-note-btn {
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
  border: none !important;
  border-radius: 999px !important;
  font-size: 0.82rem !important;
  font-weight: 400 !important;
  padding: 8px 14px !important;
  transform: none !important;
}
.settings-font-btn:hover,
.settings-theme-btn:hover,
.settings-lang-btn:hover,
.settings-note-btn:hover {
  background: var(--bg-card-hover) !important;
  color: var(--text-primary) !important;
  transform: none !important;
}
.settings-font-btn.active,
.settings-theme-btn.active,
.settings-lang-btn.active,
.settings-note-btn.active {
  background: var(--accent-bg) !important;
  color: var(--text-primary) !important;
  font-weight: 500 !important;
}
.settings-reset-btn {
  background: transparent !important;
  color: var(--text-muted) !important;
  border-radius: 999px !important;
  font-weight: 400 !important;
}
.settings-reset-btn:hover {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  transform: none !important;
}

/* ---------- 5c. TTS 朗读设置弹窗：同一套语言 ---------- */
.tts-settings-panel {
  border-radius: 18px !important;
  padding: 18px 16px 16px !important;
  width: 360px !important;
  max-width: calc(100vw - 32px) !important;
}
.tts-settings-group {
  background: var(--bg-surface) !important;
  border-radius: 12px !important;
}
.tts-group-title {
  font-size: 0.78rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.06em !important;
}
.tts-settings-label {
  color: var(--text-muted) !important;
  font-weight: 400 !important;
  letter-spacing: 0.1em !important;
}

/* 折叠高度必须跟着字号走。原规则把字号写死进 max-height：
   calc(1.3 * clamp(1.55rem, 3vw, 1.9rem) * 2)
   字号一改，这个高度就不够了，而 overflow:hidden 是硬切（没有省略号），
   第二行文字直接被拦腰截断。改用 em（相对自身 font-size）：2 行 × 1.25 行高，
   字号怎么变都不会切断。 */
.title-expand-text.collapsed {
  max-height: 2.5em !important;   /* 回退：2 行 × 1.25 行高 */
  max-height: 2lh !important;     /* 支持 lh 时精确等于两行，不依赖行高取值 */
}

/* ---------- 6. 移动端：两个设置面板改底部通栏 ---------- */
/* ⚠️ 阅读设置面板的 DOM 在 .bottom-nav-bar 内部（reading_settings.htm 被嵌进底部导航），
   而 .bottom-nav-bar 上有 transform: translateY() —— 它会成为 position:fixed 的包含块。
   也就是说面板的 fixed 是相对「底部导航条」这个盒子定位的，不是视口：
   top:50% 会变成「导航条高度的 50%」，遮罩 inset:0 也只盖住导航条那 50px。
   好在导航条本身贴视口底、宽度等于视口宽，于是：
     left/right 0 → 通栏；bottom 0 → 视口底；height: 100vh → 向上铺满整个视口（遮罩）。
   面板的 left/width/max-width/transform 由 JS 写 inline style（showPanel），必须 !important 推翻。 */
@media (max-width: 767px) {
  .reading-settings-panel {
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    max-width: none !important;
    max-height: 86vh !important;
    border-radius: 18px 18px 0 0 !important;
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom)) !important;
    transform: translateY(100%) !important;
    box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.4) !important;
  }
  .reading-settings-panel.open {
    transform: translateY(0) !important;
  }
  .reading-settings-overlay {
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
  }

  /* TTS 面板挂在 body 上（tts-reader.js），fixed 就是视口，直接用 left/right 0 通栏 */
  .tts-settings-panel {
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: auto !important;
    max-width: none !important;
    max-height: 86vh !important;
    border-radius: 18px 18px 0 0 !important;
    padding: 10px 16px calc(16px + env(safe-area-inset-bottom)) !important;
    transform: translateY(100%) !important;
  }
  .tts-settings-panel.open {
    transform: translateY(0) !important;
  }

  /* 抓扟条：告诉用户这是「可下拉的底部弹层」，也给顶部一个视觉起点 */
  .reading-settings-panel::before,
  .tts-settings-panel::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background: var(--text-dim);
    opacity: 0.6;
    pointer-events: none;
  }
  .reading-settings-header,
  .tts-settings-head {
    padding-top: 8px !important;
  }
}

/* ---------- 7. 移动端：其余 ---------- */
@media (max-width: 700px) {
  /* 移动端同三档：默认 / 面包屑后 / 阅读栏目页 */
  .category-header:not(.category-header--reading) { padding: 24px 0 20px !important; }
  /* 题词窄屏收紧字距：360px 下 0.18em 会让 16 字雅称折行，收到 0.12em 能多放约 2 字 */
  .category-epigraph { font-size: 0.92rem; letter-spacing: 0.12em; line-height: 1.8; }
  .breadcrumb + .category-header { padding-top: 12px !important; }
  .category-header.category-header--reading { padding: 0.75rem 0 0.6rem !important; }
  .category-title {
    font-size: 1.95rem !important;
    letter-spacing: 0 !important;
  }
  .proofread-badge { margin-left: 10px; font-size: 0.66rem !important; }
  .category-description { font-size: 0.98rem !important; max-width: none; }
  .book-chapters--text a { padding: 16px 18px !important; line-height: 1.95 !important; }
  .book-section { margin-bottom: 32px !important; }
  .book-section-title { font-size: 1.15rem !important; }
  .book-sections > .book-section:first-child { margin-top: 14px !important; }
}

/* ---------- 8. 移动端章节目录抽屉：选中项去位移 ----------
   基础规则 .chapter-sidebar-item.active 带 transform: translateX(3px)，那是在「无底色、
   靠右移做选中反馈」时写的。现在两种情况都会让位移变成错位：
   · 桌面侧栏：选中项有 accent-bg 色块（第 5 节），右移 3px 使色块比容器右偏 3px；
   · 移动抽屉：选中态是父级 .chapter-sidebar-group-content 的整块底色 + 绿标题，
     单条再右移会和分组底色错开。
   抽屉里是另一份 DOM 副本（.chapter-sidebar.mobile-only），桌面侧栏的作用域盖不到，
   所以在这里用全局选择器一并去掉；hover 的右移反馈保留。 */
.chapter-sidebar-item.active { transform: none !important; }

/* ---------- 9. 搜索页 / 搜索结果页 ----------
   旧版每个组件自带阴影、上浮、渐变、斑马纹，是「卡片悬浮」时代的写法；
   新皮肤四条：零阴影零边框 / 背景色分层 / 药丸控件 / 强调色只做 hover 反馈。
   以下逐类重写，不改结构、只改外观。 */

/* 三种卡片：去掉投影，靠 --bg-card 与米色页底分层 */
.search-card,
.search-exact-match,
.search-articles-wrap {
  box-shadow: none !important;
}

/* 卡片 hover：只升一档底色，不位移不发光 */
.search-card:hover,
.search-card-book:hover {
  background: var(--bg-tertiary) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* 精确匹配条：原为 accent 斜向渐变（伪高光），改纯色块 */
.search-exact-card {
  background: var(--bg-surface) !important;
}
/* 48×48 实心绿图标块：强调色只该出现在主按钮，这里降为浅色底 + 绿字 */
.search-exact-icon {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
  border-radius: var(--radius-full) !important;
}
/* 「查看」是主按钮，保留实心绿，只去掉上浮 */
.search-exact-btn:hover {
  transform: none !important;
}

/* 精确匹配卡内的子栏目分段：卡片内部不再叠线条，靠底色区分 */
.search-subcats {
  border-top: none !important;
  background: var(--bg-card) !important;
}
.search-subcat-btn {
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-full) !important;
}
.search-subcat-btn:hover {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}

/* 结果列表：取消偶数行斑马纹（旧设计），整块一色 + 单条 hover */
.search-article-item,
.search-article-item:nth-child(even),
html.dark .search-article-item:nth-child(even) {
  background: transparent !important;
}
.search-article-link:hover {
  background: var(--bg-hover) !important;
}

/* 热门词药丸：实心绿 + 上浮 + 光晕 → 中性色块，hover 才上强调 */
.search-hot-tag:hover {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
  transform: none !important;
  box-shadow: none !important;
}
/* 「展开更多」：虚线边框是旧线条语言，改纯色块 */
.search-hot-more-btn {
  border: none !important;
  background: var(--bg-tertiary) !important;
}
.search-hot-more-btn:hover {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}

/* 顶栏搜索历史面板：全站共用，与热门词同一套药丸语言 */
.search-history-tag,
.search-history-hot-tag {
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
  border-color: transparent !important;
}
.search-history-tag:hover,
.search-history-hot-tag:hover {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
  border-color: transparent !important;
}
/* 「最近搜索」与「热门」两段之间不用分割线 */
.search-history-hot {
  border-top: none !important;
}

/* 诗句浮层（search.htm 内联样式）的「查看全诗」按钮 */
.pm-book-link:hover {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}

/* ---------- 10. 打赏页 / 打赏弹窗 ----------
   donate.css 里有 11 处 var(--uc-divider) 和 2 处 var(--uc-item)，那是用户中心
   layout.php 里定义的私有变量，而打赏页并不加载那个 layout —— 变量失效后
   border-color 回落到 currentColor，于是每个控件都描了一圈「近乎纯黑/纯白」的实线，
   这就是打赏页看着糙的真正原因（2026-10-30 定位）。
   新皮肤一律去边框、用背景色分层；选中态用浅绿底 + 绿字，不用实心绿大块。 */

/* 金额按钮 / 支付方式 / 次要操作：中性色块 */
.donate-amount-btn,
.donate-pay-btn,
.donate-qr-cancel,
.donate-back-read,
.donate-qr-placeholder {
  border: none !important;
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
}
/* 输入框 / 留言框：保留原来的「凹陷」关系（比卡片深一档），只去那条实线 */
.donate-input,
.donate-textarea {
  border: none !important;
}
.donate-input {
  border-radius: var(--radius-full) !important;
}
/* 多行文本域不用药丸形，但收一档圆角与输入框同家族 */
.donate-textarea {
  border-radius: var(--radius) !important;
}

/* 悬停：不用边框变色提示，底色上浮到浅绿 */
.donate-amount-btn:hover,
.donate-pay-btn:hover,
.donate-qr-cancel:hover,
.donate-back-read:hover {
  border-color: transparent !important;
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}

/* 选中态：实心绿 + 光晕 → 浅绿底 + 绿字（与全站药丸选中态同一语言） */
.donate-amount-btn.active,
.donate-pay-btn.active {
  border-color: transparent !important;
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
  box-shadow: none !important;
  font-weight: 600;
}

/* 二维码卡与弹窗内的遮罩：去掉投影与硬编码色 */
.qr-card {
  box-shadow: none !important;
}
.donate-dialog {
  background: var(--bg-card) !important;
}
/* 双列分栏不用竖线，左列已有独立背景块区分 */
.donate-dialog-right {
  border-left: none !important;
}
/* 滚动渐隐遮罩：原来的 #201c17 / #ffffff 硬编码改成跟随卡片色 */
.donate-dialog-right.has-more::after,
html.light .donate-dialog-right.has-more::after {
  background: linear-gradient(
    to top,
    var(--bg-card) 0%,
    color-mix(in srgb, var(--bg-card) 85%, transparent) 45%,
    transparent 100%
  ) !important;
}

/* 「写句留言」也是药丸，与全站控件统一 */
.donate-message-toggle {
  border-radius: var(--radius-full) !important;
}
/* 「保存留言」是主按钮，保留实心绿，只统一为药丸形 */
.donate-btn-save {
  border: none !important;
  border-radius: var(--radius-full) !important;
}

/* ---------- 11. 汉字工具站（hanzi/*）----------
   hanzi 的样式全在模板内联 <style> 里，与 style-v2.css 并行。内联在 yinru.htm 之后加载，
   同权重会盖过本文件 → 这里必须用 !important 才盖得住。
   只改「与主站不一致」的部分：顶栏载体、卡片悬浮、实心绿当 hover。
   有意保留：拼音播放按钮的 .is-playing 实心绿（「正在播放」是功能状态，不是装饰）；
   移动端底部悬浮操作条的阴影（浮层允许投影，新皮肤只禁静态卡片投影）。 */

/* 顶栏：实色 --bg-secondary + 1px 投影 → 与主站同款玻璃条（88% 底色 + 模糊） */
.hz-topbar-wrap {
  background: color-mix(in srgb, var(--bg-primary) 88%, transparent) !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.hz-topbar {
  box-shadow: none !important;
}

/* 浅色主题下的搜索框：硬编码 #d9d3c8 + 1px 描边 → 跟随 --bg-tertiary，去描边 */
html.light .hz-search-input-wrap {
  background: var(--bg-tertiary) !important;
  border: none !important;
}

/* 搜索历史下拉：浮层保投影，但去掉描边线 */
.hz-dropdown-panel {
  border: none !important;
}

/* 搜索历史药丸：实心绿 hover → 浅绿底 + 绿字（与全站搜索历史面板同语言） */
.hz-search-history-tag:hover {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
  border-color: transparent !important;
}

/* 二级导航 chip：按下时实心绿 → 浅绿底（与主站 nav-pill 选中态一致） */
.hz-subnav-chip:active {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}

/* 拼音总览卡：hover 上浮 + 投影 → 只升一档底色 */
.py-hub-card:hover {
  background: var(--bg-tertiary) !important;
  transform: none !important;
  box-shadow: none !important;
}
.py-hub-card:hover .py-hub-icon {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}

/* 拼音播放系列：hover 给浅绿；「正在播放」仍用实心绿做状态强提示 */
.py-step:hover .py-step-num {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}
.py-play:hover,
.py-mini:hover {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}
.py-alt:hover {
  background: var(--accent-bg) !important;
  border-color: transparent !important;
  color: var(--accent) !important;
}
.py-blend-part:hover,
.py-cell:hover {
  background: var(--accent-bg) !important;
}
.py-pager-link:hover {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}

/* 字词页主操作（换一个）：实心绿保留，去掉 accent 光晕 */
.hanzi-action-float .hanzi-action-btn.hanzi-action-primary,
.hanzi-action-float .hanzi-action-btn.hanzi-action-primary:hover {
  box-shadow: none !important;
}
/* 移动端悬浮操作条：浮层投影保留，去掉顶部那条分割线 */
.hanzi-action-float {
  border-top: none !important;
}

/* ---------- 12. 用户中心（app/User/views/*）----------
   用户中心是唯一「自带一整套私有色板」的模块：layout.php 里定义 --uc-page / --uc-card /
   --uc-divider 等 15 个变量，色值比主站更暗（深色 #0e0c08 vs 主站 #171410），
   导致从主站点进用户中心时页面整体「沉下去一档」，且这些变量只在该 layout 内定义，
   donate.css 引用的 --uc-divider 在文章页/游标页无人定义 → border-color 回落 currentColor。

   做法分两层：
   ① 变量层：把 --uc-* 全部指回主站 token，整套私有色板自动跟随主题（不必逐类改色）；
   ② 组件层：只覆盖与新皮肤四条不符的具体规则（阴影/位移/线条/实心绿 hover）。
   变量层必须 !important —— layout.php 的 <style> 在 style-v2.css 之后加载，同权重会盖回来。 */

:root {
  --uc-page: var(--bg-primary) !important;
  --uc-surface: var(--bg-secondary) !important;
  --uc-surface-hover: var(--bg-tertiary) !important;
  --uc-card: var(--bg-card) !important;
  /* 卡片是容器，hover 不换底色：浅色下 --bg-card-hover(#f7f5f0) 与页面底色(#f5f2ed)
     几乎相同，一悬停整张卡就从页面上"消失"（2026-11-06 修复）。 */
  --uc-card-hover: var(--bg-card) !important;
  --uc-card-elevated: var(--bg-card) !important;
  --uc-input: var(--bg-tertiary) !important;
  --uc-input-hover: var(--bg-tertiary) !important;
  --uc-item: var(--bg-hover) !important;
  --uc-item-hover: var(--bg-hover) !important;
  --uc-tab-bg: var(--bg-tertiary) !important;
  --uc-divider: var(--border-light) !important;
  --uc-dropdown-bg: var(--bg-card) !important;
  --uc-dropdown-item: var(--bg-hover) !important;
  --uc-shadow: var(--shadow-sm) !important;
}

/* ---- 顶栏：与主站同一条玻璃条（吸顶 + 88% 底色 + 模糊） ---- */
.uc-topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 80;
  background: color-mix(in srgb, var(--bg-primary) 88%, transparent) !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.uc-topbar {
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}
/* 桌面端放开裁切：原 .uc-topbar-wrap / .uc-topbar 都是 overflow:hidden，
   而头像下拉菜单是绝对定位挂在 .uc-user 下方 8px 处、高度远超顶栏，
   被裁成只剩顶部几像素（导航菜单实际点不到第二项）。移动端本来就隐藏下拉，保持原样。 */
@media (min-width: 641px) {
  .uc-topbar-wrap,
  .uc-topbar {
    overflow: visible !important;
  }
}
/* logo 只变字色，不做缩放 */
.uc-logo:hover {
  transform: none !important;
}
/* 头像内描边是旧皮肤的「玻璃圈」，新皮肤头像不加圈 */
.uc-user-avatar {
  box-shadow: none !important;
}
/* 下拉菜单内的粗分隔条（3px 色块）去掉，靠分组间距区分 */
.uc-dropdown-divider {
  display: none !important;
}

/* ---- 导航 tab：透明文字 → 药丸选中态 ---- */
.uc-tab {
  border-radius: var(--radius-full) !important;
}
.uc-tab.active {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}

/* ---- 卡片：去投影、去 hover 位移 ---- */
.uc-card {
  border-radius: var(--radius-lg) !important;
  box-shadow: none !important;
}
.uc-card:hover {
  background: var(--uc-card) !important;
  transform: none !important;
  box-shadow: none !important;
}
html.light .uc-card:hover {
  box-shadow: none !important;
}

/* ---- 列表：所有分隔线改由底色/间距分层 ---- */
.uc-feed-item + .uc-feed-item,
.uc-timeline-item + .uc-timeline-item,
.uc-profile-stats,
.rank-item,
.fav-tabs {
  border-top: none !important;
  border-bottom: none !important;
}
/* rank-item / fav-tabs 原来把线写在行内 style 上，行内优先级高于类，需单独压 */
.rank-item[style],
.fav-tabs[style] {
  border-top: none !important;
  border-bottom: none !important;
}

/* ---- 按钮：主按钮保留实心绿，去掉投影与上浮 ---- */
.uc-btn--pri {
  box-shadow: none !important;
}
.uc-btn--pri:hover,
.btn-primary:hover {
  background: var(--accent-hover) !important;
  filter: none !important;
  transform: none !important;
  box-shadow: none !important;
}
/* 资料卡编辑 / 数据小格：hover 只升底色 */
.uc-profile-edit:hover,
.uc-stat-box:hover {
  transform: none !important;
  box-shadow: none !important;
}
.uc-stat-box:hover {
  background: var(--bg-tertiary) !important;
}

/* ---- 输入框：去掉描边与聚焦光晕（主站聚焦只换底色） ---- */
.uc-input,
.form-input,
html.light .uc-input {
  border: none !important;
}
.uc-input:focus,
.form-input:focus {
  box-shadow: none !important;
  background: var(--input-focus-bg) !important;
}

/* ---- 消息中心（notify.php）---- */
/* 未读左竖条：新皮肤禁止左竖强调条，未读已由 --accent-bg 底区分 */
.notify-unread::before {
  display: none !important;
}
.notify-unread {
  background: var(--accent-bg) !important;
}
/* 原 hover 用的是旧 indigo 主题的 rgba(99,102,241,.1)，与绿色主题完全无关（历史残留） */
.notify-unread:hover,
.notify-card--interact:hover {
  background: var(--bg-hover) !important;
  transform: none !important;
}
.notify-card--system:hover {
  background: var(--bg-hover) !important;
}
/* 引用块左竖线 → 纯底色块 */
.notify-quote--reply,
.notify-quote--moderation {
  border-left: none !important;
  border-radius: var(--radius-sm) !important;
  padding-left: 10px !important;
}
/* 筛选药丸：选中态实心绿 → 浅绿底 + 绿字 */
.notify-filter-btn.active {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}
/* 「查看详情」链接按钮同理 */
.notify-link-btn:hover {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}
/* 未读小圆点去光晕 */
.notify-dot {
  box-shadow: none !important;
}

/* ---- 搜索历史面板（用户中心自带一份实现）---- */
.search-history-hot {
  border-top: none !important;
}
.search-history-tag:hover,
.search-history-hot-tag:hover {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
  border-color: transparent !important;
}

/* ---- 预设头像：选中框是功能指示可留，hover 放大去掉（34px 头像放大后会盖住邻居） ---- */
.preset-avatar-item:hover {
  transform: none !important;
}

/* ---------- 13. 旧变量名补全 + 热门榜 / 诗站 / 工具页 ----------
   全站扫了一遍「引用了但从未定义」的 CSS 变量：--read-bg / --rows / --text-tertiary
   是有意为之（带 fallback 或由 JS 注入）；--exp-mark 是本地预览用的竖排书名，
   2026-10-30 已由真实题词 .category-epigraph（shuqian.htm）取代。剩下 3 个是改版时
   变量名换了、模板没跟上，且没有 fallback —— 浏览器直接丢弃声明，肉眼看到的就是
   「按钮没底色」「hover 不变色」。这里给等值别名，模板不必逐个改。 */
:root {
  --accent-soft: var(--accent-bg);
  --bg-item: var(--bg-hover);
  --bg-page: var(--bg-primary);
}

/* ---- 13.1 热门榜（remen.htm）---- */
/* 选中 tab 原来是 bg-card + 1px 投影，与全站药丸选中态不一致 */
.remen-tab.active {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
  box-shadow: none !important;
}
/* 图书卡 hover：原为位移 + 投影，且把底色改成 bg-card（比 bg-surface 还暗） */
.remen-book-card:hover {
  background: var(--bg-tertiary) !important;
  transform: none !important;
  box-shadow: none !important;
}
/* 排行榜：行线原是硬编码 rgba(255,255,255,.04/.025)，浅色主题下等于隐形。
   去线改用隔行底色分层，表头底色原已有。 */
.remen-rank-table thead th,
.remen-rank-table tbody td {
  border-bottom: none !important;
}
.remen-rank-table tbody tr:nth-child(even) {
  background: var(--bg-surface);
}

/* ---- 13.2 诗站（poet/*）---- */
/* 浅色主题搜索框：硬编码 #d9d3c8 + 描边，与 hanzi 顶栏同款遗留 */
html.light .pt-search-input-wrap {
  background: var(--bg-tertiary) !important;
  border: none !important;
}
html.light .pt-search-input-wrap:focus-within {
  background: var(--bg-card) !important;
  box-shadow: none !important;
}
/* 内容库 / 精选诗人 / 典籍 / 蒙学 / 名句 五类卡：hover 全部 translateY(-2px) */
.pt-lib-card:hover,
.pt-feat-card:hover,
.pt-classic-card:hover,
.pt-cls-card:hover,
.pt-mj-card:hover {
  transform: none !important;
}
/* 名句「出处」胶囊与书站入口胶囊：一个实心绿 hover，一个 accent 描边 */
.pt-mj-src-btn:hover {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}
.pt-book-rel-site {
  border: none !important;
  background: var(--accent-bg) !important;
}
/* 填空：难度药丸选中态、格子 hover */
.tk-mode.is-on {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
  box-shadow: none !important;
}
.tk-tile:hover:not(:disabled) {
  transform: none !important;
}

/* ---- 13.3 工具页（api/*）---- */
/* 成语页：卡片投影、次要按钮无底色（旧变量名 --bg-item 已在上方补全）、
   主按钮 hover 带一层硬编码蓝色光晕（rgba(9,105,218,.4)，与绿色主题无关的老代码） */
.idiom-card,
.idiom-card:hover {
  box-shadow: none !important;
}
.action-btn.primary:hover:not(:disabled),
.action-btn.secondary:hover:not(:disabled) {
  transform: none !important;
  box-shadow: none !important;
}
.action-btn.primary:hover:not(:disabled) {
  background: var(--accent-hover) !important;
}
.action-btn.secondary:hover:not(:disabled),
.dict-link:hover {
  background: var(--bg-tertiary) !important;
}
/* 诗词页：卡片投影 + hover 硬编码 #359962 与光晕 */
.poem-wrap {
  box-shadow: none !important;
}
.poem-btn:hover {
  background: var(--accent-hover) !important;
  box-shadow: none !important;
}
/* 繁简转换：主按钮 hover 光晕、轮廓按钮靠 inset 描边、复制按钮 hover 变白字（浅绿底上不可读） */
.fjzh-btn-primary:hover {
  background: var(--accent-hover) !important;
  box-shadow: none !important;
}
.fjzh-btn-outline {
  box-shadow: none !important;
  background: var(--bg-hover) !important;
}
.fjzh-btn-outline:hover {
  background: var(--bg-tertiary) !important;
}
.fjzh-btn-copy:hover {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}
.fjzh-textarea:focus {
  box-shadow: none !important;
}
/* 分段切换 / 声调格 / 拼音分类：选中态实心绿 → 浅绿底 + 绿字，与全站药丸选中态一致 */
.ss-seg button.is-on,
.ss-seg button.is-on:hover,
.cf-seg button.is-on,
.cf-seg button.is-on:hover,
.cf-chip.is-on,
.cf-chip.is-on:hover,
.ks-seg button.is-on,
.ks-seg button.is-on:hover,
.py-seg button.active {
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
}
/* 工具矩阵卡：hover 上浮去掉，只留底色 */
.tool-card:hover,
.tool-card:focus-visible {
  transform: none !important;
}

/* ---- 13.4 汉字门户入口（hanzi/index.htm）---- */
/* 中英两个入口卡 hover 上浮；中文入口是主按钮，实心绿保留 */
.hanzi-gw-entry:hover {
  transform: none !important;
}

/* ---- 13.5 书籍首页英文版入口（2026-10-31）---- */
/* 孙子（sunzi 站 507.htm）与道德经（www 站 521.htm）共用这一份。
   中文读者对英文版兴趣很小，所以不做卡片、不放图标块、不占一整行高度：
   只在书首页顶部右对齐一行 13px 小字，hover 变强调色。
   替代 507.htm 原先那个带 38px 图标 + 两行说明 + 箭头的大卡。 */
.en-link {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 8px;
}
.en-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  text-decoration: none;
  transition: color .16s ease;
}
.en-link a:hover { color: var(--accent); }
.en-link i { font-size: 11px; }

/* ===== 图书分类页重构（book_category_list.htm，2026-11-21）=====
   旧版：固定 2 列大卡 + box-shadow + 绿色 800 书名 + 不截断长描述。
   4 本书时右列留白、行末死白约 50px，且与全站书站语言（/jingshiziji/ 书目卡、首页热门书卡）
   完全两套：页头已经是透明刊头，下面突然一大块阴影卡片，所以“格格不入”。
   新版：沿用书站语言——纯背景色块 / 10px 圆角 / 无阴影无边框 / hover 切 accent-bg；
   网格 auto-fill 同时服务 3、4、40 本书；描述 line-clamp 统一行数，卡片不因长短留死白。
   作用域 .book-category-page 限定在本模板：.book-group-title 是全局类（typetemp 508/2139/2339 也在用），
   左竖色条只能在本页覆盖，不动全局定义。 */
.book-category-page .bc-books {
  /* 页头本身自带 26–36px 底部内距（移动端 20px），这里只补一点。
     旧值 34px 与页头内距叠加成 60–70px，读者看到的是「一道空」。 */
  margin: 4px 0 8px;
}
.book-category-page .bc-books-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 14px;
}
.book-category-page .bc-books-title {
  margin: 0;
  font-family: var(--font-read);
  font-size: 1.06rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-heading);
}
.book-category-page .bc-books-count {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.book-category-page .bc-books-count:empty {
  display: none;
}

/* 书目网格：4 本时一行四项，3 本时三项同宽，40 本时 4 列多行 */
.book-category-page .book-card-grid,
.book-category-page .book-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  margin: 0;
}
.book-category-page .book-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px 19px;
  background: rgba(43, 38, 31, 0.55);
  border-radius: 10px;
  box-shadow: none;
  color: inherit;
  text-decoration: none;
  /* 11.8em ≈ 4 行描述 + 书名 + 副题 + 上下内边距。
     部分书无副标题（PHP 不输出 .book-card-sub）会矮 25px，40 本时跨行高矮不齐；
     用最小高度兑平，不靠空白撑高。 */
  min-height: 11.8em;
  transition: background 0.22s ease, transform 0.22s ease;
}
html.light .book-category-page .book-card {
  background: var(--bg-surface);
}
.book-category-page .book-card:hover {
  background: var(--accent-bg);
  box-shadow: none;
  transform: translateY(-2px);
}
.book-category-page .book-card-name {
  margin: 0;
  color: var(--text-heading);
  font-family: var(--font-read);
  font-size: 1.16rem;
  font-weight: 600;
  line-height: 1.35;
}
.book-category-page .book-card:hover .book-card-name {
  color: var(--accent-hover);
}
.book-category-page .book-card-sub {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.55;
}
.book-category-page .book-card-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  margin: 2px 0 0;
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.72;
}

/* 分类套分类的分组标题：去左竖色条（L12），靠字号/字距建立层级 */
.book-category-page .book-group-title {
  display: block;
  margin: 24px 0 12px;
  padding-left: 0;
  border-left: none;
  color: var(--text-heading);
  font-family: var(--font-read);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.book-category-page .book-group:first-child .book-group-title {
  margin-top: 0;
}

@media (max-width: 640px) {
  .book-category-page .bc-books {
    margin-top: 4px;
  }
  .book-category-page .book-card-grid,
  .book-category-page .book-group-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .book-category-page .book-card {
    padding: 15px 16px 16px;
    gap: 5px;
    /* 9.75em ≈ 3 行描述 + 书名 + 副题 + 内边距（与桌面同一逻辑） */
    min-height: 9.75em;
  }
  .book-category-page .book-card-name {
    font-size: 1.08rem;
  }
  /* 移动端一列，描述收到 3 行，避免单张卡过高、四本拉出一屏半 */
  .book-category-page .book-card-desc {
    -webkit-line-clamp: 3;
  }
}

