/* ============================================================
   《古文观止》漫画版 —— 风格系统
   黑白网点 / 速度线 / 硬边分镜 / 对话框 / 印章 / 水墨
   ============================================================ */

:root {
  --paper: #f7f1e3;
  --paper-2: #efe6d2;
  --paper-3: #e7dcc4;
  --ink: #17130d;
  --ink-soft: #4b4436;
  --ink-faint: #8a8070;
  --red: #b03a2e;
  --red-dark: #86281f;
  --red-soft: #d8a39a;
  --gold: #a97b2f;
  --line: #17130d;
  --font-brush: "Ma Shan Zheng", "STKaiti", "KaiTi", "Kaiti SC", serif;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --font-comic: "ZCOOL KuaiLe", "Comic Sans MS", "PingFang SC", cursive;
  --shadow-hard: 6px 6px 0 rgba(23, 19, 13, 0.92);
  --shadow-hard-sm: 3px 3px 0 rgba(23, 19, 13, 0.92);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.55), transparent 55%),
    radial-gradient(ellipse at 85% 90%, rgba(169,123,47,.08), transparent 45%),
    repeating-linear-gradient(0deg, rgba(23,19,13,.02) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(23,19,13,.015) 0 1px, transparent 1px 3px);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- 顶部阅读进度条 ---------- */
#progressbar {
  position: fixed; top: 0; left: 0; height: 4px; width: 0;
  background: linear-gradient(90deg, var(--red), var(--gold));
  z-index: 1000;
}

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 900;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--red);
  box-shadow: 0 4px 0 rgba(0,0,0,.25);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 10px 20px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--paper); }
.brand-seal {
  font-family: var(--font-serif); font-weight: 900;
  background: var(--red); color: var(--paper);
  border: 2px solid var(--paper);
  border-radius: 30% 22% 28% 24% / 24% 30% 22% 28%;
  padding: 2px 6px; font-size: 15px; line-height: 1.2;
  transform: rotate(-4deg);
  box-shadow: 2px 2px 0 rgba(255,255,255,.25) inset;
}
.brand-text { font-family: var(--font-brush); font-size: 24px; letter-spacing: 2px; }
.brand-sub { font-family: var(--font-comic); font-size: 12px; color: var(--red-soft); margin-left: 4px; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a {
  color: var(--paper); text-decoration: none; font-size: 15px;
  padding: 6px 12px; position: relative; font-weight: 500;
}
.nav-links a:hover { color: #ffd9a0; }
.nav-links a.active { color: #ffd9a0; }
.nav-links a.active::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px;
  height: 3px; background: var(--red); transform: skewX(-20deg);
}
.nav-search { display: flex; gap: 8px; align-items: center; }
.nav-search input {
  border: 2px solid var(--paper-3); background: var(--paper);
  color: var(--ink); padding: 7px 12px; font-size: 14px; width: 210px;
  border-radius: 0; font-family: var(--font-sans);
}
.nav-search input:focus { outline: none; border-color: var(--gold); }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-block; cursor: pointer; user-select: none;
  font-family: var(--font-sans); font-weight: 700; font-size: 15px;
  background: var(--paper); color: var(--ink);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-hard-sm);
  padding: 10px 22px; text-decoration: none; text-align: center;
  transition: transform .08s ease, box-shadow .08s ease;
}
.btn:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.btn--red { background: var(--red); color: var(--paper); border-color: var(--ink); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--mini { padding: 7px 14px; font-size: 13px; }
.btn--ghost { background: transparent; border-style: dashed; box-shadow: none; }

.chip {
  display: inline-block; font-size: 12px; font-weight: 700;
  border: 2px solid var(--ink); padding: 2px 9px;
  background: var(--paper); line-height: 1.5; white-space: nowrap;
}
.chip--red { background: var(--red); color: var(--paper); border-color: var(--ink); }
.chip--ink { background: var(--ink); color: var(--paper); }
.chip--gold { background: var(--gold); color: var(--paper); }
.chip--dash { border-style: dashed; background: transparent; }

/* 硬边分镜面板 */
.panel {
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow-hard);
  position: relative;
}
.panel--tilt1 { transform: rotate(-.55deg); }
.panel--tilt2 { transform: rotate(.45deg); }
.panel--no-shadow { box-shadow: none; }

/* 网点（screentone） */
.halftone {
  background-image: radial-gradient(rgba(23,19,13,.22) 1px, transparent 1.4px);
  background-size: 7px 7px;
}
.halftone--soft {
  background-image: radial-gradient(rgba(23,19,13,.12) 1px, transparent 1.5px);
  background-size: 9px 9px;
}
.halftone--red {
  background-image: radial-gradient(rgba(176,58,46,.25) 1px, transparent 1.5px);
  background-size: 8px 8px;
}

/* 速度线（辐射状） */
.speedlines {
  background:
    repeating-conic-gradient(from 0deg at 85% 8%,
      rgba(23,19,13,.9) 0deg 1.6deg, transparent 1.6deg 7deg);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.95), rgba(0,0,0,.05) 88%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.95), rgba(0,0,0,.05) 88%);
}
.speedlines--diag {
  background:
    repeating-linear-gradient(-55deg,
      rgba(23,19,13,.85) 0 3px, transparent 3px 14px);
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.9), rgba(0,0,0,0) 75%);
  mask-image: linear-gradient(90deg, rgba(0,0,0,.9), rgba(0,0,0,0) 75%);
}

/* 印章 */
.seal {
  display: inline-block; color: var(--red);
  border: 3px solid var(--red); font-family: var(--font-serif);
  font-weight: 900; line-height: 1;
  padding: 6px 9px;
  border-radius: 26% 18% 30% 20% / 20% 30% 18% 28%;
  transform: rotate(-5deg);
  box-shadow: inset 0 0 0 2px rgba(176,58,46,.35);
  text-shadow: 0 0 1px rgba(176,58,46,.4);
}
.seal--sm { font-size: 13px; padding: 3px 6px; border-width: 2px; }

/* 对话框 */
.bubble {
  position: relative;
  border: 3px solid var(--ink);
  background: #fffdf6;
  border-radius: 26px;
  padding: 18px 26px;
  box-shadow: var(--shadow-hard-sm);
}
.bubble::after {
  content: ""; position: absolute; bottom: -17px; left: 34px;
  border: 9px solid transparent; border-top-color: var(--ink);
}
.bubble::before {
  content: ""; position: absolute; bottom: -10px; left: 38px;
  border: 6px solid transparent; border-top-color: #fffdf6;
  z-index: 1;
}
.bubble--tail-left::after { left: 26px; }
.bubble--tail-left::before { left: 30px; }
.bubble--tail-right::after { left: auto; right: 30px; }
.bubble--tail-right::before { left: auto; right: 34px; }

/* 拟声字 */
.onoma {
  font-family: var(--font-comic); font-weight: 900;
  position: absolute; color: var(--ink); line-height: 1; z-index: 2;
  text-shadow: 3px 3px 0 rgba(23,19,13,.18);
  pointer-events: none;
}

/* 章节标题 */
.section-title { text-align: center; margin: 56px 0 30px; }
.section-title .st-main {
  font-family: var(--font-brush); font-size: 40px; letter-spacing: 6px;
  position: relative; display: inline-block;
}
.section-title .st-main::before,
.section-title .st-main::after {
  content: ""; position: absolute; top: 50%; width: 64px; height: 3px;
  background: var(--ink); transform: skewX(-30deg);
}
.section-title .st-main::before { right: calc(100% + 18px); }
.section-title .st-main::after { left: calc(100% + 18px); }
.section-title .st-sub { font-size: 13px; color: var(--ink-faint); letter-spacing: 4px; margin-top: 6px; }

/* ============================================================
   首页
   ============================================================ */
.hero {
  position: relative; overflow: hidden;
  background: var(--paper);
  border-bottom: 4px solid var(--ink);
}
.hero .halftone-bg {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(rgba(23,19,13,.14) 1px, transparent 1.5px);
  background-size: 9px 9px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, rgba(0,0,0,.9), rgba(0,0,0,.25) 70%);
  mask-image: radial-gradient(ellipse at 30% 40%, rgba(0,0,0,.9), rgba(0,0,0,.25) 70%);
}
.hero .speed-bg { position: absolute; inset: 0; opacity: .5; }
.hero-inner {
  position: relative; z-index: 3;
  max-width: 1180px; margin: 0 auto;
  padding: 84px 24px 66px;
  text-align: center;
}
.hero-eyebrow {
  display: inline-block; font-family: var(--font-comic); font-size: 15px;
  border: 2px dashed var(--ink); padding: 4px 16px; margin-bottom: 22px;
  background: rgba(247,241,227,.8); letter-spacing: 2px;
}
.hero-title {
  font-family: var(--font-brush);
  font-size: clamp(64px, 12vw, 138px);
  line-height: 1.05; letter-spacing: 14px;
  color: var(--ink);
  text-shadow: 6px 6px 0 rgba(23,19,13,.12);
  position: relative; display: inline-block;
}
.hero-title .t-ink {
  position: absolute; right: -64px; top: -34px; font-size: 26px;
  transform: rotate(8deg); color: var(--red); font-weight: 900;
  font-family: var(--font-serif);
}
.hero-sub {
  margin-top: 20px; font-size: 17px; color: var(--ink-soft);
  letter-spacing: 2px; font-family: var(--font-serif);
}
.hero-quote { margin: 30px auto 0; max-width: 640px; text-align: left; }
.hero-quote .bubble { font-family: var(--font-serif); font-size: 20px; font-weight: 700; text-align: center; }
.hero-quote .bubble small { display: block; font-family: var(--font-sans); font-weight: 400; font-size: 13px; color: var(--ink-faint); margin-top: 8px; letter-spacing: 1px; }

.hero-stats {
  display: flex; justify-content: center; gap: 14px; margin-top: 34px; flex-wrap: wrap;
}
.stat {
  border: 3px solid var(--ink); background: var(--paper);
  box-shadow: var(--shadow-hard-sm); padding: 12px 22px; min-width: 108px;
}
.stat b { display: block; font-family: var(--font-comic); font-size: 30px; line-height: 1.15; }
.stat span { font-size: 13px; color: var(--ink-soft); letter-spacing: 2px; }

.hero-actions { margin-top: 36px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.hero-mockbar {
  position: relative; z-index: 3;
  border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink);
  background: var(--ink); color: var(--paper);
  display: flex; justify-content: center; gap: 34px; flex-wrap: wrap;
  padding: 10px 20px; font-family: var(--font-comic); font-size: 14px; letter-spacing: 1px;
}
.hero-mockbar .ok { color: #ffd9a0; }

/* 金句走马灯 */
.quote-marquee { overflow: hidden; white-space: nowrap; border-bottom: 3px solid var(--ink); background: var(--paper-2); }
.quote-marquee .qm-track { display: inline-block; padding: 12px 0; animation: qm-scroll 60s linear infinite; }
.quote-marquee .qm-item {
  display: inline-block; font-family: var(--font-serif); font-size: 16px;
  margin-right: 64px; font-weight: 600;
}
.quote-marquee .qm-item em { font-style: normal; color: var(--red); font-weight: 700; }
@keyframes qm-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* 卷章卡片 */
.chapter-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 26px; max-width: 1180px; margin: 0 auto; padding: 0 24px;
}
.chapter-card {
  display: block; text-decoration: none; color: var(--ink);
  border: 3px solid var(--ink); background: var(--paper);
  box-shadow: var(--shadow-hard);
  padding: 20px 22px 18px; position: relative; overflow: hidden;
  transition: transform .12s ease, box-shadow .12s ease;
}
.chapter-card:nth-child(odd) { transform: rotate(-.4deg); }
.chapter-card:nth-child(even) { transform: rotate(.4deg); }
.chapter-card:hover { transform: rotate(0) translate(-3px,-3px); box-shadow: 9px 9px 0 var(--ink); }
.chapter-card .cc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.chapter-card .cc-vol {
  font-family: var(--font-brush); font-size: 54px; line-height: 1;
  color: var(--red);
}
.chapter-card .cc-theme { font-family: var(--font-serif); font-weight: 900; font-size: 19px; margin-top: 6px; letter-spacing: 1px; }
.chapter-card .cc-desc { font-size: 13px; color: var(--ink-soft); margin-top: 8px; line-height: 1.7; }
.chapter-card .cc-meta { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.chapter-card .cc-count { position: absolute; right: -8px; bottom: -8px; width: 64px; height: 64px; }
.chapter-card .cc-count svg { width: 100%; height: 100%; }
.chapter-card .cc-count text { font-family: var(--font-comic); }

/* ============================================================
   目录 / 卷页
   ============================================================ */
.page { max-width: 1180px; margin: 0 auto; padding: 30px 24px 70px; }

.crumb { font-size: 13px; color: var(--ink-faint); margin-bottom: 18px; letter-spacing: 1px; }
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--red); text-decoration: underline; }
.crumb .sep { margin: 0 8px; }

.vol-hero {
  position: relative; overflow: hidden;
  border: 4px solid var(--ink); box-shadow: var(--shadow-hard);
  padding: 40px 36px; margin-bottom: 34px;
  display: flex; gap: 30px; align-items: center; flex-wrap: wrap;
}
.vol-hero .vh-num {
  font-family: var(--font-brush); font-size: clamp(70px, 11vw, 130px);
  line-height: 1; color: var(--red); position: relative; z-index: 2;
  text-shadow: 4px 4px 0 rgba(23,19,13,.15);
}
.vol-hero .vh-info { position: relative; z-index: 2; flex: 1; min-width: 260px; }
.vol-hero .vh-theme { font-family: var(--font-serif); font-weight: 900; font-size: 28px; letter-spacing: 2px; }
.vol-hero .vh-desc { margin-top: 10px; color: var(--ink-soft); font-size: 15px; max-width: 560px; }
.vol-hero .vh-meta { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.vol-hero .onoma { right: 26px; top: 18px; font-size: 46px; transform: rotate(8deg); opacity: .85; }

.art-list { display: flex; flex-direction: column; gap: 18px; }
.art-row {
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  border: 3px solid var(--ink); background: var(--paper);
  box-shadow: var(--shadow-hard-sm);
  padding: 16px 20px; text-decoration: none; color: var(--ink);
  position: relative; overflow: hidden;
  transition: transform .1s ease, box-shadow .1s ease;
}
.art-row:hover { transform: translate(-3px,-3px); box-shadow: 7px 7px 0 var(--ink); }
.art-row .ar-no {
  font-family: var(--font-comic); font-size: 20px; color: var(--red);
  border: 3px solid var(--ink); background: var(--paper);
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  transform: rotate(-3deg); flex: 0 0 auto;
}
.art-row .ar-main { flex: 1; min-width: 220px; }
.art-row .ar-title { font-family: var(--font-serif); font-weight: 900; font-size: 20px; letter-spacing: 1px; }
.art-row .ar-meta { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.art-row .ar-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.art-row .ar-scene {
  font-family: var(--font-serif); font-size: 13px; font-weight: 700;
  border: 2px dashed var(--red); color: var(--red-dark);
  padding: 4px 12px; max-width: 300px;
}
.art-row .ar-quote {
  font-family: var(--font-serif); font-size: 13px; color: var(--ink-soft);
  max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.art-row .ar-go { font-family: var(--font-comic); font-size: 16px; color: var(--red); }

/* ============================================================
   文章详情
   ============================================================ */
.art-top {
  position: relative; overflow: hidden;
  border: 4px solid var(--ink); box-shadow: var(--shadow-hard);
  padding: 44px 40px 38px; margin-bottom: 26px;
}
.art-top .at-scene {
  position: absolute; top: 16px; right: 22px;
  font-family: var(--font-brush); font-size: 30px; color: var(--ink);
  opacity: .9; transform: rotate(3deg); z-index: 2;
  border-bottom: 3px solid var(--red); padding-bottom: 4px;
  max-width: 46%; text-align: right;
  pointer-events: none;
}
.art-top .at-title {
  font-family: var(--font-serif); font-weight: 900;
  font-size: clamp(30px, 5vw, 46px); letter-spacing: 3px; line-height: 1.3;
  max-width: 60%;
}
.art-top .at-meta { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.art-top .at-seal { margin-left: 6px; }
.art-top .at-quote {
  margin-top: 26px; font-family: var(--font-serif); font-size: 18px; font-weight: 700;
  padding-left: 18px; border-left: 5px solid var(--red);
}
.art-top .at-tools { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.art-top .at-tools .toolgroup { display: flex; border: 2px solid var(--ink); }
.art-top .at-tools .toolgroup button {
  background: var(--paper); border: none; border-right: 2px solid var(--ink);
  padding: 6px 12px; cursor: pointer; font-family: var(--font-sans); font-weight: 700; font-size: 13px;
}
.art-top .at-tools .toolgroup button:last-child { border-right: none; }
.art-top .at-tools .toolgroup button.active { background: var(--ink); color: var(--paper); }

.art-panel {
  border: 3px solid var(--ink); background: var(--paper);
  box-shadow: var(--shadow-hard-sm);
  padding: 30px 34px; margin-bottom: 26px; position: relative;
}
.art-panel .ap-label {
  display: inline-block; font-family: var(--font-comic); font-size: 14px;
  background: var(--ink); color: var(--paper); padding: 4px 14px;
  letter-spacing: 2px; margin-bottom: 18px;
  transform: skewX(-8deg);
}
.art-panel .ap-label em { font-style: normal; color: #ffd9a0; }

.art-text { font-family: var(--font-serif); font-size: 18px; line-height: 2.05; }
.art-text p { margin-bottom: 1.1em; text-align: justify; text-indent: 2em; }
.art-text.vertical {
  writing-mode: vertical-rl; text-orientation: upright;
  height: 760px; max-height: 70vh;
  overflow-x: auto; overflow-y: hidden;
  padding-bottom: 8px;
}
.art-text.vertical p { margin: 0 0.5em 0 0; text-indent: 0; }
.art-text .text-para-hl { background: rgba(176,58,46,.12); }

.art-content { font-size: 16px; line-height: 2; color: var(--ink-soft); text-align: justify; }
.art-content p { margin-bottom: 1em; }
.art-content .jc { color: var(--ink); font-weight: 700; }

.story-panel { background: var(--paper-2); }
.story-panel .ap-label { background: var(--red-dark); }

.quote-bubbles { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 26px; }
.quote-bubbles .bubble { flex: 1; min-width: 280px; font-family: var(--font-serif); font-size: 18px; font-weight: 700; }
.quote-bubbles .bubble small { display: block; font-weight: 400; font-size: 13px; color: var(--ink-faint); margin-top: 10px; }

.tags-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.tags-row .tag {
  font-size: 13px; font-weight: 700; border: 2px solid var(--ink);
  padding: 3px 12px; background: var(--paper-2); cursor: pointer;
}
.tags-row .tag:hover { background: var(--ink); color: var(--paper); }

.prevnext { display: flex; gap: 18px; margin-top: 34px; }
.prevnext a {
  flex: 1; border: 3px solid var(--ink); text-decoration: none; color: var(--ink);
  padding: 16px 20px; box-shadow: var(--shadow-hard-sm); background: var(--paper);
  transition: transform .1s ease, box-shadow .1s ease;
}
.prevnext a:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 var(--ink); }
.prevnext .pn-label { font-size: 12px; color: var(--ink-faint); letter-spacing: 2px; }
.prevnext .pn-title { font-family: var(--font-serif); font-weight: 900; font-size: 17px; margin-top: 4px; }
.prevnext .pn-empty { flex: 1; border: 3px dashed var(--ink-faint); padding: 16px 20px; color: var(--ink-faint); }

/* 生僻字注音（ruby） */
.art-text ruby { ruby-align: center; }
.art-text rt {
  font-size: 0.42em; line-height: 1.3;
  color: var(--red-dark); font-weight: 400;
  font-family: var(--font-sans);
  letter-spacing: 0;
}
.art-text.vertical rt { font-size: 0.4em; }
.art-text.no-py rt { display: none; }

/* 朗读台 */
.reader-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 3px solid var(--ink); background: var(--paper-2);
  box-shadow: var(--shadow-hard-sm); padding: 12px 18px; margin-bottom: 26px;
  position: relative;
}
.reader-bar .rb-label {
  font-family: var(--font-comic); font-size: 14px; letter-spacing: 2px;
  background: var(--ink); color: var(--paper); padding: 4px 12px;
  transform: skewX(-8deg);
}
.reader-bar .rb-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.reader-bar .rb-sec.active { background: var(--red); color: var(--paper); }
.reader-bar .rb-status { font-size: 13px; color: var(--ink-soft); letter-spacing: 1px; }
.reader-bar .rb-status.playing { color: var(--red); font-weight: 700; }
.reader-bar .rb-hint { font-size: 12px; color: var(--ink-faint); width: 100%; }

/* 朗读高亮（当前朗读的段落） */
.reading-hl {
  background: linear-gradient(180deg, transparent 30%, rgba(176,58,46,.18) 30%);
  box-shadow: 0 0 0 6px rgba(176,58,46,.10);
  border-radius: 2px;
  transition: background .2s ease;
}

/* 内联注释标记：悬浮显示解释 */
.note-term {
  border-bottom: 2px dotted var(--red);
  cursor: help; position: relative;
  transition: background .15s ease;
}
.note-term:hover { background: rgba(176,58,46,.12); }
.note-term::after {
  content: attr(data-note);
  position: absolute; bottom: 140%; left: 50%; transform: translateX(-50%);
  z-index: 60; width: 250px; max-width: 60vw;
  background: var(--ink); color: var(--paper);
  border: 3px solid var(--paper); outline: 2px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(0,0,0,.35);
  padding: 10px 13px; font-size: 13px; line-height: 1.75;
  font-family: var(--font-sans); font-weight: 400;
  text-align: left; white-space: normal;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .15s ease, visibility .15s ease;
}
.note-term:hover::after { opacity: 1; visibility: visible; }
/* 关闭注释标记模式 */
.art-text.no-anno .note-term { border-bottom: none; cursor: inherit; }
.art-text.no-anno .note-term:hover { background: transparent; }
.art-text.no-anno .note-term::after { display: none; }

/* 注释面板 */
.note-list { display: flex; flex-direction: column; gap: 0; }
.note-item {
  display: flex; gap: 14px; padding: 9px 0;
  border-bottom: 1px dashed rgba(23,19,13,.22);
  font-size: 15px; line-height: 1.85;
}
.note-item:last-child { border-bottom: none; }
.note-item .ni-no {
  flex: 0 0 auto; font-family: var(--font-comic); color: var(--red);
  border: 2px solid var(--ink); background: var(--paper);
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  transform: rotate(-2deg); font-size: 14px; margin-top: 2px;
}
.note-item .ni-term {
  flex: 0 0 auto; font-family: var(--font-serif); font-weight: 900;
  color: var(--red-dark); min-width: 74px; text-align: right;
}
.note-item .ni-note { color: var(--ink-soft); flex: 1; }

/* 典故面板 */
.allusion-list { display: flex; flex-direction: column; gap: 18px; }
.allusion-card {
  border: 3px solid var(--ink); background: #fdf9ee;
  box-shadow: var(--shadow-hard-sm); padding: 18px 22px;
  position: relative;
}
.allusion-card:nth-child(odd) { transform: rotate(-.25deg); }
.allusion-card:nth-child(even) { transform: rotate(.25deg); }
.allusion-card .al-term {
  font-family: var(--font-serif); font-weight: 900; font-size: 17px;
  color: var(--ink); letter-spacing: 1px;
}
.allusion-card .al-term::before { content: "「"; color: var(--red); }
.allusion-card .al-term::after { content: "」"; color: var(--red); }
.allusion-card .al-story {
  margin-top: 8px; font-size: 14.5px; color: var(--ink-soft);
  line-height: 1.95; text-align: justify;
}
.allusion-card .al-seal {
  position: absolute; top: -12px; right: 14px;
  font-family: var(--font-serif); font-weight: 900; font-size: 13px;
  color: var(--paper); background: var(--red);
  border: 2px solid var(--ink); padding: 3px 9px;
  transform: rotate(4deg);
}

/* ============================================================
   附录 / 搜索 / 关于
   ============================================================ */
.app-row {
  border: 3px solid var(--ink); background: var(--paper);
  box-shadow: var(--shadow-hard-sm); margin-bottom: 16px; overflow: hidden;
}
.app-row summary {
  cursor: pointer; list-style: none; padding: 16px 20px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}
.app-row summary::-webkit-details-marker { display: none; }
.app-row summary:hover { background: var(--paper-2); }
.app-row .ar-no { font-family: var(--font-comic); color: var(--red); font-size: 17px; }
.app-row .ar-title { font-family: var(--font-serif); font-weight: 900; font-size: 18px; flex: 1; min-width: 180px; }
.app-row .ar-src { font-size: 13px; color: var(--ink-faint); }
.app-row .app-body { border-top: 2px dashed var(--ink); padding: 20px 24px; }
.app-row .app-body .art-text { font-size: 16px; }

.search-box { margin-bottom: 26px; display: flex; gap: 12px; }
.search-box input {
  flex: 1; border: 3px solid var(--ink); background: var(--paper);
  padding: 12px 18px; font-size: 16px; font-family: var(--font-serif);
}
.search-box input:focus { outline: none; box-shadow: var(--shadow-hard-sm); }

.result-count { font-size: 14px; color: var(--ink-faint); margin-bottom: 18px; letter-spacing: 1px; }
.result-count b { color: var(--red); }

.about-panel { border: 3px solid var(--ink); box-shadow: var(--shadow-hard); padding: 34px 38px; background: var(--paper); }
.about-panel h2 { font-family: var(--font-brush); font-size: 28px; margin: 26px 0 12px; }
.about-panel h2:first-child { margin-top: 0; }
.about-panel p { color: var(--ink-soft); margin-bottom: 10px; line-height: 2; }

/* 朝代巡礼 */
.era-strip { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.era-chip {
  font-family: var(--font-brush); font-size: 21px; letter-spacing: 3px;
  border: 3px solid var(--ink); background: var(--paper);
  box-shadow: var(--shadow-hard-sm); padding: 10px 26px;
  text-decoration: none; color: var(--ink); position: relative;
  transition: transform .1s ease, box-shadow .1s ease;
}
.era-chip:nth-child(odd) { transform: rotate(-1.2deg); }
.era-chip:nth-child(even) { transform: rotate(1deg); }
.era-chip:hover { transform: rotate(0) translate(-2px,-2px); box-shadow: 6px 6px 0 var(--red); color: var(--red-dark); }
.era-chip::after {
  content: "▶"; position: absolute; right: -14px; top: 50%; transform: translateY(-50%);
  color: var(--red); font-size: 15px; text-shadow: 2px 2px 0 rgba(23,19,13,.25);
}

/* 页脚 / 响应式 */
.footer {
  border-top: 4px solid var(--ink); background: var(--ink); color: var(--paper-3);
  margin-top: 60px;
}
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 36px 24px; text-align: center; }
.footer-title { font-family: var(--font-brush); font-size: 24px; color: var(--paper); letter-spacing: 3px; margin-bottom: 10px; }
.footer p { font-size: 13px; line-height: 1.9; opacity: .85; }
.footer .footer-slogan { font-family: var(--font-serif); color: #ffd9a0; margin-top: 12px; font-size: 14px; }

/* 加载态 */
.loading {
  text-align: center; padding: 90px 20px; font-family: var(--font-comic);
  font-size: 20px; letter-spacing: 3px;
}
.loading .dots::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.empty {
  text-align: center; padding: 60px 20px; font-size: 16px; color: var(--ink-faint);
}

@media (max-width: 760px) {
  .nav-inner { gap: 10px; }
  .nav-search input { width: 130px; }
  .hero-inner { padding: 56px 18px 48px; }
  .art-top { padding: 30px 22px; }
  .art-top .at-scene { position: static; max-width: none; text-align: left; margin-top: 14px; }
  .art-top .at-title { max-width: none; }
  .vol-hero { padding: 28px 22px; }
  .art-panel { padding: 22px 18px; }
  .art-text { font-size: 17px; }
  .prevnext { flex-direction: column; }
}
