/* ============================================================
   播客精读 · Design System v2
   设计语言：中文报纸/账本编辑部——暖纸底、墨色字、绛红印章点缀、
   思源宋体大标题、直角 hairline 分隔、克制的金色装饰。
   三主题：light（米纸）/ sepia（羊皮纸）/ dark（暖棕黑），
   阅读器变量（--reader-*）支持字体族/字号/行距自定义。
   ============================================================ */

:root,
:root[data-theme='light'] {
  --bg: #f6efe3;
  --card: #faf7f1;
  --line: #ded5ca;
  --line-strong: #c1b8ad;
  --rule: #2a1a14;
  --text: #2a1a14;
  --text-soft: #473831;
  --text-faint: #a0968c;
  --muted: #7c6f67;
  --accent: #8c1c2b;
  --accent-hover: #741c25;
  --on-accent: #ffffff;
  --gold: #b8863b;
  --zh-soft: rgba(140, 28, 43, 0.07);
  --trans-bg: rgba(140, 28, 43, 0.04);
  --mark-bg: rgba(184, 134, 59, 0.22);
  --shadow: 0 14px 40px rgba(42, 26, 20, 0.12), 0 2px 6px rgba(42, 26, 20, 0.05);
  --f-bg: #2a1a14;
  --f-text: #eeedec;
  --f-soft: #b3aeab;
  --f-faint: #827975;
  --f-line: rgba(238, 237, 236, 0.13);
  color-scheme: light;
}

:root[data-theme='sepia'] {
  --bg: #f3ead6;
  --card: #f9f2e3;
  --line: #dbd2bf;
  --line-strong: #bfb7a4;
  --rule: #2b2416;
  --text: #2b2416;
  --text-soft: #474031;
  --text-faint: #9f9785;
  --muted: #7b7363;
  --accent: #8c1c2b;
  --accent-hover: #741e26;
  --on-accent: #ffffff;
  --gold: #b8863b;
  --zh-soft: rgba(140, 28, 43, 0.07);
  --trans-bg: rgba(140, 28, 43, 0.04);
  --mark-bg: rgba(184, 134, 59, 0.22);
  --shadow: 0 14px 40px rgba(43, 36, 22, 0.12), 0 2px 6px rgba(43, 36, 22, 0.05);
  --f-bg: #2b2416;
  --f-text: #eeedec;
  --f-soft: #b4b1ac;
  --f-faint: #837e76;
  --f-line: rgba(238, 237, 236, 0.13);
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #1a1210;
  --card: #251c1a;
  --line: #3c3430;
  --line-strong: #5a514b;
  --rule: #efe4d6;
  --text: #efe4d6;
  --text-soft: #d1c7ba;
  --text-faint: #736a63;
  --muted: #9a9087;
  --accent: #e08a74;
  --accent-hover: #e8a797;
  --on-accent: #1a1210;
  --gold: #d7a95a;
  --zh-soft: rgba(224, 138, 116, 0.07);
  --trans-bg: rgba(224, 138, 116, 0.04);
  --mark-bg: rgba(215, 169, 90, 0.3);
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  --f-bg: #0f0a08;
  --f-text: #ecebeb;
  --f-soft: #aaa8a7;
  --f-faint: #726f6e;
  --f-line: rgba(236, 235, 235, 0.13);
  color-scheme: dark;
}

:root {
  --font-serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'Source Han Serif SC', 'SimSun', serif;
  --font-kai: 'LXGW WenKai Screen', 'Kaiti SC', 'STKaiti', 'KaiTi', var(--font-serif);
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Noto Sans SC', sans-serif;

  /* 阅读器自定义（app.js / 内联脚本按 localStorage 覆写） */
  --reader-font: var(--font-serif);
  --reader-size: 17px;
  --reader-leading: 2;

  --wrap: 1200px;
  --prose: 40rem;
}

/* ---------- Reset & Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-width: 0;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  overflow-wrap: anywhere;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  vertical-align: middle;
}

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

::selection {
  background: var(--mark-bg);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--card);
  color: var(--text);
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

/* 通用小标签（kicker）：源站式大字距 */
.kicker {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-weight: 600;
}

/* ---------- 顶栏（dateline + actions） ---------- */

.topbar {
  border-bottom: 1px solid var(--line);
}

.topbar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}

.topbar-date {
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 13px;
  color: var(--text-soft);
}

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

.topbar-nav .nav-link {
  letter-spacing: 0.08em;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 0.4rem;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text-soft);
  cursor: pointer;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  transition: color 0.2s ease;
}

.icon-btn:hover {
  color: var(--accent);
}

/* ---------- 报头 masthead（金线双框 + 巨型衬线标题） ---------- */

.masthead {
  position: relative;
  margin: 12px auto 0;
  max-width: calc(var(--wrap) - 48px);
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
  padding: 2.6rem 2rem 2.2rem;
  text-align: center;
}

.masthead::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid var(--gold);
  pointer-events: none;
  opacity: 0.55;
}

.masthead > * {
  position: relative;
}

.mast-kicker {
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--gold);
  font-weight: 600;
  margin: 0;
}

.mast-title {
  font-weight: 700;
  font-size: clamp(38px, 6.4vw, 84px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0.9rem 0 0;
}

.mast-title a {
  text-decoration: none;
}

.mast-rule {
  width: 168px;
  height: 1px;
  background: var(--line-strong);
  border: 0;
  margin: 1.4rem auto 1.1rem;
}

.mast-tagline {
  color: var(--text-soft);
  font-size: 14px;
  margin: 0 auto;
  max-width: 34rem;
}

.mast-facts {
  display: flex;
  justify-content: center;
  margin-top: 1.8rem;
  border-block: 1px solid var(--line);
}

.mast-facts > div {
  padding: 1rem 2.2rem;
  border-inline-start: 1px solid var(--line);
}

.mast-facts > div:first-child {
  border-inline-start: 0;
}

.mast-facts b {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.mast-facts span {
  display: block;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-top: 0.25rem;
}

.mast-intro {
  max-width: 40rem;
  margin: 1.5rem auto 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.9;
}

.mast-intro .mast-hosts {
  display: block;
  margin-top: 0.5rem;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 13.5px;
  letter-spacing: 0.08em;
}

.mast-actions {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  margin-top: 1.5rem;
}

.mast-actions a,
.mast-actions button {
  font-family: var(--font-serif);
  font-size: 13.5px;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0;
}

.mast-actions a:hover,
.mast-actions button:hover {
  color: var(--accent);
}

/* ---------- 单集行式列表（hairline 分隔，无卡片盒） ---------- */

.ep-list {
  display: flex;
  flex-direction: column;
}

.ep-card {
  border-bottom: 1px solid var(--line);
  padding: 1.05rem 0.2rem;
  transition: background 0.2s ease;
}

.ep-card:hover {
  background: var(--card);
}

.ep-card.is-seen {
  opacity: 0.55;
}

.ep-link {
  display: block;
}

.ep-link.pending {
  cursor: default;
}

.ep-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.badge {
  font-family: var(--font-serif);
  font-weight: 600;
  color: var(--show-accent, var(--accent));
  letter-spacing: 0.1em;
}

.read-badge {
  color: var(--accent);
  font-weight: 600;
}

.read-badge.pending {
  color: var(--text-faint);
  font-weight: 400;
}

.ep-title {
  margin: 0.35rem 0 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.5;
}

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

.ep-sub {
  margin: 0.25rem 0 0;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-serif);
}

.ep-excerpt {
  margin: 0.4rem 0 0;
  font-size: 13.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ---------- 电台墙 ---------- */

.show-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
  gap: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.show-card {
  display: block;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 1.6rem;
  transition: background 0.2s ease;
}

.show-card:hover {
  background: var(--card);
}

.show-card-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.show-card-head h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.show-card:hover .show-card-head h3 {
  color: var(--accent);
}

.show-host {
  margin: 0.4rem 0 0;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--show-accent, var(--accent));
}

.show-tagline {
  margin: 0.5rem 0 0;
  font-size: 13.5px;
  color: var(--text-soft);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.show-meta {
  margin: 0.9rem 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* ---------- 电台页头部（报头式） ---------- */

.show-hero {
  text-align: center;
  padding-top: 2rem;
}

.show-title {
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.12;
  margin: 0.8rem 0 0;
}

.show-host-line {
  font-family: var(--font-serif);
  color: var(--text-soft);
  font-size: 14px;
  letter-spacing: 0.06em;
  margin: 1rem 0 0;
}

.show-desc {
  max-width: 38rem;
  margin: 0.9rem auto 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.9;
}

/* ---------- 筛选工具栏 ---------- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-block: 1px solid var(--line);
  margin-top: 2.2rem;
}

#quick-search {
  flex: 1 1 15rem;
  min-inline-size: 0;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--card);
  color: var(--text);
  font-size: 13.5px;
}

#quick-search::placeholder {
  color: var(--text-faint);
}

.chips {
  display: flex;
  gap: 0.2rem;
}

.chip {
  padding: 0.35rem 0.9rem;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  color: var(--text);
}

.chip.active {
  color: var(--text);
  border-bottom-color: var(--gold);
}

.topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.3rem;
  margin: 1.4rem 0 0;
  padding: 0;
}

.topic-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--text-soft);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.topic-chip:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.topic-count {
  font-size: 11.5px;
  color: var(--text-faint);
  font-family: var(--font-sans);
}

/* ---------- 继续阅读 ---------- */

.continue {
  margin-top: 2.2rem;
  padding: 0.95rem 1.2rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  background: var(--card);
  font-size: 13.5px;
}

.continue.hidden {
  display: none;
}

.continue a {
  color: var(--accent);
  font-weight: 600;
}

.continue .clear-history {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.continue-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ---------- 按钮 ---------- */

.btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 1.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.5rem;
  border-radius: 0;
  border: 1px solid var(--rule);
  font-family: var(--font-serif);
  font-size: 13.5px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

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

.btn.ghost {
  background: none;
  border-color: var(--line-strong);
  color: var(--text-soft);
}

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

/* ---------- 章节标题 ---------- */

.sec-title {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.4rem;
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.sec-h {
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.7rem;
  margin-bottom: 0.4rem;
}

.sec-h .sec-title {
  margin: 0;
}

.section {
  margin-top: 3.2rem;
}

.empty {
  color: var(--muted);
  padding: 1.4rem 0;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--show-accent, var(--accent));
  align-self: center;
}

/* ---------- 精读文章页 ---------- */

.ep-layout {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  gap: 3rem;
  padding-top: 2.2rem;
}

.toc {
  position: sticky;
  top: 1.4rem;
  align-self: start;
  max-height: calc(100vh - 3rem);
  overflow: auto;
  font-size: 13px;
}

.toc-title {
  font-family: var(--font-sans);
  color: var(--muted);
  letter-spacing: 0.18em;
  font-size: 11.5px;
  font-weight: 500;
  margin: 0 0 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li a {
  display: block;
  padding: 0.32rem 0;
  color: var(--muted);
  border-bottom: 1px solid var(--trans-bg);
}

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

.toc li.toc-l3 a {
  padding-left: 1rem;
}

.toc-bar {
  display: block;
  height: 2px;
  margin-top: 0.25rem;
  border-radius: 0;
  background: var(--gold);
  opacity: 0.6;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 1.6rem;
}

.article {
  max-width: calc(var(--prose) + 2rem);
}

.article-header .kicker {
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.18em;
}

.article-title {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 900;
  line-height: 1.4;
  letter-spacing: 0.01em;
  margin: 0.7rem 0 0;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  margin-top: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--line);
}

/* 速览与要点 */

.tldr {
  margin-top: 1.8rem;
  padding: 1rem 1.3rem;
  background: var(--zh-soft);
  border: 0;
  border-left: 3px solid var(--accent);
}

.tldr h2 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.4rem;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--accent);
}

.tldr p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 1.95;
}

.keypoints {
  margin-top: 1.4rem;
  padding: 1rem 1.3rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  background: var(--card);
}

.keypoints h2 {
  margin: 0 0 0.5rem;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--text-soft);
}

.keypoints ol {
  margin: 0;
  padding-left: 1.3rem;
}

.keypoints li {
  margin: 0.32rem 0;
  font-size: 14.5px;
  line-height: 1.8;
}

.keypoints li::marker {
  color: var(--gold);
  font-weight: 700;
}

/* 正文（阅读器变量作用区） */

.prose {
  margin-top: 2.2rem;
  font-family: var(--reader-font);
  font-size: var(--reader-size);
  line-height: var(--reader-leading);
  color: var(--text);
}

.prose h2 {
  font-size: 1.45em;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 2.1em 0 0.75em;
  scroll-margin-top: 1.5rem;
}

.prose h3 {
  font-size: 1.15em;
  font-weight: 700;
  margin: 1.8em 0 0.55em;
  scroll-margin-top: 1.5rem;
}

.prose p {
  margin: 0 0 1.05em;
}

.prose strong {
  color: var(--accent);
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--mark-bg);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose blockquote {
  margin: 1.4em 0;
  padding: 0.15em 0 0.15em 1.2em;
  border-left: 3px solid var(--gold);
  color: var(--text-soft);
}

/* 金句 */

.quotes {
  margin-top: 3rem;
}

.quotes h2 {
  font-size: 19px;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.quote-card {
  margin: 1.2rem 0;
  padding: 1.1rem 1.4rem;
  background: none;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  position: relative;
}

.quote-card::before {
  content: '「';
  position: absolute;
  left: -0.4rem;
  top: -0.65rem;
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--gold);
  background: var(--bg);
  padding: 0 0.2rem;
  line-height: 1;
}

.quote-card p {
  margin: 0;
  font-family: var(--reader-font);
  font-size: calc(var(--reader-size) + 1px);
  line-height: 1.9;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.quote-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.quote-actions .btn {
  padding: 0.25rem 0.9rem;
  font-size: 12px;
  letter-spacing: 0.08em;
}

/* 单集问答 */

.ask {
  margin-top: 2.6rem;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0.9rem 1.3rem;
}

.ask summary {
  cursor: pointer;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--text);
}

.ask summary:hover {
  color: var(--accent);
}

.ask-hint {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0.6rem 0 0;
}

.ask-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.ask-input {
  flex: 1;
  min-inline-size: 0;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-sans);
}

.ask-result {
  margin-top: 0.9rem;
  padding: 0.9rem 1.1rem;
  background: var(--zh-soft);
  border-left: 3px solid var(--accent);
  font-size: 14.5px;
  line-height: 1.9;
}

.ask-result.hidden {
  display: none;
}

.ask-answer {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
}

.ask-sources {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* 上下集 */

.pn-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  margin: 3rem 0 2rem;
}

.pn {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  font-size: 13.5px;
  transition: border-color 0.2s ease;
}

.pn:hover {
  border-color: var(--gold);
}

.pn.next {
  text-align: right;
  align-items: flex-end;
}

.pn-label {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.16em;
}

.pn-title {
  font-family: var(--font-serif);
  font-weight: 700;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ---------- 归档 / 话题 / 搜索 / 报告 / 管理台 ---------- */

.page-title {
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 700;
  margin: 1.6rem 0 0.4rem;
}

.page-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin: 0 0 1.6rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.search-form {
  display: flex;
  gap: 0.6rem;
  margin: 1.4rem 0;
}

.search-form input {
  flex: 1;
  min-inline-size: 0;
  padding: 0.55rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}

.admin-card {
  margin-top: 1.8rem;
  padding: 1.2rem 1.5rem;
  border: 1px solid var(--line);
  background: var(--card);
}

.admin-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.admin-status {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 26rem;
  overflow: auto;
}

.report-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3.4rem;
  margin: 2rem 0;
  padding: 1.4rem 0;
  border-block: 1px solid var(--line);
}

.report-dist {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.report-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 13.5px;
}

.report-row-label {
  flex: 0 0 9rem;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}

.report-row-track {
  flex: 1;
  height: 8px;
  background: var(--line);
  overflow: hidden;
}

.report-row-bar {
  display: block;
  height: 100%;
  background: var(--accent);
}

.report-row-num {
  flex: 0 0 4rem;
  text-align: right;
  color: var(--muted);
  font-size: 12px;
}

.report-recent {
  margin: 0;
  padding-left: 1.4rem;
  color: var(--text-soft);
  font-size: 14px;
}

.report-recent li {
  margin: 0.4rem 0;
}

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

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

/* ---------- 页脚（墨色） ---------- */

.site-footer {
  margin-top: 4.5rem;
  background: var(--f-bg);
  color: var(--f-soft);
  padding: 2.2rem 1.5rem 2.8rem;
  font-size: 12.5px;
  line-height: 2;
  text-align: center;
}

.site-footer p {
  margin: 0 auto;
  max-width: 60rem;
}

.site-footer a {
  color: var(--f-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--f-line);
}

.site-footer a:hover {
  color: var(--gold);
}

/* ---------- Toast / 进度条 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%) translateY(8px);
  background: var(--f-bg);
  color: var(--f-text);
  border: 1px solid var(--f-line);
  padding: 0.5rem 1.2rem;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 98;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  transform-origin: 0 0;
  transform: scaleX(0);
  z-index: 99;
  pointer-events: none;
}

/* ---------- 阅读设置面板 ---------- */

.reader-fab {
  position: fixed;
  right: 1.4rem;
  bottom: 1.4rem;
  z-index: 96;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.05em;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.reader-fab:hover {
  border-color: var(--gold);
  color: var(--accent);
}

.reader-panel {
  position: fixed;
  right: 1.4rem;
  bottom: 4.6rem;
  z-index: 97;
  width: min(21rem, calc(100vw - 2.8rem));
  background: var(--card);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.2rem 0.9rem;
}

.reader-panel[hidden] {
  display: none;
}

.rp-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 0.8rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.1em;
}

.rp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.45rem 0;
}

.rp-label {
  font-size: 13px;
  color: var(--text-soft);
  flex: 0 0 4.5em;
}

.rp-opts {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.rp-opts button {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  color: var(--text-soft);
  font-family: var(--font-serif);
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.rp-opts button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.rp-opts button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.rp-close {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.5rem 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.2em;
  cursor: pointer;
}

.rp-close:hover {
  color: var(--accent);
}

/* 阅读器字体族切换（作用于正文） */
:root[data-rfont='sans'] {
  --reader-font: var(--font-sans);
}

:root[data-rfont='kai'] {
  --reader-font: var(--font-kai);
}

:root[data-rsize='lg'] {
  --reader-size: 19px;
}

:root[data-rsize='xl'] {
  --reader-size: 21px;
}

:root[data-rlead='loose'] {
  --reader-leading: 2.3;
}

/* ---------- 响应式 ---------- */

@media (max-width: 960px) {
  .ep-layout {
    display: block;
  }

  .toc {
    position: static;
    max-height: none;
    margin-bottom: 1.8rem;
    padding: 0.8rem 1.1rem;
    border: 1px solid var(--line);
    background: var(--card);
  }

  .toc ol {
    border-left: 0;
  }

  .mast-facts {
    flex-wrap: wrap;
  }

  .mast-facts > div {
    flex: 1 1 40%;
    border-top: 1px solid var(--line);
  }

  .mast-facts > div:nth-child(-n + 2) {
    border-top: 0;
  }

  .mast-facts > div:nth-child(3) {
    border-inline-start: 0;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 18px;
  }

  .masthead {
    padding: 2rem 1.2rem 1.8rem;
  }

  .mast-facts > div {
    padding: 0.8rem 1rem;
  }

  .pn-nav {
    grid-template-columns: 1fr;
  }

  .pn.next {
    text-align: left;
    align-items: flex-start;
  }

  .search-form {
    flex-direction: column;
  }

  .reader-fab {
    right: 1rem;
    bottom: 1rem;
  }

  .reader-panel {
    right: 1rem;
    bottom: 4rem;
  }
}
