/* ============================================================
   运河志 · 京杭大运河故事  —  共享样式
   设计语言：青绿山水 × 宣纸底色 × 朱砂点睛
   ============================================================ */

:root {
  --paper: #f6f1e5;
  --paper-2: #fffdf6;
  --paper-3: #efe8d6;
  --ink: #2e2a24;
  --ink-soft: #55503f;
  --muted: #7a7260;
  --line: #e2d9c3;
  --water: #175d5d;
  --water-deep: #0d3b3b;
  --water-ink: #092a2a;
  --water-soft: #3f8a83;
  --water-mist: #dcebe5;
  --gold: #b08a3e;
  --gold-soft: #d9c48f;
  --cinnabar: #a63a2b;
  --cinnabar-deep: #8c2f22;
  --radius: 14px;
  --shadow-sm: 0 2px 8px rgba(46, 42, 36, 0.07);
  --shadow-md: 0 10px 28px rgba(46, 42, 36, 0.12);
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  background-image:
    radial-gradient(rgba(23, 93, 93, 0.045) 1px, transparent 1px),
    linear-gradient(var(--paper), var(--paper));
  background-size: 26px 26px, auto;
  color: var(--ink);
  line-height: 1.85;
  font-size: 16.5px;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--water); text-decoration: none; }
a:hover { color: var(--cinnabar); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ---------- 阅读进度条 ---------- */
#progress-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--water-soft), var(--water), var(--gold));
  z-index: 999; transition: width 0.1s linear;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 241, 229, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-weight: 700; font-size: 21px;
  color: var(--water-deep); white-space: nowrap;
}
.brand:hover { color: var(--water-deep); }
.brand .wave-badge {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--water-deep); color: #e8f3ee;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25);
}
.brand small { font-size: 12px; color: var(--muted); font-weight: 400; display: block; line-height: 1.2; }

.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
  display: block; padding: 8px 13px; border-radius: 9px;
  font-size: 15px; color: var(--ink-soft); font-weight: 500;
  transition: all 0.18s ease;
}
.nav-links a:hover { background: var(--water-mist); color: var(--water-deep); }
.nav-links a.active { background: var(--water-deep); color: #f2ede0; }

.nav-toggle {
  display: none; background: none; border: 1.5px solid var(--line);
  border-radius: 9px; padding: 7px 10px; cursor: pointer;
  font-size: 18px; color: var(--water-deep); line-height: 1;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; left: 0; right: 0; top: 64px;
    flex-direction: column; background: var(--paper-2);
    border-bottom: 1px solid var(--line); padding: 10px 16px 16px;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 14px; }
  .brand small { display: none; }
}

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(63, 138, 131, 0.35), transparent 60%),
    radial-gradient(900px 420px at 10% 110%, rgba(176, 138, 62, 0.22), transparent 60%),
    linear-gradient(180deg, var(--water-ink) 0%, var(--water-deep) 55%, #11494a 100%);
  color: #f3efe2; text-align: center;
  padding: 92px 24px 150px;
}
.hero-kicker {
  font-family: var(--serif); letter-spacing: 0.5em; text-indent: 0.5em;
  color: var(--gold-soft); font-size: 15px; margin-bottom: 22px;
}
.hero h1 {
  font-family: var(--serif); font-size: clamp(46px, 9vw, 88px);
  font-weight: 900; letter-spacing: 0.12em; line-height: 1.15;
  text-shadow: 0 6px 30px rgba(0,0,0,0.35);
}
.hero h1 .accent { color: var(--gold-soft); }
.hero-sub {
  max-width: 640px; margin: 26px auto 0; font-size: 17px;
  color: rgba(243, 239, 226, 0.88); font-family: var(--serif);
}
.hero-cta { margin-top: 38px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 999px;
  font-size: 15.5px; font-weight: 600; transition: all 0.2s ease;
}
.btn-light { background: var(--gold-soft); color: var(--water-ink); }
.btn-light:hover { background: #e6d6a8; color: var(--water-ink); transform: translateY(-2px); }
.btn-ghost { border: 1.5px solid rgba(243,239,226,0.55); color: #f3efe2; }
.btn-ghost:hover { background: rgba(243,239,226,0.12); color: #fff; transform: translateY(-2px); }

.hero-waves { position: absolute; bottom: -2px; left: 0; width: 100%; line-height: 0; }
.hero-waves svg { width: 100%; height: 90px; }
.wave-move { animation: waveDrift 14s linear infinite; }
.wave-move2 { animation: waveDrift 22s linear infinite reverse; }
@keyframes waveDrift { from { transform: translateX(0); } to { transform: translateX(-600px); } }

.hero-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  max-width: 860px; margin: -95px auto 0; position: relative; z-index: 5;
  padding: 0 24px;
}
.stat-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 12px 18px; text-align: center; box-shadow: var(--shadow-md);
}
.stat-card .num {
  font-family: var(--serif); font-size: 34px; font-weight: 900; color: var(--water);
  line-height: 1.1;
}
.stat-card .num em { font-style: normal; font-size: 16px; margin-left: 3px; color: var(--gold); }
.stat-card .label { font-size: 13.5px; color: var(--muted); margin-top: 6px; }
@media (max-width: 700px) { .hero-stats { grid-template-columns: repeat(2, 1fr); margin-top: -70px; } }

/* ---------- 内页页头 ---------- */
.page-hero {
  position: relative; color: #f3efe2; overflow: hidden;
  background:
    radial-gradient(800px 300px at 90% -20%, rgba(63,138,131,0.4), transparent 60%),
    linear-gradient(160deg, var(--water-ink), var(--water-deep) 70%, #124a4b);
  padding: 64px 24px 54px; text-align: center;
}
.page-hero h1 {
  font-family: var(--serif); font-size: clamp(30px, 5vw, 44px);
  letter-spacing: 0.25em; text-indent: 0.25em; font-weight: 800;
}
.page-hero .zh-tag {
  display: inline-block; font-family: var(--serif); color: var(--gold-soft);
  border: 1px solid rgba(217,196,143,0.5); border-radius: 999px;
  padding: 4px 18px; font-size: 13.5px; letter-spacing: 0.35em; text-indent: 0.35em;
  margin-bottom: 18px;
}
.page-hero p {
  max-width: 680px; margin: 16px auto 0; color: rgba(243,239,226,0.85);
  font-size: 15.5px; font-family: var(--serif);
}
.page-hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 26px;
  background: var(--paper);
  clip-path: polygon(0 100%, 0 60%, 6% 20%, 12% 60%, 18% 15%, 25% 60%, 32% 25%, 40% 65%, 47% 20%, 55% 60%, 62% 18%, 70% 62%, 78% 22%, 85% 60%, 92% 18%, 100% 58%, 100% 100%);
}

/* ---------- 章节骨架 ---------- */
.section { padding: 72px 0 30px; }
.section-tight { padding: 48px 0 20px; }
.section-head { text-align: center; max-width: 760px; margin: 0 auto 44px; }
.section-head .kicker {
  display: inline-block; font-family: var(--serif); color: var(--cinnabar);
  letter-spacing: 0.4em; text-indent: 0.4em; font-size: 14px; margin-bottom: 10px;
}
.section-head h2 {
  font-family: var(--serif); font-size: clamp(26px, 4vw, 36px);
  color: var(--water-deep); letter-spacing: 0.08em; font-weight: 800;
}
.section-head h2::after {
  content: ""; display: block; width: 52px; height: 3px; margin: 16px auto 0;
  background: linear-gradient(90deg, var(--gold), var(--water-soft));
  border-radius: 2px;
}
.section-head .lead { margin-top: 18px; color: var(--ink-soft); font-size: 16px; }

.divider-wave { text-align: center; color: var(--water-soft); letter-spacing: 1.2em; text-indent: 1.2em; padding: 34px 0 6px; font-size: 15px; user-select: none; }

/* ---------- 卡片 ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  position: relative; background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px 24px 22px; box-shadow: var(--shadow-sm);
  transition: transform 0.22s ease, box-shadow 0.22s ease; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--water), var(--water-soft) 60%, var(--gold));
  opacity: 0; transition: opacity 0.22s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.card:hover::before { opacity: 1; }
.card h3 { font-family: var(--serif); font-size: 19.5px; color: var(--water-deep); margin: 10px 0 8px; }
.card h3 a { color: inherit; }
.card p { font-size: 14.8px; color: var(--ink-soft); }
.card .card-icon {
  width: 48px; height: 48px; border-radius: 12px; font-size: 24px;
  background: var(--water-mist); display: flex; align-items: center; justify-content: center;
}
.card .more { display: inline-block; margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--cinnabar); }
.card .more::after { content: " →"; }

/* ---------- 目录药丸 ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 30px 0 6px; }
.toc a {
  border: 1px solid var(--line); background: var(--paper-2);
  padding: 7px 18px; border-radius: 999px; font-size: 14px; color: var(--ink-soft);
  transition: all 0.18s ease;
}
.toc a:hover { background: var(--water-deep); color: #f3efe2; border-color: var(--water-deep); }

/* ---------- 时间线 ---------- */
.timeline { position: relative; max-width: 880px; margin: 0 auto; padding-left: 0; }
.timeline::before {
  content: ""; position: absolute; left: 118px; top: 8px; bottom: 8px; width: 3px;
  background: linear-gradient(var(--water-soft), var(--water), var(--gold));
  border-radius: 2px;
}
.t-item { position: relative; display: flex; gap: 26px; padding: 0 0 44px 0; }
.t-item:last-child { padding-bottom: 6px; }
.t-date {
  flex: 0 0 96px; text-align: right; padding-top: 4px;
  font-family: var(--serif); font-weight: 800; color: var(--cinnabar);
  font-size: 17px; line-height: 1.4;
}
.t-date small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.t-dot {
  position: absolute; left: 111px; top: 8px; width: 17px; height: 17px; border-radius: 50%;
  background: var(--paper); border: 4px solid var(--water); box-shadow: 0 0 0 4px rgba(23,93,93,0.14);
}
.t-body {
  flex: 1; background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 24px; box-shadow: var(--shadow-sm);
}
.t-body h3 { font-family: var(--serif); font-size: 19px; color: var(--water-deep); margin-bottom: 8px; }
.t-body h3 .era-badge {
  display: inline-block; margin-left: 10px; vertical-align: 3px;
  font-size: 11.5px; color: var(--gold); border: 1px solid var(--gold-soft);
  border-radius: 999px; padding: 1px 10px; letter-spacing: 0.15em; font-weight: 600;
}
.t-body p { font-size: 15px; color: var(--ink-soft); margin-bottom: 8px; }
.t-body p:last-child { margin-bottom: 0; }
.t-body .t-fact {
  margin-top: 10px; padding: 10px 14px; background: var(--water-mist);
  border-left: 3px solid var(--water); border-radius: 0 8px 8px 0;
  font-size: 13.8px; color: var(--water-ink);
}
@media (max-width: 700px) {
  .timeline::before { left: 12px; }
  .t-item { flex-direction: column; gap: 8px; padding-left: 36px; }
  .t-date { text-align: left; flex: none; }
  .t-dot { left: 5px; top: 6px; }
}

/* ---------- 人物卡 ---------- */
.person-card { text-align: center; }
.person-card .avatar {
  width: 66px; height: 66px; margin: 0 auto; border-radius: 50%;
  background: linear-gradient(145deg, var(--water-deep), var(--water-soft));
  color: #f3efe2; font-family: var(--serif); font-size: 25px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.3);
}
.person-card h3 { margin-top: 14px; }
.person-card .p-tag { font-size: 12.5px; color: var(--gold); letter-spacing: 0.2em; margin-bottom: 8px; }

/* ---------- 故事卡 ---------- */
.story-card { position: relative; }
.story-card .story-no {
  position: absolute; top: 8px; right: 16px; font-family: var(--serif);
  font-size: 44px; font-weight: 900; color: rgba(23, 93, 93, 0.1); line-height: 1;
}
.story-card .story-loc {
  display: inline-block; font-size: 12px; color: var(--water);
  background: var(--water-mist); border-radius: 999px; padding: 2px 12px; margin-bottom: 4px;
}
.story-card .story-src { margin-top: 12px; font-size: 12.8px; color: var(--muted); }
.story-card .story-src::before { content: "◈ "; color: var(--gold); }

/* ---------- 美食页 ---------- */
.city-block { margin-bottom: 46px; }
.city-block .city-head {
  display: flex; align-items: baseline; gap: 14px; border-bottom: 2px solid var(--line);
  padding-bottom: 10px; margin-bottom: 18px;
}
.city-block .city-head .station {
  font-family: var(--serif); font-weight: 900; font-size: 24px; color: var(--water-deep);
}
.city-block .city-head .milestone { font-size: 13px; color: var(--muted); letter-spacing: 0.1em; }
.dish-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 900px) { .dish-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .dish-grid { grid-template-columns: 1fr; } }
.dish {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 16px 14px; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dish:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.dish .dish-name { font-family: var(--serif); font-weight: 700; font-size: 16.5px; color: var(--cinnabar); }
.dish .dish-name .dish-emoji { margin-right: 6px; }
.dish p { font-size: 13.6px; color: var(--ink-soft); margin-top: 5px; line-height: 1.7; }
.dish .dish-star { float: right; font-size: 11.5px; color: var(--gold); }

.food-topic {
  display: flex; gap: 18px; background: var(--paper-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow-sm);
}
.food-topic .ft-icon { font-size: 30px; flex: 0 0 auto; }
.food-topic h3 { font-family: var(--serif); color: var(--water-deep); font-size: 18px; margin-bottom: 6px; }
.food-topic p { font-size: 14.5px; color: var(--ink-soft); }

/* ---------- 引文 / 诗词 ---------- */
.poem-block {
  max-width: 680px; margin: 0 auto; text-align: center; padding: 40px 24px;
}
.poem-block .poem-line {
  font-family: var(--serif); font-size: clamp(20px, 3vw, 26px);
  color: var(--water-deep); letter-spacing: 0.12em; line-height: 2.1;
}
.poem-block .poem-author { margin-top: 14px; color: var(--muted); font-size: 14px; letter-spacing: 0.3em; }
.poem-block::before {
  content: "❝"; display: block; font-size: 40px; color: var(--gold-soft); margin-bottom: 6px;
}

.pull-quote {
  border-left: 4px solid var(--gold); background: var(--paper-2);
  padding: 16px 22px; border-radius: 0 10px 10px 0; margin: 18px 0;
  font-family: var(--serif); color: var(--water-deep); font-size: 15.5px;
}

/* ---------- 地理页 ---------- */
.map-figure {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-md);
}
.map-figure figcaption { text-align: center; font-size: 13px; color: var(--muted); margin-top: 10px; }

.seg-card .seg-range { font-size: 13px; color: var(--gold); letter-spacing: 0.08em; margin-bottom: 6px; }
.seg-card .seg-status {
  display: inline-block; margin-top: 10px; font-size: 12px; border-radius: 999px; padding: 2px 12px;
}
.status-on { background: #e3efe3; color: #2c6e3f; border: 1px solid #bcd9c0; }
.status-half { background: #faf0dc; color: #916a1d; border: 1px solid #e6d3a8; }
.status-off { background: #f3e2de; color: #8c3a2c; border: 1px solid #e0c2ba; }

.water-system {
  text-align: center; padding: 22px 16px;
}
.water-system .ws-glyph { font-size: 30px; }
.water-system h3 { font-size: 17px; }
.water-system .ws-at { font-size: 12.5px; color: var(--cinnabar); letter-spacing: 0.1em; }

.city-table { width: 100%; border-collapse: collapse; background: var(--paper-2); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.city-table th, .city-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.city-table th { background: var(--water-deep); color: #f3efe2; font-family: var(--serif); letter-spacing: 0.15em; font-weight: 700; }
.city-table tr:last-child td { border-bottom: none; }
.city-table tr:hover td { background: var(--water-mist); }
.city-table td:first-child { font-family: var(--serif); font-weight: 700; color: var(--water-deep); white-space: nowrap; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

/* ---------- 遗产点 / 非遗标签 ---------- */
.chip-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 16px; font-size: 13.8px; color: var(--ink-soft);
}
.chip b { color: var(--water-deep); }
.chip.heritage { border-color: var(--gold-soft); background: #fbf6e8; }

/* ---------- 参考书目列表 ---------- */
.bib-group { margin-bottom: 40px; }
.bib-group h3 {
  font-family: var(--serif); font-size: 19px; color: var(--water-deep);
  border-left: 4px solid var(--gold); padding-left: 12px; margin-bottom: 16px;
  letter-spacing: 0.08em;
}
.bib-group h3 .bib-count { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-left: 10px; letter-spacing: 0.05em; }
.bib-item {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 15px 18px; margin-bottom: 10px; transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.bib-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.bib-item .b-title { font-family: var(--serif); font-weight: 700; font-size: 16.5px; color: var(--ink); }
.bib-item .b-title .b-flag {
  font-size: 11px; color: var(--cinnabar); border: 1px solid rgba(166,58,43,0.35);
  border-radius: 999px; padding: 1px 8px; vertical-align: 2px; margin-left: 8px; font-family: var(--sans); font-weight: 600;
}
.bib-item .b-meta { font-size: 12.8px; color: var(--gold); margin-top: 3px; letter-spacing: 0.04em; }
.bib-item .b-note { font-size: 13.8px; color: var(--ink-soft); margin-top: 6px; line-height: 1.75; }
.bib-external { text-align: center; color: var(--muted); font-size: 13px; padding: 8px 0 2px; }

/* ---------- 提示框 ---------- */
.note {
  display: flex; gap: 12px; background: #fdf8ec; border: 1px solid var(--gold-soft);
  border-radius: 12px; padding: 14px 18px; font-size: 14px; color: var(--ink-soft);
  margin: 16px 0;
}
.note .n-icon { color: var(--gold); font-size: 18px; }

/* ---------- 数字滚动区（首页栏目速览） ---------- */
.home-quote-band {
  background: linear-gradient(160deg, var(--water-deep), var(--water));
  color: #f3efe2; text-align: center; padding: 70px 24px;
}
.home-quote-band .poem-line { color: #f3efe2; font-size: clamp(20px, 3.4vw, 28px); }
.home-quote-band .poem-author { color: var(--gold-soft); }

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: 80px; background: var(--water-ink); color: rgba(243,239,226,0.8);
  padding: 54px 0 30px; font-size: 14px;
}
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 36px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  font-family: var(--serif); color: var(--gold-soft); letter-spacing: 0.2em;
  font-size: 16px; margin-bottom: 14px;
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: rgba(243,239,226,0.82); }
.site-footer a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(243,239,226,0.15); margin-top: 36px; padding-top: 20px;
  text-align: center; font-size: 12.8px; color: rgba(243,239,226,0.5);
}

/* ---------- 返回顶部 ---------- */
#back-top {
  position: fixed; right: 22px; bottom: 26px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--water-deep); color: #f3efe2; font-size: 18px;
  box-shadow: var(--shadow-md); opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#back-top.show { opacity: 1; pointer-events: auto; }
#back-top:hover { transform: translateY(-3px); background: var(--cinnabar); }

/* ---------- 滚动浮现 ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 站内搜索 ---------- */
.search-btn {
  display: flex; align-items: center; gap: 4px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; color: var(--muted); font-size: 13.5px;
  transition: all 0.18s ease; white-space: nowrap;
}
.search-btn:hover { border-color: var(--water); color: var(--water-deep); background: var(--water-mist); }
.search-btn .sb-kbd {
  font-size: 11px; border: 1px solid var(--line); border-radius: 5px;
  padding: 0 5px; background: var(--paper); color: var(--muted);
}
.search-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(9, 34, 34, 0.5); backdrop-filter: blur(4px);
  display: none; justify-content: center; align-items: flex-start; padding: 12vh 18px 0;
}
.search-overlay.open { display: flex; }
.search-panel {
  width: min(660px, 100%); background: var(--paper-2);
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 70px rgba(9, 34, 34, 0.35);
}
.s-row { display: flex; align-items: center; gap: 10px; padding: 6px 16px; }
.s-glyph { font-size: 17px; }
.s-input { flex: 1; border: none; outline: none; background: transparent; font-size: 16.5px; padding: 12px 0; color: var(--ink); font-family: var(--sans); }
.s-close {
  border: 1px solid var(--line); background: var(--paper); color: var(--muted);
  border-radius: 7px; font-size: 11.5px; padding: 3px 8px; cursor: pointer;
}
.s-results { max-height: 56vh; overflow-y: auto; border-top: 1px solid var(--line); }
.s-item { display: block; padding: 12px 18px; border-bottom: 1px solid var(--line); color: var(--ink); }
.s-item:hover, .s-item.active { background: var(--water-mist); }
.s-item .r-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.s-item .r-title { font-family: var(--serif); font-weight: 700; font-size: 15.5px; color: var(--water-deep); }
.s-item .r-title b { color: var(--cinnabar); }
.s-item .r-crumb { font-size: 11.5px; color: var(--muted); }
.s-item .r-text {
  font-size: 13px; color: var(--ink-soft); margin-top: 4px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.s-item mark { background: var(--gold-soft); color: var(--ink); border-radius: 3px; padding: 0 1px; }
.s-empty { padding: 30px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.s-foot {
  display: flex; gap: 16px; padding: 8px 18px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted); background: var(--paper);
}
@media (max-width: 700px) { .search-btn .sb-txt, .search-btn .sb-kbd { display: none; } }

/* ---------- 章节翻页 ---------- */
.chapter-pager {
  max-width: 1100px; margin: 64px auto 0; padding: 0 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.chapter-pager .pg {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 20px; box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chapter-pager .pg:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.chapter-pager .pg.next { align-items: flex-end; text-align: right; }
.chapter-pager .pg-dir { font-size: 12px; color: var(--gold); letter-spacing: 0.12em; }
.chapter-pager .pg-name { font-family: var(--serif); font-weight: 800; font-size: 18px; color: var(--water-deep); }
@media (max-width: 620px) { .chapter-pager { grid-template-columns: 1fr; } .chapter-pager .pg.next { align-items: flex-start; text-align: left; } }

/* ---------- 无障碍焦点 ---------- */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2.5px solid var(--water); outline-offset: 2px; border-radius: 6px;
}

/* ---------- 打印 ---------- */
@media print {
  .site-header, #back-top, #progress-bar, .hero-waves { display: none; }
  body { background: #fff; }
}
