/* ============================================================
   出发吧！从大理 · 风花雪月手账地图
   单一夜航皮肤：扎染靛蓝底 + 发光地图屏幕 + 章节式排版
   性能约定：无 backdrop-filter，无大面积 box-shadow 动画，
   动效只用 transform/opacity，章节启用 content-visibility
   ============================================================ */

:root {
  --night: #070a14;
  --night-2: #0b1020;
  --ink: #f2f6ff;
  --ink-soft: rgba(242, 246, 255, .66);
  --ink-faint: rgba(242, 246, 255, .42);
  --stroke: rgba(255, 255, 255, .14);
  --stroke-soft: rgba(255, 255, 255, .09);
  --glass: rgba(255, 255, 255, .06);
  --glass-deep: rgba(7, 10, 20, .72);
  --accent: #ff6f7f;        /* 茶花 · 公路 */
  --accent-2: #7de3ff;      /* 洱海 · 铁路 */
  --accent-3: #d7fff2;      /* 苍山雪 · 高亮 */
  --scene-a: #7de3d2;
  --scene-b: #ff8f7d;
  --scene-c: #eafff6;
  --font-display: "Kaiti SC", "STKaiti", "KaiTi", "Noto Serif SC", "Songti SC", serif;
  --font-latin: Georgia, "Times New Roman", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

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

html { height: auto; }

body {
  background: radial-gradient(circle at 30% 12%, #101a33, var(--night) 58%);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

::selection { background: color-mix(in srgb, var(--scene-b) 50%, transparent); }

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--scene-c) 80%, white);
  outline-offset: 2px;
}

/* ---------------- 底层：颜料画布与纸纹 ---------------- */

#paint-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  contain: strict;
  opacity: 0; /* WebGL 首帧渲染后由 JS 淡入；失败时保持隐藏，露出 body 渐变 */
  transition: opacity 1.2s ease;
}

#paper-bg {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------------- 章节进度轨 ---------------- */

#story-rail {
  position: fixed;
  left: clamp(12px, 2vw, 28px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 55;
  display: grid;
  grid-template-columns: 14px auto;
  gap: 14px;
  pointer-events: none;
}

.story-rail-track {
  position: relative;
  width: 2px;
  height: 232px;
  margin: auto;
  background: rgba(255, 255, 255, .14);
  border-radius: 2px;
  overflow: hidden;
}

#story-progress-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--scene-b), var(--scene-a), var(--scene-c));
  transform: scaleY(0);
  transform-origin: top;
}

#story-rail ol { list-style: none; display: grid; gap: 22px; }

#story-rail li {
  display: grid;
  grid-template-columns: 22px auto;
  align-items: baseline;
  gap: 8px;
  opacity: .38;
  transform: translateX(-4px);
  transition: opacity .3s, transform .3s;
}

#story-rail li b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  color: rgba(255, 255, 255, .92);
}

#story-rail li span {
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--ink-soft);
}

#story-rail li.active {
  opacity: 1;
  transform: translateX(0);
}

#story-rail li.active b {
  color: var(--scene-c);
  text-shadow: 0 0 18px color-mix(in srgb, var(--scene-b) 70%, transparent);
}

/* ---------------- 顶栏 ---------------- */

#topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px clamp(16px, 3vw, 30px);
  background: linear-gradient(180deg, rgba(7, 10, 20, .88), rgba(7, 10, 20, 0));
}

.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }

.brand-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff8f7d, var(--accent));
  color: #fff;
  font-family: var(--font-display);
  font-size: 19px;
  transform: rotate(-6deg);
}

.brand h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  letter-spacing: .04em;
  white-space: nowrap;
}

.brand-sub {
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 11.5px;
  color: var(--ink-faint);
  white-space: nowrap;
}

#mode-switch { display: flex; gap: 6px; }

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px 6px 7px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}

.mode-btn .mb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-family: var(--font-display);
  font-size: 12px;
}

.mode-btn:hover { border-color: rgba(255, 255, 255, .34); color: var(--ink); }

.mode-btn.active {
  background: rgba(255, 255, 255, .13);
  border-color: color-mix(in srgb, var(--scene-c) 64%, transparent);
  color: #fff;
}

/* ---------------- 章节骨架 ---------------- */

#story-shell { position: relative; z-index: 10; }

.story-chapter {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, .94fr) minmax(320px, .86fr);
  align-items: center;
  gap: clamp(18px, 4vw, 56px);
  /* 左侧多留出章节进度轨的空间 */
  padding: clamp(104px, 12vh, 150px) clamp(22px, 5vw, 80px) clamp(48px, 8vh, 96px) clamp(64px, 7.5vw, 118px);
  overflow: clip;
  isolation: isolate;
}

.local-chapter,
.far-chapter {
  content-visibility: auto;
  contain-intrinsic-size: auto 1000px;
}

.story-chapter::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 24%, color-mix(in srgb, var(--scene-a) 13%, transparent), transparent 34rem),
    radial-gradient(circle at 84% 70%, color-mix(in srgb, var(--scene-b) 9%, transparent), transparent 30rem);
}

.chapter-glyph {
  position: absolute;
  right: clamp(-40px, 2vw, 60px);
  top: 50%;
  z-index: 1;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-size: clamp(280px, 36vw, 540px);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .09);
  pointer-events: none;
  user-select: none;
}

@supports not (-webkit-text-stroke: 1px black) {
  .chapter-glyph { color: rgba(255, 255, 255, .04); }
}

.chapter-copy { position: relative; z-index: 5; max-width: 640px; }

.chapter-kicker {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 13px;
  letter-spacing: .12em;
  color: color-mix(in srgb, var(--scene-c) 80%, white);
  transition: color .6s;
}

.chapter-kicker i {
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 15px;
  color: var(--ink-faint);
}

.chapter-kicker em {
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--ink-faint);
}

.chapter-copy h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(46px, 6.2vw, 94px);
  line-height: 1.1;
  letter-spacing: .015em;
  color: rgba(255, 255, 255, .97);
  text-shadow: 0 0 44px color-mix(in srgb, var(--scene-b) 26%, transparent);
  margin-bottom: 26px;
}

.chapter-copy > p {
  max-width: 56ch;
  padding-left: 16px;
  border-left: 1px solid color-mix(in srgb, var(--scene-a) 55%, transparent);
  font-size: 14.5px;
  line-height: 2;
  color: var(--ink-soft);
  transition: border-color .6s;
}

.chapter-copy > p b { color: var(--ink); font-weight: 600; }

.chapter-note {
  margin-top: 14px !important;
  font-size: 12.5px !important;
  color: var(--ink-faint) !important;
}

.chapter-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.chapter-stats span {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--glass);
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .2s;
}

.chapter-stats b {
  font-family: var(--font-latin);
  font-style: italic;
  font-weight: 400;
  font-size: 27px;
  line-height: 1;
  color: color-mix(in srgb, var(--scene-c) 86%, white);
  transition: color .6s;
}

.mode-live {
  margin-top: 26px;
  max-width: 390px;
  padding: 14px 16px;
  border: 1px solid var(--stroke);
  border-left: 3px solid color-mix(in srgb, var(--scene-b) 70%, transparent);
  border-radius: 12px;
  background: var(--glass);
  transition: border-color .25s;
}

.mode-live-kicker {
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.mode-live b {
  display: block;
  margin: 5px 0 3px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 27px;
  color: #fff;
}

.mode-live p { font-size: 12.5px; line-height: 1.75; color: var(--ink-soft); }

.mode-live.pulse {
  border-color: color-mix(in srgb, var(--scene-c) 60%, transparent);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  font-size: 10.5px;
  letter-spacing: .3em;
  color: var(--ink-faint);
  animation: cue-drift 2.6s ease-in-out infinite;
}

@keyframes cue-drift {
  0%, 100% { transform: translate(-50%, 0); opacity: .55; }
  50% { transform: translate(-50%, 7px); opacity: 1; }
}

/* ---------------- 场景画布通用 ---------------- */

.scene-art {
  position: relative;
  z-index: 4;
  width: min(42vw, 600px);
  min-width: 300px;
  height: min(64svh, 580px);
  justify-self: center;
  contain: layout paint style;
  opacity: .88;
  transition: opacity .4s;
}

.story-chapter:not(.is-active) .scene-art { opacity: .5; }

.scene-layer { position: absolute; }

/* 玻璃贴片 · 票根 · 图钉 */

.scene-pin,
.local-stop,
.far-city {
  position: absolute;
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  background: var(--glass-deep);
  color: rgba(255, 255, 255, .88);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .2s;
}

.scene-pin::before,
.local-stop::before,
.far-city::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--scene-b);
  box-shadow: 0 0 10px color-mix(in srgb, var(--scene-b) 80%, transparent);
  transition: background-color .6s;
}

.scene-ticket,
.boarding-pass {
  z-index: 6;
  display: grid;
  gap: 2px;
  padding: 11px 15px;
  border: 1px solid var(--stroke);
  border-radius: 11px;
  background: linear-gradient(105deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
  color: rgba(255, 255, 255, .82);
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}

.scene-ticket span,
.boarding-pass span {
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.scene-ticket b,
.boarding-pass b {
  font-family: var(--font-latin);
  font-style: italic;
  font-weight: 400;
  font-size: 25px;
  line-height: 1.05;
  color: rgba(255, 255, 255, .94);
}

.boarding-pass b { font-family: var(--font-display); font-style: normal; }

.scene-ticket em,
.boarding-pass em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--ink-soft);
}

/* ---------------- 第一章 · 下关风 ---------------- */

.hero-scene .hero-pagodas {
  left: 50%;
  bottom: 6%;
  width: min(100%, 420px);
  transform: translateX(-50%);
}

.hero-pagodas .pagoda rect { fill: rgba(223, 233, 255, .2); }
.hero-pagodas .pagoda-main rect { fill: rgba(223, 233, 255, .3); }

.hero-pagodas .pagoda-ground {
  stroke: rgba(255, 255, 255, .22);
  stroke-width: 1;
}

.hero-pagodas .pagoda-wave {
  fill: none;
  stroke: color-mix(in srgb, var(--scene-a) 60%, transparent);
  stroke-width: 1.4;
  stroke-linecap: round;
  transition: stroke .6s;
}

.scene-route-thread,
.far-route {
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.scene-route-thread path,
.far-route path {
  fill: none;
  stroke: rgba(255, 255, 255, .42);
  stroke-width: 1.5;
  stroke-dasharray: 2 11;
  stroke-linecap: round;
}

.scene-route-thread.is-hotspot-active path,
.far-route.is-hotspot-active path { stroke: rgba(255, 255, 255, .86); }

.scene-pin-home { left: 6%; bottom: 22%; }
.scene-pin-north { left: 38%; top: 18%; }
.scene-pin-east { right: 4%; top: 38%; }

.scene-ticket-rail { left: 0; top: 4%; transform: rotate(-3deg); }
.scene-ticket-air { right: 2%; bottom: 4%; transform: rotate(2deg); }

.scene-compass {
  right: 8%;
  top: 6%;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--stroke);
  border-radius: 50%;
  background: var(--glass);
  color: rgba(255, 255, 255, .8);
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 16px;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}

/* ---------------- 第二章 · 上关花 ---------------- */

.local-chapter {
  grid-template-columns: minmax(320px, .84fr) minmax(0, .98fr);
}

.local-chapter .chapter-glyph { right: auto; left: clamp(-30px, 3vw, 80px); }

.split-copy { grid-column: 2; grid-row: 1; }
.local-scene { grid-column: 1; grid-row: 1 / span 2; }
.route-board { grid-column: 2; grid-row: 2; align-self: start; }

.zaran-rings {
  left: 50%;
  top: 50%;
  width: min(88%, 460px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.zaran-rings circle {
  fill: none;
  stroke: color-mix(in srgb, var(--scene-a) 36%, transparent);
  stroke-width: 1;
  stroke-dasharray: 3 9;
  transition: stroke .6s;
}

.local-lake {
  left: 18%;
  top: 22%;
  width: 60%;
  height: 56%;
  z-index: 2;
  border-radius: 58% 42% 56% 44% / 48% 56% 44% 52%;
  background:
    radial-gradient(circle at 32% 30%, color-mix(in srgb, var(--scene-c) 26%, transparent), transparent 62%),
    radial-gradient(circle at 70% 72%, color-mix(in srgb, var(--scene-b) 22%, transparent), transparent 58%),
    rgba(255, 255, 255, .07);
  border: 1px solid var(--stroke-soft);
  transform: rotate(-7deg);
}

.local-stop-a { left: 10%; top: 18%; }
.local-stop-b { right: 8%; top: 32%; }
.local-stop-c { left: 4%; bottom: 26%; }
.local-stop-d { left: 34%; bottom: 9%; }

.local-note {
  right: 0;
  bottom: 0;
  z-index: 6;
  padding: 9px 14px;
  border-left: 1px solid rgba(255, 255, 255, .26);
  background: var(--glass);
  color: var(--ink-soft);
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .2s, background-color .2s;
}

.route-board {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.route-card {
  padding: 16px 16px 14px;
  border: 1px solid var(--stroke);
  border-radius: 13px;
  background: var(--glass);
  cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .2s;
}

.route-card span {
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 24px;
  color: color-mix(in srgb, var(--scene-b) 88%, white);
  transition: color .6s;
}

.route-card h3 {
  margin: 7px 0 6px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  color: rgba(255, 255, 255, .94);
}

.route-card p { font-size: 12px; line-height: 1.8; color: var(--ink-soft); }

/* ---------------- 第三章 · 苍山雪 · 地图屏幕 ---------------- */

.map-chapter {
  display: block;
  min-height: 174svh;
  padding: 78px 0 0;
}

.map-copy {
  position: absolute;
  top: 102px;
  left: clamp(34px, 6vw, 96px);
  z-index: 28;
  max-width: 560px;
  pointer-events: none;
}

.map-copy h2 { font-size: clamp(44px, 5.4vw, 84px); margin-bottom: 18px; }

.map-copy p {
  padding: 10px 14px 10px 16px;
  border-left: 1px solid rgba(255, 255, 255, .22);
  background: rgba(5, 6, 10, .55);
  border-radius: 0 10px 10px 0;
  font-size: 13px;
}

#stage {
  position: sticky;
  top: 74px;
  height: calc(100svh - 88px);
  min-height: 660px;
  margin: 0 clamp(14px, 2vw, 26px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background:
    radial-gradient(circle at 36% 22%, rgba(125, 227, 255, .15), transparent 22rem),
    radial-gradient(circle at 74% 26%, rgba(255, 111, 127, .11), transparent 24rem),
    #03050c;
  box-shadow: 0 28px 84px rgba(0, 0, 0, .4);
  contain: layout paint;
}

#map-wrap { position: relative; width: 100%; height: 100%; }

#map-wrap::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 34%;
  pointer-events: none;
  background:
    radial-gradient(circle at 48% 20%, rgba(255, 255, 255, .09), transparent 14rem),
    linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 44%);
}

#map { width: 100%; height: 100%; display: block; cursor: grab; }
#map:active { cursor: grabbing; }

#map-cinema-overlay { position: absolute; inset: 0; z-index: 21; pointer-events: none; }

.map-scene-card {
  position: absolute;
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border: 1px solid var(--stroke);
  border-radius: 11px;
  background: var(--glass-deep);
  pointer-events: auto;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}

.map-scene-card span {
  font-size: 9.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.map-scene-card b {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 19px;
  color: rgba(255, 255, 255, .92);
}

.map-scene-card-a { left: clamp(286px, 28vw, 430px); top: 26px; transform: rotate(-1deg); }
.map-scene-card-b { right: clamp(420px, 36vw, 560px); bottom: 46px; transform: rotate(1deg); }

.map-scanline {
  position: absolute;
  left: 300px;
  right: 430px;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--scene-b) 56%, transparent), color-mix(in srgb, var(--scene-a) 44%, transparent), transparent);
  transform: translateY(-50%);
  opacity: .7;
}

/* —— 地图 SVG 内部（由 map.js 生成，类名为既有契约） —— */

.province {
  fill: rgba(11, 15, 26, .74);
  stroke: rgba(214, 238, 255, .18);
  stroke-width: .72;
  transition: fill .12s;
}

.province-yunnan { fill: rgba(39, 54, 86, .92); }

.dash-line { stroke: rgba(214, 238, 255, .3); }

.map-graticule {
  fill: none;
  stroke: rgba(255, 255, 255, .1);
  stroke-width: .55;
  stroke-dasharray: 1 8;
  pointer-events: none;
}

.province-label {
  font-family: var(--font-body);
  font-size: 8.8px;
  fill: rgba(244, 249, 255, .4);
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .44);
  stroke-width: 2px;
  pointer-events: none;
}

.root:not(.map-zoomed) .province-label { display: none; }

.province-focus-outline {
  fill: none;
  stroke: rgba(215, 255, 242, .72);
  stroke-width: 1.45;
  stroke-dasharray: 4 8;
  pointer-events: none;
}

.iso-band {
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: .3;
}

.route-line {
  mix-blend-mode: screen;
  transition: opacity .12s, stroke-width .12s;
}

.route-line.route-active { stroke-width: 2.2; }
.route-line.story-linked { stroke-width: 2.5; }

.city-sticker { cursor: pointer; }

.city-sticker .sticker-bg { transition: transform .15s; }
.city-sticker:hover .sticker-bg { transform: scale(1.18); }

.city-sticker .sticker-bg circle:first-child {
  fill: rgba(255, 255, 255, .92);
  stroke: rgba(255, 255, 255, .82);
  stroke-width: 1.2;
}

.city-sticker .sticker-bg circle:nth-child(2) { opacity: .72; }

.marker-icon { pointer-events: none; stroke: rgba(5, 6, 10, .88); }

.city-label,
.city-time-tag {
  font-family: var(--font-body);
  fill: rgba(255, 255, 255, .92);
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .72);
  stroke-width: 2px;
  pointer-events: none;
}

.city-time-tag { fill: rgba(215, 255, 242, .88); }

.city-sticker.city-active .city-label,
.city-sticker.city-active .city-time-tag,
.city-sticker:hover .city-label,
.city-sticker:hover .city-time-tag { display: block !important; }

.city-sticker.city-active .sticker-bg circle:first-child,
.city-sticker:hover .sticker-bg circle:first-child {
  stroke: rgba(215, 255, 242, .96);
  stroke-width: 2.4;
}

.home-pulse {
  animation: none;
  opacity: .38;
  transform-origin: center;
  transform-box: fill-box;
}

/* —— 图例与近程放大图 —— */

.paper-card {
  position: relative;
  border: 1px solid var(--stroke);
  border-radius: 13px;
  background: rgba(5, 7, 14, .72);
  color: rgba(255, 255, 255, .84);
}

#legend,
#dali-inset {
  opacity: .74;
  transition: opacity .16s ease;
}

#legend:hover,
#dali-inset:hover,
#legend.is-hotspot-active,
#dali-inset.is-hotspot-active { opacity: .97; }

#legend {
  position: absolute;
  left: 22px;
  bottom: 18px;
  width: 252px;
  padding: 16px 16px 12px;
  z-index: 22;
}

#legend h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 17px;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, .94);
}

.legend-note { font-size: 11.5px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 9px; }
.legend-note b { color: var(--ink); }

#legend-bands { list-style: none; }

#legend-bands li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.95;
  color: rgba(255, 255, 255, .8);
}

.band-chip {
  width: 26px;
  height: 13px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, .26);
  flex: none;
}

.legend-foot {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed rgba(255, 255, 255, .2);
  font-size: 10.5px;
  color: var(--ink-faint);
  line-height: 1.6;
}

#dali-inset {
  position: absolute;
  right: 22px;
  top: 86px;
  width: 382px;
  padding: 15px 14px 11px;
  z-index: 22;
}

.inset-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.inset-head h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 16px;
  color: rgba(255, 255, 255, .94);
}

.inset-head span { font-size: 11px; color: var(--ink-faint); white-space: nowrap; }

#dali-inset-map {
  display: block;
  width: 100%;
  height: 292px;
  border: 1px dashed rgba(255, 255, 255, .16);
  border-radius: 9px;
  background: rgba(255, 255, 255, .035);
}

.inset-note { margin-top: 7px; font-size: 10.5px; line-height: 1.5; color: var(--ink-faint); }

.inset-cangshan { fill: rgba(139, 166, 255, .12); stroke: rgba(139, 166, 255, .32); stroke-width: 1.1; }
.inset-erhai { fill: rgba(125, 227, 255, .18); stroke: rgba(125, 227, 255, .54); stroke-width: 1.5; }

.inset-road {
  fill: none;
  stroke: rgba(255, 111, 127, .42);
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
}

.inset-city { cursor: pointer; }

.inset-city text,
.inset-home text {
  font-family: var(--font-body);
  paint-order: stroke;
  stroke: rgba(0, 0, 0, .6);
  stroke-width: 2.5px;
}

.inset-city-label { font-size: 10.5px; fill: rgba(255, 255, 255, .9); }
.inset-city-time { font-size: 9.5px; fill: rgba(215, 255, 242, .85); }

.inset-home circle { fill: var(--accent); stroke: rgba(255, 255, 255, .8); stroke-width: 1.6; }

.inset-home path {
  fill: none;
  stroke: rgba(255, 255, 255, .85);
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.inset-home text { font-size: 11px; fill: rgba(255, 255, 255, .92); }

.inset-route { mix-blend-mode: screen; }

/* —— 悬浮提示 —— */

#hover-tip {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  max-width: 230px;
  padding: 8px 12px;
  border: 1px solid var(--stroke);
  border-radius: 9px;
  background: rgba(5, 6, 10, .9);
  color: rgba(255, 255, 255, .9);
  font-size: 12.5px;
  line-height: 1.55;
}

#hover-tip .tip-time {
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 15px;
  color: var(--accent-3);
}

.hidden { display: none; }

/* —— 城市手账抽屉 —— */

#panel {
  position: absolute;
  top: 14px;
  right: 16px;
  bottom: 16px;
  width: min(430px, 92vw);
  z-index: 40;
  transform: translateX(calc(100% + 40px));
  opacity: 0;
  transition: transform .32s cubic-bezier(.3, .9, .3, 1), opacity .28s;
}

#panel.hidden { display: block; pointer-events: none; }

.panel-paper {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px 22px 22px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(6, 8, 16, .93);
  color: rgba(255, 255, 255, .84);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .26) transparent;
}

#panel-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  cursor: pointer;
}

#panel-close:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.pj-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }

.pj-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff8f7d, var(--accent));
  border: 1px solid rgba(255, 255, 255, .4);
  color: #fff;
  font-family: var(--font-display);
  font-size: 23px;
  transform: rotate(-7deg);
}

.pj-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 28px;
  color: rgba(255, 255, 255, .96);
}

.pj-head .pj-sub { font-size: 12.5px; color: rgba(215, 255, 242, .8); }

.pj-tagline {
  margin: 4px 0 14px;
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.7;
  color: rgba(215, 255, 242, .85);
}

.pj-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 9px;
  font-family: var(--font-display);
  font-size: 16px;
  color: rgba(255, 255, 255, .92);
}

.pj-section-title::after { content: ""; flex: 1; border-bottom: 1px dashed rgba(255, 255, 255, .2); }

.ticket {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background: var(--glass);
  color: rgba(255, 255, 255, .8);
}

.ticket.recommended {
  border-color: rgba(215, 255, 242, .56);
  background: rgba(215, 255, 242, .07);
}

.ticket.unavailable { opacity: .5; }

.ticket .tk-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-family: var(--font-display);
  font-size: 13px;
}

.ticket .tk-main { flex: 1; min-width: 0; }
.ticket .tk-name { font-size: 13.5px; color: rgba(255, 255, 255, .92); }
.ticket .tk-name span { color: var(--ink-faint) !important; }
.ticket .tk-detail { font-size: 11px; color: var(--ink-soft); line-height: 1.55; }

.ticket .tk-time {
  flex: none;
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 19px;
  color: rgba(215, 255, 242, .88);
}

.ticket .tk-price { font-size: 10.5px; color: var(--ink-faint); text-align: right; }

.tk-badge {
  position: absolute;
  top: -9px;
  right: 14px;
  padding: 2px 10px;
  border-radius: 20px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
}

.pj-reco {
  margin-top: 6px;
  padding: 9px 12px;
  border-left: 3px solid var(--accent-2);
  border-radius: 0 8px 8px 0;
  background: rgba(125, 227, 255, .07);
  font-size: 12.5px;
  line-height: 1.85;
  color: rgba(255, 255, 255, .82);
}

.spot-wall { display: flex; flex-wrap: wrap; gap: 8px; }

.spot-sticker {
  display: flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background: var(--glass);
  font-size: 12.5px;
  color: rgba(255, 255, 255, .84);
}

.day-block { margin-bottom: 12px; }

.day-tag {
  display: inline-block;
  margin-bottom: 5px;
  padding: 2px 10px;
  border-radius: 6px;
  background: rgba(139, 166, 255, .22);
  border: 1px solid rgba(139, 166, 255, .36);
  color: #dfe9ff;
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 12px;
}

.day-route { font-size: 12.5px; line-height: 2; color: rgba(255, 255, 255, .82); }
.day-route .rt-arrow { color: var(--accent); margin: 0 2px; }
.day-note { margin-top: 2px; font-size: 12px; line-height: 1.7; color: var(--ink-soft); }

.pj-tips {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, .24);
  border-radius: 10px;
  background: var(--glass);
  font-size: 12px;
  line-height: 1.85;
  color: var(--ink-soft);
}

.pj-tips b { color: rgba(215, 255, 242, .9); }

/* ---------------- 第四章 · 洱海月 ---------------- */

.far-chapter { grid-template-columns: minmax(0, .9fr) minmax(320px, .92fr); }

.moon-disc {
  right: 12%;
  top: 4%;
  z-index: 2;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 36%, rgba(255, 255, 255, .92), rgba(223, 233, 255, .5) 52%, transparent 72%);
  filter: none;
  box-shadow: 0 0 64px 18px color-mix(in srgb, var(--scene-c) 22%, transparent);
}

.airport-board {
  left: 0;
  top: 18%;
  z-index: 6;
  display: grid;
  gap: 1px;
  padding: 8px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(5, 6, 10, .74);
}

.airport-board div {
  display: grid;
  grid-template-columns: 52px auto;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .2s;
}

.airport-board div:hover { background: rgba(255, 255, 255, .08); }

.airport-board span {
  font-family: var(--font-latin);
  font-style: italic;
  font-size: 15px;
  letter-spacing: .08em;
  color: color-mix(in srgb, var(--scene-c) 88%, white);
  transition: color .6s;
}

.airport-board b { font-weight: 400; font-size: 12.5px; color: rgba(255, 255, 255, .88); }

.boarding-pass {
  right: 4%;
  bottom: 10%;
  transform: rotate(2deg);
  padding-right: 34px;
}

.boarding-pass::after {
  content: "";
  position: absolute;
  right: 22px;
  top: 8px;
  bottom: 8px;
  border-left: 1px dashed rgba(255, 255, 255, .26);
}

.far-city-a { left: 30%; top: 8%; }
.far-city-b { right: 2%; top: 40%; }
.far-city-c { left: 12%; bottom: 28%; }

/* ---------------- 交互态 ---------------- */

[data-hotspot]:hover,
[data-focus-city]:hover,
[data-scroll-target]:hover,
.is-hotspot-active {
  border-color: color-mix(in srgb, var(--scene-c) 62%, transparent);
}

.chapter-stats span:hover,
.scene-pin:hover, .local-stop:hover, .far-city:hover,
.scene-ticket:hover, .boarding-pass:hover,
.route-card:hover, .map-scene-card:hover,
.scene-compass:hover,
.chapter-stats span.is-hotspot-active,
.scene-pin.is-hotspot-active, .local-stop.is-hotspot-active, .far-city.is-hotspot-active,
.scene-ticket.is-hotspot-active, .boarding-pass.is-hotspot-active,
.route-card.is-hotspot-active, .map-scene-card.is-hotspot-active {
  background-color: rgba(255, 255, 255, .12);
  transform: translateY(-2px);
}

.scene-ticket-rail:hover, .scene-ticket-rail.is-hotspot-active { transform: rotate(-3deg) translateY(-2px); }
.scene-ticket-air:hover, .scene-ticket-air.is-hotspot-active { transform: rotate(2deg) translateY(-2px); }
.boarding-pass:hover, .boarding-pass.is-hotspot-active { transform: rotate(2deg) translateY(-2px); }
.map-scene-card-a:hover, .map-scene-card-a.is-hotspot-active { transform: rotate(-1deg) translateY(-2px); }
.map-scene-card-b:hover, .map-scene-card-b.is-hotspot-active { transform: rotate(1deg) translateY(-2px); }

/* ---------------- 提示气泡与页脚 ---------------- */

.interaction-toast {
  position: fixed;
  right: clamp(16px, 3vw, 34px);
  bottom: clamp(16px, 3vw, 30px);
  z-index: 90;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 14px;
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(5, 6, 10, .88);
  color: rgba(255, 255, 255, .84);
  font-size: 13px;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .16s ease, transform .16s ease;
}

.interaction-toast.show { opacity: 1; transform: translateY(0); }

#credit {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px clamp(18px, 4vw, 30px);
  background: rgba(5, 6, 10, .88);
  border-top: 1px solid var(--stroke-soft);
  color: var(--ink-faint);
  font-size: 11px;
  line-height: 1.6;
}

.credit-motif {
  flex: none;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .3em;
  color: rgba(215, 255, 242, .55);
  white-space: nowrap;
}

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

@media (max-width: 1100px) {
  #dali-inset { display: none; }
  .map-scene-card-b { right: 60px; }
}

@media (max-width: 760px) {
  #story-rail { display: none; }
  #topbar { padding: 10px 12px; flex-wrap: wrap; }
  .brand h1 { font-size: 15px; }
  .brand-sub { display: none; }
  .mode-btn { flex: 1 1 0; justify-content: center; padding: 6px 4px; }
  .mode-btn .mb-icon { display: none; }
  #mode-switch { width: 100%; }

  .story-chapter {
    grid-template-columns: 1fr;
    min-height: 92svh;
    /* 顶栏在窄屏折成两行，章节顶部要让出更多空间 */
    padding: 156px 18px 44px;
    gap: 16px;
  }

  .chapter-glyph { font-size: clamp(200px, 70vw, 320px); opacity: .7; }
  .chapter-copy h2 { font-size: clamp(46px, 14vw, 68px); }
  .chapter-copy > p { font-size: 13.5px; }
  .mode-live b { font-size: 23px; }

  .scene-art { width: 100%; min-width: 0; height: 46svh; }

  .split-copy, .local-scene, .route-board { grid-column: 1; }
  .split-copy { grid-row: 1; }
  .local-scene { grid-row: 2; }
  .route-board { grid-row: 3; grid-template-columns: 1fr; }

  .map-chapter { padding-top: 156px; min-height: 168svh; }
  .map-copy { position: relative; top: 0; left: 0; padding: 0 18px 18px; }
  .map-copy h2 { font-size: clamp(40px, 12vw, 56px); }
  .map-scene-card, .map-scanline { display: none; }

  #stage {
    top: 96px;
    height: calc(100svh - 110px);
    min-height: 540px;
    margin: 0 8px;
    border-radius: 14px;
  }

  #legend { width: 216px; left: 10px; bottom: 10px; padding: 12px 12px 9px; }
  .legend-foot { display: none; }

  #panel { top: 8px; right: 6px; bottom: 8px; left: 6px; width: auto; }

  .scroll-cue { display: none; }
  #credit { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .story-chapter, .scene-art, #story-rail li,
  .mode-btn, .route-card, .scene-pin, .local-stop, .far-city,
  .scene-ticket, .boarding-pass, .map-scene-card { transition: none; }
  .scroll-cue { animation: none; }
}
