/* ============================================
   5000言 v2 主题样式
   设计法则：零下划线、零边框、纯背景色分层
   药丸交互 · 毛玻璃卡片 · 日夜双模式
   ============================================ */

/* ===== 1. 全局变量 - 深色主题（默认） ===== */
:root {
  /* 页面底色层级 */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-surface: rgba(30, 41, 59, 0.7);

  /* 卡片 */
  --bg-card: rgba(30, 41, 59, 0.8);
  --bg-card-hover: rgba(30, 41, 59, 0.95);

  /* 交互态 */
  --bg-hover: rgba(148, 163, 184, 0.08);
  --bg-active: rgba(46, 160, 67, 0.12);

  /* 文字 */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* 强调色（深森林绿系 — 暗色模式下需稍亮以保证可读性） */
  --accent: #2ea043;
  --accent-hover: #3fb950;
  --accent-rgb: 46, 160, 67;
  --accent-bg: rgba(46, 160, 67, 0.12);
  --accent-bg-hover: rgba(46, 160, 67, 0.2);

  /* 危险色 */
  --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(15, 23, 42, 0.85);
  --header-blur: 12px;
  --footer-bg: #070d18;

  /* 表单 */
  --input-bg: #0b1120;
  --input-focus-bg: #0d1526;

  /* 顶部导航专用变量 */
  --topbar-bg: rgba(15, 23, 42, 0.85);
  --topbar-tab-bg: rgba(255, 255, 255, 0.04);
  --topbar-dropdown-bg: #111b2e;
  --topbar-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);

  /* 过渡 */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* 字体 */
  --font: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* 加载骨架 */
  --shimmer: linear-gradient(105deg, var(--bg-secondary) 0%, #2a3340 45%, var(--bg-secondary) 90%);
}

/* ===== 浅色主题 ===== */
html.light {
  /* 页面底色 — 暖白纸色，平滑递进 */
  --bg-primary: #f5f2ed;
  --bg-secondary: #eeebe4;
  --bg-tertiary: #e5e0d8;
  --bg-surface: #f1ede7;

  /* 卡片 — 半透明白，柔和护眼 */
  --bg-card: rgba(255, 255, 255, 0.80);
  --bg-card-hover: rgba(255, 255, 255, 0.95);

  /* 交互态 */
  --bg-hover: rgba(0, 0, 0, 0.05);
  --bg-active: rgba(27, 107, 58, 0.10);

  /* 文字 — 微微柔化，保持可读性 */
  --text-primary: #1e2024;
  --text-secondary: #3d4148;
  --text-muted: #7a8089;
  --text-dim: #9ca3af;

  /* 强调色 — 翠绿系，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);

  /* 危险色 — 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: #ffffff;
  --input-focus-bg: #f5f2ed;

  /* 顶栏 */
  --topbar-bg: rgba(245, 242, 237, 0.85);
  --topbar-tab-bg: rgba(0, 0, 0, 0.04);
  --topbar-dropdown-bg: rgba(255, 255, 255, 0.95);
  --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;
}
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: 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);
}
a:hover {
  color: var(--accent-hover);
}
::selection {
  background: var(--accent-bg);
  color: var(--accent);
}
input:not([type="checkbox"]):not([type="radio"]),
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;
  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;
}
.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-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 0.85rem;
  flex-shrink: 0;
}
.topbar-logo-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}
.topbar-logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.03em;
}

/* ===== 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图标/文字 ===== */
.topbar.logo-icon-hidden .topbar-logo-icon { display: none; }
.topbar.logo-text-hidden .topbar-logo-text { display: none; }
.topbar.logo-text-hidden .topbar-left { gap: 0; }

/* ===== 5. 顶部导航链接 ===== */
.topbar-nav { display: flex; gap: 2px; }

/* ===== 6. 顶部搜索框（桌面端） ===== */
.topbar-search-desktop { display: none; }
@media (min-width: 641px) {
  .topbar-search-desktop {
    display: block;
  }
  .topbar-search-desktop form {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .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: 34px;
    height: 36px;
    transition: background 0.2s;
  }
  .topbar-search-input-wrap:focus-within {
    background: var(--input-bg);
  }
  .topbar-search-inner-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 0.78rem;
    pointer-events: none;
  }
  .topbar-search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.82rem;
    outline: none;
    min-width: 0;
    padding: 0 4px 0 0;
  }
  .topbar-search-input::placeholder {
    color: var(--text-dim);
    font-size: 0.78rem;
  }
  .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: 32px;
    padding: 0 18px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    font-size: 0.8rem;
    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: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  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. 导航药丸组（从用户中心复用） ===== */
.nav-pills {
  display: flex;
  gap: 6px;
  padding: 6px;
  border-radius: var(--radius-full);
  background: var(--topbar-tab-bg);
  width: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nav-pills::-webkit-scrollbar { display: none; }
.nav-pill {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-full);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
}
.nav-pill:hover { color: var(--text-secondary); }
.nav-pill.active {
  color: var(--accent);
  background: var(--accent-bg);
  font-weight: 600;
}
.nav-pill i { font-size: 0.7rem; opacity: 0.8; }

/* ===== 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.5rem;
  flex-shrink: 0;
  position: relative;
}
.topbar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.topbar-user-placeholder {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255,255,255,0.03);
  flex-shrink: 0;
}
html.light .topbar-user-placeholder {
  background: rgba(0,0,0,0.02);
}
.topbar-user-icon { font-size: 20px; color: var(--text-muted); }
.topbar-user-name { display: none; }
.topbar-avatar-wrap {
  position: relative;
  z-index: 1;
  cursor: pointer;
}

/* 桌面端：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: translateX(-50%) translateY(0) scale(1);
  transition-delay: 0s;
  visibility: visible;
}

/* 下拉菜单 */
.topbar-dropdown {
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  background: var(--topbar-dropdown-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 18px;
  padding: 6px;
  min-width: 170px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-4px) scale(0.96);
  transform-origin: top center;
  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.82rem;
  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.85rem;
  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: 200px;
  max-width: 380px;
  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);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 18px;
  padding: 8px;
  box-shadow: var(--topbar-shadow);
}
.search-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.search-history-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s;
  opacity: 0.6;
}
.search-history-clear:hover {
  color: var(--danger);
  background: rgba(239,68,68,0.1);
  opacity: 1;
}
.search-history-list {
  display: flex;
  flex-direction: column;
}
.search-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 12px;
  cursor: pointer;
  padding: 8px 10px;
  transition: background 0.25s ease;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.search-history-item:hover {
  background: var(--bg-hover);
}
.search-history-item-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-history-item-text::before {
  content: '\f1da';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.65rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.search-history-item-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 0.7rem;
  opacity: 0;
  padding: 3px 8px;
  border-radius: 4px;
  transition: all 0.25s ease;
}
.search-history-item:hover .search-history-item-del { opacity: 1; }
.search-history-item-del:hover {
  color: var(--danger);
  background: rgba(239,68,68,0.1);
}
.search-history-empty {
  color: var(--text-muted);
  cursor: default;
  font-size: 0.8rem;
  justify-content: center;
  padding: 12px 10px;
}
.search-history-hot {
  border-top: 1px solid rgba(255,255,255,0.05);
  margin-top: 4px;
  padding: 8px 2px 0;
}
html.light .search-history-hot {
  border-top-color: rgba(0,0,0,0.04);
}
.search-history-hot-header {
  color: var(--text-muted);
  font-size: 0.7rem;
  padding: 0 8px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.search-history-hot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 6px 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.78rem;
  padding: 5px 12px;
  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: 380px;
  }
  .search-history-panel.show {
    transform: translateX(-50%) scale(1) !important;
  }
}

/* ===== 12. 卡片（从用户中心复用） ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem 1.8rem;
  margin-bottom: 0.9rem;
  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: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-hd i { color: var(--accent); font-size: 0.85rem; }

@media (max-width: 640px) {
  .card {
    padding: 1.2rem 1rem;
    border-radius: var(--radius-lg);
  }
  .card:hover { transform: none; }
}

/* ===== 13. 表单（从用户中心复用） ===== */
.field { margin-bottom: 1rem; }
.field-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.field-row .label {
  min-width: 72px;
  text-align: right;
  margin-bottom: 0;
  flex-shrink: 0;
}
.field-row .input { flex: 1; }
.label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
  padding-left: 2px;
}
.input {
  width: 100%;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-full);
  border: none;
  background: var(--input-bg);
  color: var(--text-primary);
  font-size: 0.88rem;
  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.55rem 1.3rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  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.3rem 0.8rem;
  font-size: 0.74rem;
}
.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.8rem 0.9rem;
  font-size: 0.85rem;
  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.72rem;
  margin-left: 0.6rem;
  white-space: nowrap;
}

/* ===== 16. 消息提示（从用户中心复用） ===== */
.msg {
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  margin-bottom: 1rem;
}
.msg--err {
  background: var(--danger-bg);
  color: var(--danger);
}
.msg--ok {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ===== 17. 空状态（从用户中心复用） ===== */
.empty {
  text-align: center;
  padding: 3.5rem 1rem;
  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: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.9rem;
  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: 2.5rem 0 2rem;
  color: var(--text-dim);
  font-size: 0.75rem;
  opacity: 0.35;
}

/* ===== 22. 动画 ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.animate-in {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s cubic-bezier(0.22,1,0.36,1), transform 0.5s cubic-bezier(0.22,1,0.36,1);
}
.animate-in.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 23. 响应式辅助 ===== */
@media (max-width: 640px) {
  .topbar {
    flex-wrap: nowrap;
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.6rem;
    gap: 0.4rem;
  }
  .topbar-user::after { display: none; }
  .topbar-user .topbar-dropdown { display: none !important; }
  .topbar-search-mobile { display: flex; }
  .nav-pills { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; flex-shrink: 0; }
  .nav-pill { padding: 0.4rem 0.65rem; font-size: 0.76rem; }
  .topbar-left { gap: 0.4rem; min-width: 0; flex: 1; }
  .topbar-right { flex-shrink: 0; gap: 2px; }
}

/* ===== 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-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.category-block-title {
  margin: 0 0 0.6rem 0;
  font-size: 0.95rem;
  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.75rem;
  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(51, 65, 85, 0.55);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  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.88rem;
  }
  .category-link {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
  }
  .category-list {
    gap: 6px;
  }
}

/* ===== 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. 每日一言卡片 ===== */
.wisdom-section {
  margin-bottom: 1rem;
}
.wisdom-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}
.wisdom-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.wisdom-quote-cn {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.7;
  cursor: pointer;
  text-wrap: pretty;
  transition: color 0.25s ease;
}
.wisdom-quote-cn:hover {
  color: var(--accent);
}
.wisdom-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.8rem;
  width: 100%;
}
.wisdom-theme { display: none; font-size: 0.75rem; color: var(--text-muted); font-style: italic; }
.wisdom-card.expanded .wisdom-theme { display: block; }
.wisdom-theme::before { content: "—— "; font-style: normal; }
.wisdom-theme:empty::before { content: none; }
.wisdom-actions {
  margin-left: auto;
  display: flex;
  gap: 4px;
}
.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: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.92rem;
  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.75rem;
  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;
}

/* ===== 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.8rem;
  line-height: 1.6;
  max-width: 380px;
  margin: 0;
}
.footer-nav {
  display: flex;
  gap: 2.5rem;
}
.footer-nav-section h4 {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.footer-nav-link {
  color: var(--text-dim);
  font-size: 0.82rem;
  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;
  text-align: center;
  font-size: 0.75rem;
}
.footer-bottom, .footer-bottom a {
  color: var(--text-dim);
}
html.light .footer-bottom {
  border-top-color: rgba(0,0,0,0.06);
}

@media (max-width: 640px) {
  .wisdom-card {
    padding: 14px 16px;
    border-radius: var(--radius);
  }
  .wisdom-quote-cn {
    font-size: 0.88rem;
  }
  .wisdom-footer {
    margin-top: 0.6rem;
  }
  .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.85rem;
  }
  .footer {
    padding: 1.5rem 0 1rem;
    margin-top: 1.5rem;
  }
  .footer-content {
    flex-direction: column;
    gap: 1.2rem;
  }
  .footer-nav {
    gap: 1.5rem;
  }
}

/* ===== 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;
}

/* ===== 30. 热门图书（remen.htm） ===== */
.hot-section {
  margin-bottom: 1.5rem;
}
.hot-section .category-block-header {
  margin-bottom: 1rem;
}
.hot-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
}
.hot-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.25s ease;
}
.hot-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.hot-link {
  color: var(--text-primary);
  text-decoration: none;
  flex: 1;
  min-width: 0;
}
.hot-title {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}
.hot-link:hover .hot-title { color: var(--accent); }
.hot-meta {
  color: var(--text-muted);
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--bg-surface);
  white-space: nowrap;
  flex-shrink: 0;
}
.hot-item .article-thumbnail {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-tertiary);
}
.hot-item .article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== 31. 搜索页面（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.75rem;
  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(260px, 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: linear-gradient(135deg, rgba(var(--accent-rgb), 0.06), rgba(var(--accent-rgb), 0.02));
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
}
.search-card-book:hover {
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), rgba(var(--accent-rgb), 0.04));
}
.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 { color: var(--accent); font-size: 0.95rem; }
.search-card:hover .search-card-name { color: var(--accent); }
.search-card-desc {
  color: var(--text-muted);
  font-size: 0.75rem;
  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-book:hover .search-card-link-hint { opacity: 1; transform: translateX(0); }

/* 精确匹配顶部栏目卡片 */
.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.82rem;
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* 热门搜索区块 */
.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-card);
  border: 1px solid var(--bg-tertiary);
  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);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}
.search-hot-count {
  background: rgba(var(--accent-rgb), 0.12);
  border-radius: 12px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 1px 8px;
}
.search-hot-tag:hover .search-hot-count {
  background: rgba(255,255,255,0.25);
  color: #fff;
}
.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: 1.4rem 0 0.8rem;
  padding: 0.5rem 0;
  font-size: 0.82rem;
  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.9rem;
  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.8rem;
  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);
}

/* 子栏目标签（药丸风格） */
.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);
}

/* 子栏目卡片网格（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: 0.95rem;
  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.72rem;
  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.82rem;
  line-height: 1.6;
  margin-top: 0.35rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

/* 诗词列表 —— 居中、大间距，不截断 */
.la-item-desc.poem-preview {
  font-size: 0.88rem;
  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.88rem;
  }
  .la-item-desc {
    font-size: 0.78rem;
  }
  .breadcrumb {
    margin: 0.8rem 0 0.5rem;
    font-size: 0.75rem;
  }
  .category-block-text {
    font-size: 0.85rem;
  }
}

/* ===== 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(140px, 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-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.5rem;
  padding-bottom: 0.4rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(128, 128, 128, 0.12);
}
html.dark .category-list-section > .category-block-title {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
.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. 阅读页布局 ===== */
/* 阅读页基础宽度：52rem 舒适阅读 + 侧边内边距，不超出导航栏 */
.reading-page {
  margin: 0 auto;
  max-width: min(calc(52rem + 3rem), 94vw);
  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 auto;
  max-width: 52rem;
  width: 100%;
}
.reading-page--chapter .reading-measure {
  padding: 18px 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.1rem, 2.4vw, 1.45rem);
  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.1rem, 2.4vw, 1.45rem) * 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(--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端文章底部操作按钮 */
.article-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 24px 0;
}
.article-action-btn {
  align-items: center;
  background: 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);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
}
.reading-content p {
  margin-bottom: 1.25em;
  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;
}

/* 内容图片悬停效果 */
.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(--bg-surface);
  border-radius: var(--radius);
}
.poem-verse p,
.poem-verse div {
  text-align: left;
  margin-bottom: 0.4em;
  font-size: 1.1em;
  line-height: 1.9;
  letter-spacing: 0.04em;
  font-family: var(--font), "STKaiti", "KaiTi", "楷体", serif;
  font-weight: 400;
}
.poem-verse p:last-child,
.poem-verse div:last-child {
  margin-bottom: 0;
}

/* ===== 43c. 注释/翻译块 ===== */
.annotation-block {
  margin: 1.5em 0;
  padding: 1em 1.25em;
  background: var(--accent-bg);
  border-radius: var(--radius);
  line-height: 1.9;
}
.annotation-block .annotation-label {
  display: block;
  font-size: 0.95em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.5em;
}
.annotation-block--translation {
  background: #fffdf5;
}
.annotation-block--interpretation {
  background: #f8f6fc;
}
html.dark .annotation-block--translation {
  background: #2a2518;
}
html.dark .annotation-block--interpretation {
  background: #1e1a2e;
}

/* 田字格（neirong_ciju.htm 内联样式迁移至全局） */
.char-grid-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2em 0 1.5em;
}
.char-pinyin {
  font-size: 1.1rem;
  line-height: 1;
  margin-bottom: 0.6em;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
.char-grid {
  position: relative;
  width: 120px;
  height: 120px;
  border: 2px solid var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
}
.char-grid::before,
.char-grid::after {
  content: '';
  position: absolute;
  background: rgba(128, 128, 128, 0.12);
}
.char-grid::before {
  top: 0;
  left: 50%;
  width: 1px;
  height: 100%;
  transform: translateX(-0.5px);
}
.char-grid::after {
  top: 50%;
  left: 0;
  height: 1px;
  width: 100%;
  transform: translateY(-0.5px);
}
html.dark .char-grid::before,
html.dark .char-grid::after {
  background: rgba(255, 255, 255, 0.06);
}
.char-grid-text {
  position: relative;
  z-index: 1;
  font-size: 4rem;
  line-height: 1;
  font-family: "Ma Shan Zheng", "Noto Serif SC", "Source Han Serif CN", "KaiTi", serif;
  color: var(--text-primary);
}

/* ===== 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(--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(--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: 12px;
  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: 13px;
  padding: 4px 0 8px 0;
}
.pc-sidebar-chapters::-webkit-scrollbar {
  display: none;
}
.pc-sidebar-chapters {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.pc-sidebar-section--ad {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  overflow: visible;
}

/* ===== 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);
}
.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 {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  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-page {
    max-width: 100%;
    padding: 16px 14px 40px;
  }
  .reading-layout {
    gap: 0;
  }
  .pc-right-sidebar {
    display: none;
  }
  .top-book-nav {
    margin-bottom: 20px;
    padding: 8px 0 12px 0;
  }
  .reading-content {
    font-size: 0.95rem;
  }
  .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;
  }
  /* 田字格缩小 */
  .char-grid {
    width: 96px;
    height: 96px;
  }
  .char-grid-text {
    font-size: 3.2rem;
  }
  /* 底部导航栏 */
  .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-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;
  }
  /* 内容页有侧边栏时：52rem阅读区 + 300px侧边栏 + 间距，不超导航栏宽度 */
  .reading-page--chapter {
    max-width: min(calc(52rem + 2rem + 300px), 94vw);
  }
}

/* 极小屏幕 */
@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);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  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 {
  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 {
  background: var(--bg-hover);
  color: var(--accent);
  transform: translateY(-1px);
}
.settings-font-btn:active {
  transform: scale(0.95);
}
.settings-font-btn.active {
  background: var(--accent);
  color: #fff;
}

/* 语言切换按钮 */
.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; }
#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;
}

/* ---- 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; align-items: center;
  justify-content: space-between; padding: 6px 0 0;
  position: relative; flex-wrap: wrap;
}
.wqy-pl .b-submit-button input {
  background-color: var(--accent); border: none;
  border-radius: 10px; color: #fff; cursor: pointer;
  font-size: 14px; height: 32px; text-align: center;
  transition: opacity 0.2s ease; width: 60px; flex-shrink: 0;
}
.wqy-pl .b-submit-button input:hover { opacity: 0.85; }
.wqy-pl .b-submit-button input:active { opacity: 1; transform: scale(0.97); }

/* PC发布框内的emoji按钮 */
.wqy-pl .emoji-trigger {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1.3em; padding: 4px 6px;
}
.wqy-pl .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.5rem 0; position: relative;
}
.feedbacks .comment-block + .comment-block {
  margin-top: 0.75rem; padding-top: 0.85rem;
  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: 6px;
}
.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 左缩进对齐头像 */
.feedbacks .msg { margin-left: calc(45px + 10px); }

/* 评论内容气泡 */
.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: 14px 16px; 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: 6px; padding-left: 16px;
  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;
}
.feedbacks .feedback-action .action-left a:hover {
  color: var(--accent) !important;
}
.commentVote { cursor: pointer; }
.commentVote:hover { opacity: 0.8; }
.commentVote.liked { color: var(--success) !important; }

/* 删除按钮 */
.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） ===== */
/* 展开/收起子回复按钮 */
.mobile-reply-toggle {
  cursor: pointer; margin: 4px 0;
  margin-left: calc(45px + 10px);
  display: block;
}
.mobile-reply-toggle .reply-count {
  color: var(--success); font-size: 13px;
  padding-left: 16px;
}
.mobile-reply-toggle:hover .reply-count { opacity: 0.8; }

/* 子回复容器（父级 .huifu 已提供 margin-left，此处不再追加以免双重缩进） */
.mobile-replies-container {
  margin-top: 8px; display: none;
}
.mobile-replies-container.open { display: block; }

/* 子回复头部 */
.mobile-replies-header {
  font-size: 13px; color: var(--text-muted);
  padding: 8px 0 4px 0; font-weight: 400;
  margin-bottom: 4px;
}

/* 子回复列表（对齐 .huifu） */
.feedbacks .huifu {
  margin-left: calc(45px + 10px); padding: 0;
}
.feedbacks .huifu .reply-item {
  padding: 8px 0; display: flex;
  align-items: center; flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle, rgba(216,211,202,0.4));
}
.feedbacks .huifu .reply-item:last-child { border-bottom: none; }
.feedbacks .huifu .reply-item .face {
  border-radius: 50%; height: 35px; margin-right: 10px;
  object-fit: cover; width: 35px; flex-shrink: 0;
}
.feedbacks .huifu .reply-item .face-placeholder {
  border-radius: 50%; height: 35px; margin-right: 10px;
  width: 35px; flex-shrink: 0;
  background: var(--bg-tertiary);
  display: flex; align-items: center;
  justify-content: center;
  color: var(--text-muted); font-size: 0.8rem;
}
.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;
}
.feedbacks .huifu .reply-item .msg {
  margin-left: 0; margin-top: 6px;
  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: 14px;
  line-height: 1.6; margin-top: 2px;
  padding: 10px 14px; word-break: break-word;
}
.feedbacks .huifu .reply-item .feedback-content img {
  height: auto; max-height: 16px; max-width: 16px;
  vertical-align: middle;
}
.feedbacks .huifu .reply-item .feedback-action {
  padding-left: 14px;
}
.feedbacks .huifu .reply-item .action-left {
  align-items: center; color: var(--text-muted);
  display: flex; flex-wrap: wrap; font-size: 12px; 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: 12px; 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; }
.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; 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); }

/* ===== 移动端评论弹窗（对齐 .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;
}
.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;
}

/* ===== 原文翻译对比按钮 ===== */
.compare-button {
  background-color: var(--bg-tertiary); border: none; border-radius: 50px;
  color: var(--accent); cursor: pointer; display: block;
  font-size: 14px; font-weight: 500;
  margin: 0 auto 15px auto; outline: none;
  padding: 8px 20px; transition: all 0.2s ease;
}
.compare-button:hover {
  background-color: var(--accent); color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.25);
}
.yuanwen {
  background-color: #f8f5f0; border-radius: 8px;
  color: #3d3d3d; font-size: 15px; line-height: 1.9;
  padding: 15px 18px; text-align: left; width: 50%;
}
.fanyi {
  background-color: #fff8e7; border-radius: 8px;
  color: #3d3d3d; font-size: 15px; line-height: 1.9;
  padding: 15px 18px; text-align: left; width: 50%;
}
.para-container { display: flex; gap: 10px; justify-content: space-between; margin-bottom: 3px; }
html.dark .yuanwen { background-color: #2a2a2a; color: #e8e8e8; }
html.dark .fanyi { background-color: #352e20; color: #e8e8e8; }

/* ===== 收藏图标 ===== */
.wq-faved { color: #f0a500 !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定位，无滚动条） ===== */
.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);
  width: 340px;
}

/* ===== 响应式：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); }
  .feedbacks .huifu { margin-left: calc(38px + 10px); }
  .mobile-reply-toggle { margin-left: calc(38px + 10px); }
  .mobile-replies-container { margin-left: calc(38px + 10px); }

  /* 内容气泡缩减间距 */
  .feedbacks .msg .feedback-content {
    padding: 10px 12px; font-size: 14px;
  }
  .feedbacks .huifu .reply-item .feedback-content {
    padding: 8px 12px; font-size: 13px;
  }

  /* 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.05);
}
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 .commentVote.liked { color: #5cb88a !important; }
html.dark .mobile-reply-toggle .reply-count { color: #5cb88a; }
html.dark .feedbacks .reply-to-text { color: #5cb88a; }

/* ===== 论道页内嵌评论框（不在.wqy-pl内，需要独立样式） ===== */
.lundao-comments .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: 36px; outline: none;
  padding: 8px 10px; width: 100%; box-sizing: border-box;
}
html.dark .lundao-comments .b-box-textarea .b-box-content {
  background-color: var(--bg-tertiary);
  border: none;
  color: var(--text-primary);
}

/* ===== 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; }
