/* ============================================
   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 */
  /* --read-bg 不预定义：保持未定义态，body/卡片等通过 var(--read-bg, 默认背景) 回退；JS 设置亮度时覆盖 */
  --read-font-size: 16px;
  --read-line-height: 1.75;
  --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; }
}
/* 药丸紧凑模式：只收紧内边距，不缩小字体（保证移动端可读） */
@media (max-width: 640px) {
  .topbar.pill-compact .nav-pill { padding: 0.35rem 0.55rem; }
  .topbar.pill-super-compact .nav-pill { padding: 0.28rem 0.4rem; }
}
/* 单个药丸图标隐藏 */
.topbar .nav-pill.pill-icon-hidden i { display: none; }

/* ===== 5. 顶部导航链接 ===== */
.topbar-nav { display: flex; gap: 2px; }

/* ===== 6. 顶部搜索框（桌面端） ===== */
.topbar-search-desktop { display: none; }
@media (min-width: 768px) {
  .topbar-search-desktop {
    display: block;
    width: 320px;
    flex-shrink: 0;
  }
  .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; }
.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-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; }
}

/* 极窄屏（≤380px，如老旧小屏机）：保持与内容区同留白，收紧字号/水平内边距与右侧图标，
   保证“热门/字词通典/讨论”三项可完整放下且顶栏不增高 */
@media (max-width: 380px) {
  .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; }
}

/* 搜索入口互斥铁律：<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);
}

/* ===== 33. 栏目头部卡片 ===== */
.category-header {
  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;
}
.category-title {
  color: var(--accent);
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 0.6rem;
}
.category-description-wrapper {
  margin-bottom: 0.8rem;
}
.category-description-wrapper .category-description {
  margin-bottom: 0;
}
.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%;
}

/* 内容截断 + 虚化渐变 */
.category-description.truncate {
  max-height: 3.4em;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.category-description.truncate::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2em;
  background: linear-gradient(to bottom, transparent, var(--bg-card));
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.category-description.truncate.expanded {
  max-height: none;
}
.category-description.truncate.expanded::after {
  opacity: 0;
}

/* 展开/收起按钮 */
.category-expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  color: var(--accent);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  margin-top: 0.4rem;
  padding: 6px 16px;
  transition: all 0.2s ease;
}
.category-expand-btn:hover {
  background: var(--accent-bg);
  color: var(--accent);
}
.category-expand-btn i {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}
.category-expand-btn.expanded i {
  transform: rotate(180deg);
}

/* 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. 通用行数折叠（hero 描述 / 评论区共用同一套逻辑） ===== */
/* 判定逻辑见 /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;
}
[data-collapse].is-collapsed::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2em;
  background: linear-gradient(to bottom, transparent, var(--collapse-fade, var(--bg-card)));
  pointer-events: none;
  transition: opacity 0.3s ease;
}
[data-collapse].is-expanded::after {
  opacity: 0;
}
.collapse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(var(--accent-rgb), 0.08);
  border: none;
  border-radius: 6px;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  margin-top: 8px;
  padding: 5px 12px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.collapse-toggle:hover {
  background: rgba(var(--accent-rgb), 0.15);
  transform: translateY(-1px);
}
/* 评论区气泡底色与页面卡片不同，渐隐色跟随气泡 */
.feedbacks .msg [data-collapse],
.feedbacks .huifu .reply-item [data-collapse] {
  --collapse-fade: var(--bg-tertiary);
}
@media (max-width: 767px) {
  .collapse-toggle {
    font-size: 0.78rem;
    padding: 4px 10px;
  }
}

/* 书首页章节卡片：两列（心经/金刚经首页同款密度） */
.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);
}
/* 卷名型索引（后汉书等，模板加 .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;
}
.novel-chapter-link {
  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;
  line-height: 1.95;
  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);
}
@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);
}

/* ===== 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);
}
.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 条） */
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.book-chapters a {
  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;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  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;
}
/* 章句全文（道德经 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;
  }
  /* 回目/篇名较长时在手机端换行显示完整，不截断（只作用于普通列表，不碰 --text/--wide） */
  .book-chapters:not(.book-chapters--text):not(.book-chapters--wide) a {
    white-space: normal;
    word-break: break-word;
    line-height: 1.5;
  }
  .book-chapters--wide {
    grid-template-columns: 1fr;
  }
  /* 整章原文型列表（论语/孙子兵法）：手机上必须通栏，否则长文被挤进半宽列、右侧留白 */
  .book-chapters--text {
    grid-template-columns: 1fr;
  }
}

/* 子栏目卡片网格（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;
}

@media (max-width: 640px) {
  .category-header {
    padding: 1rem 1.2rem;
    border-radius: var(--radius-lg);
  }
  .category-title {
    font-size: clamp(1.05rem, 4vw, 1.35rem);
  }
  .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-size: clamp(1.55rem, 3vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  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;
}

/* 生僻字小图（<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);
}

/* 内容图片悬停效果 */
.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;
}
.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；必须用变量引用，否则 JS 调节的 --read-font-size 会被固定值覆盖 */
  :root {
    --read-font-size: 15px;
  }
  .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 {
  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 {
  background: var(--bg-hover);
  color: var(--accent);
  transform: translateY(-1px);
}
.settings-lang-btn:active {
  transform: scale(0.95);
}
.settings-lang-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;
}
.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 输出） ===== */

/* 对照三态切换栏（背景色分层药丸，与全站零边框设计语言一致） */
.read-mode-bar {
  display: flex; gap: 8px; margin: 0 0 24px;
}
.read-mode-bar button {
  border: none;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13.5px;
  padding: 7px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.read-mode-bar button:hover { background: var(--bg-hover); color: var(--text-primary); }
.read-mode-bar button.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

/* 对照段：原文无底 / 译文极浅灰圆弧底块（排版与原文一致，仅背景区分） */
.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; }

/* 注释对照模式（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); }

/* 区块内容形态：短句 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; }

/* 划词锚点 + 注释弹窗 */
.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;
}

/* ===== 已校订标识（书名旁低权重浅灰小字 + 点击气泡） ===== */
.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;
}
/* 移动端单列（与站内区块断点对齐） */
@media (max-width: 767px) {
  .game-grid { grid-template-columns: 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; }
/* 五子棋：黑白双子球面质感（高光+边缘明暗，模拟真实棋子） */
.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;
  padding: 1.35rem 1.6rem;
}
.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%;
}

/* 栏目文章列表：标题更醒目、摘要两行截断 */
.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; }
}
