/* ==========================================================================
   style.css —— 《千里跃进·大别山》视觉系统
   --------------------------------------------------------------------------
   设计基调：墨底 + 中国红 + 暖金，标题取宋体骨架，正文取黑体，庄重克制。
   结构：0 变量与重置 / 1 全局容器 / 2 导航与进度 / 3 地图舞台与图例 /
        4 封面 / 5 引子与尾声 / 6 章节分隔页 / 7 沉浸章节与面板 /
        8 插画与占位图 / 9 致谢 / 10 响应式与打印
   ========================================================================== */

/* ============================ 0 变量与重置 ============================ */
:root {
  --ink-0: #080b0f;
  --ink-1: #0c1218;
  --ink-2: #131b22;
  --ink-3: #1b2530;
  --red: #c1272d;
  --red-bright: #ff5a2b;
  --red-deep: #7d1a18;
  --gold: #e8b563;
  --gold-dim: #b98d47;
  --cream: #f4efe6;
  --muted: rgba(244, 239, 230, 0.62);
  --faint: rgba(244, 239, 230, 0.34);
  --line: rgba(232, 181, 99, 0.22);
  --glass: rgba(10, 15, 20, 0.74);
  --font-title: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", "Microsoft YaHei", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --nav-h: 58px;
  --shadow-card: 0 18px 50px rgba(0, 0, 0, 0.45);
}

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

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

body {
  background: var(--ink-0);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  opacity: 0;
  transition: opacity 0.6s ease;
}
body.is-ready { opacity: 1; }

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ============================ 1 全局容器 ============================ */
#map-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--ink-1);
}
#map-stage svg { display: block; width: 100%; height: 100%; }

#story {
  position: relative;
  z-index: 1;
}

.sec { position: relative; }

/* 滚动浮现 */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s cubic-bezier(0.22, 0.61, 0.36, 1),
              transform 0.75s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ============================ 2 导航与进度 ============================ */
#progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px; width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  z-index: 6;
}

#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 clamp(0.8rem, 3vw, 2rem);
  background: rgba(8, 11, 15, 0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(232, 181, 99, 0.16);
  transform: translateY(-102%);
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 5;
}
#navbar.is-shown { transform: none; }

.nav-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  white-space: nowrap;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }

.nav-link {
  position: relative;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
  border-radius: 2px;
  transition: color 0.25s ease, background 0.25s ease;
}
.nav-link:hover { color: var(--cream); background: rgba(244, 239, 230, 0.06); }
.nav-link.is-active { color: var(--gold); }
.nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0.7rem; right: 0.7rem; bottom: 0.05rem;
  height: 1px;
  background: var(--gold);
}

#audio-toggle {
  flex: none;
  padding: 0.34rem 0.8rem;
  font-size: 0.78rem;
  color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease;
}
#audio-toggle:hover { background: rgba(232, 181, 99, 0.12); }
#audio-toggle.is-missing { color: var(--faint); border-color: rgba(244, 239, 230, 0.16); cursor: default; }

/* 底图切换按钮：与音频按钮同款，放在导航栏内以保证可点击 */
#map-toggle {
  flex: none;
  padding: 0.34rem 0.8rem;
  font-size: 0.78rem;
  color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.25s ease, color 0.25s ease;
}
#map-toggle:hover { background: rgba(232, 181, 99, 0.12); }
#map-toggle[hidden] { display: none; }

/* ========================= 3 地图舞台与图例 ========================= */
#map-hud {
  position: fixed;
  left: clamp(0.8rem, 3vw, 2rem);
  bottom: clamp(0.8rem, 3vh, 1.6rem);
  z-index: 1;               /* 位于地图之上、叙事内容之下 */
  pointer-events: none;
  max-width: 26rem;
}
.hud-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.6rem 0.85rem;
  background: rgba(8, 11, 15, 0.62);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(232, 181, 99, 0.18);
  border-radius: 3px;
}
.hud-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: var(--muted);
}
.swatch { display: inline-block; }
.swatch.route {
  width: 1.5rem; height: 2px;
  background: var(--red-bright);
  box-shadow: 0 0 6px rgba(255, 90, 43, 0.7);
}
.swatch.battle { color: var(--red-bright); font-size: 0.8rem; line-height: 1; }
.swatch.river { width: 1.5rem; height: 2px; background: #8fc4d8; }
.swatch.flood {
  width: 1.1rem; height: 0.7rem;
  background: repeating-linear-gradient(35deg, rgba(138, 106, 58, 0.9) 0 2px, transparent 2px 4px);
  border: 1px solid rgba(138, 106, 58, 0.6);
}
.swatch.march-gray { width: 1.5rem; height: 2px; background: #9fb3c8; }
.swatch.march-gold { width: 1.5rem; height: 2px; background: #e8b563; }
.swatch.march-red { width: 1.5rem; height: 2px; background: #ff5a2b; }
.swatch.ancient {
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: #9fb3c8;
}
.swatch.province {
  width: 1.1rem; height: 0.7rem;
  background: rgba(160, 44, 44, 0.30);
  border: 1px solid rgba(160, 44, 44, 0.85);
}
.swatch.pass {
  width: 0.5rem; height: 0.5rem;
  background: #d8c9a0;
  transform: rotate(45deg);
}
.swatch.uprising {
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: #ff5a2b;
  box-shadow: 0 0 6px rgba(255, 90, 43, 0.8);
}
.swatch.site {
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: #e8b563;
}
.swatch.suzone {
  width: 1.1rem; height: 0.7rem;
  background: rgba(193, 39, 45, 0.35);
  border: 1px solid rgba(255, 120, 90, 0.6);
}
.swatch.laoyuan {
  width: 1.1rem; height: 0.7rem;
  background: rgba(200, 140, 20, 0.38);
  border: 1px solid rgba(165, 22, 28, 0.9);
}
.swatch.physio {
  width: 1.1rem; height: 0.7rem;
  background: rgba(110, 150, 90, 0.32);
  border: 1px solid rgba(60, 100, 50, 0.95);
}
.hud-foot {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 0.5rem;
  padding-left: 0.2rem;
}
.hud-north {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  color: var(--gold);
}
.hud-north i {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 9px solid var(--gold);
  margin-top: 1px;
}
.hud-note {
  font-size: 0.7rem;
  color: var(--faint);
  line-height: 1.5;
}

/* 地图 SVG 内的标注：字号随相机缩放换算，保证任何级别都可读 */
.map-node { transition: opacity 0.5s ease; }
.map-node-dot { fill: var(--cream); stroke: #0c1218; stroke-width: calc(1.5 * var(--u, 0.3) * 1px); }
.map-node-dot.river { fill: #8fc4d8; }
.map-node-dot.area { fill: #c8a064; }
.map-node-dot.place {
  fill: rgba(244, 239, 230, 0.5);
  stroke: rgba(8, 12, 16, 0.8);
  stroke-width: calc(0.9 * var(--u, 0.3) * 1px);
}
.map-node-halo { fill: none; stroke: rgba(143, 196, 216, 0.45); stroke-width: calc(1.1 * var(--u, 0.3) * 1px); }
.map-node-label {
  font-family: var(--font-body);
  font-size: calc(13 * var(--u, 0.3) * 1px);
  font-weight: 600;
  fill: var(--cream);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.92);
  stroke-width: calc(3.2 * var(--u, 0.3) * 1px);
  letter-spacing: 0.02em;
}
.map-node-label.minor { font-size: calc(11 * var(--u, 0.3) * 1px); fill: rgba(244, 239, 230, 0.74); }
.map-node-label.battle { fill: #ffd9a8; }
.map-node-note {
  font-family: var(--font-body);
  font-size: calc(9 * var(--u, 0.3) * 1px);
  fill: rgba(244, 239, 230, 0.5);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.88);
  stroke-width: calc(2.4 * var(--u, 0.3) * 1px);
}
.map-river-label {
  font-family: var(--font-body);
  font-size: calc(11 * var(--u, 0.3) * 1px);
  fill: #7fc0da;
  letter-spacing: 0.22em;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(2.6 * var(--u, 0.3) * 1px);
}
.map-ridge-label {
  font-family: var(--font-body);
  font-size: calc(11 * var(--u, 0.3) * 1px);
  fill: rgba(200, 145, 112, 0.95);
  letter-spacing: 0.18em;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.7);
  stroke-width: calc(2.4 * var(--u, 0.3) * 1px);
}
.map-area-label {
  font-family: var(--font-body);
  font-size: calc(10 * var(--u, 0.3) * 1px);
  fill: rgba(210, 175, 115, 0.85);
  letter-spacing: 0.24em;
}
.map-province-label {
  font-family: var(--font-title);
  font-size: calc(34 * var(--u, 0.3) * 1px);
  font-weight: 700;
  fill: rgba(244, 239, 230, 0.14);
  letter-spacing: 0.42em;
}
/* 沿线地名标注：只在近景出现，宽视野下让位于叙事节点 */
.map-node-label.place {
  font-size: calc(10.5 * var(--u, 0.3) * 1px);
  font-weight: 500;
  fill: rgba(244, 239, 230, 0.66);
}
svg:not(.is-tight) .map-node-label.place { display: none; }

/* 近景（相机可视高度较小）时收敛标注，只保留主要地名与当前关注点的注记 */
svg.is-tight .map-node-label.minor { display: none; }
svg.is-tight .map-node:not(.is-focus) .map-node-note { display: none; }
/* 山名反向处理：只在近景显示。远景下它与叙事节点注记抢地方，
   而第一章另有专门的自然地理范围标注承担"大别山"这个名称。 */
svg:not(.is-tight) .map-ridge-label { display: none; }
.map-battle-disc { fill: var(--red-bright); opacity: 0.92; }
.map-battle-star { fill: #ffe9c9; }
.map-battle-ring {
  fill: none;
  stroke: #ff8a5c;
  stroke-width: calc(1.3 * var(--u, 0.3) * 1px);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.map-node.is-focus .map-battle-ring { animation: ringPulse 1.9s ease-out infinite; }
.map-node.is-focus .map-node-dot,
.map-node.is-focus .map-battle-disc { fill: var(--gold); }
.map-node.is-focus .map-node-label { fill: #ffe1b0; font-weight: 700; }
@keyframes ringPulse {
  0% { transform: scale(0.65); opacity: 0.9; }
  100% { transform: scale(2.1); opacity: 0; }
}

/* ==================== 3b 专题图层（按章切换的底图） ==================== */
/* 省域面：第一章"范围归属"（三省用不同色调区分，便于一眼看出归属） */
.provinceShape.area {
  fill: rgba(232, 181, 99, 0.055);
  stroke: rgba(232, 181, 99, 0.3);
  stroke-width: 1.1;
  stroke-dasharray: 5 3;
}
.provinceShape[data-name="河南省"] { fill: rgba(232, 181, 99, 0.085); }
.provinceShape[data-name="湖北省"] { fill: rgba(106, 163, 154, 0.10); }
.provinceShape[data-name="安徽省"] { fill: rgba(118, 152, 205, 0.095); }
.provinceShape[data-name="山东省"] { fill: rgba(198, 138, 158, 0.075); }

/* 自然地理范围：用醒目的亮色虚线勾边来定义"山脉范围"，
   填色保持中性，避免与省域面撞色 */
.physio.area {
  fill: rgba(158, 156, 126, 0.10);
  stroke: rgba(206, 224, 150, 0.78);
  stroke-width: 1.5;
  stroke-dasharray: 8 4;
}

/* 自然地理范围与主峰 */
.physio-label {
  font-family: var(--font-title);
  font-size: calc(15 * var(--u, 0.3) * 1px);
  fill: rgba(190, 220, 170, 0.8);
  letter-spacing: 0.3em;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.8);
  stroke-width: calc(3 * var(--u, 0.3) * 1px);
}
.physio-peak { fill: rgba(190, 220, 170, 0.85); stroke: rgba(8, 12, 16, 0.7); stroke-width: 0.3; }
.physio-peak-label {
  font-family: var(--font-body);
  font-size: calc(10 * var(--u, 0.3) * 1px);
  fill: rgba(205, 230, 185, 0.9);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(2.6 * var(--u, 0.3) * 1px);
}

/* 鄂豫皖苏区核心范围 */
.su.area {
  fill: rgba(193, 39, 45, 0.22);
  stroke: rgba(255, 120, 90, 0.8);
  stroke-width: 1.3;
}
/* 三年游击区：用暖金虚线区分于红色实线的苏区核心区，
   两者叠在一起时也能一眼分开 */
.su.area.guerrilla {
  fill: rgba(232, 181, 99, 0.07);
  stroke: rgba(232, 181, 99, 0.62);
  stroke-width: 1.2;
  stroke-dasharray: 7 4;
}
.su-label {
  font-family: var(--font-title);
  font-size: calc(15 * var(--u, 0.3) * 1px);
  fill: rgba(255, 170, 145, 0.88);
  letter-spacing: 0.26em;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(3 * var(--u, 0.3) * 1px);
}

/* 国家级大别山革命老区全域 */
.lao.area {
  fill: rgba(232, 181, 99, 0.12);
  stroke: rgba(232, 181, 99, 0.6);
  stroke-width: 1.4;
  stroke-dasharray: 10 5;
}
.lao-label {
  font-family: var(--font-title);
  font-size: calc(15 * var(--u, 0.3) * 1px);
  fill: rgba(245, 214, 155, 0.9);
  letter-spacing: 0.26em;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(3 * var(--u, 0.3) * 1px);
}

/* 关隘：菱形 */
.pass-glyph { fill: #d8c9a0; stroke: #0c1218; stroke-width: calc(0.9 * var(--u, 0.3) * 1px); }
.pass-label {
  font-family: var(--font-body);
  font-size: calc(11 * var(--u, 0.3) * 1px);
  fill: #e6dcc0;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.9);
  stroke-width: calc(2.8 * var(--u, 0.3) * 1px);
}
.pass-sub {
  font-family: var(--font-body);
  font-size: calc(8.5 * var(--u, 0.3) * 1px);
  fill: rgba(230, 220, 192, 0.6);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(2.2 * var(--u, 0.3) * 1px);
}

/* 历代兵事地点 */
.ancient-glyph { fill: #9fb3c8; stroke: #0c1218; stroke-width: calc(0.9 * var(--u, 0.3) * 1px); }
.ancient-label {
  font-family: var(--font-body);
  font-size: calc(11 * var(--u, 0.3) * 1px);
  fill: #cfe0ec;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.9);
  stroke-width: calc(2.8 * var(--u, 0.3) * 1px);
}
.ancient-sub {
  font-family: var(--font-body);
  font-size: calc(8.5 * var(--u, 0.3) * 1px);
  fill: rgba(207, 224, 236, 0.6);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(2.2 * var(--u, 0.3) * 1px);
}

/* 早期起义地点：红星标记 */
.uprisings-glyph { fill: #ff5a2b; stroke: #ffe0c2; stroke-width: calc(0.8 * var(--u, 0.3) * 1px); }
.uprisings-label {
  font-family: var(--font-body);
  font-size: calc(12 * var(--u, 0.3) * 1px);
  font-weight: 600;
  fill: #ffd9a8;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.9);
  stroke-width: calc(3 * var(--u, 0.3) * 1px);
}
.uprisings-sub {
  font-family: var(--font-body);
  font-size: calc(9 * var(--u, 0.3) * 1px);
  fill: rgba(255, 217, 168, 0.7);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(2.4 * var(--u, 0.3) * 1px);
}

/* 当代红色景点 */
.site-glyph { fill: #e8b563; stroke: #0c1218; stroke-width: calc(0.9 * var(--u, 0.3) * 1px); }
.site-label {
  font-family: var(--font-body);
  font-size: calc(11 * var(--u, 0.3) * 1px);
  fill: #f0dcb4;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.9);
  stroke-width: calc(2.8 * var(--u, 0.3) * 1px);
}
.site-sub {
  font-family: var(--font-body);
  font-size: calc(8.5 * var(--u, 0.3) * 1px);
  fill: rgba(240, 220, 180, 0.55);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(2.2 * var(--u, 0.3) * 1px);
}
/* 当代红色景点数量多（20 余处），宽视野下只显示金点、不显示名称，
   拉近后逐点显示；这是专题地图控制注记密度的常规做法 */
svg:not(.is-tight) .site-label.in-modern,
svg:not(.is-tight) .site-sub.in-modern { display: none; }

/* 专题路线（长征 / 抗日 / 突围） */
.march.line { fill: none; stroke-width: 1.15; stroke-linecap: round; }
.march.halo { fill: none; stroke-width: 2.6; opacity: 0.14; stroke-linecap: round; }
.march-stop { opacity: 0.9; }
.march-arrow { opacity: 0.95; }
.tone-red .march-line, .march.line.tone-red { stroke: #ff5a2b; }
.march.halo.tone-red { stroke: #ff6a3d; }
.march-stop.tone-red { fill: #ffd0b0; }
.march-arrow.tone-red { fill: #ff5a2b; }
.march.line.tone-gray { stroke: #9fb3c8; }
.march.halo.tone-gray { stroke: #9fb3c8; }
.march-stop.tone-gray { fill: #cfe0ec; }
.march-arrow.tone-gray { fill: #9fb3c8; }
.march.line.tone-gold { stroke: #e8b563; }
.march.halo.tone-gold { stroke: #e8b563; }
.march-stop.tone-gold { fill: #f5d69b; }
.march-arrow.tone-gold { fill: #e8b563; }
/* 出图指示：路线走出图幅时标出去向 */
.march-exitarrow { fill: rgba(255, 170, 130, 0.9); }
.march-exit {
  font-family: var(--font-body);
  font-size: calc(10.5 * var(--u, 0.3) * 1px);
  fill: #ffcfae;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.9);
  stroke-width: calc(2.8 * var(--u, 0.3) * 1px);
}

/* ================== 3c 高德实景底图模式（map-amap.js） ==================
   高德覆盖物用自有 HTML 承载，因此这里定义点、标注、副标的样式。
   与自绘模式不同：实景底图上标注用固定屏幕字号（px），不随缩放缩放，
   这是真实地图的常规做法。
   近景收敛沿用同一判据：容器带 is-tight 类时，由下列 descendant 规则控制显隐。 */

/* 覆盖物容器：0 尺寸锚点盒，圆点居中于锚点，标注绝对定位在其周围 */
.am-marker { position: relative; width: 0; height: 0; overflow: visible; }
.am-labelbox { position: relative; width: 0; height: 0; overflow: visible; }

.am-dot {
  position: absolute;
  left: 0; top: 0;
  width: 9px; height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--cream);
  border: 1.5px solid rgba(8, 12, 16, 0.9);
  box-sizing: border-box;
}
.am-dot.am-battle {
  width: 15px; height: 15px;
  margin: -7.5px 0 0 -7.5px;
  background: var(--red-bright);
  border-color: #ffe9c9;
  box-shadow: 0 0 0 3px rgba(255, 90, 43, 0.28);
}
.am-dot.am-riverdot { background: #8fc4d8; }
.am-dot.am-areadot { background: #c8a064; }
.am-dot.am-citydot { width: 8px; height: 8px; margin: -4px 0 0 -4px; }
.am-dot.am-placedot { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: rgba(244, 239, 230, 0.6); border-width: 1px; }
.am-dot.am-pass { border-radius: 1px; transform: rotate(45deg); background: var(--pass, #d8c9a0); }
.am-dot.am-ancient { background: #9fb3c8; }
.am-dot.am-uprising { background: var(--red-bright); border-color: #ffe0c2; box-shadow: 0 0 0 3px rgba(255, 90, 43, 0.25); }
.am-dot.am-site { background: var(--gold); border-color: rgba(8, 12, 16, 0.85); }
.am-dot.am-peak {
  width: 0; height: 0;
  margin: -6px 0 0 -6px;
  border-radius: 0;
  background: none;
  border: none;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 11px solid rgba(206, 224, 150, 0.95);
}

/* 标注文字 */
.am-lbl, .am-sub {
  position: absolute;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.2;
  color: var(--cream);
  text-shadow: 0 1px 2px #000, 0 0 4px #000, 0 0 8px rgba(0, 0, 0, 0.9);
  pointer-events: none;
}
.am-sub { font-size: 10px; color: rgba(244, 239, 230, 0.62); }
.am-lbl-top { left: 0; bottom: 8px; transform: translateX(-50%); }
.am-lbl-bottom { left: 0; top: 8px; transform: translateX(-50%); }
.am-lbl-left { right: 8px; top: 0; transform: translateY(-50%); }
.am-lbl-right { left: 8px; top: 0; transform: translateY(-50%); }
.am-sub.am-lbl-top { bottom: -20px; }
.am-sub.am-lbl-bottom { top: 22px; }
.am-sub.am-lbl-left { top: 14px; }
.am-sub.am-lbl-right { top: 14px; }

/* 节点与景点的强调样式 */
.am-nodelbl-battle { color: #ffd9a8; font-weight: 600; }
.am-nodelbl-minor { font-size: 11px; color: rgba(244, 239, 230, 0.74); font-weight: 500; }
.am-nodelbl-place { font-size: 10.5px; color: rgba(244, 239, 230, 0.66); font-weight: 500; }
.am-peaklbl { font-size: 10px; color: rgba(205, 230, 185, 0.95); }
.am-passlbl { font-size: 11px; color: #e6dcc0; }
.am-ancientlbl { font-size: 11px; color: #cfe0ec; }
.am-uplbl { font-size: 12px; color: #ffd9a8; font-weight: 600; }
.am-sitelbl { font-size: 11px; color: #f0dcb4; }

/* 面名与线名 */
.am-label { font-family: var(--font-title); font-size: 15px; color: rgba(244, 239, 230, 0.9); letter-spacing: 0.2em; text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: none; white-space: nowrap; }
.am-province { font-size: 22px; color: rgba(244, 239, 230, 0.35); letter-spacing: 0.4em; font-weight: 700; }
.am-ridge { font-size: 11px; color: rgba(200, 145, 112, 0.95); letter-spacing: 0.18em; }
.am-river { font-size: 11px; color: #7fc0da; letter-spacing: 0.2em; }
.am-area { font-size: 10px; color: rgba(210, 175, 115, 0.9); letter-spacing: 0.22em; }
.am-physio { font-size: 15px; color: rgba(206, 224, 150, 0.85); letter-spacing: 0.3em; }
.am-su { font-size: 15px; color: rgba(255, 170, 145, 0.9); letter-spacing: 0.24em; }
.am-lao { font-size: 15px; color: rgba(245, 214, 155, 0.9); letter-spacing: 0.24em; }
.am-exit { font-size: 11px; color: #ffcfae; letter-spacing: 0.02em; }

/* 关注点脉冲 */
.am-marker .is-focus { color: #ffe1b0; }
.am-marker.is-focus .am-dot {
  background: var(--gold);
  animation: amPulse 1.9s ease-out infinite;
}
@keyframes amPulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 181, 99, 0.7); }
  100% { box-shadow: 0 0 0 14px rgba(232, 181, 99, 0); }
}

/* 近景 / 远景收敛（与自绘引擎同一套语义） */
#map-stage:not(.is-tight) .in-modern { display: none; }
#map-stage:not(.is-tight) .am-nodelbl-place { display: none; }
#map-stage.is-tight .am-nodelbl-minor { display: none; }
#map-stage.is-tight .am-ridge { display: none; }
#map-stage.is-tight .am-sub:not(.is-focus) { display: none; }

/* 地图引擎状态提示 */
#map-notice {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%) translateY(200%);
  z-index: 4;
  max-width: min(92vw, 40rem);
  padding: 0.5rem 1rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--gold);
  background: rgba(8, 11, 15, 0.92);
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: transform 0.4s ease;
  pointer-events: none;
}
#map-notice.is-shown { transform: translateX(-50%) translateY(0); }

.hud-attribution {
  margin-top: 0.35rem;
  padding-left: 0.2rem;
  font-size: 0.68rem;
  color: var(--faint);
  letter-spacing: 0.04em;
}

/* 底图切换按钮已移入导航栏（见 #map-toggle），此处不再需要 hud-toggle */

/* 天地图没有暗色底图，与页面深色基调不协。这里用 CSS 滤镜调整底图瓦片：
   只作用于 http(s) 来源的瓦片图与 canvas，
   本作品的专题覆盖物是 data-URI SVG 图标，不受影响、颜色不会被反转。

   强度由 --basemap-filter 控制（config.js 的 baseMapFilter 可覆盖）：
   压得越狠越融进深色页面，但真实地物的细节（路网、水系、地名）也越糊。
   默认值刻意保留了较高的对比度与饱和度，让"这是真实地图"看得出来。 */
#map-stage.tdt-dark img[src^="http"] {
  filter: var(--basemap-filter,
    invert(1) hue-rotate(180deg) brightness(1.04) contrast(1.34) saturate(1.18));
}
#map-stage.tdt-dark canvas {
  filter: var(--basemap-filter,
    invert(1) hue-rotate(180deg) brightness(1.04) contrast(1.34) saturate(1.18));
}

/* ============================== 4 封面 ============================== */
.sec-cover {
  height: 100vh;
  min-height: 34rem;
  overflow: hidden;
}
.cover-art { position: absolute; inset: 0; }
.cover-art svg { width: 100%; height: 100%; display: block; }
.cover-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(8, 10, 14, 0.18), rgba(8, 10, 14, 0.86) 72%),
    linear-gradient(to bottom, rgba(8, 10, 14, 0.55), rgba(8, 10, 14, 0.94));
}
.cover-inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6vh clamp(1.2rem, 6vw, 4rem) 8vh;
}
.cover-series {
  font-size: clamp(0.7rem, 1.6vw, 0.86rem);
  letter-spacing: 0.42em;
  color: var(--gold);
  margin-bottom: clamp(1rem, 3vh, 2rem);
}
.cover-title {
  font-family: var(--font-title);
  font-size: clamp(2.1rem, 7.2vw, 5.2rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0.12em;
  text-shadow: 0 6px 34px rgba(0, 0, 0, 0.7);
}
.cover-title::after {
  content: "";
  display: block;
  width: clamp(3rem, 12vw, 7rem);
  height: 2px;
  margin: clamp(1rem, 2.4vh, 1.8rem) auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.cover-sub {
  margin-top: clamp(0.9rem, 2.2vh, 1.5rem);
  font-size: clamp(0.86rem, 2vw, 1.16rem);
  color: var(--muted);
  letter-spacing: 0.1em;
  max-width: 34em;
}
.cover-meta {
  margin-top: clamp(1rem, 2.6vh, 1.9rem);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  font-size: clamp(0.76rem, 1.7vw, 0.9rem);
  color: var(--faint);
  letter-spacing: 0.14em;
}
.cover-meta .dot { color: var(--gold-dim); }
.scroll-hint {
  position: absolute;
  bottom: clamp(1.4rem, 4vh, 3rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  color: var(--faint);
}
.hint-arrow {
  font-size: 1.1rem;
  color: var(--gold);
  animation: hintBounce 2s ease-in-out infinite;
}
@keyframes hintBounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(6px); opacity: 1; }
}

/* ========================= 5 引子与尾声 ========================= */
.sec-sequence {
  padding: clamp(5rem, 18vh, 11rem) clamp(1.2rem, 6vw, 4rem);
  display: flex;
  justify-content: center;
}
.bg-ink {
  background:
    radial-gradient(ellipse at 22% 12%, rgba(35, 62, 76, 0.5), transparent 62%),
    linear-gradient(165deg, #0a1014 0%, #101a22 55%, #0a1014 100%);
}
.bg-red {
  background:
    radial-gradient(ellipse at 78% 18%, rgba(140, 30, 26, 0.55), transparent 60%),
    linear-gradient(165deg, #12090a 0%, #24100f 55%, #0d0809 100%);
}
.seq-inner {
  width: 100%;
  max-width: 44rem;
}
.seq-title {
  font-family: var(--font-title);
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin-bottom: clamp(1.4rem, 3.4vh, 2.4rem);
}
.seq-title::after {
  content: "";
  display: block;
  width: 3.2rem; height: 2px;
  margin-top: 1rem;
  background: var(--red-bright);
}
.seq-text {
  font-size: clamp(0.98rem, 2.1vw, 1.1rem);
  color: rgba(244, 239, 230, 0.84);
  margin-bottom: 1.1rem;
}
.seq-lead {
  font-family: var(--font-title);
  font-size: clamp(1.12rem, 2.7vw, 1.5rem);
  line-height: 1.8;
  color: var(--gold);
  margin: 1.6rem 0 1.1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--red);
}
.seq-routes-title {
  font-family: var(--font-title);
  font-size: clamp(1.05rem, 2.3vw, 1.3rem);
  color: var(--cream);
  letter-spacing: 0.1em;
  margin: 2.4rem 0 1rem;
}
.route-line {
  display: flex;
  gap: 0.9rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed rgba(232, 181, 99, 0.18);
}
.route-line-name {
  flex: none;
  width: 5.2rem;
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}
.route-line-text {
  font-size: 0.94rem;
  color: rgba(244, 239, 230, 0.8);
}
.seq-inner .p-plate { margin: 2.4rem 0 0; }

/* ========================= 6 章节分隔页 ========================= */
.sec-divider {
  height: 100vh;
  min-height: 30rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.divider-art { position: absolute; inset: 0; }
.divider-art svg { width: 100%; height: 100%; display: block; }
.divider-veil {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(6, 9, 12, 0.86), rgba(6, 9, 12, 0.62) 45%, rgba(6, 9, 12, 0.92));
}
.divider-inner {
  position: relative;
  text-align: center;
  padding: 0 1.5rem;
}
.divider-num {
  font-family: var(--font-title);
  font-size: clamp(3.4rem, 13vw, 8rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(232, 181, 99, 0.55);
  opacity: 0.9;
}
.divider-title {
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 6vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-top: 0.4rem;
}
.divider-rule {
  width: clamp(4rem, 16vw, 9rem);
  height: 2px;
  margin: 1.4rem auto;
  background: linear-gradient(90deg, transparent, var(--red-bright), transparent);
}
.divider-period {
  font-size: clamp(0.8rem, 1.8vw, 0.94rem);
  color: var(--muted);
  letter-spacing: 0.24em;
}
.divider-quote {
  margin-top: 1.6rem;
  font-family: var(--font-title);
  font-size: clamp(0.95rem, 2.2vw, 1.16rem);
  color: var(--gold);
  letter-spacing: 0.12em;
}

/* ====================== 7 沉浸章节与图文面板 ====================== */
.sec-immersive { background: transparent; }

.imm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 40rem);
  gap: 2rem;
  padding: 0 clamp(1rem, 4vw, 4.5rem);
}
.imm-spacer { min-height: 1px; }
.imm-panels {
  padding: clamp(10vh, 14vh, 18vh) 0 clamp(16vh, 22vh, 26vh);
  display: flex;
  flex-direction: column;
  gap: clamp(3vh, 7vh, 7rem);
}

.panel-head {
  padding: 1.4rem 1.6rem;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border-left: 3px solid var(--red);
  box-shadow: var(--shadow-card);
}
.panel-kicker {
  font-size: 0.76rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.panel-title {
  font-family: var(--font-title);
  font-size: clamp(1.3rem, 3.4vw, 2rem);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.06em;
}
.panel-date {
  margin-top: 0.6rem;
  font-size: 0.82rem;
  color: var(--faint);
  letter-spacing: 0.16em;
}

.panel-card {
  min-height: 42vh;
  display: flex;
  align-items: center;
  padding: 1.5rem 1.7rem;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border-left: 3px solid rgba(232, 181, 99, 0.5);
  box-shadow: var(--shadow-card);
}
.panel-card > * { width: 100%; }

.p-date {
  font-family: var(--font-title);
  font-size: clamp(1.05rem, 2.6vw, 1.4rem);
  color: var(--gold);
  letter-spacing: 0.14em;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(232, 181, 99, 0.24);
}
.p-lead {
  font-family: var(--font-title);
  font-size: clamp(1.1rem, 2.7vw, 1.5rem);
  line-height: 1.82;
  color: #fff6e6;
  letter-spacing: 0.02em;
}
.p-text {
  font-size: clamp(0.98rem, 2.1vw, 1.08rem);
  color: rgba(244, 239, 230, 0.86);
}
.p-quote {
  position: relative;
  padding-left: 2.4rem;
}
.quote-mark {
  position: absolute;
  left: 0; top: -0.6rem;
  font-family: var(--font-title);
  font-size: 3rem;
  line-height: 1;
  color: rgba(193, 39, 45, 0.75);
}
.quote-text {
  display: block;
  font-family: var(--font-title);
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  line-height: 1.7;
  color: #ffe9c9;
  letter-spacing: 0.04em;
}
.quote-who {
  display: block;
  margin-top: 0.9rem;
  font-style: normal;
  font-size: 0.9rem;
  color: var(--gold);
  letter-spacing: 0.14em;
}
.p-stat {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 1rem 1.4rem;
}
.stat-cell {
  padding-left: 0.9rem;
  border-left: 2px solid rgba(193, 39, 45, 0.7);
}
.stat-value {
  font-family: var(--font-title);
  font-size: clamp(1.35rem, 3.6vw, 2.05rem);
  font-weight: 700;
  color: var(--gold);
  line-height: 1.3;
  letter-spacing: 0.02em;
}
.stat-key {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 0.2rem;
}
.p-note {
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--faint);
  padding-left: 0.9rem;
  border-left: 1px solid rgba(244, 239, 230, 0.18);
}

/* ======================== 8 插画与占位图 ======================== */
.p-plate { margin: 0; }
.plate-holder {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid rgba(232, 181, 99, 0.2);
  background: var(--ink-2);
}
.plate-holder svg { width: 100%; height: 100%; display: block; }
.p-plate img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid rgba(232, 181, 99, 0.2);
}
.plate-caption {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-top: 0.6rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--muted);
}
.plate-tag {
  flex: none;
  padding: 0.08rem 0.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  border: 1px solid rgba(232, 181, 99, 0.42);
  border-radius: 2px;
}

/* ============================= 9 致谢 ============================= */
.sec-credits {
  padding: clamp(4.5rem, 14vh, 9rem) clamp(1.2rem, 6vw, 4rem) clamp(6rem, 16vh, 10rem);
  background: linear-gradient(180deg, #080b0f, #0d1319 60%, #080b0f);
}
.credits-inner { max-width: 48rem; margin: 0 auto; }
.credits-title {
  font-family: var(--font-title);
  font-size: clamp(1.3rem, 3.2vw, 1.9rem);
  letter-spacing: 0.12em;
  margin-bottom: 1.8rem;
}
.credits-title::after {
  content: "";
  display: block;
  width: 3.2rem; height: 2px;
  margin-top: 1rem;
  background: var(--gold-dim);
}
.credits-list { list-style: none; }
.credits-list li {
  position: relative;
  padding: 0.55rem 0 0.55rem 1.3rem;
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--muted);
  border-bottom: 1px solid rgba(244, 239, 230, 0.06);
}
.credits-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--gold-dim);
}
.credits-makers {
  margin-top: 2rem;
  font-size: 0.86rem;
  color: var(--faint);
  letter-spacing: 0.06em;
}

.noscript {
  position: relative;
  z-index: 9;
  padding: 4rem 1.5rem;
  max-width: 40rem;
  margin: 0 auto;
}

/* ====================== 10 响应式与打印 ====================== */
@media (max-width: 980px) {
  body { font-size: 15px; }
  .imm-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 clamp(0.8rem, 4vw, 1.6rem);
  }
  .imm-spacer { display: none; }
  .imm-panels { padding: clamp(8vh, 12vh, 14vh) 0 clamp(14vh, 20vh, 22vh); }
  .panel-card {
    min-height: 40vh;
    background: rgba(9, 13, 18, 0.84);
  }
  .panel-head { background: rgba(9, 13, 18, 0.88); }
  #map-hud { max-width: calc(100vw - 1.6rem); }
  .hud-note { display: none; }
}

@media (max-width: 620px) {
  :root { --nav-h: 52px; }
  .nav-title { display: none; }
  .cover-meta { letter-spacing: 0.08em; }
  .panel-card { min-height: 34vh; padding: 1.2rem 1.1rem; }
  .panel-head { padding: 1.1rem 1.1rem; }
  .p-quote { padding-left: 1.8rem; }
  .hud-legend { gap: 0.35rem 0.7rem; padding: 0.5rem 0.6rem; }
  .hud-item { font-size: 0.68rem; }
  .route-line { flex-direction: column; gap: 0.2rem; }
  .route-line-name { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hint-arrow { animation: none; }
  .map-node.is-focus .map-battle-ring { animation: none; opacity: 0.7; }
  body { transition: none; opacity: 1; }
}

/* 打印 / 导出 PDF：展开为静态长文，隐藏交互层 */
@media print {
  body { opacity: 1; background: #fff; color: #111; }
  #navbar, #progress-bar, #map-hud, #map-stage { display: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .sec { page-break-inside: avoid; }
  .sec-cover, .sec-divider { height: auto; min-height: 0; padding: 3rem 0; }
  .cover-veil, .divider-veil { display: none; }
  .cover-title, .divider-title, .panel-title, .credits-title { color: #111; -webkit-text-stroke: 0; }
  .cover-sub, .cover-meta, .divider-period, .p-text, .seq-text, .credits-list li { color: #333; }
  .panel-card, .panel-head { background: #fff; border: 1px solid #ddd; box-shadow: none; backdrop-filter: none; }
  .plate-holder svg { max-height: 16rem; }
}
