:root {
  /* —— 默认即「晨曦·牙白」：奶油白纸 + 暖陶 accent，最适合长时间阅读 —— */
  --bg: #faf6ee;
  --paper: #ffffff;
  --ink: #2a2620;
  --ink-soft: #6b6258;
  --accent: #c97a5b;
  --line: rgba(60, 50, 40, 0.12);
  --era-init: #b89b6f;
  --era-shen: #d49a6a;
  --era-mid:  #8aa978;
  --era-late: #b07e9a;
  /* 卡片层 / 工具栏（白色卡片浮在彩色页面上） */
  --panel-bg-1: rgba(255, 255, 255, .94);
  --panel-bg-2: rgba(252, 250, 245, .9);
  --toolbar-bg: rgba(255, 255, 255, .88);
  --chip-bg: rgba(255, 255, 255, .6);
  --chip-bg-hover: rgba(255, 255, 255, .95);
  --map-bg: #ede4d2;
  --map-frame-bg: #ede4d2;
  /* 与 #uiSurfaceMixSlider 同步：左低=透、右高=实；默认约中间 */
  --ui-surface-mix: 0.68;
  /* 地名/地标字与徽章随地图 zoom 略放大缩小（由 renderPlaces 写入） */
  --place-label-scale: 1;
  --map-tile-filter: sepia(.18) saturate(.85) brightness(1.02);
  --tooltip-bg: rgba(255, 255, 255, .98);
  --loading-bg: linear-gradient(180deg, #ffffff 0%, #f5ecd9 100%);
  --loading-fg: #2a2620;
  --loading-glow: color-mix(in srgb, var(--accent) 45%, transparent);
  --scroll-paper-bg:
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(252, 248, 240, .92)),
    radial-gradient(circle at 20% 10%, rgba(201, 122, 91, .06), transparent 45%);
  --bio-card-bg:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(252, 248, 240, .96)),
    radial-gradient(circle at 20% 10%, rgba(201, 122, 91, .06), transparent 45%);
  --shadow-card: 0 8px 28px rgba(80, 60, 40, .08), 0 2px 6px rgba(80, 60, 40, .04);
  --shadow-pop:  0 12px 36px rgba(80, 60, 40, .14), 0 4px 12px rgba(80, 60, 40, .08);
}

/* === 全局主题：8 套浅色「古诗词工作台」 ===
 * 设计：浅色背景 + 白卡 + 单一调性 accent；地图瓦片用相近 hue 的 sepia 微调，
 * 让整页色彩一致而克制。变量同时驱动加载屏、卷轴、小传卡。
 */
body[data-theme="ivory"] { /* 与 :root 一致，可显式指定 */ }

body[data-theme="paper"] {
  --bg: #f5ecd6; --paper: #f8f0d8; --ink: #2a1f15; --ink-soft: #6b5840;
  --accent: #b3492b; --line: rgba(60, 40, 20, .18);
  --panel-bg-1: rgba(248, 240, 216, .96); --panel-bg-2: rgba(245, 236, 214, .92);
  --toolbar-bg: rgba(248, 240, 216, .94);
  --chip-bg: rgba(255, 255, 255, .4); --chip-bg-hover: rgba(255, 255, 255, .85);
  --map-bg: #d8c89c; --map-frame-bg: #e3d3a8;
  --map-tile-filter: sepia(.2) saturate(.85) brightness(.95);
  --tooltip-bg: rgba(248, 240, 216, .98);
  --loading-bg: linear-gradient(180deg, #1c1208 0%, #2c1d10 100%);
  --loading-fg: #e8d8b6;
  --loading-glow: rgba(255, 200, 120, .5);
  --scroll-paper-bg:
    linear-gradient(180deg, rgba(248, 240, 216, .55), rgba(245, 232, 200, .50)),
    radial-gradient(circle at 20% 10%, rgba(180, 130, 70, .12), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(180, 130, 70, .12), transparent 40%);
  --bio-card-bg:
    linear-gradient(180deg, rgba(248, 240, 216, .98), rgba(245, 232, 200, .98)),
    radial-gradient(circle at 20% 10%, rgba(180, 130, 70, .08), transparent 40%);
}

body[data-theme="sakura"] {
  --bg: #fdf3f0; --paper: #ffffff; --ink: #3a2932; --ink-soft: #8a6b75;
  --accent: #d4878a; --line: rgba(160, 110, 120, .14);
  --panel-bg-1: rgba(255, 250, 248, .94); --panel-bg-2: rgba(253, 244, 241, .9);
  --toolbar-bg: rgba(255, 250, 248, .9);
  --chip-bg: rgba(255, 245, 245, .7); --chip-bg-hover: rgba(255, 255, 255, .96);
  --map-bg: #f5e4e2; --map-frame-bg: #f5e4e2;
  --map-tile-filter: sepia(.2) hue-rotate(-12deg) saturate(.78) brightness(1.02);
  --tooltip-bg: rgba(255, 250, 248, .98);
  --loading-bg: linear-gradient(180deg, #fff8f6 0%, #fbe8e4 100%);
  --loading-fg: #3a2932;
  --scroll-paper-bg:
    linear-gradient(180deg, rgba(255, 252, 251, .94), rgba(252, 240, 236, .92)),
    radial-gradient(circle at 80% 0%, rgba(212, 135, 138, .12), transparent 40%);
  --bio-card-bg:
    linear-gradient(180deg, rgba(255, 252, 251, .98), rgba(252, 240, 236, .96));
}

body[data-theme="matcha"] {
  --bg: #f0efe1; --paper: #fafaf2; --ink: #2c3a2e; --ink-soft: #6b7a68;
  --accent: #7ba36e; --line: rgba(80, 100, 80, .14);
  --panel-bg-1: rgba(252, 252, 245, .94); --panel-bg-2: rgba(245, 246, 232, .9);
  --toolbar-bg: rgba(252, 252, 245, .9);
  --chip-bg: rgba(245, 248, 235, .7); --chip-bg-hover: rgba(252, 252, 245, .96);
  --map-bg: #e6e8d6; --map-frame-bg: #e6e8d6;
  --map-tile-filter: sepia(.18) hue-rotate(20deg) saturate(.7) brightness(1.02);
  --tooltip-bg: rgba(252, 252, 245, .98);
  --loading-bg: linear-gradient(180deg, #fafaf2 0%, #e6e8d6 100%);
  --loading-fg: #2c3a2e;
  --scroll-paper-bg:
    linear-gradient(180deg, rgba(252, 252, 245, .94), rgba(245, 246, 232, .92)),
    radial-gradient(circle at 20% 80%, rgba(123, 163, 110, .1), transparent 45%);
  --bio-card-bg:
    linear-gradient(180deg, rgba(252, 252, 245, .98), rgba(245, 246, 232, .96));
}

body[data-theme="apricot"] {
  --bg: #fbf2e4; --paper: #fff9ed; --ink: #3a2a1a; --ink-soft: #8a6e50;
  --accent: #e89a5c; --line: rgba(160, 110, 60, .14);
  --panel-bg-1: rgba(255, 253, 247, .94); --panel-bg-2: rgba(252, 244, 230, .9);
  --toolbar-bg: rgba(255, 253, 247, .9);
  --chip-bg: rgba(255, 247, 232, .7); --chip-bg-hover: rgba(255, 253, 247, .96);
  --map-bg: #f1e0c4; --map-frame-bg: #f1e0c4;
  --map-tile-filter: sepia(.32) saturate(.92) brightness(1.02) hue-rotate(-3deg);
  --tooltip-bg: rgba(255, 253, 247, .98);
  --loading-bg: linear-gradient(180deg, #fff9ed 0%, #f1d9b6 100%);
  --loading-fg: #3a2a1a;
  --scroll-paper-bg:
    linear-gradient(180deg, rgba(255, 253, 247, .94), rgba(252, 240, 220, .92)),
    radial-gradient(circle at 80% 10%, rgba(232, 154, 92, .12), transparent 45%);
  --bio-card-bg:
    linear-gradient(180deg, rgba(255, 253, 247, .98), rgba(252, 240, 220, .96));
}

body[data-theme="misty"] {
  --bg: #eef2f5; --paper: #f9fbfc; --ink: #2e3a44; --ink-soft: #6b7783;
  --accent: #6b8a9a; --line: rgba(70, 90, 105, .14);
  --panel-bg-1: rgba(252, 253, 254, .94); --panel-bg-2: rgba(240, 244, 248, .9);
  --toolbar-bg: rgba(252, 253, 254, .9);
  --chip-bg: rgba(240, 246, 250, .7); --chip-bg-hover: rgba(252, 253, 254, .96);
  --map-bg: #d8e0e6; --map-frame-bg: #d8e0e6;
  --map-tile-filter: grayscale(.35) brightness(1.05) saturate(.85);
  --tooltip-bg: rgba(252, 253, 254, .98);
  --loading-bg: linear-gradient(180deg, #f9fbfc 0%, #d8e0e6 100%);
  --loading-fg: #2e3a44;
  --scroll-paper-bg:
    linear-gradient(180deg, rgba(252, 253, 254, .94), rgba(238, 244, 248, .92)),
    radial-gradient(circle at 30% 20%, rgba(107, 138, 154, .1), transparent 50%);
  --bio-card-bg:
    linear-gradient(180deg, rgba(252, 253, 254, .98), rgba(238, 244, 248, .96));
}

body[data-theme="sage"] {
  --bg: #eef1e9; --paper: #f8faf3; --ink: #2c322a; --ink-soft: #6c7466;
  --accent: #8aa07a; --line: rgba(90, 100, 80, .14);
  --panel-bg-1: rgba(252, 253, 248, .94); --panel-bg-2: rgba(244, 246, 236, .9);
  --toolbar-bg: rgba(252, 253, 248, .9);
  --chip-bg: rgba(244, 248, 236, .7); --chip-bg-hover: rgba(252, 253, 248, .96);
  --map-bg: #dde2d3; --map-frame-bg: #dde2d3;
  --map-tile-filter: sepia(.2) hue-rotate(28deg) saturate(.7) brightness(1.02);
  --tooltip-bg: rgba(252, 253, 248, .98);
  --loading-bg: linear-gradient(180deg, #f8faf3 0%, #dde2d3 100%);
  --loading-fg: #2c322a;
  --scroll-paper-bg:
    linear-gradient(180deg, rgba(252, 253, 248, .94), rgba(244, 246, 236, .92)),
    radial-gradient(circle at 70% 90%, rgba(138, 160, 122, .1), transparent 45%);
  --bio-card-bg:
    linear-gradient(180deg, rgba(252, 253, 248, .98), rgba(244, 246, 236, .96));
}

body[data-theme="honey"] {
  --bg: #fbf0dc; --paper: #fff9ea; --ink: #3a2a14; --ink-soft: #8a6c3e;
  --accent: #d4884a; --line: rgba(160, 105, 50, .14);
  --panel-bg-1: rgba(255, 253, 246, .94); --panel-bg-2: rgba(252, 244, 224, .9);
  --toolbar-bg: rgba(255, 253, 246, .9);
  --chip-bg: rgba(255, 247, 224, .7); --chip-bg-hover: rgba(255, 253, 246, .96);
  --map-bg: #efdcb6; --map-frame-bg: #efdcb6;
  --map-tile-filter: sepia(.4) saturate(.95) brightness(1.0) hue-rotate(-5deg);
  --tooltip-bg: rgba(255, 253, 246, .98);
  --loading-bg: linear-gradient(180deg, #fff9ea 0%, #efdcb6 100%);
  --loading-fg: #3a2a14;
  --scroll-paper-bg:
    linear-gradient(180deg, rgba(255, 253, 246, .94), rgba(252, 240, 215, .92)),
    radial-gradient(circle at 25% 15%, rgba(212, 136, 74, .12), transparent 45%);
  --bio-card-bg:
    linear-gradient(180deg, rgba(255, 253, 246, .98), rgba(252, 240, 215, .96));
}

body[data-theme="linen"] {
  --bg: #eef3f6; --paper: #f8fbfd; --ink: #1f2a35; --ink-soft: #5e6b7a;
  --accent: #4a85a8; --line: rgba(60, 90, 120, .14);
  --panel-bg-1: rgba(252, 253, 255, .94); --panel-bg-2: rgba(240, 246, 250, .9);
  --toolbar-bg: rgba(252, 253, 255, .9);
  --chip-bg: rgba(238, 246, 252, .7); --chip-bg-hover: rgba(252, 253, 255, .96);
  --map-bg: #e8eff4; --map-frame-bg: #e8eff4;
  --map-tile-filter: sepia(.04) hue-rotate(180deg) saturate(.28) brightness(1.14);
  --tooltip-bg: rgba(252, 253, 255, .98);
  --loading-bg: linear-gradient(180deg, #f8fbfd 0%, #d6e2ea 100%);
  --loading-fg: #1f2a35;
  --scroll-paper-bg:
    linear-gradient(180deg, rgba(252, 253, 255, .94), rgba(238, 246, 252, .92)),
    radial-gradient(circle at 80% 90%, rgba(74, 133, 168, .1), transparent 45%);
  --bio-card-bg:
    linear-gradient(180deg, rgba(252, 253, 255, .98), rgba(238, 246, 252, .96));
}

* { box-sizing: border-box; }
html {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family: "Noto Serif SC", "Songti SC", serif;
  color: var(--ink);
  background: var(--bg);
}
body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  overflow: hidden;
  font-family: "Noto Serif SC", "Songti SC", serif;
  color: var(--ink);
  background: var(--bg);
}

/* 全局滚动条：细窄圆角，随主题 --accent / --line（诗人条、列表等） */
* {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 62%, var(--ink-soft)) color-mix(in srgb, var(--line) 65%, transparent);
}
*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
*::-webkit-scrollbar-track {
  background: color-mix(in srgb, var(--paper) 55%, var(--line) 45%);
  border-radius: 6px;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--accent) 78%, transparent),
    color-mix(in srgb, var(--accent) 55%, var(--ink-soft))
  );
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
}
*::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 85%, var(--paper));
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

/* === 加载屏 === */
.loading { position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--loading-bg); color: var(--loading-fg);
  transition: opacity .8s; }
.loading.hidden { opacity: 0; pointer-events: none; }
.loading-title { font-family: "Ma Shan Zheng", serif; font-size: 64px; letter-spacing: 8px;
  text-shadow: 0 0 40px var(--loading-glow, rgba(201, 122, 91, .35)); margin-bottom: 16px; }
.loading-sub { font-size: 14px; opacity: .7; letter-spacing: 4px; }

/* === 顶栏 + 诗人 + 配乐/主题/设置：Grid 占位，避免 fixed 叠在诗人行上 === */
.app-title-chrome {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto;
  align-items: center;
  column-gap: 8px;
  box-sizing: border-box;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--toolbar-bg) calc(var(--ui-surface-mix, 1) * 100%), transparent),
    color-mix(in srgb, color-mix(in srgb, var(--toolbar-bg) 85%, transparent) calc(var(--ui-surface-mix, 1) * 100%), transparent));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  overflow: visible;
}
.title-bar {
  position: relative; z-index: 0;
  overflow: visible;
  display: flex; align-items: center; gap: 10px;
  padding: 0; margin: 0;
  min-width: 0;
  background: none; border: none;
}
.title-seal { display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  width: var(--bar-h, 44px); height: var(--bar-h, 44px);
  background: var(--accent); padding: 4px;
  border-radius: 4px; color: #f8f0d8; font-family: "Ma Shan Zheng", serif;
  font-size: 14px; line-height: 1; box-shadow: 0 2px 6px rgba(179, 73, 43, .3);
  box-sizing: border-box; }
.title-seal span { display: flex; align-items: center; justify-content: center; }
/* 横排两字（诗堂）：高度严格使用 --bar-h，跟 dataset-switch 同步 */
.title-seal--duo { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr;
  width: auto; min-width: 56px; height: var(--bar-h, 44px);
  padding: 0 12px; font-size: 19px; letter-spacing: 4px; gap: 0;
  line-height: 1; }
.title-text { flex-shrink: 0; display: none; }
.title-text h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.title-sub { font-size: 12px; color: var(--ink-soft); letter-spacing: 1px; margin-top: 2px; }

/* 唐宋六朝 框：高度严格跟随 --bar-h，跟诗堂印章一致 */
.dataset-switch { display: inline-flex; flex-shrink: 0; gap: 0;
  height: var(--bar-h, 44px);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  background: var(--chip-bg);
  box-sizing: border-box;
  /* 加一点微妙阴影，跟印章的视觉重量平衡 */
  box-shadow: 0 1px 3px rgba(40, 30, 15, .06); }
.dataset-switch button { appearance: none; border: 0; background: transparent;
  padding: 0 clamp(10px, 1.1vw + 6px, 16px);
  height: 100%;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: clamp(14px, 0.22rem + 2.15vw, 17px);
  line-height: 1;
  letter-spacing: clamp(0px, 0.2vw, 1.2px);
  color: var(--ink-soft);
  cursor: pointer; transition: background .15s, color .15s;
  display: inline-flex; align-items: center; }
.dataset-switch button + button { border-left: 1px solid var(--line); }
.dataset-switch button:hover { background: var(--chip-bg-hover); color: var(--ink); }
.dataset-switch button.active { background: var(--accent); color: var(--paper);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }

/* 全局 --bar-h：诗堂印章 + 唐宋六朝 一致，所有屏幕宽度同步缩放 */
:root { --bar-h: 44px; }
@media (max-width: 768px) { :root { --bar-h: 40px; } }
@media (max-width: 420px) { :root { --bar-h: 36px; } }

.poet-select { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px;
  min-width: 0; max-height: 56px; overflow-y: auto; padding: 0; }
.poet-chip { padding: 3px 10px; font-size: clamp(12.5px, 0.15rem + 1.35vw, 14px); border-radius: 999px;
  border: 1px solid var(--line); background: var(--chip-bg);
  cursor: pointer; user-select: none; transition: all .15s ease;
  font-family: "Noto Serif SC", serif; color: var(--ink); }
.poet-chip:hover { background: var(--chip-bg-hover); transform: translateY(-1px);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 22%, transparent); }
.poet-chip.selected { background: var(--ink); color: var(--paper);
  border-color: var(--ink); font-weight: 600; }
.poet-chip[data-era="初唐"] { border-left: 3px solid var(--era-init); }
.poet-chip[data-era="盛唐"] { border-left: 3px solid var(--era-shen); }
.poet-chip[data-era="中唐"] { border-left: 3px solid var(--era-mid);  }
.poet-chip[data-era="晚唐"] { border-left: 3px solid var(--era-late); }

/* === 地图 === */
#map {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  top: var(--header-bar-height, 70px);
  bottom: 120px;
  background: var(--map-bg);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}
.leaflet-container {
  width: 100% !important;
  height: 100% !important;
  background: var(--map-frame-bg) !important;
  font-family: inherit;
}

/* Leaflet 缩放控件：与顶栏/卡片风格统一，随主题与界面透明度 */
.leaflet-bar { box-shadow: none !important; }
.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-card) !important;
  border-radius: 10px;
  overflow: hidden;
}
.leaflet-control-zoom a {
  width: 34px !important;
  height: 34px !important;
  line-height: 32px !important;
  font-size: 20px !important;
  font-weight: 600;
  color: var(--ink) !important;
  background: color-mix(in srgb, var(--toolbar-bg) calc(var(--ui-surface-mix, 1) * 100%), transparent) !important;
  border: none !important;
  box-sizing: border-box;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.leaflet-touch .leaflet-control-zoom a {
  width: 38px !important;
  height: 38px !important;
  line-height: 36px !important;
}
.leaflet-control-zoom a:hover {
  background: var(--chip-bg-hover) !important;
  color: var(--accent) !important;
}
.leaflet-control-zoom a.leaflet-disabled {
  opacity: 0.42 !important;
  color: var(--ink-soft) !important;
}
.leaflet-control-zoom-in {
  border-bottom: 1px solid var(--line) !important;
}

body.map-physical .leaflet-tile { filter: var(--map-tile-filter); }
body.map-modern #map { background: var(--map-bg); }
body.map-modern .leaflet-container { background: var(--map-frame-bg) !important; }
body.map-modern .leaflet-tile { filter: var(--map-tile-filter) brightness(var(--map-modern-bright, 1)); }

/* 地形档：套用主题色调滤镜（让山地阴影 + Voyager 颜色层一起跟主题走） */
body.map-physical .leaflet-tile {
  filter: var(--map-tile-filter) contrast(1.05);
}
/* 现代图自带地名，弱化我们自绘的副名以减少冲突 */
body.map-modern .place-label .place-alt { display: none; }
body.map-modern .place-label .place-main {
  background: rgba(252, 246, 230, .94);
  color: #2a1810;
  border: 1px solid rgba(90, 60, 30, .55);
  border-radius: 2px;
  padding: 3px 1px;
  text-shadow: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
}

/* 地图样式/地名：固定于视口水平正中，不受右侧地点卡片影响 */
.map-top-row {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--header-bar-height, 72px) + 8px);
  z-index: 800;
  display: flex;
  justify-content: center;
  align-items: center;
  width: max-content;
  max-width: calc(100vw - 16px);
  box-sizing: border-box;
  pointer-events: none;
}
.map-style-bar {
  position: relative;
  z-index: 950;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  pointer-events: none;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.map-style-bar::-webkit-scrollbar { display: none; height: 0; }

/* 配乐在顶栏：主题切换钮右侧 */
.map-chrome--header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: auto;
}
.map-chrome--header .player {
  max-width: min(300px, 28vw);
}

/* 悬浮地图：无底、仅轻线框；未选按钮全透明 */
.map-style-bar .seg {
  pointer-events: auto;
  flex-shrink: 0;
  background: transparent !important;
  box-shadow: none !important;
  border: 1px solid color-mix(in srgb, var(--line) 42%, transparent) !important;
}
.map-style-bar .seg button:not(.active) {
  background: transparent !important;
}
.map-style-bar .seg button {
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.map-style-bar .seg button:hover {
  background: color-mix(in srgb, var(--paper) 52%, transparent) !important;
}
/* 选中 + 焦点：避免移动端系统 :focus 盖成白底，需点空白才恢复 */
.map-style-bar .seg button.active,
.map-style-bar .seg button.active:hover,
.map-style-bar .seg button.active:focus,
.map-style-bar .seg button.active:focus-visible,
.map-style-bar .seg button.active:active {
  background: var(--ink) !important;
  color: var(--paper) !important;
}
.map-style-bar .seg button:focus {
  outline: none;
}
.map-style-bar .seg button:not(.active):focus-visible {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent);
}
.map-hidden-controls {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.map-fs-btn {
  padding: 5px 12px; font-size: 12px; border-radius: 6px; cursor: pointer;
  font-family: inherit; color: var(--ink);
  background: var(--toolbar-bg); border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  white-space: nowrap;
}
.map-fs-btn:hover { background: var(--chip-bg-hover); color: var(--ink); }

/* 地形档专属：山纹↔颜色 调节滑块 */
.map-tune {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; height: 26px;
  background: var(--toolbar-bg); border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  font-size: 11px; color: var(--ink-soft);
  font-family: inherit; letter-spacing: 1px;
}
.map-tune[hidden] { display: none; }
.map-tune-label { user-select: none; flex-shrink: 0; }
.map-tune input[type=range] {
  appearance: none; -webkit-appearance: none;
  width: 110px; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg,
    color-mix(in srgb, var(--ink) 55%, transparent),
    color-mix(in srgb, var(--accent) 65%, transparent));
  outline: none; cursor: pointer;
}
.map-tune input[type=range]::-webkit-slider-thumb {
  appearance: none; -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--paper);
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
  cursor: pointer; transition: transform .12s ease;
}
.map-tune input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2); }
.map-tune input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--paper);
  box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer;
}

.map-fs-exit {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  z-index: 2500;
  padding: 10px 16px; font-size: 13px; border-radius: 8px; cursor: pointer;
  font-family: inherit; color: var(--ink);
  background: color-mix(in srgb, var(--toolbar-bg) calc(var(--ui-surface-mix, 1) * 100%), transparent);
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
  backdrop-filter: blur(8px);
}
.map-fs-exit:hover { background: var(--chip-bg-hover); }

/* 全屏地图：仅保留地图 + 退出按钮 */
body.map-fullscreen .app-title-chrome,
body.map-fullscreen .map-top-row,
body.map-fullscreen .left-panel,
body.map-fullscreen .right-panel,
body.map-fullscreen .timeline {
  display: none !important;
}
body.map-fullscreen #map {
  inset: 0 !important;
  left: 0 !important;
  right: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
}
body.map-fullscreen .bio-overlay,
body.map-fullscreen .scroll-overlay {
  display: none !important;
  pointer-events: none !important;
}
body.map-fullscreen .immerse-stage { display: none !important; }
body.map-fullscreen .audio-menu { display: none !important; }
body.map-fullscreen .timeline-peek { display: none !important; }
body.map-fullscreen .map-fs-exit:not([hidden]) { display: block; }
.seg { display: inline-flex; background: var(--toolbar-bg);
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
.seg button { padding: 5px 11px; font-size: 12px; border: none; cursor: pointer;
  background: transparent; color: var(--ink-soft); font-family: inherit;
  border-right: 1px solid var(--line); }
.seg button:last-child { border-right: none; }
.seg button:hover { background: var(--chip-bg-hover); color: var(--ink); }
.seg button.active { background: var(--ink); color: var(--paper); font-weight: 600; }

/* 纯净模式按钮：独立 toggle，外观与 .seg 单段按钮完全一致 */
.pure-toggle {
  padding: 5px 11px; font-size: 12px; line-height: 1.4;
  background: var(--toolbar-bg); color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
  outline: none;
  -webkit-appearance: none; appearance: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto; /* .map-style-bar 为 none，.seg 才 auto；独立钮需显式开启 */
}
.pure-toggle:hover { background: var(--chip-bg-hover); color: var(--ink); }
.pure-toggle:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.pure-toggle.active,
.pure-toggle.active:hover,
.pure-toggle.active:focus,
.pure-toggle.active:focus-visible,
.pure-toggle.active:active {
  background: var(--ink); color: var(--paper);
  border-color: var(--ink); font-weight: 600;
}

/* 地点标签：主名（现代）+ 古名（小字副注），均竖排 */
.place-label { font-family: "Noto Serif SC", serif; color: #1a120a;
  background: transparent; border: none; box-shadow: none;
  display: flex; flex-direction: row; align-items: flex-start; justify-content: center;
  line-height: 1; padding: 0; margin: 0; pointer-events: none; gap: 4px; }
.place-label .place-main { writing-mode: vertical-rl; text-orientation: upright;
  letter-spacing: calc(2px * var(--place-label-scale, 1)); font-weight: 700;
  pointer-events: auto; cursor: pointer;
  text-shadow: 0 0 3px #fff, 0 0 6px var(--paper), 0 0 10px var(--paper), 0 0 14px var(--paper); }
.place-label .place-alt { writing-mode: vertical-rl; text-orientation: upright;
  font-size: calc(8px * var(--place-label-scale, 1)); color: #8a7858; opacity: .85; font-weight: 400;
  letter-spacing: calc(1px * var(--place-label-scale, 1)); align-self: center;
  pointer-events: auto; cursor: pointer;
  text-shadow: 0 0 3px #fff, 0 0 6px var(--paper); }
.place-label.l1 .place-main { font-size: calc(17px * var(--place-label-scale, 1)); }
.place-label.l2 .place-main { font-size: calc(14px * var(--place-label-scale, 1)); }
.place-label.l3 .place-main { font-size: calc(12px * var(--place-label-scale, 1)); font-weight: 600; opacity: .95; }
.place-label.l4 .place-main { font-size: calc(11px * var(--place-label-scale, 1)); font-weight: 500; opacity: .85; }
.place-label.l2 .place-alt, .place-label.l3 .place-alt, .place-label.l4 .place-alt { display: none; }

/* 选中诗人后：地名标签整体淡一点，让诗人轨迹（生/卒/编号点）成为视觉焦点 */
body.has-poet-focus .place-label { opacity: 0.55; transition: opacity .25s ease; }
body.has-poet-focus .place-label:hover { opacity: 1; }
body.has-poet-focus .landmark-badge { opacity: 0.75; transition: opacity .25s ease; }
body.has-poet-focus .landmark-badge:hover { opacity: 1; }

/* 诗意地标徽章：彩色圆形 + 汉字（山/水/楼/寺/关/园） */
.landmark-badge { display: flex; align-items: center; justify-content: center;
  pointer-events: auto; cursor: pointer; }
.landmark-badge > span { display: inline-flex; align-items: center; justify-content: center;
  width: calc(22px * var(--place-label-scale, 1)); height: calc(22px * var(--place-label-scale, 1)); border-radius: 50%; color: #fff;
  font-family: "Noto Serif SC", serif; font-size: calc(13px * var(--place-label-scale, 1)); font-weight: 700;
  line-height: 1; box-shadow: 0 1px 4px rgba(0,0,0,.3), 0 0 0 1.5px rgba(255,255,255,.85); }
.landmark-badge:hover > span { transform: scale(1.15); transition: transform .15s; }

/* 地标标签：复用城市的竖排样式，仅字号略大，颜色由 .cat-* 决定 */
.place-label.landmark .place-main { font-size: calc(13px * var(--place-label-scale, 1)); }
.place-label.landmark .place-alt { display: none; }
.place-label.landmark.l1 .place-main { font-size: calc(15px * var(--place-label-scale, 1)); }
.place-label.landmark.l2 .place-main { font-size: calc(14px * var(--place-label-scale, 1)); }
.place-label.landmark.l3 .place-main { font-size: calc(13px * var(--place-label-scale, 1)); }
.place-label.landmark.l4 .place-main { font-size: calc(12px * var(--place-label-scale, 1)); }

/* 地点 tooltip 强制横排 + 自适应 */
.leaflet-tooltip { font-family: "Noto Serif SC", serif; font-size: 13px; line-height: 1.7;
  background: var(--tooltip-bg); color: var(--ink);
  writing-mode: horizontal-tb !important; text-orientation: mixed !important;
  border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  max-width: min(800px, 90vw); min-width: 100px;
  white-space: normal; word-break: break-word; }
.leaflet-tooltip b { color: var(--accent); font-weight: 700; font-size: 14px;
  letter-spacing: 1px; }
.leaflet-tooltip .tip-visitors { margin-top: 4px; line-height: 1.85; color: var(--ink-soft); }
.leaflet-tooltip .tip-visitors .tip-era { display: inline-block; padding: 0 5px;
  margin-right: 4px; border-radius: 3px; background: var(--ink-soft); color: var(--paper);
  font-size: 11px; font-weight: 600; }
.leaflet-tooltip .tip-note { margin-top: 4px; color: var(--ink-soft); font-style: italic; }
.leaflet-tooltip-top:before { border-top-color: var(--tooltip-bg); }

/* 路径上的"诗人色脉冲圆点"（人在路上） */
.poet-walker { cursor: pointer; }
.walker-wrap { position: relative; width: 24px; height: 24px; }
.walker-label { pointer-events: none; }
.walker-icon {
  width: 24px; height: 24px;
  font-size: 20px; line-height: 24px; text-align: center;
  filter: drop-shadow(0 0 2px var(--c, #a05030))
          drop-shadow(0 1px 2px rgba(0,0,0,.5));
  transform-origin: 50% 100%;
  --face-x: 1; /* 默认按 emoji 自带朝向（多数平台朝左） */
}
.walker-icon.face-right { --face-x: -1; } /* 向东走时水平翻转 */
.walker-icon.moving { animation: walker-bob 0.55s infinite alternate ease-in-out; }
.walker-icon.staying { animation: walker-breathe 2.4s infinite ease-in-out; }
@keyframes walker-bob {
  0%   { transform: translateY(0) scale(calc(var(--face-x) * 1), 1); }
  50%  { transform: translateY(-2px) scale(calc(var(--face-x) * 1.02), 0.98); }
  100% { transform: translateY(0) scale(calc(var(--face-x) * 0.98), 1.02); }
}
@keyframes walker-breathe {
  0%, 100% { transform: scale(calc(var(--face-x) * 1), 1); }
  50%      { transform: scale(calc(var(--face-x) * 1.08), 1.08); }
}
.walker-label {
  position: absolute;
  left: 28px; top: -4px;
  width: max-content;
  max-width: 220px;
  min-width: 90px;
  padding: 4px 10px;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: 12.5px;
  line-height: 1.45;
  color: #2a1810;
  background: rgba(255, 250, 240, 0.96);
  border: 1px solid rgba(160, 80, 48, 0.55);
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  white-space: normal;
  word-break: break-word;
  pointer-events: none;
  backdrop-filter: blur(3px);
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}
.walker-label b { display: inline; }
.walker-label b { color: #7a2f1c; font-weight: 700; }
.walker-age {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 1.5;
  color: #fff;
  background: rgba(122, 47, 28, 0.85);
  border-radius: 8px;
  vertical-align: 1px;
  white-space: nowrap;
}
.walker-label.moving {
  border-style: dashed;
  animation: walker-label-drift 1.4s infinite ease-in-out;
}
.walker-label.staying { opacity: 0.95; }
/* 智能贴边：靠右半屏时把 label 翻到左侧；太靠上时翻到下方，避免出屏/压地名 */
.walker-wrap.flip-h .walker-label { left: auto; right: 28px; }
.walker-wrap.flip-v .walker-label { top: auto; bottom: -4px; }
@keyframes walker-label-drift {
  0%, 100% { transform: translate(0, 0); }
  50%      { transform: translate(2px, 0); }
}

/* 时间轴朝代标签：按真实年份位置绝对定位；首尾不用 -50% 以免贴边溢出 */
.time-eras { position: relative; height: 16px; margin-top: 4px; font-size: 10px; color: var(--ink-soft); }
.time-eras span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.time-eras span:first-child:not(:last-child) { transform: translateX(0); }
.time-eras span:last-child:not(:first-child) { transform: translateX(-100%); }

/* 倍速：与「卷」同为描边按钮 */
.speed-toggle {
  margin-left: 0;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Ma Shan Zheng", serif;
  font-size: 13px;
  padding: 0 10px;
  min-width: 48px;
  min-height: 36px;
  border: 2px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}
.speed-toggle:hover { background: rgba(179, 73, 43, .08); }
.speed-toggle:active { transform: scale(0.97); }
.speed-toggle #speedV { font-size: inherit; color: inherit; font-weight: 600; }
.place-label.cat-mountain .place-main { color: #5a7340; }
.place-label.cat-river_lake .place-main { color: #4a7e8f; }
.place-label.cat-pavilion .place-main { color: #a85040; }
.place-label.cat-temple .place-main { color: #7d5a3a; }
.place-label.cat-pass .place-main { color: #6a4a2c; }
.place-label.cat-garden .place-main { color: #9b6e3a; }

/* === 左/右侧面板 === */
.left-panel, .right-panel {
  position: fixed; top: 78px; bottom: 130px; width: 320px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--panel-bg-1) calc(var(--ui-surface-mix, 1) * 100%), transparent),
    color-mix(in srgb, var(--panel-bg-2) calc(var(--ui-surface-mix, 1) * 100%), transparent));
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; z-index: 800;
  font-family: "Noto Serif SC", serif;
  color: var(--ink);
  backdrop-filter: blur(10px);
}
.left-panel { left: 12px; }
.right-panel { right: 12px; }
[hidden] { display: none !important; }

.left-panel-inner {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  overflow: hidden;
}
.panel-head-actions { display: flex; align-items: flex-start; gap: 6px; flex-shrink: 0; }

/* 卷轴/印钮风：收起、时间轴、配乐共用 */
.fold-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
  color: #f5ead0;
  background: linear-gradient(165deg, #4a3830 0%, #2a1f15 48%, #17120e 100%);
  box-shadow:
    0 0 0 1px rgba(179, 73, 43, 0.4),
    0 1px 4px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.12s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.fold-btn:hover {
  color: #ffd9a8;
  box-shadow:
    0 0 0 1px rgba(179, 73, 43, 0.65),
    0 2px 10px rgba(179, 73, 43, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.fold-btn:active { transform: scale(0.94); }

/* 收：网页端在 .timeline-tail 内与年份并排；移动端在栅格右上角 */
.timeline-fold-btn {
  position: static;
  flex-shrink: 0;
  z-index: 2;
}

.left-panel-peek {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  min-height: 100px;
  padding: 10px 4px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  gap: 8px;
}
.left-panel-peek-char {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.left-panel-peek-name {
  font-size: 13px; font-weight: 600;
  writing-mode: vertical-rl; text-orientation: upright;
  letter-spacing: 3px; max-height: 140px; overflow: hidden;
  color: var(--ink); line-height: 1.25;
}
/* 收起：仅占内容高度，在地图可视带内垂直居中（PC）；不用 transform，避免盖掉 panel-in-left 的 translateX */
.left-panel.is-collapsed {
  width: 52px !important;
  min-width: 52px !important;
  top: 78px !important;
  bottom: 130px !important;
  height: max-content !important;
  min-height: 0 !important;
  max-height: none !important;
  margin-top: auto !important;
  margin-bottom: auto !important;
  justify-content: center;
}
.left-panel.is-collapsed .left-panel-inner { display: none !important; }
.left-panel.is-collapsed .left-panel-peek { display: flex !important; flex: 0 0 auto !important; min-height: 0 !important; height: auto !important; padding: 14px 4px !important; }

.panel-head { display: flex; justify-content: space-between; align-items: flex-start;
  padding: 12px 14px 8px; border-bottom: 1px solid var(--line); }
.panel-title { font-size: 18px; font-weight: 700; letter-spacing: 1px;
  display: flex; align-items: center; flex-wrap: wrap; gap: 0; }
.panel-meta { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.panel-close { background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--ink-soft); padding: 0 4px; }
.panel-close:hover { color: var(--ink); }

.score-row { display: flex; align-items: center; gap: 6px; padding: 8px 14px;
  font-size: 11px; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.score-row input { flex: 1; }
.score-row .score-value {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.works-meta { padding: 4px 14px; font-size: 11px; color: var(--ink-soft); }

.works-list { flex: 1; overflow-y: auto; padding: 4px 0 12px; }
.work-item { padding: 10px 14px; border-bottom: 1px dashed var(--line); cursor: pointer;
  transition: background .18s ease, transform .18s ease;
  border-left: 2px solid transparent; }
.work-item:hover { background: var(--chip-bg-hover); transform: translateX(2px);
  border-left-color: var(--accent); }
.work-item.is-current-poet {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-left-color: var(--accent);
}
.work-item.is-current-poet .work-author { color: var(--accent); font-weight: 600; }
.place-works-header {
  padding: 8px 14px 4px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--ink-soft);
  background: color-mix(in srgb, var(--ink-soft) 8%, transparent);
}
.place-works-header + .work-item { border-top: none; }

/* —— 地点详情：行迹区（数字徽章/生卒徽章 click 后显示） —— */
.place-journey {
  flex: 0 0 auto;
  max-height: 38vh; overflow-y: auto;
  padding: 4px 12px 8px;
  border-bottom: 1px dashed var(--line);
}
.place-journey[hidden] { display: none; }
.pj-title {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 2px 6px;
  font-size: 12px; letter-spacing: 1px; color: var(--ink-soft);
}
.pj-count { color: var(--accent); font-weight: 600; }
.pj-item {
  padding: 6px 2px;
  border-top: 1px dashed color-mix(in srgb, var(--line) 70%, transparent);
}
.pj-item:first-of-type { border-top: none; }
.pj-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; }
.pj-step {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); color: var(--paper);
  font-size: 11px; font-weight: 700;
}
.pj-y { color: var(--ink); font-weight: 600; letter-spacing: .5px; }
.pj-tag {
  padding: 1px 6px; border-radius: 4px; font-size: 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.pj-reason, .pj-note { margin-top: 4px; font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.pj-note { color: color-mix(in srgb, var(--ink-soft) 80%, var(--accent)); }
.pj-works { margin: 4px 0 0; padding-left: 18px; font-size: 12px; color: var(--ink-soft); }
.pj-works li { line-height: 1.55; }
.work-title { font-size: 14px; font-weight: 600; }
.work-author { font-size: 11px; color: var(--ink-soft); margin-top: 1px; }
.work-text { font-size: 12px; color: var(--ink-soft); margin-top: 4px;
  white-space: pre-line; line-height: 1.6; max-height: 0; overflow: hidden;
  transition: max-height .25s; }
.work-item.open .work-text { max-height: 400px; }
.work-meta { font-size: 10px; color: var(--ink-soft); margin-top: 4px; }
.work-tag { display: inline-block; padding: 1px 6px; border-radius: 8px;
  background: var(--accent); color: var(--paper); font-size: 9px; margin-right: 4px; }
.work-tag.genre { background: var(--ink-soft); }
.work-tag.year { background: #6e8b58; margin-right: 6px; font-weight: 600; letter-spacing: .5px; }
.work-tag.year.est { background: transparent; color: #6e8b58; border: 1px dashed #6e8b58; padding: 0 5px; }
.work-tag.age { background: #b89048; color: var(--paper); margin-right: 6px; font-weight: 600; }
.work-tag.place { background: #8b6e3c; margin-right: 6px; }
.work-tag.rank { background: var(--accent); color: var(--paper); font-weight: 600; }

.view-toggle { display: flex; gap: 4px; padding: 4px 12px 8px; }
.view-toggle button {
  flex: 1; padding: 4px 0; font-size: 12px;
  background: transparent; color: var(--ink-soft); border: 1px solid var(--line);
  border-radius: 4px; cursor: pointer; font-family: inherit;
}
.view-toggle button:hover { background: rgba(58, 37, 16, .08); }
.view-toggle button.active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.work-tag.year.poet { background: #c8763a; }
.work-tag.year.history { background: #5a5a5a; }

.event-item { background: rgba(255, 250, 240, .35); border-left: 3px solid transparent; padding-left: 11px; }
.event-item.poet-event { border-left-color: #c8763a; background: rgba(200, 118, 58, .07); }
.event-item.history-event { border-left-color: #8a8a8a; background: rgba(120, 120, 120, .05); }
.event-item .work-title { font-weight: 500; }
.event-item .work-text { color: var(--ink-soft); font-size: 11.5px; }
.event-prefix { display: inline-block; padding: 0 4px; margin-right: 5px; border-radius: 3px;
  background: #5a5a5a; color: #fff; font-size: 9px; vertical-align: middle; }

@keyframes work-fresh-flash {
  0%   { background: rgba(200, 118, 58, .22); }
  100% { background: transparent; }
}

/* === 时间轴 === */
/* 网页端：左按钮 | 中轨道 | 右年份+收；右缘收紧少占图例区 */
.timeline {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 900;
  display: flex; flex-direction: column; align-items: stretch;
  padding: 32px 12px 10px 12px; border-radius: 14px;
  background: color-mix(in srgb, var(--toolbar-bg) calc(var(--ui-surface-mix, 1) * 100%), transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card); backdrop-filter: blur(10px);
  color: var(--ink);
}
.timeline-inner {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.timeline-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  flex-shrink: 0;
  min-width: 0;
  width: auto;
}
.timeline-tail {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: 0;
}
.timeline-tail .time-year {
  margin-bottom: 0;
  flex: 0 1 auto;
  min-width: 0;
  text-align: right;
  line-height: 1;
}
.time-body {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}
.timeline-peek {
  position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); z-index: 899;
  width: 44px; height: 44px; border-radius: 3px;
  padding: 0;
  border: none;
  cursor: pointer;
  display: none; align-items: center; justify-content: center;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: 18px;
  line-height: 1;
  color: #f5ead0;
  background: linear-gradient(165deg, #4a3830 0%, #2a1f15 48%, #17120e 100%);
  box-shadow:
    0 0 0 1px rgba(179, 73, 43, 0.4),
    0 4px 14px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.12s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.timeline-peek:hover {
  color: #ffd9a8;
  box-shadow:
    0 0 0 1px rgba(179, 73, 43, 0.65),
    0 6px 18px rgba(179, 73, 43, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.timeline-peek:active { transform: translateX(-50%) scale(0.94); }

body.timeline-collapsed .timeline { display: none !important; }
body.timeline-collapsed .timeline-peek:not([hidden]) { display: flex !important; }

body.timeline-collapsed #map {
  bottom: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
}
.play-btn { width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--ink); color: var(--paper); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.play-btn.playing { background: var(--accent); }
.time-year { font-family: "Ma Shan Zheng", serif; font-size: 22px; line-height: 1;
  margin-bottom: 4px; color: var(--ink); }
.time-track { position: relative; height: 14px; background: rgba(60, 40, 20, .1);
  border-radius: 7px; cursor: pointer; }
.life-band { position: relative; height: 18px; margin-bottom: 8px;
  font-size: 11px; color: var(--ink); pointer-events: none; }
.life-band .life-tick { position: absolute; top: 0; transform: translateX(-50%);
  white-space: nowrap; padding: 1px 4px; border-radius: 3px;
  background: rgba(255, 250, 240, .85); border: 1px solid rgba(60, 40, 20, .35); }
.life-band .life-tick.birth { color: #2d6a4f; border-color: rgba(45, 106, 79, .55); }
.life-band .life-tick.death { color: #8a3a2d; border-color: rgba(138, 58, 45, .55); }
.life-band .life-range { display: none; }
.life-tick-on-track { position: absolute; top: -2px; bottom: -2px; width: 2px;
  transform: translateX(-50%); pointer-events: none; }
.life-tick-on-track.birth { background: #2d6a4f; }
.life-tick-on-track.death { background: #8a3a2d; }
.time-fill { position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--era-init), var(--era-shen), var(--era-mid), var(--era-late));
  border-radius: 7px; }
.time-thumb { position: absolute; top: 1px; width: 6px; height: 12px;
  background: var(--paper); border: 1.5px solid var(--ink); border-radius: 3px;
  transform: translateX(-50%); pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.time-thumb.start { background: var(--ink); border-color: var(--paper);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45); }
/* （旧的 .time-eras / .speed-row 定义已被新的覆盖） */

/* === 诗作挂轴：点击诗作时的浮层 === */
/* 挂轴层只是定位容器，不挡点击；只有 .scroll-paper 本身吃事件 */
.scroll-overlay { position: fixed; inset: 70px 0 100px 0; z-index: 1500;
  display: flex; align-items: center; justify-content: center;
  background: transparent; pointer-events: none;
  animation: scroll-fade .25s ease-out; }
.scroll-overlay[hidden] { display: none; }
.scroll-overlay .scroll-paper { pointer-events: auto; }
@keyframes scroll-fade { from { opacity: 0; } to { opacity: 1; } }

/* 挂轴主体：半透明，主题色卷纸 */
.scroll-paper { position: relative;
  background: var(--scroll-paper-bg);
  backdrop-filter: blur(3px) saturate(1.05);
  -webkit-backdrop-filter: blur(3px) saturate(1.05);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25), 0 0 0 1px var(--line);
  padding: 28px 36px;
  max-width: min(720px, 92vw); max-height: min(82vh, 720px);
  display: flex; flex-direction: column; gap: 8px;
  font-family: "Noto Serif SC", "Songti SC", serif;
  color: var(--ink);
  animation: scroll-slide .5s cubic-bezier(.2, .6, .3, 1);
  overflow: hidden; }
@keyframes scroll-slide { from { opacity: 0; transform: translateY(20px) scale(.95); }
                          to   { opacity: 1; transform: translateY(0) scale(1); } }

/* 上下两道丝带 */
.scroll-band { height: 6px; flex: 0 0 6px;
  background: linear-gradient(90deg, transparent, #b3492b 12%, #a05030 50%, #b3492b 88%, transparent);
  border-radius: 1px; opacity: .75; }
.scroll-band.top { margin-bottom: 12px; }
.scroll-band.bottom { margin-top: 12px; }

.scroll-close { position: absolute; top: 8px; right: 12px;
  background: none; border: none; font-size: 26px; line-height: 1;
  color: var(--ink-soft); cursor: pointer; padding: 4px 8px; z-index: 10; }
.scroll-close:hover { color: var(--accent); }

/* 沉浸模式角标 */
.scroll-hint { position: absolute; bottom: 14px; right: 18px;
  background: rgba(42, 30, 16, .8); color: var(--paper);
  padding: 5px 12px; border-radius: 14px;
  font-size: 11px; letter-spacing: 1.5px; z-index: 6;
  pointer-events: none; user-select: none;
  animation: hint-fade .5s ease-out; }
@keyframes hint-fade { from { opacity: 0; transform: translateY(8px); }
                       to   { opacity: 1; transform: translateY(0); } }
body.immersive-paused .scroll-hint { background: rgba(179, 73, 43, .9);
  animation: hint-pulse 1.5s infinite ease-in-out; }
@keyframes hint-pulse { 50% { transform: scale(1.05); } }
body.immersive .scroll-paper { cursor: pointer; }
body.immersive .scroll-paper:hover { box-shadow: 0 12px 40px rgba(0, 0, 0, .35), 0 0 0 1px rgba(179, 73, 43, .35); }

/* === 诗词赏析（AI 译注 + 未来历代评注） · 左右滑切原文/赏析 === */
.scroll-pages { display: flex; flex: 1 1 auto; min-height: 0;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; }
.scroll-pages::-webkit-scrollbar { display: none; }
.scroll-page { flex: 0 0 100%; min-width: 100%;
  scroll-snap-align: center; scroll-snap-stop: always;
  overflow-y: auto; overflow-x: hidden;
  padding: 0 2px;
  scrollbar-width: none; }
.scroll-page::-webkit-scrollbar { display: none; width: 0; height: 0; }
.scroll-page.poem { display: flex; flex-direction: column; }
.scroll-page.poem .scroll-content { flex: 1 1 auto; }
.scroll-page.appr { padding: 0 6px 4px; }
.scroll-dots { display: flex; justify-content: center; gap: 8px;
  margin-top: 10px; flex: 0 0 auto; }
.scroll-dot { background: transparent; border: 1px solid var(--line);
  color: var(--ink-soft); font-family: "Noto Serif SC", serif;
  font-size: 11.5px; letter-spacing: 2px; padding: 3px 14px;
  border-radius: 12px; cursor: pointer; transition: all .25s;
  opacity: .65; }
.scroll-dot:hover { opacity: 1; color: var(--ink); }
.scroll-dot.active { background: var(--accent); color: #fff;
  border-color: var(--accent); opacity: 1; }
.appr-tabs { display: flex; gap: 6px; margin-bottom: 14px;
  border-bottom: 1px solid var(--line); }
.appr-tab { background: transparent; border: none;
  padding: 7px 14px 9px; font-family: inherit; font-size: 13px;
  color: var(--ink-soft); cursor: pointer; letter-spacing: 1px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.appr-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.appr-tab.disabled { color: var(--ink-soft); opacity: .55; cursor: not-allowed;
  font-style: italic; }
.appr-tab:not(.disabled):not(.active):hover { color: var(--ink); }
.appr-loading, .appr-empty { text-align: center; padding: 24px; color: var(--ink-soft); font-size: 13px; }
.appr-chip-bar { display: flex; flex-wrap: wrap; gap: 10px 14px;
  margin-bottom: 12px; align-items: center; font-size: 12px; }
.appr-chip-label { color: var(--ink-soft); letter-spacing: 1px; }
.appr-tags { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-right: 6px; }
.appr-tag { background: rgba(179, 73, 43, .08);
  color: var(--accent); padding: 2px 8px; border-radius: 10px;
  font-size: 11.5px; letter-spacing: .5px; }
.appr-tags.imagery .appr-tag { background: rgba(96, 124, 84, .12); color: #5a7048; }
.appr-tags.tech .appr-tag { background: rgba(120, 100, 80, .12); color: #7a6450; }
.appr-section { margin-bottom: 14px; }
.appr-h { font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: 15px; color: var(--accent); letter-spacing: 2px;
  margin-bottom: 6px; }
.appr-p { font-size: 14px; line-height: 1.85; color: var(--ink);
  text-align: justify; }
.appr-p.para { white-space: normal; }
.appr-notes { list-style: none; padding: 0; margin: 0;
  font-size: 13px; line-height: 1.8; color: var(--ink); }
.appr-notes li { padding: 3px 0;
  border-bottom: 1px dotted rgba(0, 0, 0, .06); }
.appr-notes li b { color: var(--accent); margin-right: 6px; font-weight: 600; }
.appr-keyline { font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: 16px; color: var(--accent); padding: 4px 0;
  letter-spacing: 1.5px; }
.appr-footer { margin-top: 16px; padding-top: 10px;
  border-top: 1px dotted var(--line);
  text-align: center; font-size: 11px; color: var(--ink-soft);
  letter-spacing: 1px; }

/* 沉浸"卷"按钮 —— 加方括号让人知道可点 */
.immersive-btn { background: transparent !important; color: var(--accent) !important;
  border: 2px solid var(--accent); font-family: "Ma Shan Zheng", serif;
  font-size: 14px; padding: 0 10px; width: auto; min-width: 56px; border-radius: 6px;
  letter-spacing: 1px; }
.immersive-btn:hover { background: rgba(179, 73, 43, .08) !important; }

/* === 沉浸模式：8 套可切换主题 === */
/* 沉浸全屏层：避免右侧漏出底层地图（配合 body.immerse-open） */
.immerse-stage { position: fixed; inset: 0; z-index: 1700; overflow: hidden;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  box-sizing: border-box;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  --verse-color: #f4e4bd;
  --verse-glow: rgba(255, 220, 160, .55);
  --meta-color: rgba(244, 228, 189, .55);
  --char-color: rgba(244, 228, 189, .38);
  --imagery-color: rgba(244, 228, 189, .55);
  /* UI 元素（顶栏按钮 / 设置面板 / 状态条）配色，浅色方案会覆盖 */
  --ui-color: rgba(255, 240, 210, .78);
  --ui-color-strong: #fff5dc;
  --ui-bg: rgba(0, 0, 0, .22);
  --ui-bg-hover: rgba(255, 240, 210, .14);
  --ui-border: rgba(255, 255, 255, .08);
  --ui-popover-bg: rgba(12, 14, 22, .32);
  --ui-track: rgba(255, 240, 210, .18);
  --ui-thumb: rgba(255, 245, 220, .92);
  --ui-status-bg: rgba(0, 0, 0, .55);
  --ui-status-color: rgba(255, 240, 210, .92);
}
.immerse-stage[hidden] { display: none; }

/* 卷帘——展开蒙住整屏（默认深色） */
.immerse-curtain { position: absolute; inset: 0; pointer-events: auto;
  width: 100%;
  min-width: 100%;
  min-height: 100%;
  background: linear-gradient(180deg, #0b1224 0%, #050911 100%);
  backdrop-filter: blur(8px) saturate(1.1);
  -webkit-backdrop-filter: blur(8px) saturate(1.1);
  clip-path: inset(0 50% 0 50%);
  transition: clip-path 1.4s cubic-bezier(.55, .1, .25, 1); }
.immerse-curtain.open { clip-path: inset(0 0 0 0); }

html.immerse-open,
body.immerse-open {
  overflow: hidden !important;
  overscroll-behavior: none;
  width: 100%;
  max-width: 100%;
}

/* 背景装饰层（星点/月轮/灯笼/远山等）*/
.immerse-bg-fx { position: absolute; inset: 0;
  pointer-events: none; overflow: hidden; opacity: 0;
  transition: opacity .45s .12s ease-out; }
.immerse-stage.ready .immerse-bg-fx { opacity: 1; }

/* 飘落意象层 + 单字底纹层 */
.immerse-flakes, .immerse-chars { position: absolute; inset: 0;
  pointer-events: none; overflow: hidden; opacity: 0;
  transition: opacity .4s .1s ease-out; }
.immerse-stage.ready .immerse-flakes,
.immerse-stage.ready .immerse-chars { opacity: 1; }

/* === 飘落意象动画 === */
@keyframes fall-down {
  0%   { transform: translateY(-15vh) rotate(-90deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(118vh) rotate(270deg); opacity: 0; }
}
@keyframes snow-zigzag {
  0%   { transform: translate(0, -15vh) rotate(-90deg); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translate(var(--sx), 118vh) rotate(90deg); opacity: 0; }
}
@keyframes rain-drop {
  0%   { transform: translateY(-15vh) skewX(-12deg); opacity: 0; }
  10%  { opacity: .8; }
  100% { transform: translateY(118vh) skewX(-12deg); opacity: 0; }
}
@keyframes sand-drift {
  0%   { transform: translate(0, 0); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(-30vw, -8vh); opacity: 0; }
}
@keyframes rise-up {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(-130vh); opacity: 0; }
}
@keyframes drift-side {
  0%   { transform: translateX(0); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateX(120vw); opacity: 0; }
}

.immerse-imagery { position: absolute; top: 0;
  color: var(--imagery-color); user-select: none;
  will-change: transform, opacity;
  animation: fall-down linear forwards; }
.glyph-snow  { animation-name: snow-zigzag; }
.glyph-rain  { animation-name: rain-drop; }
.glyph-sand  { animation-name: sand-drift; }
.glyph-rise  { animation-name: rise-up; }
.glyph-drift { animation-name: drift-side; }

.immerse-char { position: absolute; top: 0;
  color: var(--char-color); user-select: none;
  will-change: transform, opacity;
  animation: fall-down linear forwards;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif; font-weight: 600;
  letter-spacing: 2px; }

/* === 诗河层 === */
.immerse-stream { position: absolute; inset: 0;
  pointer-events: none; overflow: hidden; opacity: 0;
  transform: translateZ(0);
  contain: layout paint;
  transition: opacity .4s .08s ease-out; }
.immerse-stage.ready .immerse-stream { opacity: 1; }

/* (a) 竖排横向流动 */
@keyframes flow-verse-v {
  from { transform: translateX(110vw); }
  to   { transform: translateX(-110%); }
}
.flow-verse { position: absolute; right: 0;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  color: var(--verse-color);
  text-shadow: 0 0 14px var(--verse-glow), 0 2px 4px rgba(0, 0, 0, .35);
  will-change: transform; backface-visibility: hidden;
  animation: flow-verse-v linear forwards; pointer-events: none;
  display: inline-flex; flex-direction: row-reverse; align-items: flex-start;
  gap: 18px; max-height: 88vh; }
.fv-line { writing-mode: vertical-rl; text-orientation: upright;
  font-size: inherit; font-weight: 700; letter-spacing: 10px; line-height: 1.5; }
.fv-meta { writing-mode: vertical-rl; text-orientation: upright;
  font-size: 16px; color: var(--meta-color);
  font-family: "Noto Serif SC", serif; font-style: italic;
  letter-spacing: 3px; padding-top: 14px; align-self: flex-start; }

/* (b) 横排横向流动 */
@keyframes flow-verse-h {
  from { transform: translateX(110vw); }
  to   { transform: translateX(-110vw); }
}
.flow-verse-h { position: absolute; right: 0; white-space: nowrap;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  color: var(--verse-color);
  text-shadow: 0 0 14px var(--verse-glow), 0 2px 4px rgba(0, 0, 0, .35);
  will-change: transform; backface-visibility: hidden;
  animation: flow-verse-h linear forwards; pointer-events: none;
  display: inline-flex; align-items: center; gap: 18px; }
.fvh-block { display: inline-flex; flex-direction: column; gap: 4px; line-height: 1.1; }
.fvh-line { font-size: var(--fvh-fs1, 48px); font-weight: 700; letter-spacing: 10px; }
.fvh-block .fvh-line:nth-child(2) { font-size: var(--fvh-fs2, var(--fvh-fs1, 48px)); }
.fvh-meta { font-size: var(--fvh-fsm, 16px); color: var(--meta-color);
  font-family: "Noto Serif SC", serif; font-style: italic; letter-spacing: 2px; }

/* (c) 上往下飘落 + 淡入淡出 */
@keyframes fall-fade {
  0%   { transform: translateY(-12vh); opacity: 0; }
  18%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { transform: translateY(110vh); opacity: 0; }
}
.fall-verse { position: absolute; top: 9vh;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  color: var(--verse-color);
  text-shadow: 0 0 16px var(--verse-glow), 0 2px 6px rgba(0, 0, 0, .4);
  animation: fall-fade linear forwards; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; }
.ff-block { display: inline-flex; flex-direction: row-reverse; gap: 10px; }
.ff-line { font-size: inherit; font-weight: 700; letter-spacing: 12px;
  writing-mode: vertical-rl; text-orientation: upright; line-height: 1.45; }
.ff-meta { font-size: 14px; color: var(--meta-color);
  font-family: "Noto Serif SC", serif; font-style: italic;
  letter-spacing: 2px; margin-top: 8px; text-align: center; }

/* (d) 原地墨晕渐显（横排） */
@keyframes ink-bloom-life {
  0%   { opacity: 0; filter: blur(14px); transform: translateY(-10px) scale(.96); }
  20%  { opacity: 1; filter: blur(0); transform: translateY(0) scale(1); }
  75%  { opacity: 1; filter: blur(0); }
  100% { opacity: 0; filter: blur(8px); }
}
.bloom-verse { position: absolute;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  color: var(--verse-color);
  text-shadow: 0 0 18px var(--verse-glow), 0 2px 4px rgba(0, 0, 0, .35);
  animation: ink-bloom-life 11s ease-out forwards; pointer-events: none;
  transform-origin: center;
  display: flex; flex-direction: column; align-items: center;
  /* left/top 给的是中心点 */
  translate: -50% -50%; }
.bv-block { display: inline-flex; flex-direction: row-reverse; gap: 16px;
  align-items: flex-start; max-height: 50vh; }
.bv-line { font-size: inherit; font-weight: 700; letter-spacing: 10px; line-height: 1.45;
  writing-mode: vertical-rl; text-orientation: upright; }
.bv-meta { font-size: 14px; color: var(--meta-color); margin-top: 10px;
  font-family: "Noto Serif SC", serif; font-style: italic; letter-spacing: 2px; }

/* (e) 一字一字洒下来（竖排） */
@keyframes drip-char {
  0%   { opacity: 0; transform: translateY(-32px) scale(.6); filter: blur(6px); }
  35%  { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  85%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(8px); filter: blur(4px); }
}
.drip-verse { position: absolute; top: 9vh;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  color: var(--verse-color);
  text-shadow: 0 0 18px var(--verse-glow), 0 2px 4px rgba(0, 0, 0, .35);
  pointer-events: none; max-height: 80vh;
  display: flex; flex-direction: column; align-items: center; }
.dv-cols { display: flex; flex-direction: row-reverse; gap: 18px; align-items: flex-start; }
.dv-col { display: flex; flex-direction: column; align-items: center; }
.dv-char { display: block; font-size: inherit; font-weight: 700; letter-spacing: 0;
  line-height: 1.25; opacity: 0; animation: drip-char 9s ease-out forwards; }
.dv-meta { font-size: 14px; color: var(--meta-color);
  font-family: "Noto Serif SC", serif; font-style: italic; letter-spacing: 3px;
  margin-top: 12px; writing-mode: vertical-rl; text-orientation: upright;
  opacity: 0; animation: drip-char 6s ease-out forwards; }

/* (f) 呼吸式渐显渐隐（竖排） */
@keyframes breathe-life {
  0%   { opacity: 0; filter: blur(10px); transform: scale(.95); }
  18%  { opacity: 1; filter: blur(0); transform: scale(1); }
  82%  { opacity: 1; filter: blur(0); transform: scale(1.02); }
  100% { opacity: 0; filter: blur(8px); transform: scale(1.04); }
}
.breathe-verse { position: absolute;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  color: var(--verse-color);
  text-shadow: 0 0 20px var(--verse-glow), 0 2px 4px rgba(0, 0, 0, .35);
  animation: breathe-life 9s ease-in-out forwards; pointer-events: none;
  display: inline-flex; flex-direction: row-reverse; gap: 14px; }
.bz-line { writing-mode: vertical-rl; text-orientation: upright;
  font-size: inherit; font-weight: 700; letter-spacing: 12px; line-height: 1.5; }
.bz-meta { writing-mode: vertical-rl; text-orientation: upright;
  font-size: 14px; color: var(--meta-color); font-family: "Noto Serif SC", serif;
  font-style: italic; letter-spacing: 3px; padding-top: 12px; align-self: flex-start; }

/* (g) 单字居中放大消散（禅意） */
@keyframes zen-pulse {
  0%   { opacity: 0; transform: scale(.4); filter: blur(20px); }
  25%  { opacity: 1; transform: scale(1); filter: blur(0); }
  70%  { opacity: 1; transform: scale(1.08); filter: blur(0); }
  100% { opacity: 0; transform: scale(1.4); filter: blur(14px); }
}
.zen-verse { position: absolute; top: 9vh; left: 0; right: 0; bottom: 13vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  color: var(--verse-color); text-align: center;
  text-shadow: 0 0 30px var(--verse-glow);
  animation: zen-pulse 6.5s ease-out forwards; }
.zv-block { display: inline-flex; flex-direction: row-reverse; gap: 26px;
  align-items: flex-start; justify-content: center; max-height: 78vh; }
.zv-line { font-size: inherit; font-weight: 700; letter-spacing: 14px; line-height: 1.3;
  writing-mode: vertical-rl; text-orientation: upright; }
.zv-meta { font-size: 14px; color: var(--meta-color); margin-top: 16px;
  font-family: "Noto Serif SC", serif; font-style: italic; letter-spacing: 4px; }

/* === 顶栏 + 设置 + 底部主题壳 === */
.immerse-topbar {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 0px));
  left: max(10px, env(safe-area-inset-left, 0px));
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s .15s ease-out;
}
.immerse-stage.ready .immerse-topbar { opacity: 1; pointer-events: auto; }
.immerse-icon-btn {
  pointer-events: auto;
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 0;
  color: var(--ui-color);
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background .2s, color .2s, transform .1s;
}
.immerse-icon-svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: .9;
}
.immerse-icon-btn:hover { background: var(--ui-bg-hover); color: var(--ui-color-strong); }
.immerse-icon-btn:active { transform: scale(.94); }
.immerse-icon-btn[aria-expanded="true"] { background: var(--ui-bg-hover); color: var(--ui-color-strong); }

.immerse-settings-popover {
  position: absolute;
  top: calc(max(10px, env(safe-area-inset-top, 0px)) + 46px);
  right: max(10px, env(safe-area-inset-right, 0px));
  z-index: 21;
  min-width: 240px;
  padding: 12px 14px;
  background: var(--ui-popover-bg);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.immerse-settings-popover[hidden] { display: none !important; }
.immerse-settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--ui-color);
  font-family: "Noto Serif SC", sans-serif;
}
.immerse-settings-row:last-child { margin-bottom: 0; }
.immerse-settings-label { flex: 0 0 4.5em; }
.immerse-settings-row input[type="range"] {
  flex: 1; min-width: 0;
  height: 3px;
  border-radius: 999px;
  -webkit-appearance: none; appearance: none;
  background: var(--ui-track);
  outline: none;
  border: none;
  box-shadow: none;
}
.immerse-settings-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--ui-thumb);
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  cursor: pointer;
}
.immerse-settings-row input[type="range"]::-moz-range-track {
  height: 3px; border-radius: 999px;
  background: var(--ui-track);
  border: none;
}
.immerse-settings-row input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--ui-thumb);
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  cursor: pointer;
}
.immerse-settings-val { flex: 0 0 3.2em; text-align: right; font-variant-numeric: tabular-nums; color: var(--ui-color-strong); }

.immerse-settings-row-mute .immerse-mute-btn {
  margin-left: auto;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid var(--ui-border);
  background: color-mix(in srgb, var(--ui-popover-bg) 70%, var(--ui-bg-hover));
  color: var(--ui-color-strong);
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}
.immerse-settings-row-mute .immerse-mute-btn:hover {
  background: var(--ui-bg-hover);
}
.immerse-settings-row-mute .immerse-mute-btn.is-muted {
  opacity: 0.88;
}

.immerse-flow-switch {
  display: inline-flex;
  margin-left: auto;
  border: 1px solid var(--ui-border);
  border-radius: 10px;
  overflow: hidden;
  background: color-mix(in srgb, var(--ui-popover-bg) 82%, var(--ui-bg-hover));
}
.immerse-bottom-cell .immerse-flow-switch {
  margin-left: 0;
  flex-shrink: 0;
}
.immerse-flow-switch button {
  appearance: none; border: none; background: transparent;
  padding: 5px 12px; font: inherit; font-size: 12px;
  color: var(--ui-color-strong); cursor: pointer; transition: background .15s, color .15s;
}
.immerse-flow-switch button + button { border-left: 1px solid var(--ui-border); }
.immerse-flow-switch button:hover { background: var(--ui-bg-hover); color: var(--ui-color-strong); }
.immerse-flow-switch button.on {
  background: var(--ui-thumb);
  color: var(--ui-popover-bg);
}
.immerse-stage.is-light .immerse-flow-switch button:not(.on) {
  color: rgba(28, 22, 16, 0.88);
}
.immerse-stage.is-light .immerse-flow-switch button.on {
  color: rgba(255, 252, 248, 0.98);
}
.immerse-settings-tip {
  margin: -2px 0 8px;
  font-size: 11px;
  line-height: 1.55;
  color: var(--ui-color);
  opacity: 0.72;
  font-family: "Noto Serif SC", serif;
}

/* ----- 沉浸模式底部 dock（卷读设置 + 主题） ----- */
.immerse-dock {
  position: absolute;
  bottom: max(10px, env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: min(920px, calc(100vw - 24px));
  max-width: min(920px, calc(100vw - 24px));
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s .25s ease-out;
  font-family: "Noto Serif SC", "PingFang SC", sans-serif;
}
.immerse-stage.ready .immerse-dock { opacity: 0.9; pointer-events: auto; }
.immerse-dock:hover { opacity: 1; }

.immerse-dock-fold {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 44px;
  padding: 7px 16px;
  margin: 0 auto;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-bg) 92%, rgba(0, 0, 0, 0.12));
  color: var(--ui-color);
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: inherit;
  transition: background .2s, color .2s, border-radius .2s;
}
.immerse-dock-fold:hover { background: var(--ui-bg-hover); color: var(--ui-color-strong); }
.immerse-dock:not(.is-collapsed) .immerse-dock-fold {
  width: 100%;
  border-radius: 12px 12px 0 0;
  border-bottom: none;
  margin-bottom: 0;
}
.immerse-fold-chevron {
  font-size: 15px;
  line-height: 1;
  opacity: .88;
  transition: transform .2s ease;
}
.immerse-dock.is-collapsed .immerse-fold-chevron { transform: rotate(180deg); }
.immerse-dock.is-collapsed .immerse-dock-body { display: none; }

.immerse-dock-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.immerse-bottom-shell,
.immerse-schemes-shell {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.immerse-bottom-grid {
  display: grid;
  grid-template-columns: max-content max-content minmax(120px, 1fr) minmax(120px, 1fr);
  align-items: center;
  column-gap: 28px;
  row-gap: 12px;
  padding: 10px 18px;
  background: color-mix(in srgb, var(--ui-bg) 92%, rgba(0, 0, 0, 0.12));
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.immerse-dock:not(.is-collapsed) .immerse-bottom-grid {
  border-top: none;
  border-radius: 0 0 14px 14px;
}
.immerse-bottom-cell {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  color: var(--ui-color-strong);
  min-width: 0;
}
.immerse-bottom-cell:not(.immerse-bottom-cell-slider) {
  max-width: 100%;
  min-width: max-content;
}
.immerse-bottom-cell-slider { gap: 12px; min-width: 0; }
.immerse-bottom-label {
  font-size: 12px; letter-spacing: 2px;
  color: var(--ui-color-strong);
  opacity: 0.92;
  flex-shrink: 0;
  white-space: nowrap;
}
.immerse-stage.is-light .immerse-bottom-label {
  color: rgba(24, 18, 12, 0.88);
  opacity: 1;
}
.immerse-bottom-cell input[type="range"] {
  width: 110px;
  accent-color: var(--ui-thumb);
  height: 4px;
}
.immerse-bottom-val {
  font-size: 12px; min-width: 44px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--ui-color-strong);
  opacity: 0.95;
  flex-shrink: 0;
}
.immerse-stage.is-light .immerse-bottom-val {
  color: rgba(24, 18, 12, 0.88);
  opacity: 1;
}
@media (min-width: 541px) and (max-width: 1024px) {
  .immerse-dock {
    width: min(720px, calc(100vw - 24px));
    max-width: min(720px, calc(100vw - 24px));
  }
  .immerse-bottom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(14px, 2.5vw, 24px);
    row-gap: 12px;
    padding: 10px clamp(14px, 2.5vw, 22px);
    box-sizing: border-box;
  }
  .immerse-bottom-cell:not(.immerse-bottom-cell-slider) {
    min-width: 0;
    justify-content: space-between;
    gap: 10px;
  }
  .immerse-bottom-cell-slider {
    gap: 10px;
    min-width: 0;
  }
  .immerse-bottom-cell input[type="range"] {
    flex: 1;
    min-width: 48px;
    width: auto;
  }
}
@media (min-width: 1025px) {
  .immerse-bottom-grid {
    grid-template-columns: max-content max-content minmax(120px, 1fr) minmax(120px, 1fr);
    column-gap: clamp(16px, 2.5vw, 36px);
    row-gap: 14px;
    padding: 12px clamp(16px, 3vw, 32px) 14px;
    box-sizing: border-box;
  }
  .immerse-bottom-cell input[type="range"] {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .immerse-bottom-cell-slider {
    gap: 14px;
  }
}
@media (max-width: 540px) {
  .immerse-dock {
    width: calc(100vw - 40px);
    max-width: 320px;
  }
  .immerse-bottom-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 12px;
  }
  .immerse-bottom-cell input[type="range"] { width: 100%; flex: 1; }
}

.immerse-schemes-shell {
  opacity: 1;
}

/* === 方案选择器（与卷读设置同底） === */
.immerse-schemes {
  position: relative;
  display: flex;
  gap: 2px;
  z-index: 12;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--ui-bg) 92%, rgba(0, 0, 0, 0.12));
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.immerse-schemes-track { display: contents; }
.immerse-schemes button {
  background: transparent;
  color: color-mix(in srgb, var(--ui-color) 75%, transparent);
  border: 1px solid transparent;
  padding: 6px 14px;
  font-size: 12px;
  letter-spacing: 1.5px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  font-family: "Noto Serif SC", serif;
  transition: color .2s, background .2s;
}
.immerse-schemes button b { display: none; }
.immerse-schemes button:hover { color: var(--ui-color-strong); }
.immerse-schemes button.on {
  background: var(--ui-bg-hover);
  color: var(--ui-color-strong);
}

/* === 暂停状态 === */
.immerse-status {
  position: absolute;
  top: calc(max(10px, env(safe-area-inset-top, 0px)) + 50px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ui-status-bg); color: var(--ui-status-color);
  padding: 6px 14px; border-radius: 14px;
  font-size: 12px; letter-spacing: 2px; font-family: "Noto Serif SC", serif;
  z-index: 12; pointer-events: none;
  animation: status-pulse 1.6s infinite ease-in-out; }
@keyframes status-pulse { 50% { transform: translateX(-50%) scale(1.04); } }

/* 诗河/意象/底字及子元素一律暂停（含滴落逐字等子动画） */
body.immerse-paused .immerse-stream *,
body.immerse-paused .immerse-flakes *,
body.immerse-paused .immerse-chars *,
body.immerse-paused .immerse-bg-fx * { animation-play-state: paused !important; }

/* ============================================== */
/* === 8 套主题色调（4 深 + 4 浅，鲜活、年轻向） ===== */
/* ============================================== */
/* 浅色方案统一覆盖 UI 变量（按钮 / 设置面板 / 状态条用深字） */
.immerse-stage.is-light {
  --ui-color: rgba(40, 30, 25, .70);
  --ui-color-strong: #1f1610;
  --ui-bg: rgba(255, 255, 255, .42);
  --ui-bg-hover: rgba(255, 255, 255, .72);
  --ui-border: rgba(40, 30, 20, .12);
  --ui-popover-bg: rgba(255, 252, 246, .78);
  --ui-track: rgba(40, 30, 20, .14);
  --ui-thumb: rgba(40, 30, 25, .85);
  --ui-status-bg: rgba(255, 252, 246, .82);
  --ui-status-color: rgba(40, 30, 25, .88);
}

/* 1. 墨夜·星河 —— 深靛紫 → 电光蓝，赛博星河 */
.immerse-stage[data-scheme="ink-night"] .immerse-curtain {
  background:
    radial-gradient(ellipse 80vw 60vh at 25% 18%, rgba(110, 70, 220, .55) 0%, transparent 60%),
    radial-gradient(ellipse 70vw 50vh at 80% 85%, rgba(60, 130, 220, .42) 0%, transparent 60%),
    linear-gradient(160deg, #1a0e3a 0%, #0a0a28 55%, #050314 100%); }
.immerse-stage[data-scheme="ink-night"] {
  --verse-color: #f0f4ff; --verse-glow: rgba(150, 200, 255, .85);
  --meta-color: rgba(200, 220, 255, .7); --char-color: rgba(180, 200, 255, .35);
  --imagery-color: rgba(230, 240, 255, .9); }
.bg-star { position: absolute; width: var(--s, 2px); height: var(--s, 2px);
  border-radius: 50%; background: #fff;
  box-shadow: 0 0 8px rgba(180, 220, 255, .9), 0 0 14px rgba(140, 180, 255, .4);
  animation: star-twinkle var(--d, 3s) ease-in-out infinite alternate; }
@keyframes star-twinkle {
  from { opacity: .3; transform: scale(.85); }
  to   { opacity: 1;  transform: scale(1.2); }
}
.bg-moon { position: absolute; top: 12vh; right: 14vw;
  width: 26vh; height: 26vh; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffbeb 0%, #c6b8ff 55%, transparent 75%);
  box-shadow: 0 0 90px rgba(180, 160, 255, .45);
  filter: blur(.5px); opacity: .9; }

/* 2. 寒灯·赤雨 —— 玫红 → 桃霞，霓虹夜灯 */
.immerse-stage[data-scheme="crimson-lamp"] .immerse-curtain {
  background:
    radial-gradient(ellipse 90vw 60vh at 50% 110%, rgba(255, 130, 90, .55) 0%, transparent 65%),
    radial-gradient(ellipse 60vw 50vh at 85% 10%, rgba(220, 60, 140, .45) 0%, transparent 60%),
    linear-gradient(170deg, #2a0628 0%, #5a0e3a 45%, #200818 100%); }
.immerse-stage[data-scheme="crimson-lamp"] {
  --verse-color: #ffeef0; --verse-glow: rgba(255, 130, 170, .85);
  --meta-color: rgba(255, 210, 220, .75); --char-color: rgba(255, 170, 190, .4);
  --imagery-color: rgba(255, 210, 200, .85); }
.bg-lantern { position: absolute; width: 70px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, #ffac6e 0%, #ff5a78 55%, #6e1a3c 100%);
  box-shadow: 0 0 80px rgba(255, 110, 150, .7); opacity: .9;
  animation: lantern-sway 4s ease-in-out infinite alternate; }
.bg-lantern.small { width: 46px; height: 60px; opacity: .7; }
@keyframes lantern-sway {
  from { transform: translateX(-6px) rotate(-3deg); }
  to   { transform: translateX(6px) rotate(3deg); }
}

/* 3. 月下·飞花 —— 浅色：奶桃 → 樱粉，少女日出（LIGHT） */
.immerse-stage[data-scheme="moon-petal"] .immerse-curtain {
  background:
    radial-gradient(ellipse 90vw 70vh at 50% 0%, rgba(255, 220, 235, .9) 0%, transparent 65%),
    radial-gradient(ellipse 80vw 60vh at 30% 100%, rgba(255, 200, 215, .7) 0%, transparent 60%),
    linear-gradient(170deg, #fff3ec 0%, #ffd9e4 45%, #f0bcd5 100%); }
.immerse-stage[data-scheme="moon-petal"] {
  --verse-color: #4a1638; --verse-glow: rgba(255, 130, 170, .45);
  --meta-color: rgba(110, 50, 80, .75); --char-color: rgba(160, 80, 120, .35);
  --imagery-color: rgba(220, 90, 140, .65); }
.bg-bigmoon { position: absolute; top: -10vh; left: 50%; transform: translateX(-50%);
  width: 60vh; height: 60vh; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255, 245, 250, .85) 0%, rgba(255, 200, 220, .35) 45%, transparent 70%);
  filter: blur(8px); }

/* 4. 烟雨·江南 —— 浅色：薄荷 → 青绿，清晨雾湖（LIGHT） */
.immerse-stage[data-scheme="jiangnan-mist"] .immerse-curtain {
  background:
    radial-gradient(ellipse 90vw 60vh at 50% 0%, rgba(220, 240, 232, .9) 0%, transparent 60%),
    radial-gradient(ellipse 80vw 50vh at 50% 100%, rgba(140, 200, 200, .55) 0%, transparent 70%),
    linear-gradient(180deg, #e9f4ee 0%, #c8e2dc 55%, #a0c8c2 100%); }
.immerse-stage[data-scheme="jiangnan-mist"] {
  --verse-color: #133a36; --verse-glow: rgba(80, 180, 160, .4);
  --meta-color: rgba(40, 90, 80, .75); --char-color: rgba(60, 120, 105, .35);
  --imagery-color: rgba(40, 120, 110, .55); }
.bg-water { position: absolute; bottom: 0; left: 0; right: 0; height: 34vh;
  background: linear-gradient(180deg, transparent 0%, rgba(120, 180, 170, .28) 55%, rgba(80, 140, 130, .52) 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 32%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 32%); }
.bg-mountains { position: absolute; bottom: 0; left: 0; right: 0; height: 48vh;
  background:
    radial-gradient(ellipse 40vw 18vh at 20% 100%, rgba(80, 130, 120, .55) 0%, transparent 70%),
    radial-gradient(ellipse 50vw 22vh at 60% 100%, rgba(60, 110, 100, .65) 0%, transparent 70%),
    radial-gradient(ellipse 35vw 16vh at 90% 100%, rgba(70, 120, 110, .55) 0%, transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .45) 16%, #000 36%);
  mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .45) 16%, #000 36%); }

/* 5. 大漠·孤烟 —— 熔金落日：深酒红 → 烈日橙 → 桃霞 */
.immerse-stage[data-scheme="desert-sun"] .immerse-curtain {
  background:
    radial-gradient(ellipse 70vw 40vh at 50% 50%, rgba(255, 160, 70, .55) 0%, transparent 65%),
    linear-gradient(180deg, #2a0612 0%, #6e1828 28%, #c8483a 58%, #ff8a4c 82%, #2a0810 100%); }
.immerse-stage[data-scheme="desert-sun"] {
  --verse-color: #fff0d8; --verse-glow: rgba(255, 180, 90, .85);
  --meta-color: rgba(255, 220, 180, .75); --char-color: rgba(255, 200, 150, .4);
  --imagery-color: rgba(255, 230, 180, .8); }
.bg-sun { position: absolute; top: 28vh; left: 50%; transform: translateX(-50%);
  width: 40vh; height: 40vh; border-radius: 50%;
  background: radial-gradient(circle, #fff0c8 0%, #ffac4c 40%, #ff5a3a 75%, transparent 90%);
  filter: blur(2px); opacity: .8; }
.bg-dunes { position: absolute; bottom: 0; left: 0; right: 0; height: 35vh;
  background:
    radial-gradient(ellipse 60vw 22vh at 30% 100%, rgba(80, 25, 20, .85) 0%, transparent 70%),
    radial-gradient(ellipse 80vw 30vh at 80% 110%, rgba(50, 12, 14, .9) 0%, transparent 70%); }

/* 6. 寒山·雪夜 —— 浅色：珍珠白 → 冰蓝，清晨初雪（LIGHT，默认） */
.immerse-stage[data-scheme="snow-cold"] .immerse-curtain {
  background:
    radial-gradient(ellipse 90vw 60vh at 50% 0%, rgba(245, 250, 255, 1) 0%, transparent 60%),
    radial-gradient(ellipse 80vw 50vh at 50% 100%, rgba(180, 215, 240, .7) 0%, transparent 65%),
    linear-gradient(180deg, #f4faff 0%, #d8e8f5 55%, #b8d2e8 100%); }
.immerse-stage[data-scheme="snow-cold"] {
  --verse-color: #14304a; --verse-glow: rgba(80, 150, 220, .45);
  --meta-color: rgba(40, 70, 100, .75); --char-color: rgba(60, 100, 140, .35);
  --imagery-color: rgba(80, 130, 180, .8); }
.bg-snow-floor { position: absolute; bottom: 0; left: 0; right: 0; height: 18vh;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, .55) 40%, rgba(255, 255, 255, .85) 100%); }

/* 7. 空山·墨翠 —— 极光森林：深翡翠 → 薄荷绿 + 紫晕 */
.immerse-stage[data-scheme="empty-mountain"] .immerse-curtain {
  background:
    radial-gradient(ellipse 80vw 50vh at 30% 20%, rgba(120, 90, 220, .35) 0%, transparent 60%),
    radial-gradient(ellipse 90vw 60vh at 70% 90%, rgba(80, 220, 170, .4) 0%, transparent 65%),
    linear-gradient(170deg, #051f1c 0%, #0a3a30 45%, #08221c 100%); }
.immerse-stage[data-scheme="empty-mountain"] {
  --verse-color: #e0fff0; --verse-glow: rgba(120, 240, 180, .8);
  --meta-color: rgba(180, 240, 210, .75); --char-color: rgba(150, 230, 190, .4);
  --imagery-color: rgba(180, 240, 210, .75); }
.bg-mist { position: absolute; inset: 0;
  background: radial-gradient(ellipse 80vw 30vh at 50% 60%, rgba(120, 220, 180, .25) 0%, transparent 70%); }
.bg-peaks { position: absolute; bottom: 0; left: 0; right: 0; height: 38vh;
  background:
    radial-gradient(ellipse 38vw 22vh at 15% 100%, rgba(15, 50, 38, .9) 0%, transparent 70%),
    radial-gradient(ellipse 50vw 30vh at 50% 100%, rgba(10, 38, 28, .92) 0%, transparent 70%),
    radial-gradient(ellipse 40vw 25vh at 85% 100%, rgba(15, 50, 38, .9) 0%, transparent 70%); }

/* 8. 禅心·一字 —— 浅色：暖象牙白 + 深墨字 + 金圆相（LIGHT） */
.immerse-stage[data-scheme="zen-blank"] .immerse-curtain {
  background:
    radial-gradient(ellipse 70vw 50vh at 50% 50%, #fffaf0 0%, #f3ead4 60%, #e6d8b6 100%); }
.immerse-stage[data-scheme="zen-blank"] {
  --verse-color: #18120a; --verse-glow: rgba(180, 130, 60, .35);
  --meta-color: rgba(70, 50, 30, .75); --char-color: rgba(120, 90, 50, .3);
  --imagery-color: rgba(140, 100, 60, .55); }
.bg-enso { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 60vh; height: 60vh; border-radius: 50%;
  border: 2px solid rgba(140, 90, 40, .25);
  box-shadow: inset 0 0 80px rgba(180, 130, 60, .12), 0 0 60px rgba(180, 130, 60, .08); }

.scroll-content { flex: 1; display: flex; flex-direction: row-reverse;
  align-items: stretch; gap: 24px; overflow-x: auto; overflow-y: auto;
  min-height: 0;
  padding: 4px 0; position: relative; z-index: 2;
  scrollbar-width: none; }
.scroll-content::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* 标题：濡墨绽开效果（淡入 + 模糊化清 + 字距展开） */
.scroll-title { writing-mode: vertical-rl; text-orientation: upright;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: 28px; font-weight: 700; color: var(--ink);
  letter-spacing: 6px; line-height: 1.4;
  padding: 0 6px; flex-shrink: 0;
  border-right: 2px solid rgba(140, 100, 60, .35); padding-right: 18px;
  opacity: 0; filter: blur(6px); transform: translateY(-6px);
  animation: ink-bloom .9s .1s ease-out forwards; }

/* 诗句：每列从顶往下"墨流"渐显，逐句延迟出现 */
.scroll-body { display: flex; flex-direction: row-reverse;
  align-items: flex-start; gap: 14px; flex: 1; min-height: 0; }
/* 校勘记号 [X] / 【X】整体淡化，提示为校勘存疑字 */
.vc-bracket { color: rgba(120, 90, 70, .5); }
.scroll-line { writing-mode: vertical-rl; text-orientation: upright;
  white-space: nowrap;
  font-size: 22px; line-height: 1.65; letter-spacing: 4px;
  color: var(--ink); font-weight: 500;
  padding: 4px 6px; flex-shrink: 0;
  opacity: 0; filter: blur(8px); transform: translateY(-12px);
  animation: ink-bloom 1.1s ease-out forwards;
  background: linear-gradient(180deg, transparent 0%, transparent 100%);
  background-size: 100% 0%; background-repeat: no-repeat;
  background-position: top; }
.scroll-line.shimmer { animation: ink-bloom 1.1s ease-out forwards, ink-shimmer 4s 1.5s ease-in-out infinite; }
.scroll-line { cursor: pointer; transition: color .2s, text-shadow .2s; }
.scroll-line:hover { color: var(--accent); text-shadow: 0 0 12px color-mix(in srgb, var(--accent) 35%, transparent); }
.scroll-line.is-reading {
  color: var(--accent) !important;
  text-shadow: 0 0 16px color-mix(in srgb, var(--accent) 42%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.scroll-line.is-reading:hover {
  color: var(--accent) !important;
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 48%, transparent);
}
/* 续接列：紧贴前一列，顶端轻微下沉，提示"同一句续接" */
.scroll-line.continuation { margin-right: -8px; padding-top: 18px; opacity: .92; }

@keyframes ink-bloom {
  0%   { opacity: 0; filter: blur(8px); transform: translateY(-12px); }
  60%  { opacity: 0.6; filter: blur(2px); transform: translateY(0); }
  100% { opacity: 1; filter: blur(0); transform: translateY(0); }
}
@keyframes ink-shimmer {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50% { text-shadow: 0 0 6px rgba(160, 80, 48, .25); }
}

/* 落款（作者 + 年份 + 创作地）：最后慢慢淡入 */
.scroll-meta { writing-mode: vertical-rl; text-orientation: upright;
  font-size: 13px; color: var(--ink-soft); letter-spacing: 3px;
  font-style: italic; padding: 8px 4px; align-self: flex-end;
  border-left: 1px dashed rgba(140, 100, 60, .35); padding-left: 14px;
  flex-shrink: 0; min-height: 200px;
  opacity: 0; animation: meta-fade 1s ease-out forwards; }
@keyframes meta-fade { to { opacity: 1; } }
.scroll-meta .seal { display: inline-block; margin-top: 12px;
  background: var(--accent); color: var(--paper);
  font-family: "Ma Shan Zheng", serif; font-size: 14px;
  padding: 4px 6px; letter-spacing: 2px; writing-mode: vertical-rl;
  text-orientation: upright; border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  animation: seal-stamp .4s .3s cubic-bezier(.5, 1.6, .3, 1) backwards; }
@keyframes seal-stamp {
  0%   { transform: scale(2.5); opacity: 0; }
  60%  { transform: scale(.85); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* 流霜飘落：在挂轴内（落在纸面上）随机飘下大字"霜/月/花/雪/风/云" */
.scroll-flakes { position: absolute; inset: 0; overflow: hidden;
  pointer-events: none; z-index: 1; opacity: .35; }
.scroll-flake { position: absolute; top: -10%;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  color: rgba(160, 100, 60, .55); user-select: none;
  animation: flake-fall linear infinite; }
@keyframes flake-fall {
  0%   { transform: translateY(-10%) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

/* 诗人小传按钮：只剩"传"印；圆形可点 */
.bio-btn { display: inline-flex; align-items: center; justify-content: center;
  margin-left: 10px; vertical-align: middle;
  padding: 0; line-height: 1;
  width: 26px; height: 26px;
  background: transparent; border: none;
  cursor: pointer;
  transition: transform .2s;
  animation: bio-pulse 2.4s ease-out 1s 3; border-radius: 6px; }
.bio-btn .bio-btn-seal { display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 4px; background: var(--accent);
  color: var(--paper); font-family: "Ma Shan Zheng", serif; font-size: 14px;
  font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.bio-btn:hover { transform: scale(1.08); animation: none; }
.bio-btn:hover .bio-btn-seal { background: var(--ink); }
@keyframes bio-pulse {
  0%, 100% { box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 0 0 0 rgba(179, 73, 43, .5); }
  50%      { box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 0 0 8px rgba(179, 73, 43, 0); }
}

/* 诗人小传卡片 */
.bio-overlay { position: fixed; inset: 70px 0 100px 0; z-index: 1500;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 12, 6, .25); backdrop-filter: blur(2px);
  animation: scroll-fade .25s ease-out; }
.bio-overlay[hidden] { display: none; }

.bio-card { position: relative;
  background: var(--bio-card-bg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35), 0 0 0 1px var(--line);
  width: min(640px, 92vw); max-height: 80vh; padding: 24px 32px;
  display: flex; flex-direction: column; gap: 8px;
  font-family: "Noto Serif SC", serif;
  color: var(--ink);
  animation: scroll-slide .35s cubic-bezier(.2, .6, .3, 1); }

.bio-content { flex: 1; overflow-y: auto; padding: 8px 4px 4px;
  display: flex; flex-direction: column; gap: 18px; }

.bio-header { display: flex; align-items: flex-start; gap: 16px; }
.bio-seal { flex-shrink: 0; width: 56px; height: 56px;
  background: var(--accent); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: "Ma Shan Zheng", serif; font-size: 36px; font-weight: 700;
  border-radius: 4px; box-shadow: 0 2px 8px rgba(179, 73, 43, .4); }
.bio-title { flex: 1; }
.bio-name { font-family: "Ma Shan Zheng", serif; font-size: 32px; font-weight: 700;
  color: var(--ink); letter-spacing: 4px; line-height: 1.1; }
.bio-name-alt { font-size: 13px; color: var(--ink-soft); margin-top: 6px; letter-spacing: 1px; }
.bio-life { font-size: 12px; color: var(--ink-soft); margin-top: 4px; letter-spacing: 1px; }

.bio-section { padding: 10px 0; border-top: 1px dashed rgba(140, 100, 60, .35); }
.bio-section:first-of-type { border-top: none; padding-top: 0; }
.bio-section-title { font-family: "Ma Shan Zheng", serif; font-size: 14px;
  color: var(--accent); letter-spacing: 3px; margin-bottom: 8px; }
.bio-section-body { font-size: 13.5px; line-height: 1.85; color: var(--ink); letter-spacing: .5px; }

/* 任职履历竖向时间线 */
.bio-postings { display: flex; flex-direction: column; gap: 6px; }
.bio-posting-row { display: grid; grid-template-columns: 78px 1fr; gap: 12px;
  padding: 4px 0; border-left: 2px solid var(--accent); padding-left: 12px;
  margin-left: 4px; }
.bio-posting-year { font-weight: 600; color: var(--accent); font-size: 13px; letter-spacing: .5px; }
.bio-posting-detail { font-size: 13.5px; }
.bio-posting-place { color: var(--ink-soft); font-size: 11.5px; margin-left: 6px; }

/* 交游 chip */
.bio-friends { display: flex; flex-wrap: wrap; gap: 6px; }
.bio-friend { padding: 3px 10px; border-radius: 12px; font-size: 12px;
  background: var(--chip-bg); border: 1px solid var(--line);
  color: var(--ink); }
.bio-friend.featured { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.bio-friend .rel { color: var(--ink-soft); font-size: 11px; margin-left: 4px; }
.bio-friend.featured .rel { color: rgba(255,255,255,.7); }

/* 创作概览 */
.bio-stats { display: flex; flex-wrap: wrap; gap: 14px; padding: 6px 0; }
.bio-stat { text-align: center; min-width: 76px; }
.bio-stat-num { font-family: "Ma Shan Zheng", serif; font-size: 24px;
  color: var(--accent); line-height: 1; }
.bio-stat-label { font-size: 11px; color: var(--ink-soft); margin-top: 4px; letter-spacing: 1px; }

/* === 配乐播放器 === */
.player-fs-btn[hidden] {
  display: none !important;
}

.player {
  --player-inner-radius: 8px;
  position: relative;
  right: auto;
  top: auto;
  z-index: 850;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  padding: 5px 7px;
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 228px;
  max-width: 100%;
  color: var(--ink);
  flex-shrink: 0;
}

.player .player-fs-btn,
.player .player-btn,
.player .player-fold-btn {
  flex-shrink: 0;
  appearance: none;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--player-inner-radius, 10px);
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
}
.player .player-fs-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  background: var(--chip-bg);
  color: var(--ink);
  letter-spacing: 0;
}
.player .player-fs-btn:hover { background: var(--chip-bg-hover); }
.player .player-fs-btn:active { transform: scale(0.96); }

.player .player-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 12px;
  color: var(--paper);
  background: var(--accent);
  border: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.player .player-btn:hover { filter: brightness(1.05); }
.player .player-btn:active { transform: scale(0.96); }

.player .fold-btn {
  min-width: 32px;
  min-height: 32px;
  padding: 0 clamp(5px, 1vw + 2px, 9px);
  color: var(--ink-soft);
  background: var(--chip-bg);
  font-size: clamp(13.5px, 0.2rem + 1.5vw, 16px);
  line-height: 1;
  letter-spacing: clamp(0.5px, 0.15vw, 1.2px);
  box-shadow: none;
  border: 1px solid var(--line);
  border-radius: var(--player-inner-radius, 10px);
}
.player .fold-btn:hover {
  color: var(--ink);
  background: var(--chip-bg-hover);
  box-shadow: none;
}
.player .fold-btn:active { transform: scale(0.96); }
.player .player-expand-btn,
.player .player-fold-btn {
  width: auto;
  height: 32px;
  box-sizing: border-box;
}

.player-expand-btn {
  display: none !important;
}
.player.is-collapsed .player-expand-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}
.player.is-collapsed {
  width: auto;
  border-radius: 14px;
}
.player.is-collapsed .player-panel { display: none !important; }

.player-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.player .player-body {
  flex: 1;
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.player-btn.small { width: 26px; height: 26px; padding: 0; background: transparent;
  color: var(--ink-soft); flex-shrink: 0; border-radius: var(--player-inner-radius, 10px); }
.player-btn.small:hover { color: var(--ink); filter: none; }
.player-title {
  font-size: clamp(12px, 0.18rem + 1.65vw, 14px);
  margin: 0; cursor: pointer; min-width: 0; max-width: 100%;
}
.player-title-clip {
  max-width: 4em;
  overflow: hidden;
  min-width: 0;
}
@media (min-width: 769px) {
  .player-title-clip { max-width: 8em; }
}
.player-title-line {
  display: block;
  font-size: inherit;
  line-height: 1.35;
  white-space: nowrap;
}
.player-title.is-marquee .player-title-line.is-marquee-track {
  display: inline-flex;
  width: max-content;
  will-change: transform;
  animation: player-title-marquee var(--title-loop-sec, 10s) linear infinite;
}
/* 段末留白，与下一段字首拉开，接尾时也能看出缝 */
.player-title-blk {
  flex-shrink: 0;
  box-sizing: content-box;
  padding-right: 0.65em;
}
@keyframes player-title-marquee {
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .player-title.is-marquee .player-title-line.is-marquee-track { animation: none; }
}
.player-title:hover { color: var(--accent); }
.player-progress { height: 3px; background: color-mix(in srgb, var(--ink) 14%, transparent); border-radius: 2px;
  cursor: pointer; }
.player-fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0; }

/* 配乐菜单（PC：top/right 由 JS 对齐 #player；移动端见下方 media query） */
.audio-menu { position: fixed; z-index: 1300;
  background: var(--chip-bg);
  color: var(--ink); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: var(--shadow-card); padding: 4px;
  min-width: 240px; max-width: 320px; max-height: 360px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px; }
.audio-menu-groups { display: flex; flex-wrap: wrap; gap: 4px;
  padding: 4px 4px 6px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--chip-bg); z-index: 1; }
.audio-menu-group-chip { font-size: 11px; padding: 3px 8px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  cursor: pointer; line-height: 1.4; }
.audio-menu-group-chip:hover { background: rgba(0, 0, 0, .05); }
.audio-menu-group-chip.active { background: var(--ink); color: var(--paper);
  border-color: var(--ink); }
.audio-menu-list { display: flex; flex-direction: column; }
.audio-menu-item { padding: 6px 10px; font-size: 12px; cursor: pointer;
  border-radius: 4px; }
.audio-menu-item:hover { background: rgba(0, 0, 0, .05); }
.audio-menu-item.active { background: var(--ink); color: var(--paper); }

/* === 通用配乐控件 BgPlayer：外层 / 沉浸 / 诵读共用 === */
.bg-player-host { display: block; flex: 1; min-width: 0; }
.bg-player {
  display: flex; flex-direction: column; gap: 8px;
  width: 100%;
  font-family: inherit;
}
.bg-player .bgp-row {
  display: flex; align-items: center; gap: 8px;
  min-width: 0;
}
.bg-player .bgp-btn {
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  background: var(--chip-bg);
  color: var(--ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0; flex-shrink: 0;
  transition: background .15s, border-color .15s, transform .12s;
}
.bg-player .bgp-btn:hover { background: var(--chip-bg-hover); border-color: var(--accent); }
.bg-player .bgp-btn:active { transform: scale(.94); }
.bg-player .bgp-play {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
.bg-player .bgp-play:hover {
  background: color-mix(in srgb, var(--accent) 88%, #000);
  border-color: color-mix(in srgb, var(--accent) 88%, #000);
}
.bg-player .bgp-title {
  flex: 1; min-width: 0;
  font-size: 12px; color: var(--ink);
  letter-spacing: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bg-player .bgp-mute[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}
.bg-player .bgp-vol {
  flex: 1; min-width: 0;
  accent-color: var(--accent);
  height: 4px;
}
.bg-player .bgp-vol-val {
  font-size: 11px; color: var(--ink-soft);
  width: 38px; text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.bg-player .bgp-groups {
  display: flex; flex-wrap: wrap; gap: 4px;
}
.bg-player .bgp-groups[hidden] { display: none; }
.bg-player .bgp-chip {
  font-size: 11px; padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--chip-bg);
  color: var(--ink);
  cursor: pointer; font-family: inherit;
  letter-spacing: 1px;
  transition: background .15s, color .15s, border-color .15s;
}
.bg-player .bgp-chip:hover { background: var(--chip-bg-hover); border-color: var(--accent); }
.bg-player .bgp-chip.on {
  background: var(--accent); color: var(--paper); border-color: var(--accent);
}

/* 沉浸 popover：让 BgPlayer 占整行（label 在上方） */
.immerse-settings-row-bgplayer {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;
}
.immerse-settings-row-bgplayer .immerse-settings-label {
  flex: 0 0 auto !important;
}
/* 诵读 popover 同上 */
.rm-popover-row-bgplayer {
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 6px !important;
}
.rm-popover-row-bgplayer .rm-popover-label {
  width: auto !important;
}
/* audio-menu 顶部的 BgPlayer */
.audio-menu-bgplayer {
  padding: 8px 8px 10px;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0;
  background: var(--chip-bg);
  z-index: 1;
}

/* === 诗人轨迹线（颜色随主题 --accent） === */
.journey-line { transition: stroke .35s ease; }
.journey-line-dashed,
.journey-line-main { stroke: var(--accent) !important; }
.journey-line-halo  { stroke: #fffaf0 !important; }

/* === 自定义诗人轨迹圆点 === */
.poet-marker { background: transparent; border: none; }
.poet-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--paper);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.poet-step { position: relative; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--paper);
  color: var(--paper); font: 700 11px/16px "Noto Serif SC", serif; text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4); transition: opacity .25s, filter .25s; }
.poet-step.past { opacity: 1; }
.poet-step.future { opacity: 0.6; filter: grayscale(.25); }
.poet-step .poet-step-x, .poet-endpoint .poet-endpoint-x {
  position: absolute; right: -10px; top: -8px;
  min-width: 16px; height: 14px; padding: 0 3px;
  border-radius: 8px; background: #2a1810; color: #fff8e8;
  font: 700 10px/14px "Noto Sans SC", sans-serif; text-align: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4); pointer-events: none;
}
.poet-endpoint { position: relative; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--paper); background: var(--paper);
  font: 700 14px/24px "Ma Shan Zheng", "Noto Serif SC", serif; text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45); transition: opacity .25s, filter .25s; }
.poet-endpoint .poet-endpoint-x { right: -12px; top: -6px; }
.poet-endpoint.birth { background: var(--paper); border-width: 3px; }
.poet-endpoint.death { color: var(--paper); border-color: var(--paper); }
.poet-endpoint.death.past { opacity: 1; }
.poet-endpoint.death.future { opacity: 0.65; filter: grayscale(.2); }

/* === 空态 === */
.empty { padding: 24px 14px; text-align: center; color: var(--ink-soft);
  font-size: 13px; line-height: 1.6; }

/* ========== 移动端 / 窄屏 ========== */
@media (max-width: 768px) {
  html { -webkit-text-size-adjust: 100%; }
  body { -webkit-tap-highlight-color: transparent; }

  .loading-title { font-size: 36px; letter-spacing: 4px; }
  .loading-sub { font-size: 11px; padding: 0 12px; text-align: center; }

  .app-title-chrome {
    /* 上行：卷标 + 工具；下行：诗人横滑占满宽，不与工具抢宽 */
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 6px;
    row-gap: 2px;
    padding: max(6px, env(safe-area-inset-top, 0px))
      max(10px, env(safe-area-inset-right, 0px))
      0
      max(10px, env(safe-area-inset-left, 0px));
  }
  .title-bar {
    grid-column: 1;
    grid-row: 1;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    width: auto;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 0 4px 0;
  }
  .top-right-tools {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
  }
  .title-seal { font-size: 12px; }
  .title-text { min-width: 0; }
  .title-text h1 { font-size: 16px; letter-spacing: 1px; }
  .title-sub { font-size: 10px; }
  .poet-select {
    grid-column: 1 / -1;
    grid-row: 2;
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    align-items: center;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0 6px;
    gap: 6px;
  }
  .poet-select::-webkit-scrollbar { display: none; height: 0; }
  .poet-chip { flex-shrink: 0; padding: 6px 10px; font-size: clamp(12.5px, 0.2rem + 2.05vw, 15px); }

  /* 地图：顶缘只躲开固定顶栏；样式条/配乐浮在地图之上（与 PC 一致），避免 inset 再下移露出一块 body 底色 */
  #map {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    inset: var(--header-bar-height, 132px) 0 calc(128px + env(safe-area-inset-bottom, 0px)) 0;
  }
  body.timeline-collapsed #map {
    inset: var(--header-bar-height, 132px) 0
      calc(56px + env(safe-area-inset-bottom, 0px)) 0 !important;
  }

  /* 左栏：上缘对齐地图顶（样式条与配乐之下），下缘在时间轴之上，占满中间地图带（减少展开时上方留白）；折叠时竖条加高，peek 在条内垂直居中 */
  .left-panel {
    left: 8px;
    right: 8px;
    width: auto;
    top: calc(
      var(--header-bar-height, 132px) + 8px + var(--map-style-bar-height, 44px) + 10px
    );
    bottom: calc(168px + env(safe-area-inset-bottom, 0px));
    max-height: none;
    border-radius: 10px;
    z-index: 810;
  }
  body.timeline-collapsed .left-panel {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  /* 收起：在地图带内垂直居中（移动） */
  .left-panel.is-collapsed {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    left: 8px !important;
    right: auto !important;
    top: calc(
      var(--header-bar-height, 132px) + 8px + var(--map-style-bar-height, 44px) + 10px
    ) !important;
    bottom: calc(168px + env(safe-area-inset-bottom, 0px)) !important;
    height: max-content !important;
    min-height: 0 !important;
    max-height: none !important;
    margin-top: auto !important;
    margin-bottom: auto !important;
    justify-content: center;
  }
  body.timeline-collapsed .left-panel.is-collapsed {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* 地点详情：底栏居中卡片 —— 整张卡作为单一滚动容器，行迹/作品按内容展开 */
  .right-panel {
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    width: min(calc(100vw - 24px), 400px);
    max-width: min(calc(100vw - 24px), 400px);
    top: auto;
    bottom: calc(168px + env(safe-area-inset-bottom, 0px));
    height: min(58vh, 460px);
    max-height: min(58vh, 460px);
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: 920;
    border-radius: 12px;
    box-shadow: 0 -6px 28px rgba(0, 0, 0, .14);
  }
  body.timeline-collapsed .right-panel {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
  .right-panel .panel-head {
    flex-shrink: 0;
    position: sticky; top: 0; z-index: 1;
    background: linear-gradient(180deg,
      color-mix(in srgb, var(--panel-bg-1) calc(var(--ui-surface-mix, 1) * 100%), transparent),
      color-mix(in srgb, var(--panel-bg-2) calc(var(--ui-surface-mix, 1) * 100%), transparent));
    backdrop-filter: blur(8px);
  }
  .right-panel .place-journey {
    flex: 0 0 auto;
    max-height: none;
    overflow: visible;
  }
  .right-panel .works-list {
    flex: 0 0 auto;
    overflow: visible;
  }

  /* 顶栏配乐：紧凑，避免与诗人横滑抢宽 */
  .map-chrome--header .player {
    transition: width 0.22s ease, box-shadow 0.2s ease, padding 0.2s ease;
  }
  .map-chrome--header .player:not(.is-collapsed) {
    width: fit-content !important;
    max-width: min(168px, 40vw) !important;
    justify-content: flex-end;
  }
  .map-chrome--header .player.is-collapsed {
    width: auto !important;
    max-width: min(128px, 34vw) !important;
  }
  body.map-fullscreen #map {
    inset: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
  }

  .timeline {
    left: max(6px, env(safe-area-inset-left, 0px));
    right: max(6px, env(safe-area-inset-right, 0px));
    bottom: max(6px, env(safe-area-inset-bottom, 0px));
    padding: 28px 8px 8px 8px;
  }
  /* 移动端：保持原两行的布局（上行控制+年份+收，下行轨道） */
  .timeline-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 10px;
    align-items: center;
  }
  .timeline-actions {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    gap: 10px;
  }
  .timeline-tail {
    grid-column: 2;
    grid-row: 1;
    gap: 6px;
  }
  .timeline-tail .time-year {
    font-size: 18px;
  }
  .time-body {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }
  .speed-toggle { min-height: 40px; padding: 0 12px; }
  .play-btn,
  .immersive-btn { min-width: 40px; min-height: 40px; }

  .audio-menu {
    inset: 55px max(8px, env(safe-area-inset-right, 0px)) auto auto;
    max-height: min(50vh, 280px);
    min-width: min(260px, calc(100vw - 24px));
    z-index: 1300;
    background: var(--paper);
    border-color: var(--line);
  }
  .audio-menu .audio-menu-groups,
  .audio-menu .audio-menu-bgplayer {
    background: var(--paper);
  }

  .bio-overlay,
  .scroll-overlay {
    inset: 0;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
      env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  }
  .bio-card { width: min(100%, 96vw); max-height: 85vh; padding: 16px 18px; }

  .immerse-settings-popover {
    left: max(10px, env(safe-area-inset-left, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    width: auto;
  }

  /* 沉浸层铺满视口，避免横向漏图 */
  .immerse-stage {
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
  }
  .immerse-curtain {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
  }

  /* 沉浸 dock：底部平铺 */
  .immerse-dock {
    left: 12px !important;
    right: 12px !important;
    bottom: max(10px, env(safe-area-inset-bottom, 0px)) !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
  }

  .immerse-schemes-shell {
    width: 100%;
  }

  .immerse-schemes {
    position: relative;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 auto;
    display: block;
    padding: 8px 10px;
    gap: 0;
    overflow: visible;
    scrollbar-width: none;
    border-radius: 14px;
    z-index: 12;
  }
  .immerse-schemes-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    flex: none;
    min-height: 0;
    max-height: none;
    padding: 0;
    overflow: visible;
    touch-action: manipulation;
    scroll-snap-type: none;
    scrollbar-width: none;
  }
  .immerse-schemes-track::-webkit-scrollbar { display: none; width: 0; }
  .immerse-schemes::-webkit-scrollbar { display: none; width: 0; }
  .immerse-schemes::before { display: none; }
  .immerse-schemes button {
    position: relative;
    z-index: 1;
    flex: none;
    height: 36px;
    min-height: 36px;
    scroll-snap-align: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0 4px;
    margin: 0;
    font-size: 15px;
    line-height: 1;
    font-weight: 500;
    font-family: "Noto Serif SC", "PingFang SC", sans-serif;
    border-radius: 8px;
  }
  .immerse-schemes button b { display: none; }
  .immerse-schemes button.on {
    font-weight: 600;
    font-size: 15px;
  }

  /* 横排诗轨 --fvh-fs* 由 JS 按屏宽与 immerseFontMul 设置 */
  .fvh-line { letter-spacing: 5px; }
  .fv-meta,
  .ff-meta,
  .bv-meta,
  .dv-meta,
  .bz-meta,
  .zv-meta { font-size: 11px !important; }

  .leaflet-control-zoom { margin-top: max(8px, env(safe-area-inset-top, 0px)) !important; }
}

/* 375–420：顶栏一行塞下卷切换+配乐；与 max-width:768 分离以兼容旧版解析器 */
@media (max-width: 420px) {
  .app-title-chrome {
    column-gap: 4px;
    padding: max(5px, env(safe-area-inset-top, 0px))
      max(6px, env(safe-area-inset-right, 0px))
      0
      max(6px, env(safe-area-inset-left, 0px));
  }
  .title-bar {
    gap: 4px;
    padding-bottom: 2px;
  }
  .title-seal {
    font-size: 10px;
    padding: 2px;
  }
  .title-seal--duo {
    font-size: 15px;
    padding: 2px;
  }
  .dataset-switch {
    flex-shrink: 1;
    min-width: 0;
    border-radius: 8px;
  }
  .dataset-switch button {
    padding: 2px 5px;
    font-size: clamp(12px, 2.9vw, 14px);
    letter-spacing: 0;
  }
  .top-right-tools {
    gap: 3px;
  }
  .top-right-tools .theme-picker,
  .top-right-tools .theme-picker-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
  }
  .top-right-tools .settings-tool,
  .top-right-tools .settings-btn {
    width: 32px;
    height: 32px;
  }
  .map-chrome--header .player {
    gap: 3px !important;
    padding: 4px 4px !important;
    border-radius: 10px;
  }
  .map-chrome--header .player:not(.is-collapsed) {
    max-width: min(124px, 32vw) !important;
  }
  .map-chrome--header .player.is-collapsed {
    max-width: min(100px, 28vw) !important;
  }
  .map-chrome--header .player .player-btn,
  .map-chrome--header .player .player-fs-btn {
    width: 28px;
    height: 28px;
  }
  .map-chrome--header .player .fold-btn {
    min-width: 24px;
    min-height: 28px;
    padding: 0 3px;
    font-size: clamp(11.5px, 3.1vw, 14px);
  }
  .map-chrome--header .player:not(.is-collapsed) .player-title-clip {
    max-width: 3.2em;
  }
  .poet-chip {
    padding: 5px 8px;
    font-size: clamp(12px, 2.85vw, 14px);
  }
}

@media (max-width: 768px) {
  .scroll-paper { padding: 16px 12px; max-height: 88vh; }
  .scroll-title { font-size: 16px; letter-spacing: 4px; }
  .scroll-line { font-size: 14px; letter-spacing: 2px; line-height: 1.6; }
  .scroll-meta { font-size: 11px; letter-spacing: 2px; }
  .scroll-meta .seal { font-size: 12px; padding: 3px 5px; }
}

/* === 全局氛围特效层（覆盖整个界面：粒子/诗句飘过白色面板亦可见） === */
.global-fx {
  position: fixed; inset: 0; z-index: 850;
  pointer-events: none; overflow: hidden;
  opacity: 0; transition: opacity 1s ease-out;
  mix-blend-mode: multiply; /* 与下方 UI 融合：白底面板上粒子可见，文字依然清晰 */
}
.global-fx.ready { opacity: 1; }
body.map-fullscreen .global-fx,
body.immerse-open .global-fx { display: none !important; }

/* —— 共用粒子（轻、慢、半透明） —— */
.gfx-petal, .gfx-leaf, .gfx-glyph, .gfx-mote, .gfx-firefly, .gfx-cloud, .gfx-mist-band {
  position: absolute; pointer-events: none; user-select: none;
}

/* 樱花瓣（樱雪主题） */
.gfx-petal {
  top: -8vh; width: 14px; height: 14px;
  background: radial-gradient(ellipse at 30% 30%, #ffe1e7 0%, #f0a8b3 70%, transparent 95%);
  border-radius: 60% 30% 60% 30%;
  filter: drop-shadow(0 1px 2px rgba(180, 100, 110, .15));
  opacity: .85;
  animation: gfx-petal-drift linear infinite;
}

/* 竹叶 / 苔叶（抹茶 / 青藤主题） —— 用 SVG 形态字符 */
.gfx-leaf {
  top: -6vh; width: 18px; height: 8px;
  background: linear-gradient(110deg, var(--leaf-c, #a8c89a) 0%, var(--leaf-c, #a8c89a) 50%, transparent 100%);
  border-radius: 50% 0 50% 0;
  transform-origin: center;
  opacity: .65;
  animation: gfx-leaf-fall linear infinite;
}

/* 草书字（极简底纹，所有主题通用） */
.gfx-glyph {
  top: -6vh; font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  color: color-mix(in srgb, var(--accent) 65%, var(--ink-soft));
  font-weight: 700; letter-spacing: 2px;
  opacity: .55;
  text-shadow: 0 1px 6px color-mix(in srgb, var(--accent) 30%, transparent);
  animation: gfx-glyph-drift linear infinite;
}

/* 阳光尘埃 / 萤火（蜜橘 / 杏花主题） */
.gfx-mote {
  width: 3px; height: 3px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 80%, white) 0%, transparent 70%);
  box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 50%, transparent);
  opacity: .7;
  animation: gfx-mote-float linear infinite;
}
.gfx-firefly {
  width: 4px; height: 4px; border-radius: 50%;
  background: radial-gradient(circle, #ffe089 0%, #ffae3a 70%, transparent 100%);
  box-shadow: 0 0 10px rgba(255, 174, 58, .65);
  animation: gfx-firefly-blink var(--d, 3.2s) ease-in-out infinite;
}

/* 云絮（蓝染 / 烟雨） */
.gfx-cloud {
  height: 80px; width: 240px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, .72) 0%, transparent 70%);
  filter: blur(10px); opacity: .55;
  animation: gfx-cloud-drift linear infinite;
}

/* 雾带（江南 / 烟雨） */
.gfx-mist-band {
  left: -40%; right: -40%; height: 80px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 35%, white) 40%, color-mix(in srgb, var(--accent) 25%, white) 60%, transparent);
  filter: blur(12px); opacity: .35;
  animation: gfx-mist-drift linear infinite;
}

/* —— 大型装饰：晕染光斑、光柱、远山、巨日 —— */
.gfx-orb {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 50% 50%,
    color-mix(in srgb, var(--accent) 32%, white) 0%,
    color-mix(in srgb, var(--accent) 14%, white) 35%,
    transparent 75%);
  filter: blur(2px); opacity: .85;
  animation: gfx-orb-breathe 9s ease-in-out infinite alternate;
}
.gfx-sunray {
  position: absolute; pointer-events: none; transform-origin: top right;
  width: 80vw; height: 70vh; top: -10vh; right: -10vw;
  background: linear-gradient(220deg,
    color-mix(in srgb, var(--accent) 18%, transparent) 0%,
    transparent 55%);
  opacity: .6; mix-blend-mode: multiply;
}
.gfx-mountains {
  position: absolute; bottom: 0; left: 0; right: 0; height: 26vh;
  pointer-events: none; opacity: .55;
  background:
    radial-gradient(ellipse 32vw 18vh at 18% 100%, color-mix(in srgb, var(--accent) 22%, var(--ink)) 0%, transparent 70%),
    radial-gradient(ellipse 42vw 22vh at 55% 100%, color-mix(in srgb, var(--accent) 18%, var(--ink)) 0%, transparent 70%),
    radial-gradient(ellipse 30vw 16vh at 88% 100%, color-mix(in srgb, var(--accent) 22%, var(--ink)) 0%, transparent 70%);
  filter: blur(.5px);
}

/* —— 关键帧（轻、慢、自然） —— */
@keyframes gfx-petal-drift {
  0%   { transform: translate(0, -8vh) rotate(0); opacity: 0; }
  8%   { opacity: .85; }
  100% { transform: translate(var(--sx, 12vw), 112vh) rotate(540deg); opacity: 0; }
}
@keyframes gfx-leaf-fall {
  0%   { transform: translate(0, -6vh) rotate(-30deg); opacity: 0; }
  10%  { opacity: .65; }
  50%  { transform: translate(calc(var(--sx, 8vw) * .6), 50vh) rotate(160deg); }
  100% { transform: translate(var(--sx, 8vw), 110vh) rotate(380deg); opacity: 0; }
}
@keyframes gfx-glyph-drift {
  0%   { transform: translate(0, -6vh) rotate(-4deg); opacity: 0; }
  15%  { opacity: var(--gfx-glyph-op, .55); }
  85%  { opacity: var(--gfx-glyph-op, .55); }
  100% { transform: translate(var(--sx, 0), 112vh) rotate(8deg); opacity: 0; }
}
@keyframes gfx-mote-float {
  0%   { transform: translate(0, 0); opacity: 0; }
  20%  { opacity: .7; }
  50%  { transform: translate(calc(var(--sx, 6vw) * .5), -20vh); }
  100% { transform: translate(var(--sx, 6vw), -50vh); opacity: 0; }
}
@keyframes gfx-firefly-blink {
  0%, 100% { opacity: 0; transform: translate(0, 0) scale(.7); }
  20%      { opacity: .9; transform: translate(calc(var(--sx, 0) * .2), calc(var(--sy, 0) * .2)) scale(1); }
  60%      { opacity: .7; transform: translate(calc(var(--sx, 0) * .6), calc(var(--sy, 0) * .6)) scale(1.2); }
  85%      { opacity: .3; transform: translate(var(--sx, 0), var(--sy, 0)) scale(.9); }
}
@keyframes gfx-cloud-drift {
  from { transform: translateX(-30vw); }
  to   { transform: translateX(120vw); }
}
@keyframes gfx-mist-drift {
  from { transform: translateX(0); }
  to   { transform: translateX(35%); }
}
@keyframes gfx-orb-breathe {
  from { opacity: .55; transform: scale(.95); }
  to   { opacity: .9;  transform: scale(1.06); }
}

/* —— 主题专属变量（叶色等） —— */
body[data-theme="matcha"] .global-fx { --leaf-c: #a8c89a; }
body[data-theme="sage"]   .global-fx { --leaf-c: #b9caa6; }

/* 第二颗光斑稍微换个动作节奏 */
.gfx-orb-2 { animation: gfx-orb-breathe 12s ease-in-out infinite alternate-reverse; }

/* —— 雨滴（烟雨主题） —— */
.gfx-rain {
  position: absolute; pointer-events: none;
  top: -8vh; width: 1.4px; height: 36px;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--accent) 55%, transparent));
  transform-origin: top;
  animation: gfx-rain-fall linear infinite;
}
@keyframes gfx-rain-fall {
  0%   { transform: translateY(-10vh) skewX(-12deg); opacity: 0; }
  10%  { opacity: .55; }
  100% { transform: translateY(115vh) skewX(-12deg); opacity: 0; }
}

/* —— 漂过的诗句横幅 —— */
.gfx-verse {
  position: absolute;
  white-space: nowrap;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-size: clamp(28px, 4.6vw, 64px);
  letter-spacing: .4em;
  color: color-mix(in srgb, var(--accent) 55%, var(--ink));
  opacity: 0;
  text-shadow: 0 2px 24px color-mix(in srgb, var(--accent) 35%, transparent);
  pointer-events: none;
  left: 100vw;
  animation: gfx-verse-cross linear infinite;
  font-weight: 600;
}
@keyframes gfx-verse-cross {
  0%   { transform: translateX(0); opacity: 0; }
  10%  { opacity: .22; }
  50%  { opacity: .32; }
  90%  { opacity: .22; }
  100% { transform: translateX(-220vw); opacity: 0; }
}

/* —— 主题切换涟漪 —— */
.theme-ripple {
  position: fixed; inset: -10vmax;
  pointer-events: none; z-index: 1500;
  opacity: 0;
  transform: scale(.2);
  filter: blur(40px);
  transition: opacity .9s ease-out, transform .9s ease-out;
  mix-blend-mode: multiply;
}
.theme-ripple.on { opacity: .55; transform: scale(1.4); }

/* —— global-fx 视差容器需要 transform —— */
.global-fx { transition: opacity 1s ease-out, transform .35s ease-out; will-change: transform; }
/* 弹层、卷读浮层、菜单等出现时让粒子让路（避免遮挡阅读） */
body.scroll-open .global-fx,
body.bio-open .global-fx { opacity: .35 !important; }

/* —— 首屏进场动画 —— */
@keyframes panel-in-left {
  from { opacity: 0; transform: translateX(-24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes panel-in-right {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes panel-in-top {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes panel-in-bottom {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes panel-in-fade {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes map-top-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.app-title-chrome { animation: panel-in-top    .6s cubic-bezier(.2,.8,.3,1.1) .1s both; }
.left-panel    { animation: panel-in-left   .7s cubic-bezier(.2,.8,.3,1.1) .25s both; }
.right-panel   { animation: panel-in-right  .7s cubic-bezier(.2,.8,.3,1.1) .35s both; }
.timeline      { animation: panel-in-bottom .7s cubic-bezier(.2,.8,.3,1.1) .45s both; }
.map-top-row   { animation: map-top-fade-in .55s cubic-bezier(.2,.8,.3,1.1) .5s both; }
.theme-picker  { animation: panel-in-fade   .5s cubic-bezier(.2,.8,.3,1.1) .65s both; }
.title-seal    { animation: title-seal-glow 4.2s ease-in-out infinite alternate,
                            panel-in-fade .6s cubic-bezier(.2,.8,.3,1.1) .15s both; }

/* —— 工作列表条目入场：从 0 高度撑开，下方条目随之自然下沉 —— */
@keyframes work-item-in {
  from {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-color: transparent;
  }
  to {
    opacity: 1;
    max-height: 240px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
}
.work-item {
  animation: work-item-in .55s cubic-bezier(.22,.7,.2,1) backwards;
  animation-delay: calc(var(--i, 0) * 30ms);
}
.work-item.fresh {
  animation:
    work-item-in .55s cubic-bezier(.22,.7,.2,1) backwards,
    work-fresh-flash 1.4s ease-out both;
}

/* 平滑主题过渡 */
body, .left-panel, .right-panel, .timeline, .map-top-row, .player, .app-title-chrome, .title-bar,
.scroll-paper, .bio-card, .seg, .map-fs-btn, .player-fs-btn, .audio-menu, .leaflet-tooltip,
.leaflet-control-zoom a {
  transition: background-color .55s ease, background .55s ease,
              color .55s ease, border-color .55s ease;
}

/* 标题印章主题流光 */
.title-seal {
  position: relative; overflow: hidden;
  animation: title-seal-glow 4.2s ease-in-out infinite alternate;
}
.title-seal::before {
  content: ''; position: absolute; inset: -50%;
  background: linear-gradient(60deg, transparent 35%, rgba(255, 255, 255, .4) 50%, transparent 65%);
  transform: translateX(-100%); pointer-events: none;
  animation: title-seal-shimmer 5.5s ease-in-out infinite;
}
@keyframes title-seal-glow {
  from { box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent), 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
         transform: scale(1); }
  to   { box-shadow: 0 4px 22px color-mix(in srgb, var(--accent) 70%, transparent), 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent);
         transform: scale(1.03); }
}
@keyframes title-seal-shimmer {
  0%       { transform: translateX(-100%); }
  60%      { transform: translateX(100%); }
  100%     { transform: translateX(100%); }
}

/* —— 地图标记柔和呼吸（让 Leaflet marker 不再死板） —— */
.leaflet-marker-icon {
  transition: transform .25s ease, filter .25s ease;
}
.leaflet-marker-icon:hover {
  transform: scale(1.18);
  filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--accent) 55%, transparent));
}

/* —— 当前游标对应的诗人主标记可加 .pulse，呼吸光晕 —— */
@keyframes marker-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); }
  70%  { box-shadow: 0 0 0 14px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}

@media (max-width: 768px) {
  .global-fx { opacity: .85; }
  .gfx-mountains { height: 22vh; }
  .gfx-verse { font-size: clamp(22px, 5vw, 40px); letter-spacing: .3em; }
}

/* === 配乐 + 主题 + 设置（顶栏内文档流，与诗人区 Grid 并排/分行） === */
.top-right-tools {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  pointer-events: none; /* 子项各自吃事件，背景空区不挡操作 */
}
.top-right-tools > * {
  pointer-events: auto;
  flex-shrink: 0;
  flex-grow: 0;
}
.top-right-tools .theme-picker {
  width: 34px; height: 34px;
}
.top-right-tools .theme-picker-btn {
  min-width: 34px; min-height: 34px;
}
@media (max-width: 768px) {
  .top-right-tools {
    gap: 4px;
  }
  .top-right-tools .map-chrome--header {
    min-width: 0;
    flex: 0 1 auto;
  }
  .top-right-tools .theme-picker { width: 34px; height: 34px; flex: 0 0 auto; }
  .top-right-tools .theme-picker-btn { min-width: 34px; min-height: 34px; }
}

.theme-picker { position: relative; flex-shrink: 0; }
.theme-picker-btn {
  width: 38px; height: 38px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--chip-bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 50%;
  cursor: pointer;
  transition: background .18s ease, transform .12s ease, box-shadow .18s ease;
  box-shadow: var(--shadow-card);
}
.theme-picker-btn:hover { background: var(--chip-bg-hover); transform: rotate(-12deg) scale(1.06); }
.theme-picker-btn:active { transform: scale(.95); }
.theme-picker-btn-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .85),
    0 0 0 1px var(--line),
    0 0 12px color-mix(in srgb, var(--accent) 45%, transparent);
  transition: background .35s ease;
}
.theme-picker-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 1100;
  min-width: 188px; padding: 8px;
  background: var(--panel-bg-1); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(14px); display: flex; flex-direction: column; gap: 2px;
  animation: theme-pop .22s cubic-bezier(.2, .8, .3, 1.1);
}
@keyframes theme-pop {
  from { opacity: 0; transform: translateY(-6px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.theme-picker-menu[hidden] { display: none; }
.theme-picker-item {
  appearance: none; border: none; background: transparent;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px; cursor: pointer;
  font-family: "Noto Serif SC", serif; font-size: 13.5px;
  color: var(--ink); text-align: left; letter-spacing: 2px;
  transition: background .15s ease, transform .12s ease;
}
.theme-picker-item:hover { background: var(--chip-bg-hover); transform: translateX(2px); }
.theme-picker-item.on {
  background: color-mix(in srgb, var(--accent) 15%, var(--paper));
  color: var(--ink); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.theme-picker-swatch {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .8),
    0 0 0 1px rgba(0, 0, 0, .1);
}

/* 主题菜单分区标题 */
.theme-picker-section {
  font-size: 11px; letter-spacing: 3px; color: var(--ink-soft);
  padding: 6px 12px 4px; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
}
.ink-cur-name {
  font-size: 11px; color: var(--accent); letter-spacing: 1px;
}
.theme-picker-divider {
  height: 1px; margin: 4px 8px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* 墨色：圆点排成两行 */
.ink-picker-row {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 6px; padding: 4px 10px 8px;
}
.ink-picker-item {
  appearance: none; border: none; background: transparent;
  padding: 0; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center;
  transition: transform .12s ease;
}
.ink-picker-item:hover { transform: scale(1.18); }
.ink-picker-swatch {
  width: 18px; height: 18px; border-radius: 50%;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .85),
    0 0 0 1px rgba(0, 0, 0, .15);
}
.ink-picker-item.on .ink-picker-swatch {
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, .85),
    0 0 0 2px var(--accent),
    0 0 6px color-mix(in srgb, var(--accent) 50%, transparent);
}

@media (max-width: 768px) {
  .title-bar { gap: 6px; }
  .theme-picker-btn { width: 34px; height: 34px; }
  .theme-picker-btn-dot { width: 16px; height: 16px; }
  .map-style-bar { gap: 6px; }
  .map-style-bar .seg button,
  .map-style-bar .pure-toggle {
    padding: 5px 9px;
    font-size: 11px;
  }
  /* 窄屏：由 layoutThemePickerMenu 写 fixed + left:10 + width:clientWidth-20 + 顶栏下 max-height≤480 */
  .theme-picker-menu {
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    z-index: 1400;
    animation: none;
  }
}

/* === 设置面板 === */
.top-right-tools .settings-tool { width: 34px; height: 34px; }
.top-right-tools .settings-btn { width: 34px; height: 34px; }
.settings-tool { position: relative; flex-shrink: 0; }
.settings-btn {
  width: 38px; height: 38px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--chip-bg); color: var(--ink);
  border: 1px solid var(--line); border-radius: 50%;
  cursor: pointer;
  transition: background .18s ease, transform .25s ease, box-shadow .18s ease;
  box-shadow: var(--shadow-card);
}
.settings-btn:hover { background: var(--chip-bg-hover); transform: rotate(45deg); }
.settings-btn:active { transform: scale(.95); }
.settings-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 1100;
  width: 280px; padding: 10px;
  background: var(--panel-bg-1); color: var(--ink);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(14px);
  display: flex; flex-direction: column; gap: 4px;
  animation: theme-pop .22s cubic-bezier(.2, .8, .3, 1.1);
}
.settings-menu[hidden] { display: none; }
.settings-section {
  font-size: 11px; letter-spacing: 3px; color: var(--ink-soft);
  padding: 6px 10px 4px; user-select: none;
}
.settings-divider {
  height: 1px; margin: 4px 8px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}
.settings-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  transition: background .15s ease;
}
.settings-row:hover { background: var(--chip-bg-hover); }
.settings-row-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.settings-row-title { font-size: 13.5px; color: var(--ink); letter-spacing: 1px; }
.settings-row-desc { font-size: 11px; color: var(--ink-soft); letter-spacing: .5px; }
.settings-switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; }
.settings-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.settings-switch-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--ink-soft) 30%, transparent);
  transition: background .2s ease;
}
.settings-switch-track::after {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s ease;
}
.settings-switch input:checked ~ .settings-switch-track { background: var(--accent); }
.settings-switch input:checked ~ .settings-switch-track::after { transform: translateX(16px); }
/* 账号（手机号）输入与显示 */
.settings-account { padding: 4px 4px 2px; display: flex; flex-direction: column; gap: 6px; }
.settings-account-form { display: flex; gap: 8px; padding: 0 6px; }
.settings-account-form input {
  flex: 1; min-width: 0; padding: 7px 10px;
  font-family: "Noto Serif SC", serif; font-size: 14px;
  color: var(--ink); background: var(--chip-bg);
  border: 1px solid var(--line); border-radius: 8px;
  letter-spacing: 1px; outline: none;
  transition: border-color .15s ease, background .15s ease;
}
.settings-account-form input:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  background: var(--chip-bg-hover);
}
.settings-account-form button {
  appearance: none; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent) 14%, var(--paper));
  color: var(--accent); cursor: pointer;
  padding: 0 14px; border-radius: 8px;
  font-family: "Noto Serif SC", serif; font-size: 13.5px; letter-spacing: 1px;
  transition: background .15s ease, transform .12s ease;
}
.settings-account-form button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--accent) 22%, var(--paper));
}
.settings-account-form button:disabled { opacity: .55; cursor: default; }
.settings-account-tip {
  padding: 0 8px; font-size: 11px; color: var(--ink-soft);
  letter-spacing: .5px; line-height: 1.5;
}
.settings-account-current {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, var(--chip-bg));
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
}
.settings-account-icon {
  width: 28px; height: 28px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 22%, var(--paper));
  color: var(--accent);
  font-family: "Ma Shan Zheng", serif; font-size: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.settings-account-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.settings-account-title { font-size: 13.5px; letter-spacing: 1px; color: var(--ink); }
.settings-account-desc { font-size: 11px; color: var(--ink-soft); letter-spacing: .5px; }
.settings-account-change {
  appearance: none; border: 1px solid var(--line);
  background: var(--chip-bg); color: var(--ink-soft);
  padding: 4px 10px; border-radius: 8px; cursor: pointer;
  font-family: "Noto Serif SC", serif; font-size: 12px; letter-spacing: 1px;
  transition: background .15s ease, color .15s ease;
}
.settings-account-change:hover { background: var(--chip-bg-hover); color: var(--ink); }

/* "已记习惯" 入口（位于设置菜单内） */
.settings-habits-link {
  appearance: none; border: 1px solid var(--line);
  background: var(--chip-bg); color: var(--ink);
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 12px; border-radius: 10px; cursor: pointer;
  font-family: "Noto Serif SC", serif; text-align: left;
  transition: background .15s ease, transform .12s ease;
}
.settings-habits-link:hover { background: var(--chip-bg-hover); transform: translateX(2px); }
.settings-habits-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.settings-habits-title { font-size: 13.5px; letter-spacing: 1px; color: var(--ink); }
.settings-habits-desc  { font-size: 11px; color: var(--ink-soft); letter-spacing: .5px; }
.settings-habits-desc b { color: var(--accent); font-weight: 600; }
.settings-habits-chev  { font-size: 18px; color: var(--ink-soft); flex-shrink: 0; line-height: 1; }
.settings-app { display: flex; flex-direction: column; gap: 4px; margin-bottom: 2px; }
.settings-app-version {
  padding: 10px 12px 2px;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: .5px;
}
.settings-app-download { margin-top: 8px; }
.settings-app-download .settings-habits-title { color: var(--accent); }

/* 设置页社交入口（用户群 / 小红书） */
.settings-social { display: flex; gap: 18px; padding: 10px 12px 4px; }
.settings-social-btn {
  appearance: none; border: none; background: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; font-family: "Noto Serif SC", serif;
}
.settings-social-icon {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.12);
  transition: transform .12s ease, opacity .15s ease;
}
.settings-social-btn:active .settings-social-icon { transform: scale(.94); opacity: .85; }
.settings-social-wechat { background: rgba(7,193,96,.4); }
.settings-social-xhs { background: rgba(255,36,66,.4); }
.settings-social-label { font-size: 11px; color: var(--ink-soft); letter-spacing: .5px; }

/* "已记习惯" 浮窗 */
.habits-overlay {
  position: fixed; inset: 0; z-index: 1600;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 12, 6, .32); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .22s ease;
  padding: 24px;
}
.habits-overlay[hidden] { display: none; }
.habits-overlay.open { opacity: 1; }
.habits-card {
  position: relative;
  width: min(560px, 94vw); max-height: 84vh;
  background: var(--bio-card-bg);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .35);
  padding: 22px 26px 18px;
  display: flex; flex-direction: column; gap: 12px;
  font-family: "Noto Serif SC", serif; color: var(--ink);
  transform: translateY(8px) scale(.985);
  transition: transform .25s cubic-bezier(.2, .6, .3, 1);
}
.habits-overlay.open .habits-card { transform: translateY(0) scale(1); }
.habits-head { padding-right: 32px; }
.habits-title {
  font-family: "Ma Shan Zheng", serif; font-size: 22px; letter-spacing: 4px;
  color: var(--ink);
}
.habits-sub { margin-top: 4px; font-size: 12px; color: var(--ink-soft); letter-spacing: .5px; }
.habits-body {
  flex: 1; overflow-y: auto; padding: 4px 2px 4px;
  display: flex; flex-direction: column; gap: 14px;
}
.habit-group {
  display: flex; flex-direction: column; gap: 2px;
  padding: 8px 10px; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 4%, var(--chip-bg));
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--line));
}
.habit-group-title {
  font-size: 11px; letter-spacing: 3px; color: var(--ink-soft);
  padding: 2px 0 6px;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 18%, transparent);
  margin-bottom: 4px;
}
.habit-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 5px 2px;
  font-size: 13px; line-height: 1.5;
}
.habit-row + .habit-row { border-top: 1px dotted color-mix(in srgb, var(--ink-soft) 18%, transparent); }
.habit-label { color: var(--ink-soft); letter-spacing: 1px; flex-shrink: 0; }
.habit-value {
  font-family: "Ma Shan Zheng", serif; letter-spacing: 1px;
  text-align: right; color: var(--ink);
  word-break: break-all;
}
.habit-row.is-saved .habit-value { color: var(--accent); }
.habit-row.is-default .habit-value { color: var(--ink-soft); opacity: .85; }
@media (max-width: 768px) {
  .habits-overlay { padding: 12px; }
  .habits-card { padding: 18px 18px 14px; max-height: 88vh; }
  .habits-title { font-size: 19px; }
  .habit-row { font-size: 12.5px; }
}

@media (max-width: 768px) {
  .top-right-tools .settings-tool { width: 34px; height: 34px; }
  .settings-btn { width: 34px; height: 34px; }
  .settings-menu { width: min(320px, calc(100vw - 24px)); }
}

/* ===== journey v2 富 tooltip ===== */
.leaflet-tooltip.journey-tip-wrap {
  background: rgba(255,251,243,.97);
  color: #2a1810;
  border: 1px solid rgba(160,80,48,.45);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.55;
  max-width: min(420px, calc(100vw - 32px));
  white-space: normal;
  box-shadow: 0 4px 14px rgba(40,20,10,.18);
}
.leaflet-tooltip.journey-tip-wrap::before { display: none; }
.journey-tip .t-h { font-size: 13px; margin-bottom: 4px; }
.journey-tip .t-h b { color: #7a2f1c; }
.journey-tip .t-y { color: #7a5a3a; margin-left: 6px; font-weight: normal; }
.journey-tip .t-tag {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  font-size: 11px; background: #a05030; color: #fff; border-radius: 8px;
}
.journey-tip .t-reason { color: #2a1810; margin: 2px 0; }
.journey-tip .t-note { color: #6a4a30; font-size: 11.5px; margin: 2px 0; }
.journey-tip .t-works {
  list-style: none; padding: 0; margin: 4px 0 0;
  border-top: 1px dashed rgba(160,80,48,.3); padding-top: 4px;
}
.journey-tip .t-works li { color: #4a2810; font-size: 11.5px; }
.journey-tip .t-count {
  margin-left: 8px; padding: 1px 6px; border-radius: 8px;
  background: #2a1810; color: #fff8e8; font: 600 10.5px/1.5 "Noto Sans SC", sans-serif;
}
.journey-tip.multi { width: min(400px, calc(100vw - 40px)); max-height: min(60vh, 440px); overflow-y: auto; }
.journey-tip.multi .t-visit {
  display: grid; grid-template-columns: 22px 1fr; column-gap: 8px;
  padding: 6px 0; border-top: 1px dashed rgba(80, 50, 30, .25);
}
.journey-tip.multi .t-visit:first-of-type { border-top: none; padding-top: 2px; }
.journey-tip .t-vh {
  display: flex; gap: 6px; align-items: center; margin-bottom: 2px;
  grid-column: 2;
}
.journey-tip.multi .t-visit .t-reason,
.journey-tip.multi .t-visit .t-note,
.journey-tip.multi .t-visit .t-works { grid-column: 2; }
.journey-tip .t-step {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); color: var(--paper);
  border: 2px solid var(--paper); box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  font: 700 11px/16px "Noto Serif SC", serif; text-align: center;
  grid-column: 1; grid-row: 1; margin-top: 1px;
}
@media (max-width: 768px) {
  .leaflet-tooltip.journey-tip-wrap {
    max-width: min(320px, calc(100vw - 32px));
    padding: 6px 8px; font-size: 11.5px;
  }
  .journey-tip.multi { width: min(300px, calc(100vw - 48px)); max-height: 48vh; }
  .journey-tip .t-h { font-size: 12.5px; }
  .journey-tip .t-works li,
  .journey-tip .t-reason,
  .journey-tip .t-note { font-size: 11px; }
}

/* ---------------- 朗诵 · 挂轴内嵌（仅在该诗有朗读时显示） ---------------- */
.scroll-recite {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 5;
  opacity: 0;
  animation: reciteFadeIn .8s ease 1.2s forwards;
}
@keyframes reciteFadeIn { to { opacity: 1; } }
.recite-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid rgba(120, 80, 50, .35);
  border-radius: 999px;
  background: rgba(255, 250, 240, .82);
  color: #5a3b22;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 1px;
  backdrop-filter: blur(6px);
  transition: background .2s, transform .15s;
}
.recite-btn:hover { background: rgba(255, 245, 225, .95); }
.recite-btn:active { transform: scale(.96); }
.recite-btn.on { background: rgba(180, 110, 60, .92); color: #fff8ea; border-color: rgba(180, 110, 60, .92); }
.recite-btn.loading .recite-icon { animation: reciteSpin 1s linear infinite; display: inline-block; }
@keyframes reciteSpin { to { transform: rotate(360deg); } }
.recite-icon { font-size: 11px; line-height: 1; }
.recite-voices {
  display: inline-flex;
  border: 1px solid rgba(120, 80, 50, .3);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 250, 240, .82);
  backdrop-filter: blur(6px);
}
.recite-voices button {
  border: none;
  background: transparent;
  padding: 5px 10px;
  font-size: 12px;
  color: #6b4a2c;
  cursor: pointer;
  font-family: inherit;
}
.recite-voices button.on { background: rgba(180, 110, 60, .85); color: #fff8ea; }

@media (max-width: 640px) {
  .scroll-recite { right: 12px; bottom: 12px; gap: 6px; }
  .recite-btn { padding: 5px 10px; font-size: 12px; }
  .recite-voices button { padding: 4px 8px; font-size: 11px; }
}

/* ==================== 诵读模式（独立全屏，深色护眼） ==================== */
.recite-stage {
  position: fixed; inset: 0;
  z-index: 1200;
  background: var(--bg);
  color: var(--ink);
  display: flex; flex-direction: column;
  font-family: inherit;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: rmFadeIn .35s ease;
}
@keyframes rmFadeIn { from { opacity: 0; } to { opacity: 1; } }
.recite-stage-bg {
  position: absolute; inset: 0;
  background: var(--scroll-paper-bg);
  opacity: .85;
  pointer-events: none;
}
.recite-stage-top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 14px;
  border-bottom: 1px solid var(--line);
}
.rm-icon-btn {
  width: 40px; height: 40px;
  border: none; border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s, color .2s;
}
.rm-icon-btn:hover { background: var(--chip-bg-hover); color: var(--ink); }
.rm-mode-label {
  font-size: 13px; letter-spacing: 4px;
  color: var(--ink-soft);
}
.recite-stage-main {
  position: relative; z-index: 2;
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 1fr minmax(260px, 340px);
  gap: 24px;
  padding: 28px 28px 12px;
  overflow: hidden;
}
.rm-now {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  min-height: 0;
}
.rm-author {
  font-size: 14px; letter-spacing: 6px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.rm-title {
  font-size: clamp(26px, 4.6vw, 40px);
  letter-spacing: 4px;
  color: var(--ink);
  margin-bottom: 24px;
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
}
.rm-text {
  font-size: clamp(14px, 2.2vw, 18px);
  line-height: 2.2;
  color: var(--ink-soft);
  max-width: 640px; max-height: 50vh;
  overflow-y: auto;
  white-space: pre-line;
  letter-spacing: 2px;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent);
          mask-image: linear-gradient(180deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent);
}
.rm-text::-webkit-scrollbar { width: 0; }

/* ----- 播放列表 ----- */
.rm-playlist {
  display: flex; flex-direction: column;
  background: var(--panel-bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  min-height: 0;
  box-shadow: var(--shadow-card);
}
.rm-playlist-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  font-size: 12px; letter-spacing: 3px;
  color: var(--ink-soft);
  border-bottom: 1px solid var(--line);
  background: var(--panel-bg-1);
}
.rm-playlist-h { color: var(--ink); }
.rm-playlist-n { font-size: 11px; opacity: .75; }
.rm-playlist-body {
  flex: 1; overflow-y: auto;
  padding: 6px 0;
}
.rm-playlist-body::-webkit-scrollbar { width: 6px; }
.rm-playlist-body::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.rm-pl-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 14px;
  border: none; background: transparent;
  color: var(--ink); cursor: pointer;
  font-family: inherit; text-align: left;
  border-left: 2px solid transparent;
  transition: background .15s, border-color .15s;
}
.rm-pl-item:hover { background: var(--chip-bg-hover); }
.rm-pl-item.on {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-left-color: var(--accent);
}
.rm-pl-no {
  font-variant-numeric: tabular-nums;
  font-size: 11px; color: var(--ink-soft);
  width: 24px; flex-shrink: 0; opacity: .7;
}
.rm-pl-info {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1; min-width: 0;
}
.rm-pl-title {
  font-size: 13px; letter-spacing: 1px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rm-pl-author {
  font-size: 11px; color: var(--ink-soft); letter-spacing: 1px;
}
.rm-pl-mark {
  font-size: 10px; letter-spacing: 1px;
  color: var(--ink-soft); opacity: .35;
  flex-shrink: 0;
}
.rm-pl-item.on .rm-pl-mark { color: var(--accent); opacity: 1; }
.rm-pl-item.on .rm-pl-no { color: var(--accent); opacity: 1; }
.rm-pl-empty {
  padding: 30px 20px; text-align: center;
  color: var(--ink-soft); font-size: 12px; letter-spacing: 2px;
}

.rm-progress {
  position: relative; z-index: 2;
  padding: 6px 28px 0;
}
.rm-progress-track {
  position: relative;
  touch-action: none;
}
.rm-progress-tip {
  position: absolute;
  left: 0;
  bottom: 100%;
  margin-bottom: 8px;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--paper);
  background: color-mix(in srgb, var(--ink) 88%, transparent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
  pointer-events: none;
  z-index: 4;
}
.rm-progress-bar {
  height: 8px; border-radius: 4px;
  background: var(--line);
  overflow: hidden; cursor: pointer;
  display: flex;
  align-items: center;
}
.rm-progress-bar.rm-scrubbing { cursor: grabbing; }
.rm-progress-bar.rm-scrubbing .rm-progress-fill {
  transition: none;
}
.rm-progress-fill {
  height: 4px; width: 0;
  margin: 0 1px;
  border-radius: 2px;
  background: var(--accent);
  transition: width .15s linear;
}
.rm-time {
  display: flex; justify-content: space-between;
  font-size: 11px; letter-spacing: 1px;
  color: var(--ink-soft);
  padding: 6px 2px 0;
  font-variant-numeric: tabular-nums;
}
.rm-counter { opacity: .85; }
.rm-controls {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 12px 16px 14px;
}
.rm-controls-mid {
  display: flex; align-items: center; justify-content: center;
  gap: 28px;
  flex: 1;
  min-width: 0;
}
.rm-ctrl-side {
  width: 48px; height: 48px;
  flex-shrink: 0;
}
.rm-ctrl {
  border: 1px solid var(--line);
  background: var(--chip-bg);
  color: var(--ink);
  cursor: pointer;
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background .2s, transform .12s, border-color .2s;
}
.rm-ctrl:hover { background: var(--chip-bg-hover); border-color: var(--accent); }
.rm-ctrl:active { transform: scale(.94); }
.rm-ctrl.rm-play {
  width: 76px; height: 76px;
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
  box-shadow: var(--shadow-pop);
}
.rm-ctrl.rm-play:hover {
  background: color-mix(in srgb, var(--accent) 88%, #000);
  border-color: color-mix(in srgb, var(--accent) 88%, #000);
}
.rm-ctrl.loading svg { animation: rmSpin 1s linear infinite; }
@keyframes rmSpin { to { transform: rotate(360deg); } }

/* ----- 底部：音色 / 诗序 / 语速 / 音量（窄屏可由「配置」按钮展开） ----- */
.rm-bottom-sheet {
  position: relative;
  z-index: 2;
}
.recite-stage.rm-list-collapsed .recite-stage-main {
  grid-template-columns: 1fr;
}
.recite-stage.rm-list-collapsed .rm-playlist {
  display: none !important;
}
@media (max-width: 760px) {
  .recite-stage.rm-list-collapsed .recite-stage-main {
    grid-template-rows: minmax(0, 1fr);
  }
  #rmBottomSheet:not([hidden]) {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 8;
    max-height: min(56vh, 520px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, .22);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--panel-bg-2);
  }
  #rmBottomSheet:not([hidden]) .rm-bottom-grid {
    border-top: none;
    border-radius: 16px 16px 0 0;
  }
}
.rm-bottom-grid {
  position: relative; z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--line);
  background: var(--panel-bg-2);
}
.rm-bottom-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--chip-bg) 55%, var(--panel-bg-2));
}
.rm-bottom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.rm-bottom-row-head {
  justify-content: flex-start;
  gap: 12px;
}
.rm-bottom-row-slider { gap: 12px; }
.rm-bottom-row-slider input[type="range"],
.rm-bottom-bgm .bgp-vol {
  width: clamp(96px, 38vw, 220px);
  max-width: 100%;
  flex: 0 1 auto;
  accent-color: var(--accent);
  height: 4px;
}
.rm-bottom-label {
  font-size: 11px; letter-spacing: 3px;
  color: var(--ink-soft);
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 2.6em;
}
.rm-bottom-row-slider .rm-bottom-label { min-width: 2.6em; }
.rm-bottom-val {
  font-size: 11px; color: var(--ink-soft);
  width: 44px; text-align: right;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.rm-bottom-keep {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.rm-bottom-bgm .bg-player-host { min-width: 0; }
.rm-bottom-bgm .bgp-row { justify-content: flex-start; }
.rm-bottom-bgm .bgp-title {
  flex: 0 1 auto;
  max-width: min(11em, 42vw);
}
.rm-bottom-bgm .bgp-row-vol { flex-wrap: nowrap; }
.rm-switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; display: inline-block; }
.rm-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.rm-switch-track {
  position: absolute; inset: 0;
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background .2s;
}
.rm-switch-track::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--paper);
  transition: transform .2s;
}
.rm-switch input:checked ~ .rm-switch-track { background: var(--accent); border-color: var(--accent); }
.rm-switch input:checked ~ .rm-switch-track::after { transform: translateX(16px); }

.rm-popover {
  position: absolute; right: 14px; top: 64px;
  z-index: 3;
  min-width: 280px; max-width: 92vw;
  background: var(--panel-bg-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; gap: 12px;
  backdrop-filter: blur(10px);
}
.rm-popover-row {
  display: flex; align-items: center; gap: 10px;
}
.rm-popover-label {
  font-size: 12px; letter-spacing: 2px;
  color: var(--ink-soft);
  width: 56px; flex-shrink: 0;
}
.rm-popover-val {
  font-size: 11px; color: var(--ink-soft);
  width: 48px; text-align: right; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.rm-popover-tip {
  font-size: 11px; color: var(--ink-soft); opacity: .8;
  letter-spacing: 1px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}
.rm-seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden;
  background: var(--chip-bg);
}
.rm-seg button {
  border: none; background: transparent;
  color: var(--ink-soft);
  font-size: 12px; padding: 5px 12px;
  cursor: pointer; font-family: inherit;
  transition: background .15s, color .15s;
}
.rm-seg button:hover { color: var(--ink); }
.rm-seg button.on {
  background: var(--accent);
  color: var(--paper);
}
.rm-popover input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}
.rm-mute-btn {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--chip-bg);
  color: var(--ink-soft);
  font-size: 12px; padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.rm-mute-btn:hover { background: var(--chip-bg-hover); }
.rm-mute-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}

@media (max-width: 760px) {
  .recite-stage-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 32vh);
    padding: 20px 16px 8px;
    gap: 14px;
  }
  .rm-text { max-height: 22vh; }
  .rm-bottom-grid {
    gap: 8px;
    padding: 10px 16px 14px;
  }
  .rm-bottom-block { padding: 9px 12px 10px; gap: 7px; }
}
@media (max-width: 540px) {
  .rm-controls { gap: 6px; padding: 10px 10px 12px; }
  .rm-controls-mid { gap: 22px; }
  .rm-ctrl-side { width: 44px; height: 44px; }
  .rm-ctrl { width: 44px; height: 44px; }
  .rm-ctrl.rm-play { width: 56px; height: 56px; }
  .rm-popover { right: 8px; left: 8px; min-width: 0; }
  .rm-popover-label { width: 44px; }
  .rm-mode-label { font-size: 12px; letter-spacing: 2px; }
  .rm-bottom-grid {
    gap: 8px;
    padding: 8px 12px 12px;
  }
  .rm-bottom-row-slider .rm-bottom-label { min-width: 2.4em; }
  .rm-bottom-label { font-size: 10.5px; letter-spacing: 2px; }
  .rm-bottom-val { width: 38px; font-size: 10.5px; }
}

/* 时间轴里的诵读按钮（与「卷」相邻） */
.recite-mode-btn {
  font-family: 'Ma Shan Zheng', serif;
}

/* === 卷 / 诵 / 观 三按钮统一为圆形 + 国画三色 === */
/* 卷：淡墨青底 + 深墨青字（展开卷轴感） */
/* 诵：淡朱砂底 + 深朱砂字（朱笔批注感） */
/* 观：淡金底 + 墨黑字（视觉高光感） */
.play-btn.immersive-btn,
.play-btn.recite-mode-btn,
.play-btn.view-link-btn {
  font-family: 'Ma Shan Zheng', serif;
  font-size: 14px;
  padding: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: none;
  letter-spacing: 0;
  transition: transform .18s ease, box-shadow .18s ease, background .25s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.play-btn.immersive-btn::after,
.play-btn.recite-mode-btn::after,
.play-btn.view-link-btn::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: .35;
  pointer-events: none;
  transition: opacity .2s;
}
.play-btn.immersive-btn:hover,
.play-btn.recite-mode-btn:hover,
.play-btn.view-link-btn:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 14px rgba(40, 30, 15, .18);
}
.play-btn.immersive-btn:hover::after,
.play-btn.recite-mode-btn:hover::after,
.play-btn.view-link-btn:hover::after {
  opacity: .6;
}
.play-btn.immersive-btn:active,
.play-btn.recite-mode-btn:active,
.play-btn.view-link-btn:active {
  transform: scale(.94);
}

/* 卷：淡墨青底 + 深墨青字 */
.play-btn.immersive-btn {
  background: #a8c0cc !important;
  color: #2c4a5e !important;
}
.play-btn.immersive-btn:hover {
  background: #94afbd !important;
}
/* 沉浸模式激活时 */
body.immerse-open .play-btn.immersive-btn {
  background: #2c4a5e !important;
  color: #f5ebd6 !important;
  box-shadow: 0 0 0 3px rgba(44, 74, 94, .25);
}

/* 诵：淡朱砂底 + 深朱砂字 */
.play-btn.recite-mode-btn {
  background: #e8c3c3 !important;
  color: #8a2f2f !important;
}
.play-btn.recite-mode-btn:hover {
  background: #dcb0b0 !important;
}

/* 观：淡金底 + 墨黑字 */
.play-btn.view-link-btn {
  background: #ecdcb3 !important;
  color: #1a1614 !important;
  text-decoration: none;
}
.play-btn.view-link-btn:hover {
  background: #e0cd9c !important;
}
/* 观浮层打开时（按钮变激活态） */
body.view-open .play-btn.view-link-btn {
  background: #1a1614 !important;
  color: #c9a961 !important;
  box-shadow: 0 0 0 3px rgba(201, 169, 97, .35);
}

@media (max-width: 720px) {
  .view-link-btn::after { display: none; }
}
