:root {
  --bg: #f3eddf;
  --bg-soft: #eae0cd;
  --panel: rgba(255, 252, 244, 0.88);
  --panel-solid: #fffaf0;
  --border: rgba(91, 68, 43, 0.20);
  --text: #342e27;
  --text-dim: #786d5e;
  --accent: #a34a3c;
  --accent2: #80674a;
  --gold: #9a712e;
  --green: #4e765e;
  --red: #b05245;
  --cinnabar: #d63b27;
  --seal-red: #c94a38;
  --mountains-ink: #433328;
  --paper-fiber: rgba(91,65,38,.025);
  --seal-shadow: 0 0 0 3px rgba(201,74,56,.18);
  --ink: #3f382f;
  --paper: #f5efdf;
  --shadow: 0 12px 32px rgba(78, 58, 33, 0.12);
  /* 低谷节点：墨黑绿节点 + 乌云闪电组合图标。 */
  --node-low: #173f34;
  --node-low-glow: rgba(23, 63, 52, .55);
  --node-low-glow-soft: rgba(23, 63, 52, .16);
  --cloud-a: #2f2d28;
  --cloud-b: #4a463e;
  --cloud-c: #1e1d1a;
  --cloud-outline: rgba(255, 250, 240, .78);
  --bolt: #fffbe0;
  --bolt-outline: #ffffff;
}

/* 暗色主题下云层整体提亮并加浅描边，避免与深色地图底融在一起。 */
:root[data-theme='dark'] {
  --node-low: #3d8a71;
  --node-low-glow: rgba(110, 196, 166, .55);
  --node-low-glow-soft: rgba(110, 196, 166, .14);
  --cloud-a: #a9afa7;
  --cloud-b: #d2d8d0;
  --cloud-c: #828982;
  --cloud-outline: rgba(248, 252, 246, .85);
  --bolt: #fffce8;
  --bolt-outline: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(1100px 700px at 75% -10%, rgba(255,255,255,.72), transparent 65%),
    repeating-linear-gradient(3deg, rgba(89,65,38,.018) 0 1px, transparent 1px 5px);
  color: var(--text);
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; }
a { text-decoration: none; color: inherit; }
h1, h2, h3, .brand .logo { font-family: "Songti SC", "STSong", "SimSun", serif; }

/* ---------- Header ---------- */
header {
  position: fixed; top: 0; left: 0; right: 0; height: 60px; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px;
  background: rgba(250, 247, 239, 0.88); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .logo { font-size: 20px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .sub { font-size: 12px; color: var(--text-dim); }
nav { display: flex; gap: 6px; }
nav a { position: relative; color: var(--text-dim); padding: 8px 14px; border-radius: 10px; font-size: 14px; transition: all .2s; }
nav a:hover { color: var(--text); background: rgba(116,88,52,.07); }
nav a.active { color: var(--cinnabar); background: rgba(164,63,50,.045); }
nav a.active::before { content: ""; position: absolute; top: 1px; left: 50%; width: 22px; height: 3px;
  transform: translateX(-50%); border-radius: 0 0 3px 3px; background: var(--cinnabar); }

/* ---------- Home ---------- */
#home { position: relative; padding-top: 60px; height: 100vh; overflow-y: auto; }
.hero { text-align: center; padding: 70px 20px 40px;
  background: radial-gradient(700px 300px at 50% 0%, rgba(164,63,50,.07), transparent); }
.hero h1 { font-size: 46px; letter-spacing: 8px; font-weight: 800;
  background: linear-gradient(90deg, var(--ink), var(--cinnabar), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.tags { margin-top: 22px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tag { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--text-dim); }
.tag b { color: var(--accent); }

.today-voice { max-width: 760px; margin: 30px auto 0; padding: 22px 26px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.today-voice .otd-head { display: flex; align-items: baseline; justify-content: space-between; }
.today-voice .label { font-size: 12px; color: var(--gold); letter-spacing: 2px; }
.today-voice .otd-date { font-size: 13px; color: var(--text-dim); }
.today-voice .otd-badge { display: inline-block; margin-top: 14px; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; background: rgba(154,113,46,.16); color: var(--gold); border: 1px solid rgba(154,113,46,.3); }
.today-voice .otd-badge.sample { background: rgba(120,109,94,.14); color: var(--text-dim); border-color: var(--border); }
.today-voice .otd-person { margin-top: 10px; font-size: 22px; font-weight: 800; display: flex; align-items: baseline; gap: 10px; }
.today-voice .otd-country { font-size: 12px; color: var(--text-dim); font-weight: 400; }
.today-voice .otd-title { margin-top: 4px; font-size: 14px; color: var(--accent2); }
.today-voice .otd-arc { display: flex; align-items: stretch; gap: 12px; margin-top: 16px; }
.today-voice .arc { flex: 1; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); }
.today-voice .arc.low { background: rgba(176,82,69,.08); border-color: rgba(176,82,69,.25); }
.today-voice .arc.rise { background: rgba(78,118,94,.08); border-color: rgba(78,118,94,.25); }
.today-voice .arc-tag { font-size: 11px; letter-spacing: 1px; }
.today-voice .arc.low .arc-tag { color: var(--red); }
.today-voice .arc.rise .arc-tag { color: var(--green); }
.today-voice .arc p { margin-top: 6px; font-size: 13px; line-height: 1.6; color: var(--text-dim); }
.today-voice .arc-arrow { display: grid; place-items: center; color: var(--accent); font-size: 20px; }
.today-voice .otd-story { margin-top: 14px; font-size: 14px; line-height: 1.7; color: var(--text); }
.today-voice .otd-voice { margin-top: 12px; font-size: 15px; line-height: 1.7; font-style: italic; color: var(--gold); }
.today-voice .otd-link { display: inline-block; margin-top: 14px; color: var(--accent2); font-size: 13px; }
.today-voice .otd-link:hover { text-decoration: underline; }

.section-title { max-width: 1100px; margin: 50px auto 18px; padding: 0 24px;
  font-size: 15px; color: var(--text-dim); letter-spacing: 3px; }
.cards { max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; transition: transform .2s, border-color .2s; box-shadow: var(--shadow); }
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card .avatar { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  font-size: 22px; font-weight: 800; color: #fffaf0; }
.card .avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.card h3 { margin-top: 14px; font-size: 19px; }
.card .role { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.card .desc { font-size: 13.5px; color: var(--text-dim); margin-top: 12px; line-height: 1.6; }
.card .acts { margin-top: 16px; display: flex; gap: 8px; }
.card .acts button { flex: 1; padding: 9px; border-radius: 10px; font-size: 13px; }
.btn-map { background: rgba(164,63,50,.16); color: var(--accent); }
.btn-talk { background: rgba(128,103,74,.16); color: var(--accent2); }
.cta { text-align: center; margin: 54px 0 30px; }
.cta button { font-size: 16px; padding: 14px 34px; border-radius: 14px; font-weight: 700;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fffaf0;
  box-shadow: 0 8px 30px rgba(164,63,50,.35); }

/* ============================================================
   首页增补：项目理念 · 两侧人物 · 精选人物短片
   ============================================================ */

/* ---------- Hero：理念文案 ---------- */
.hero { position: relative; overflow-x: clip; }
.hero-inner { position: relative; z-index: 2; }

.hero-motto {
  margin: 20px auto 0;
  display: flex; align-items: center; justify-content: center; gap: 18px;
}
.hero-motto::before,
.hero-motto::after {
  content: ""; height: 1px; width: 86px; flex: 0 1 auto;
  background: linear-gradient(90deg, rgba(164, 63, 50, 0), rgba(164, 63, 50, .55));
}
.hero-motto::after {
  background: linear-gradient(90deg, rgba(164, 63, 50, .55), rgba(164, 63, 50, 0));
}
.hero-motto span {
  font-size: 22px; letter-spacing: 4px; font-weight: 600;
  color: var(--accent); white-space: nowrap;
}

/* ---------- Hero：两侧人物 ---------- */
.hero-figures {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none; overflow: hidden;
}
.hero-fig {
  position: absolute;
  mix-blend-mode: multiply;
  filter: grayscale(.34) sepia(.12) contrast(.95);
  opacity: .17;
  /* 四边渐隐：避免出现方形硬边或被区块边界硬切 */
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 9%, #000 62%, transparent 97%),
    linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 0%, #000 9%, #000 62%, transparent 97%),
    linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  mask-composite: intersect;
}
.fig-sushi     { left: -26px;  bottom: -10px; width: 236px; opacity: .20; }
.fig-curie     { left: 196px;  top: 4px;      width: 120px; opacity: .13; }
.fig-beethoven { right: 196px; top: 4px;      width: 120px; opacity: .13; }
.fig-davinci   { right: -26px; bottom: -10px; width: 236px; opacity: .20; }

@media (max-width: 1280px) {
  .fig-sushi, .fig-davinci { width: 205px; bottom: -38px; }
  .fig-curie { left: 140px; width: 108px; }
  .fig-beethoven { right: 140px; width: 108px; }
  .hero-motto span { font-size: 20px; letter-spacing: 3px; }
}
@media (max-width: 1080px) {
  .hero-figures { display: none; }
}
@media (max-width: 720px) {
  .hero-motto { gap: 10px; }
  .hero-motto::before, .hero-motto::after { width: 34px; }
  .hero-motto span { font-size: 16px; letter-spacing: 1px; white-space: normal; }
}

/* ---------- 精选人物短片 ---------- */
.feature-film { max-width: 900px; margin: 6px auto 46px; padding: 0 20px; }

.film-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
}
.film-head .label { font-size: 12px; color: var(--gold); letter-spacing: 2px; }

.film-frame {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #1d1a16;
  line-height: 0;
}
.film-frame video {
  display: block; width: 100%; height: auto;
}

.film-controls {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  color: #f3eddf; background: rgba(30, 26, 20, .55);
  border: 1px solid rgba(243, 237, 223, .30);
  border-radius: 999px;
  backdrop-filter: blur(4px);
  line-height: 1;
  opacity: 1;
  transition: opacity .24s ease;
}
/* 鼠标移出、触屏超时后淡出控制条，避免压住画面字幕 */
.film-frame.is-controls-hidden .film-controls {
  opacity: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .film-controls { transition: none; }
}
.film-vol-icon { font-size: 12px; width: 14px; text-align: center; }
.film-vol-range {
  -webkit-appearance: none; appearance: none;
  width: 72px; flex: 0 0 auto; height: 14px; margin: 0;
  background: transparent; cursor: pointer;
}
.film-vol-range::-webkit-slider-runnable-track {
  height: 3px; border-radius: 999px;
  background: rgba(243, 237, 223, .45);
}
.film-vol-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%;
  background: #f3eddf; border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.film-vol-range::-moz-range-track {
  height: 3px; border-radius: 999px;
  background: rgba(243, 237, 223, .45);
}
.film-vol-range::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: #f3eddf; border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.film-vol-range:focus-visible { outline: 2px solid rgba(243, 237, 223, .7); outline-offset: 4px; }

.film-progress {
  -webkit-appearance: none; appearance: none;
  flex: 1 1 auto; min-width: 56px; height: 14px; margin: 0;
  background: transparent; cursor: pointer;
}
.film-progress::-webkit-slider-runnable-track {
  height: 3px; border-radius: 999px;
  background: linear-gradient(to right, #f3eddf var(--p, 0%), rgba(243, 237, 223, .35) var(--p, 0%));
}
.film-progress::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; margin-top: -4px; border-radius: 50%;
  background: #f3eddf; border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.film-progress::-moz-range-track {
  height: 3px; border-radius: 999px;
  background: rgba(243, 237, 223, .35);
}
.film-progress::-moz-range-progress {
  height: 3px; border-radius: 999px;
  background: #f3eddf;
}
.film-progress::-moz-range-thumb {
  width: 11px; height: 11px; border-radius: 50%;
  background: #f3eddf; border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.film-progress:focus-visible { outline: 2px solid rgba(243, 237, 223, .7); outline-offset: 4px; }

.film-play-btn {
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto; width: 22px; height: 22px; padding: 0;
  color: #f3eddf; background: transparent;
  border: none; border-radius: 6px; cursor: pointer; line-height: 0;
}
.film-play-btn:hover { background: rgba(243, 237, 223, .16); }
.film-play-btn:focus-visible { outline: 2px solid rgba(243, 237, 223, .7); outline-offset: 2px; }
.film-play-btn svg {
  width: 14px; height: 14px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.film-play-btn .ico-play { display: none; }
.film-play-btn[data-playing="0"] .ico-pause { display: none; }
.film-play-btn[data-playing="0"] .ico-play { display: block; }

.film-fs-btn {
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto; width: 22px; height: 22px; padding: 0;
  color: #f3eddf; background: transparent;
  border: none; border-radius: 6px; cursor: pointer; line-height: 0;
}
.film-fs-btn:hover { background: rgba(243, 237, 223, .16); }
.film-fs-btn:focus-visible { outline: 2px solid rgba(243, 237, 223, .7); outline-offset: 2px; }
.film-fs-btn svg {
  width: 14px; height: 14px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.film-fs-btn .ico-exit { display: none; }
.film-fs-btn[data-fs="1"] .ico-enter { display: none; }
.film-fs-btn[data-fs="1"] .ico-exit { display: block; }

/* 全屏：视频保持原比例居中，两侧用虚化放大的画面补边，避免纯黑边 */
.film-frame:fullscreen,
.film-frame:-webkit-full-screen {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; border: none; border-radius: 0;
  background: #17140f; line-height: normal;
}
.film-frame:fullscreen::before,
.film-frame:-webkit-full-screen::before {
  content: ""; position: absolute; inset: -60px; z-index: 0;
  background-image: var(--film-poster, none);
  background-position: center; background-size: cover;
  filter: blur(36px) brightness(.62) saturate(1.1);
  transform: scale(1.06);
}
.film-frame:fullscreen video,
.film-frame:-webkit-full-screen video {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: contain;
}
.film-frame:fullscreen .film-controls,
.film-frame:-webkit-full-screen .film-controls { z-index: 2; }

.film-meta {
  display: flex; align-items: center; gap: 16px;
  margin-top: 14px; padding: 0 4px;
  flex-wrap: wrap;
}
.film-name {
  font-size: 16px; font-weight: 700; color: var(--ink); letter-spacing: 1px;
  flex: 0 0 auto;
}
.film-name em {
  font-style: normal; font-size: 12px; font-weight: 400;
  color: var(--text-dim); margin-left: 8px; letter-spacing: .5px;
}
.film-desc {
  flex: 1 1 320px; font-size: 13px; line-height: 1.8;
  color: var(--text-dim);
}
.film-link {
  flex: 0 0 auto; font-size: 13px; color: var(--accent);
  text-decoration: none; border-bottom: 1px solid rgba(164, 63, 50, .3);
  padding-bottom: 1px; transition: all .2s;
}
.film-link:hover { color: var(--cinnabar); border-color: var(--cinnabar); }

@media (max-width: 720px) {
  .film-head { flex-direction: column; gap: 4px; }
  .film-desc { flex-basis: 100%; }
  .film-link { margin-left: 0; }
}

/* ============================================================
   统一内容栏宽度：与「历史上的今天」外框（760px）严格对齐
   ============================================================ */
#home .feature-film,
#home .section-title,
#home .cards {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
#home .feature-film { padding: 0; }
#home .section-title { padding: 0 26px; }
#home .cards { padding: 0 26px; }
#home .contribute-entry {
  width: calc(100% - 48px);
  max-width: 760px;
  padding: 24px 26px;
}

@media (max-width: 860px) {
  #home .feature-film { padding: 0 24px; }
  #home .contribute-entry { padding: 22px 20px; }
  #home .contribute-entry > a { flex: none; }
}


/* ============================================================
   两侧人物：绝对定位分布于整页两侧留白，随滚动自然进入视野
   ============================================================ */
#home { position: relative; overflow-x: hidden; }

.fig-stage {
  /* #home 是 100vh 的滚动容器：图层不能设 overflow:hidden，否则超过一屏的人物被裁掉。
     这里用零高度定位锚点，人物可以溢出到任意高度并随内容一起滚动。 */
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0;
  z-index: 3;
  pointer-events: none;
  overflow: visible;
}
/* 内容层压在人物之上，人物只在留白处可见 */
#home > *:not(.fig-stage) { position: relative; z-index: 1; }

.fig-col { position: absolute; top: 0; height: 0; width: 300px; }
.fig-col.left  { left: 0; }
.fig-col.right { right: 0; }

.fig-item {
  position: absolute;
  width: 236px;
  opacity: .22;
  mix-blend-mode: multiply;
  filter: grayscale(.34) sepia(.12) contrast(.95);
  -webkit-mask-image:
    linear-gradient(to bottom, transparent 0%, #000 14%, #000 66%, transparent 99%),
    linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to bottom, transparent 0%, #000 14%, #000 66%, transparent 99%),
    linear-gradient(to right, transparent 0%, #000 12%, #000 88%, transparent 100%);
  mask-composite: intersect;
}
.fig-col.left  .fig-item { left: -34px; }
.fig-col.right .fig-item { right: -34px; }
/* 左列用奇数位、右列用偶数位，保证滚动时左右交替出现 */
/* 收回在正文高度内均匀分布，避免页面底部出现大片空白 */
/* 全部置于首屏之下、正文高度之内，既不在首屏抢戏，也不把页面撑长 */
.fig-col.left  .fig-item:nth-child(1) { top: 1010px; }
.fig-col.left  .fig-item:nth-child(2) { top: 1265px; }
.fig-col.left  .fig-item:nth-child(3) { top: 1520px; }
.fig-col.right .fig-item:nth-child(1) { top: 1110px; }
.fig-col.right .fig-item:nth-child(2) { top: 1375px; }


@media (max-width: 1240px) {
  .fig-col { width: 250px; }
  .fig-item { width: 208px; }
}
@media (max-width: 1180px) {
  .fig-stage { display: none; }
}

/* ---------- Map ---------- */
#map { position: fixed; inset: 0; background: #fffaf0; }
.leaflet-container { background: #fffaf0; }
.country-tip { background: rgba(255,250,240,.94); border: 1px solid var(--border); color: var(--text-dim);
  font-size: 11px; padding: 2px 7px; border-radius: 6px; box-shadow: none; }
.country-tip::before { display: none; }
.map-dock { position: fixed; top: 76px; left: 16px; z-index: 600; width: 230px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px;
  backdrop-filter: blur(10px); box-shadow: var(--shadow); max-height: calc(100vh - 92px); overflow-y: auto; }
.map-dock h4 { font-size: 13px; color: var(--text-dim); letter-spacing: 2px; margin-bottom: 10px; }
.chip { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  cursor: pointer; transition: background .2s; margin-bottom: 4px; }
.chip:hover { background: rgba(164,63,50,.055); }
.chip.active { background: rgba(164,63,50,.15); }
.chip .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.chip .nm { font-size: 14px; }
.chip .ct { font-size: 11px; color: var(--text-dim); }
.map-detail { position: fixed; top: 76px; right: 16px; z-index: 600; width: 350px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px;
  backdrop-filter: blur(10px); box-shadow: var(--shadow); max-height: calc(100vh - 92px); overflow-y: auto; display: none; }
.map-detail.show { display: block; }
.map-detail .close { position: absolute; top: 12px; right: 14px; color: var(--text-dim); font-size: 20px; background: none; }
.map-detail h3 { font-size: 20px; }
.map-detail .role { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.map-detail .summary { font-size: 13.5px; color: var(--text-dim); line-height: 1.65; margin-top: 12px; }

/* 横向时间轴（参考城市记忆） */
.tl-title { font-size: 12px; color: var(--text-dim); letter-spacing: 2px; margin-top: 16px; }
.tl-h { display: flex; gap: 0; overflow-x: auto; padding: 14px 2px 8px; margin-top: 6px;
  border-bottom: 1px dashed var(--border); scrollbar-width: thin; }
.tl-h::-webkit-scrollbar { height: 6px; }
.tl-h::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.tl-item { position: relative; flex: 0 0 auto; width: 86px; padding: 0 6px; text-align: center; cursor: pointer; }
.tl-item::before { content: ""; position: absolute; top: 5px; left: -50%; width: 100%; height: 2px; background: var(--border); }
.tl-item:first-child::before { display: none; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold);
  margin: 0 auto 8px; box-shadow: 0 0 0 4px rgba(154,113,46,.15); position: relative; z-index: 1; }
.tl-item:hover .tl-dot { background: var(--accent); box-shadow: 0 0 0 4px rgba(164,63,50,.2); }
.tl-year { font-size: 12px; color: var(--gold); font-weight: 700; }
.tl-ev { font-size: 11px; color: var(--text-dim); margin-top: 3px; line-height: 1.4; }
.tp-title { font-size: 12px; color: var(--text-dim); letter-spacing: 2px; margin-top: 18px; }
.tp-list { margin-top: 8px; }
.tp-item { padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border);
  margin-bottom: 8px; cursor: pointer; transition: all .2s; background: rgba(255,255,255,0.02); }
.tp-item:hover { border-color: var(--accent); background: rgba(164,63,50,.1); }
.tp-item .yr { font-size: 12px; color: var(--gold); }
.tp-item .tt { font-size: 14px; margin-top: 3px; }
.tp-item .em { font-size: 11px; color: var(--accent2); margin-top: 3px; }
.map-detail .talk-btn { margin-top: 16px; width: 100%; padding: 12px; border-radius: 12px;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fffaf0; font-weight: 700; font-size: 14px; }
.legend { position: fixed; bottom: 16px; left: 16px; z-index: 600; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 11px; color: var(--text-dim); }
.legend b { color: var(--text); }
.map-pin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 10px rgba(255,255,255,.4); }
.map-pin.tp { width: 13px; height: 13px; }

/* ---------- Map · 高德 JS API 2.0 ---------- */
#map { inset: 60px 0 0; background: #eee4cf; font-family: inherit; }
#map::before, #map::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
#map::before { z-index: 50; opacity: .32; mix-blend-mode: multiply;
  background-image: radial-gradient(circle at 20% 30%, rgba(91,65,35,.15) 0 .7px, transparent 1.2px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.55) 0 .8px, transparent 1.3px),
    repeating-linear-gradient(7deg, rgba(96,70,40,.035) 0 1px, transparent 1px 6px);
  background-size: 17px 19px, 23px 29px, auto;
  background-position: var(--paper-x, 0px) var(--paper-y, 0px),
    var(--paper-x, 0px) var(--paper-y, 0px), var(--paper-x, 0px) var(--paper-y, 0px); }
#map::after { z-index: 51; box-shadow: inset 0 0 130px rgba(100,72,38,.14); }
.amap-maps > .amap-layers > canvas.amap-layer { filter: contrast(1.25) brightness(1.04) sepia(.68) saturate(.62); }
.amap-life-marker { position: relative; overflow: visible; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #f8edda;
  opacity: .9; transition: width .2s, height .2s, opacity .2s; }
.amap-life-marker.selected { border-color: #fff8e8; opacity: 1; }
.amap-life-marker.current { border-width: 3px; }
/* 聚焦某个节点时，同一路线上的其他节点保留显示但降低权重；取消聚焦后随 .selected 复位。 */
.amap-life-marker.node-muted { opacity: .6; }
.amap-life-marker.node-muted .seal-ripple { animation: none; opacity: 0; }
/* 交互降级：拖动/缩放进行中收起普通节点，只保留选中人物的节点与高光/低谷标识。
   手势结束后由 map.js 延迟 160ms 移除类，节点按原 opacity 过渡淡入，避免整屏闪跳。 */
.is-gesturing.is-gesturing-idle .amap-life-marker:not(.selected) { opacity: 0; visibility: hidden; transition: none; }
.is-gesturing .amap-life-marker.selected .seal-ripple { animation: none; opacity: 0; }
.is-gesturing .amap-life-marker.selected::before,
.is-gesturing .amap-life-marker.selected::after { animation-play-state: paused; filter: none; }
.is-gesturing .map-traveler svg,
.is-gesturing .map-traveler .traveler-leg { animation-play-state: paused; }
.amap-life-marker.low, .amap-life-marker.high { border-color: #f8edda; }
/* 低谷节点用填充色区分（深墨绿），不再依赖云朵图标；选中/弱化态沿用透明度，不覆盖颜色。 */
.amap-life-marker.low { background: var(--node-low); }
.seal-ripple { position: absolute; inset: -9px; border: 1px solid var(--seal-red); border-radius: 50%;
  background: radial-gradient(circle, rgba(201,74,56,.08), transparent 68%); opacity: 0; pointer-events: none; }
.amap-life-marker.selected .seal-ripple { animation: seal-bleed 3.2s ease-out infinite; }
.amap-life-marker.current .seal-ripple { animation-duration: 1.8s; border-width: 2px; }
@keyframes seal-bleed { 0% { opacity: .68; transform: scale(.35); }
  70%, 100% { opacity: 0; transform: scale(1.35); } }
/* 低谷节点：非常缓慢克制的呼吸光，不与选中脉冲叠加；弱化态完全静止。 */
.amap-life-marker.low .seal-ripple { border-color: var(--node-low-glow); opacity: 1;
  background: radial-gradient(circle, var(--node-low-glow-soft), transparent 68%);
  animation: low-breathe 5.6s ease-in-out infinite; }
.amap-life-marker.low.current .seal-ripple { animation-duration: 4.4s; border-width: 1px; }
.amap-life-marker.low.node-muted .seal-ripple { animation: none; opacity: 0; }
@keyframes low-breathe { 0%, 100% { opacity: .16; transform: scale(.92); }
  50% { opacity: .4; transform: scale(1.2); } }
@media (prefers-reduced-motion: reduce) {
  .amap-life-marker.low .seal-ripple { animation: none; opacity: .3; transform: none; }
}
.location-note { position: absolute; left: 50%; bottom: calc(100% + 10px); z-index: 5; min-width: max-content;
  padding: 7px 10px; border: 1px solid rgba(201,74,56,.25); border-radius: 3px; color: var(--mountains-ink);
  background: rgba(255,250,240,.96); box-shadow: 0 4px 14px rgba(79,50,31,.12); text-align: center;
  opacity: 0; transform: translate(-50%,4px); transition: opacity .18s, transform .18s; pointer-events: none; }
.location-note b { display: block; font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 12px; letter-spacing: 1px; }
.location-note small { display: block; margin-top: 3px; color: var(--cinnabar); font-size: 10px; }
@media (hover: hover) {
  .amap-life-marker:hover .location-note { opacity: 1; transform: translate(-50%,0); }
}
.amap-life-marker.high::before { content: ""; position: absolute; left: 50%; bottom: 58%; width: 20px; height: 28px;
  pointer-events: none; transform-origin: 50% 100%;
  background: radial-gradient(circle at 50% 76%, #fff3b0 0 14%, #ffc75a 16% 34%, #f06a3c 38% 62%, rgba(240,106,60,.78) 66%, transparent 72%);
  clip-path: polygon(50% 0, 67% 28%, 80% 48%, 100% 72%, 88% 100%, 12% 100%, 0 72%, 18% 45%, 32% 25%);
  filter: drop-shadow(0 0 4px rgba(240,106,60,.42)); animation: flame-flicker .9s ease-in-out infinite alternate; }
/* 低谷节点：乌云（z-index 1）在下，闪电（z-index 2）压在其上，两者都不覆盖节点主体。
   云用三层深色渐变 + 底层浅色描边，保证近墨仍能看出轮廓。 */
.amap-life-marker.low::before { content: ""; position: absolute; z-index: 1; left: 50%; top: -23px; width: 29px; height: 19px;
  pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle at 28% 68%, var(--cloud-a) 0 30%, transparent 33%),
    radial-gradient(circle at 52% 38%, var(--cloud-b) 0 35%, transparent 38%),
    radial-gradient(circle at 76% 70%, var(--cloud-c) 0 32%, transparent 35%),
    radial-gradient(circle at 28% 68%, var(--cloud-outline) 0 34%, transparent 37%),
    radial-gradient(circle at 52% 38%, var(--cloud-outline) 0 39%, transparent 42%),
    radial-gradient(circle at 76% 70%, var(--cloud-outline) 0 36%, transparent 40%);
  animation: omen-cloud 2.2s ease-in-out infinite; }
.amap-life-marker.low::after { content: ""; position: absolute; z-index: 2; left: 50%; top: -16px; width: 9px; height: 15px;
  pointer-events: none; background: var(--bolt);
  clip-path: polygon(55% 0, 100% 0, 68% 40%, 96% 40%, 18% 100%, 38% 56%, 8% 56%);
  filter: drop-shadow(1px 0 0 var(--bolt-outline)) drop-shadow(-1px 0 0 var(--bolt-outline))
    drop-shadow(0 1px 0 var(--bolt-outline)) drop-shadow(0 -1px 0 var(--bolt-outline))
    drop-shadow(0 0 4px rgba(255, 244, 170, .75));
  animation: omen-flash 1.5s steps(2, end) infinite; }
@keyframes flame-flicker { from { transform: translateX(-50%) scale(.88) rotate(-3deg); opacity: .82; }
  to { transform: translateX(-50%) scale(1.08) rotate(3deg); opacity: 1; } }
@keyframes omen-cloud { 0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px) scale(1.06); } }
@keyframes omen-flash { 0%, 42%, 100% { opacity: .9; }
  48%, 68% { opacity: 1; filter: drop-shadow(0 0 1px var(--bolt-outline)) drop-shadow(0 0 5px rgba(255, 246, 190, .9)); } }
/* 弱化态其他节点降到 .6；低谷节点保持在 .8，确保黑云与亮闪电仍能辨认。 */
.amap-life-marker.low.node-muted { opacity: .8; }
/* 同一坐标同时存在低谷与高光时，把两个图标左右错开，避免叠成一团。 */
.amap-life-marker.low.pair-left::before { left: calc(50% - 15px); }
.amap-life-marker.low.pair-left::after { left: calc(50% - 15px); }
.amap-life-marker.high.pair-right::before { left: calc(50% + 15px); }
/* 降低动态偏好：雷雨图标保持静态，只留颜色与轮廓。 */
@media (prefers-reduced-motion: reduce) {
  .amap-life-marker.low::before,
  .amap-life-marker.low::after { animation: none; }
}
#flowCanvas, #flowActive { position: absolute; inset: 0; z-index: 60; width: 100%; height: 100%; pointer-events: none; }
/* 静态底与流动层分开：静态层只在视口落定/换批时重画，流动层每帧只清空并描 5 条短线。 */
#flowActive { z-index: 61; }
/* 拖动/缩放期间、且没有选中人物时直接收起轨迹层，停稳后由 map.js 一次性补画；
   选中人物时轨迹只有一条路线，继续跟随地图重绘，保持行者与路线对齐。 */
.is-gesturing-idle #flowCanvas, .is-gesturing-idle #flowActive { visibility: hidden; }
.map-traveler { position: absolute; left: 0; top: 0; z-index: 90; display: none; width: 30px; height: 44px; pointer-events: none;
  transform: translate3d(0, 0, 0) translate(-50%, -38px); will-change: transform;
  filter: drop-shadow(0 2px 3px rgba(92,55,35,.25)); }
.map-traveler.show { display: block; }
.map-traveler.resting svg, .map-traveler.resting .traveler-leg { animation-play-state: paused; }
.map-traveler svg { width: 100%; height: 100%; overflow: visible; animation: traveler-bob .45s ease-in-out infinite alternate; }
.map-traveler circle { fill: #f7ead0; stroke: var(--cinnabar); stroke-width: 1.5; }
.map-traveler path { fill: none; stroke: var(--cinnabar); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.traveler-leg { transform-box: view-box; transform-origin: 17px 29px; animation: traveler-step .45s ease-in-out infinite alternate; }
.traveler-leg.leg-b { animation-direction: alternate-reverse; }
@keyframes traveler-bob { from { transform: translateY(0); } to { transform: translateY(-2px); } }
@keyframes traveler-step { from { transform: rotate(-13deg); } to { transform: rotate(13deg); } }
.map-marginalia { color: var(--mountains-ink); font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 12px; letter-spacing: 3px; white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translateY(4px); transition: opacity .5s, transform .5s; }
.map-marginalia::before { content: ""; display: block; width: 28px; margin: 0 auto 7px;
  border-top: 1px solid currentColor; }
.map-marginalia.visible { opacity: .30; transform: translateY(0); }
.map-credit { position: fixed; left: 20px; bottom: 48px; z-index: 500; color: var(--mountains-ink);
  font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 11px; letter-spacing: 2px;
  pointer-events: none; opacity: 0; transition: opacity .5s; }
.map-credit.visible { opacity: .52; }

.map-dock, .map-detail { background: linear-gradient(155deg, rgba(255,252,244,.96), rgba(244,236,220,.94));
  border: 1px solid rgba(103,76,44,.22); backdrop-filter: blur(20px); box-shadow: 0 18px 45px rgba(79,57,31,.16); }
.map-dock { top: 76px; right: 20px; left: auto; width: 244px; height: calc(100dvh - 104px); padding: 0;
  border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  transition: width .22s ease, height .22s ease, background .22s ease; }
.map-dock-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
  padding: 18px 44px 0 16px; flex: none; }
.map-panel-toggle { position: absolute; top: 16px; right: 16px; z-index: 2; width: 32px; height: 32px;
  display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-dim); background: rgba(255,255,255,.035); }
.map-panel-toggle:hover { color: var(--text); border-color: var(--accent); background: rgba(164,63,50,.1); }
.map-panel-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.map-panel-toggle .icon-expand { display: none; }
.map-dock.detail-open, .map-dock.story-open { width: 340px; }
.map-dock.detail-open > :not(.map-panel-toggle):not(#detail),
.map-dock.story-open > :not(.map-panel-toggle):not(#storyPanel) { display: none; }
.map-dock.detail-open .map-panel-toggle, .map-dock.story-open .map-panel-toggle { right: 50px; }
.map-dock > .map-detail { position: relative; inset: auto; z-index: auto; flex: 1; width: 100%; height: 100%; max-height: none;
  min-height: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; }
.map-dock > .map-detail.show { display: flex; }
.map-dock.collapsed { width: 48px; height: 48px; padding: 0; border-radius: 15px; }
.map-dock.collapsed > :not(.map-panel-toggle) { display: none; }
.map-dock.collapsed .map-panel-toggle { position: static; width: 46px; height: 46px; border: 0; background: transparent; }
.map-dock.collapsed .map-panel-toggle .icon-collapse { display: none; }
.map-dock.collapsed .map-panel-toggle .icon-expand { display: block; }
.map-eyebrow { display: block; color: var(--accent); font-size: 10px; letter-spacing: 3px; margin-bottom: 4px; }
.map-dock h1 { font-size: 22px; letter-spacing: 2px; }
.map-count { color: var(--gold); font-size: 10px; white-space: nowrap; padding-bottom: 3px; }
.map-lead { color: var(--text-dim); font-size: 11.5px; line-height: 1.5; margin: 7px 16px 0; flex: none; }
.map-search { display: block; margin: 12px 14px 10px; flex: none; }
.map-search span { display: block; color: var(--text-dim); font-size: 10.5px; margin-bottom: 5px; }
.map-search input { width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 10px; outline: none;
  background: rgba(255,252,244,.72); color: var(--text); padding: 0 11px; font: inherit; font-size: 12px; }
.map-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(164,63,50,.1); }
.map-search input::placeholder { color: #9a8c78; }
.character-list { display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0;
  overflow-y: auto; padding: 0 8px 8px; scrollbar-width: thin; scrollbar-gutter: stable; }
.chip { position: relative; overflow: hidden; width: 100%; min-height: 48px; display: flex; align-items: center; padding: 0;
  border-radius: 3px; color: var(--text); background: transparent; border: 1px solid transparent;
  text-align: left; transition: background .18s, border-color .18s, box-shadow .18s; }
.chip:hover { background: rgba(201,74,56,.055); box-shadow: var(--seal-shadow); }
.chip.active { background: rgba(201,74,56,.10); border-color: rgba(201,74,56,.30); box-shadow: var(--seal-shadow); }
.chip-main { min-width: 0; flex: 1; align-self: stretch; display: flex; align-items: center; gap: 8px;
  padding: 6px 0 6px 8px; color: inherit; background: transparent; border: 0; text-align: left; cursor: pointer; }
.chip-enter { width: 28px; height: 30px; margin: 0 4px 0 2px; flex: none; display: grid; place-items: center;
  color: var(--text-dim); background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer;
  transition: color .18s, background .18s, border-color .18s; }
.chip-enter:hover { color: var(--accent); background: rgba(201,74,56,.09); border-color: rgba(201,74,56,.22); }
.chip-enter svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.chip .person-mark { width: 28px; height: 28px; border-radius: 3px; display: grid; place-items: center;
  flex: none; font-size: 12.5px; font-weight: 750; border: 1px solid currentColor; }
.chip .person-mark.has-photo { border-color: var(--border); overflow: hidden; background: rgba(255,255,255,.04); }
.chip .person-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.chip .chip-copy { min-width: 0; flex: 1; }
.chip .nm, .chip .ct { display: block; }
.chip .nm { font-size: 13px; font-weight: 650; line-height: 1.35; }
.chip .ct { font-size: 10.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-indirect { display: inline-block; margin-right: 5px; padding: 0 4px; border-radius: 3px;
  color: var(--gold); background: rgba(154,113,46,.12); border: 1px solid rgba(154,113,46,.28);
  font-size: 9px; line-height: 14px; letter-spacing: .5px; vertical-align: 1px; }
.chip .stops { color: var(--text-dim); font-size: 9.5px; white-space: nowrap; }
.chip::after { content: ""; position: absolute; left: 24px; top: 50%; width: 7px; height: 7px;
  border-radius: 50%; background: var(--seal-red); opacity: 0; pointer-events: none; }
.chip.seal-pressed::after { animation: chip-seal .36s ease-out; }
@keyframes chip-seal { 0% { opacity: .42; transform: translate(-50%,-50%) scale(.6); }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(3.2); } }
.character-empty { padding: 28px 12px; text-align: center; color: var(--text-dim); font-size: 12px; line-height: 1.8; }
.character-empty .empty-act { display: inline-block; margin-top: 10px; padding: 6px 12px; min-height: 32px;
  border: 1px solid var(--border); border-radius: 8px; background: transparent;
  color: var(--text-dim); font: inherit; font-size: 12px; }
.character-empty .empty-act:hover { color: var(--accent); border-color: var(--accent); }
.overview-btn { width: calc(100% - 28px); min-height: 36px; display: flex; justify-content: space-between; align-items: center;
  margin: 4px 14px 12px; padding: 8px 11px; flex: none; border-radius: 10px; background: rgba(255,255,255,.035);
  border: 1px solid var(--border); color: var(--text-dim); font-size: 10.5px; }
.overview-btn:hover { color: var(--text); border-color: var(--accent); }
/* 底部两枚快捷开关：左「全部路线」范围切换，右「回到全览」回到世界视野。 */
.map-quick { display: flex; gap: 6px; margin: 4px 14px 12px; flex: none; }
.map-quick .overview-btn { flex: 1; width: auto; min-height: 34px; margin: 0; padding: 7px 9px; gap: 6px; }
.map-quick .overview-btn .scope-dot { width: 7px; height: 7px; border-radius: 50%; flex: none;
  border: 1px solid currentColor; background: transparent; transition: background .18s, border-color .18s; }
.map-quick .overview-btn.active { color: var(--cinnabar); border-color: rgba(164,63,50,.34); background: rgba(164,63,50,.07); }
.map-quick .overview-btn.active .scope-dot { background: var(--cinnabar); border-color: var(--cinnabar); }

.map-detail { top: 76px; right: 20px; z-index: 650; width: 380px; height: calc(100dvh - 104px);
  border-radius: 20px; padding: 0; overflow: hidden; flex-direction: column; }
.map-detail.show { display: flex; animation: detail-in .22s ease-out; }
@keyframes detail-in { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }
.detail-header { position: relative; padding: 20px 20px 0; flex: none; }
.detail-header::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 3px;
  border-left: 1px solid rgba(201,74,56,.20); }
.detail-header::after { content: ""; position: absolute; left: 10px; top: 27px; width: 7px; height: 7px;
  border-radius: 1px; background: var(--seal-red); opacity: .72; }
.map-detail .close { position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; display: grid;
  place-items: center; border-radius: 9px; color: var(--text-dim); background: transparent; font-size: 22px; }
.map-detail .close:hover { color: var(--cinnabar); background: rgba(164,63,50,.07); }
.detail-kicker { display: flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 11px; letter-spacing: 2px; }
.detail-kicker span { width: 8px; height: 8px; border-radius: 1px; box-shadow: 0 0 0 2px rgba(201,74,56,.10); }
.detail-kicker span.is-photo { width: 28px; height: 28px; border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 2px rgba(201,74,56,.10); }
.detail-kicker span.is-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.map-detail h2 { font-size: 26px; margin-top: 8px; letter-spacing: 2px; }
.map-detail .role { font-size: 12px; margin-top: 6px; }
.map-detail .summary { font-size: 13px; line-height: 1.75; margin-top: 13px; }
.detail-stats { margin-top: 15px; padding: 11px 0 0; border-top: 1px solid var(--border); }
.detail-stats span { display: block; text-align: left; }
.detail-stats .scroll-caption { color: var(--cinnabar); font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 12px; letter-spacing: 2px; }
.detail-stats .scroll-route { margin-top: 6px; color: var(--text-dim); font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 12px; line-height: 1.7; }
.detail-tabs { display: flex; margin: 14px 20px 0; border-bottom: 1px solid var(--border); flex: none; }
.detail-tabs button { position: relative; flex: 1; min-height: 42px; padding: 9px 4px 12px; color: var(--text-dim);
  background: none; font-size: 12px; }
.detail-tabs button::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: -1px; height: 2px;
  border-radius: 2px; background: transparent; }
.detail-tabs button.active { color: var(--cinnabar); }
.detail-tabs button.active::after { background: var(--cinnabar); }
.detail-tabs button span { margin-left: 4px; color: var(--gold); font-size: 10px; }
.detail-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 20px; scrollbar-width: thin; scrollbar-gutter: stable;
  background: linear-gradient(90deg, rgba(201,74,56,.15), rgba(201,74,56,.15)) 11px 0 / 1px 100% no-repeat; }
.detail-scroll [hidden] { display: none !important; }
#dTP.page-turn, #dTL.page-turn { transform-origin: left center; animation: folio-turn .3s ease-out; }
@keyframes folio-turn { from { opacity: .25; transform: perspective(700px) rotateY(-4deg) translateX(5px); }
  to { opacity: 1; transform: perspective(700px) rotateY(0) translateX(0); } }
.d-event { margin: 0 0 16px; padding: 14px; border-radius: 12px; background: rgba(164,63,50,.08); border: 1px solid rgba(164,63,50,.2); }
.d-event-year { color: var(--gold); font-size: 11px; font-weight: 700; }
.d-event h3 { font-size: 15px; margin-top: 5px; }
.d-event p { color: var(--text-dim); font-size: 12px; line-height: 1.7; margin-top: 7px; }
.d-event-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.d-event-tags span { color: var(--accent2); background: rgba(128,103,74,.1); border-radius: 999px; padding: 3px 8px; font-size: 10px; }
.tp-list { display: grid; gap: 9px; }
.tp-item { display: grid; grid-template-columns: 56px minmax(0,1fr); column-gap: 10px; width: 100%; padding: 14px;
  margin: 0; text-align: left; color: var(--text); border-radius: 12px; background: rgba(255,255,255,.025); }
.tp-item:hover { border-color: rgba(164,63,50,.5); background: rgba(164,63,50,.08); transform: none; }
.tp-item.active { border-color: var(--accent); background: rgba(164,63,50,.1); }
.tp-item .yr { grid-row: 1 / 3; padding-top: 2px; color: var(--gold); font-size: 11px; }
.tp-item .tt { font-size: 14px; line-height: 1.45; }
.tp-item .em { margin-top: 5px; color: var(--accent2); font-size: 11px; }
.tl-h { display: block; padding: 0; overflow: visible; border: 0; }
.tl-item { position: relative; display: grid; grid-template-columns: 52px 16px minmax(0,1fr); column-gap: 10px;
  align-items: start; width: 100%; min-height: 48px; padding: 10px 8px; color: var(--text); background: none;
  border-radius: 10px; text-align: left; }
.tl-item::before { content: ""; position: absolute; top: 0; bottom: 0; left: 77px; width: 1px; height: auto; background: var(--border); }
.tl-item:first-child::before { display: block; top: 50%; }
.tl-item:last-child::before { bottom: 50%; }
.tl-item:hover { background: rgba(164,63,50,.055); }
.tl-dot { grid-column: 2; display: block; width: 10px; height: 10px; margin: 3px auto 0; position: relative; z-index: 1; }
.tl-year { grid-column: 1; grid-row: 1; font-size: 11px; }
.tl-ev { grid-column: 3; grid-row: 1; margin: 0; color: var(--text); font-size: 12px; line-height: 1.45; }
.tl-item.active { background: rgba(164,63,50,.1); }
.tl-item:disabled { cursor: default; opacity: .42; }
.detail-source { color: var(--text-dim); font-size: 10px; line-height: 1.7; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.detail-footer { padding: 14px 20px 18px; border-top: 1px solid var(--border); flex: none; background: rgba(238,228,207,.48); }
.map-detail .talk-btn { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between;
  margin: 0; padding: 12px 15px; font-size: 13px; border-radius: 12px; }
.map-detail .talk-btn:hover { filter: brightness(1.1); }

.legend { bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 7px;
  white-space: nowrap; background: rgba(255,250,240,.88); backdrop-filter: blur(12px); border-radius: 999px;
  padding: 9px 14px; font-size: 11px; box-shadow: 0 8px 25px rgba(79,57,31,.13); }
.legend b { font-weight: 400; margin-left: 8px; }
.legend-line { width: 20px; border-top: 2px dashed var(--cinnabar); }

/* 图例中的低谷：与地图节点一致，用缩小的乌云 + 闪电组合图标，闪电压在云上方。 */
.legend-icon { position: relative; flex: none; width: 13px; height: 20px; margin-left: 6px; }
.legend-icon.low { width: 18px; }
.legend-icon.low::before { content: ""; position: absolute; z-index: 1; left: 50%; top: 1px; width: 18px; height: 12px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 28% 68%, var(--cloud-a) 0 34%, transparent 37%),
    radial-gradient(circle at 52% 38%, var(--cloud-b) 0 39%, transparent 42%),
    radial-gradient(circle at 76% 70%, var(--cloud-c) 0 36%, transparent 40%);
  filter: drop-shadow(0 1px 2px rgba(82,66,46,.22)); animation: omen-cloud 2.2s ease-in-out infinite; }
.legend-icon.low::after { content: ""; position: absolute; z-index: 2; left: 50%; top: 4px; width: 6px; height: 10px;
  pointer-events: none; background: var(--bolt);
  clip-path: polygon(55% 0, 100% 0, 68% 40%, 96% 40%, 18% 100%, 38% 56%, 8% 56%);
  filter: drop-shadow(1px 0 0 var(--bolt-outline)) drop-shadow(-1px 0 0 var(--bolt-outline));
  animation: omen-flash 1.5s steps(2, end) infinite; }
.legend-icon.high::before { content: ""; position: absolute; left: 50%; bottom: 0; width: 13px; height: 18px;
  pointer-events: none; transform-origin: 50% 100%;
  background: radial-gradient(circle at 50% 76%, #fff3b0 0 14%, #ffc75a 16% 34%, #f06a3c 38% 62%, rgba(240,106,60,.78) 66%, transparent 72%);
  clip-path: polygon(50% 0, 67% 28%, 80% 48%, 100% 72%, 88% 100%, 12% 100%, 0 72%, 18% 45%, 32% 25%);
  filter: drop-shadow(0 0 3px rgba(240,106,60,.4)); animation: flame-flicker .9s ease-in-out infinite alternate; }

/* 地点故事：突出当前节点，并支持顺序阅读。 */
.story-panel { height: 100%; }
#storyContent { display: flex; flex: 1; height: 100%; min-height: 0; overflow: hidden; }
.story-panel .life-popup { display: flex; flex: 1; height: 100%; min-height: 0; overflow: hidden; background: transparent; border: 0; box-shadow: none; }
.story-panel .popup-card { display: flex; flex: 1; flex-direction: column; width: 100%; height: 100%; min-height: 0; padding: 0; }
.popup-card { position: relative; }
.popup-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 24px; scrollbar-width: thin; scrollbar-gutter: stable; }
.popup-dock { flex: none; padding: 12px 24px 20px; border-top: 1px solid var(--border); background: rgba(255,250,240,.96); }
.popup-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 9px; color: var(--text-dim); background: transparent; font-size: 22px; }
.popup-close:hover { color: var(--cinnabar); background: rgba(164,63,50,.07); }
.popup-topline { display: flex; justify-content: space-between; align-items: center; padding-right: 34px; font-size: 11px; letter-spacing: 1px; }
.story-panel .popup-topline { padding-right: 76px; }
.popup-topline > span:last-child { color: var(--gold); font-weight: 700; }
.popup-person { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.popup-avatar { width: 18px; height: 18px; border-radius: 3px; object-fit: cover; flex: none; }
.popup-progress { margin-top: 16px; }
.popup-progress > span { display: block; color: var(--text-dim); font-size: 10px; margin-bottom: 7px; }
.popup-progress > div { height: 3px; border-radius: 3px; background: rgba(103,76,44,.10); overflow: hidden; }
.popup-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.popup-card h3 { font-size: 24px; line-height: 1.35; margin-top: 17px; }
.popup-note { color: var(--text-dim); font-size: 12px; line-height: 1.75; margin-top: 8px; }
.popup-turning { margin-top: 16px; padding: 14px; border-left: 2px solid var(--accent2); border-radius: 0 10px 10px 0; background: rgba(128,103,74,.07); }
.popup-turning b { font-size: 12px; color: var(--accent2); }
.popup-turning p { color: var(--text); font-size: 13px; line-height: 1.8; margin-top: 7px; }
.popup-section-title { color: var(--text-dim); font-size: 11px; margin-top: 20px; }
.popup-timeline { display: flex; overflow-x: auto; padding: 14px 0 10px; scrollbar-width: thin; }
.popup-time-item { position: relative; flex: 0 0 84px; padding: 0 4px; color: var(--text); background: none; text-align: center; }
.popup-time-item::before { content: ""; position: absolute; top: 4px; left: -50%; width: 100%; height: 1px; background: var(--border); }
.popup-time-item:first-child::before { display: none; }
.popup-time-item i { display: block; position: relative; z-index: 1; width: 9px; height: 9px; border-radius: 50%;
  background: var(--gold); margin: 0 auto 8px; }
.popup-time-item.active i, .popup-time-item:hover i { background: var(--accent); box-shadow: 0 0 0 4px rgba(164,63,50,.15); }
.popup-time-item:disabled { opacity: .4; }
.popup-time-item span { display: block; color: var(--gold); font-size: 10px; }
.popup-time-item small { display: block; color: var(--text-dim); font-size: 10px; line-height: 1.45; margin-top: 4px; }
.popup-sequence { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 0; }
.popup-sequence button { min-height: 38px; padding: 8px; color: var(--text); background: rgba(255,255,255,.04);
  border: 1px solid var(--border); border-radius: 10px; font-size: 11px; }
.popup-sequence button:hover:not(:disabled) { border-color: var(--accent); }
.popup-sequence button:disabled { opacity: .35; cursor: default; }
.popup-actions { display: flex; gap: 8px; margin-top: 10px; }
.popup-actions button { flex: 1; min-height: 40px; padding: 10px; border-radius: 10px; font-size: 11px; }
.popup-story { color: var(--accent); background: rgba(164,63,50,.12); border: 1px solid rgba(164,63,50,.25); }
.popup-talk { color: #fffaf0; font-weight: 700; background: linear-gradient(90deg, var(--accent), var(--accent2)); }

.chip-main:focus-visible, .chip-enter:focus-visible, .tp-item:focus-visible, .tl-item:focus-visible, .detail-tabs button:focus-visible,
.popup-sequence button:focus-visible, .popup-actions button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 1100px) {
  .map-dock { right: 12px; left: auto; top: 72px; width: 228px; height: calc(100dvh - 96px); }
  .map-dock.collapsed { width: 48px; height: 48px; }
  .map-detail { width: 330px; right: 12px; top: 72px; height: calc(100dvh - 96px); }
  .story-panel { height: auto; max-height: calc(100dvh - 96px); }
  .legend { left: 80px; transform: none; }
  .legend b { display: none; }
}
/* 矮屏（笔记本小窗、分屏）：进一步压缩头部，避免只露出两三条人物。 */
@media (min-width: 681px) and (max-height: 720px) {
  .map-lead { display: none; }
  .map-dock-title { padding-top: 14px; }
  .map-dock h1 { font-size: 20px; }
  .map-search { margin-top: 10px; }
  .map-search span { display: none; }
  .map-search input { height: 34px; }
  .character-list { gap: 2px; }
  .chip { min-height: 44px; }
}
@media (max-width: 680px) {
  .map-dock { left: 10px; right: 10px; top: auto; bottom: 8px; width: auto; height: min(62dvh, 560px); border-radius: 17px; }
  .map-dock.detail-open, .map-dock.story-open { width: auto; }
  .map-dock.collapsed { right: 10px; left: auto; top: 68px; bottom: auto; width: 46px; height: 46px; }
  .map-dock.collapsed .map-panel-toggle { width: 44px; height: 44px; }
  .map-dock-title { padding: 18px 50px 0 18px; }
  .map-dock h1 { font-size: 22px; }
  .map-lead { display: none; }
  .map-search { margin: 14px 14px 10px; }
  .map-search span { display: none; }
  .character-list { padding: 0 8px 8px; }
  .chip { min-height: 46px; }
  .chip-main { padding: 5px 0 5px 8px; }
  .map-quick { margin: 2px 14px 12px; }
  .map-detail { top: auto; bottom: 8px; left: 8px; right: 8px; width: auto; height: min(62dvh, 590px); border-radius: 18px; }
  .story-panel { height: auto; max-height: 68dvh; }
  .detail-header { padding: 19px 20px 0; }
  .map-detail h2 { font-size: 26px; }
  .map-detail .summary { font-size: 12px; margin-top: 9px; }
  .detail-stats { margin-top: 12px; padding-top: 9px; }
  .detail-stats .scroll-route { font-size: 11px; }
  .detail-tabs { margin: 9px 16px 0; }
  .detail-scroll { padding: 14px 16px; }
  .detail-footer { padding: 11px 16px 14px; }
  .legend, .map-credit { display: none; }
  .popup-scroll { padding: 20px 18px 16px; }
  .popup-dock { padding: 12px 18px 16px; }
  .popup-card h3 { font-size: 21px; }
  .popup-turning p { font-size: 12px; }
}

/* ---------- Dialogue ---------- */
#dialogue { position: fixed; inset: 60px 0 0 0; display: none; }
#dialogue.active { display: flex; }
.dlg-left { width: 320px; background: var(--panel-solid); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; padding: 28px 20px; overflow-y: auto; }
.dlg-left .picker-title { font-size: 12px; color: var(--text-dim); letter-spacing: 2px; margin-bottom: 14px; }
.picker { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.picker .pbtn { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px;
  background: rgba(255,255,255,.03); border: 1px solid transparent; color: var(--text); text-align: left; transition: all .2s; }
.picker .pbtn:hover { background: rgba(164,63,50,.07); }
.picker .pbtn.active { border-color: var(--accent); background: rgba(164,63,50,.14); }
.picker .pbtn .dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.picker .pbtn .pnm { font-size: 14px; }
.portrait-wrap { margin-top: 26px; display: flex; flex-direction: column; align-items: center; }
.portrait { width: 130px; height: 130px; border-radius: 26px; display: grid; place-items: center;
  font-size: 48px; font-weight: 800; color: #fffaf0; position: relative; box-shadow: var(--shadow); }
.mouth { position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: 34px; height: 8px; background: #2a1818; border-radius: 0 0 18px 18px; }
.portrait.speaking .mouth { animation: talk .22s infinite alternate; }
@keyframes talk { from { height: 6px; width: 30px; } to { height: 20px; width: 38px; border-radius: 0 0 20px 20px; } }
.dlg-name { margin-top: 14px; font-size: 18px; font-weight: 700; }
.dlg-role { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; text-align: center; padding: 0 10px; }
.dlg-source { margin-top: 16px; font-size: 11px; color: var(--text-dim); text-align: center;
  background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; line-height: 1.5; }

.dlg-right { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat { flex: 1; overflow-y: auto; padding: 26px 30px; }
.hint { color: var(--text-dim); font-size: 13px; text-align: center; margin-top: 12px; }
.msg { display: flex; margin-bottom: 16px; }
.msg.user { justify-content: flex-end; }
.msg .bubble { max-width: 70%; padding: 12px 16px; border-radius: 16px; font-size: 14.5px; line-height: 1.65; }
.msg.user .bubble { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fffaf0; border-bottom-right-radius: 4px; }
.msg.char .bubble { background: var(--panel-solid); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.char .who { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.mode-tag { font-size: 10px; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.mode-llm { background: rgba(78,118,94,.18); color: var(--green); border: 1px solid rgba(78,118,94,.4); }
.mode-script { background: rgba(154,113,46,.16); color: var(--gold); border: 1px solid rgba(154,113,46,.4); }
.mode-default { background: rgba(120,109,94,.16); color: var(--text-dim); border: 1px solid var(--border); }
.input-bar { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); background: var(--bg-soft); }
#msgInput { flex: 1; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel-solid); color: var(--text); font-size: 14px; outline: none; }
#msgInput:focus { border-color: var(--accent); }
#sendBtn { padding: 0 24px; border-radius: 12px; font-weight: 700; font-size: 14px;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fffaf0; }
#voiceBtn { padding: 0 16px; border-radius: 12px; background: rgba(255,255,255,.06); font-size: 18px; }
.disclaimer { padding: 8px 24px 14px; font-size: 11px; color: var(--text-dim); background: var(--bg-soft); }

/* ---------- Contribute & Admin ---------- */
.contribute-entry { width: calc(100% - 48px); max-width: 1052px; margin: 26px auto 0; padding: 24px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: linear-gradient(110deg, rgba(164,63,50,.10), rgba(128,103,74,.08));
  border: 1px solid rgba(164,63,50,.24); border-radius: 16px; }
.entry-kicker { color: var(--gold); font-size: 11px; letter-spacing: 2px; }
.contribute-entry h2 { margin-top: 7px; font-size: 20px; }
.contribute-entry > a { flex: none; padding: 12px 18px; border-radius: 11px; color: #fffaf0;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); font-size: 14px; font-weight: 700; }
.contribute-entry > a span { margin-left: 12px; }
.form-page, .admin-page { height: 100dvh; overflow-y: auto; padding: 106px 24px 60px;
  background: radial-gradient(800px 400px at 50% 0%, rgba(164,63,50,.07), transparent); }
/* 纸本档案：本页局部色值覆盖，避免波及其它页面 */
.form-page { padding-bottom: 0; --panel: #fffdf7; --panel-solid: #fffdf7; --text-dim: #6f6557; --gold: #8f6a2d;
  --border: rgba(91, 68, 43, .16); }
.form-hero { max-width: 1080px; margin: 0 auto 32px; display: grid;
  grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; align-items: center; text-align: left; }
.form-hero h1, .admin-head h1 { margin-top: 10px; font-size: 34px; letter-spacing: 2px; line-height: 1.32; }
.form-hero p, .admin-head p { margin-top: 12px; color: var(--text-dim); font-size: 15px; line-height: 1.75; }
.hero-proof { margin-top: 14px; font-size: 12px; color: var(--text-dim); }
.hero-proof b { color: var(--accent); font-weight: 700; }
.hero-preview { margin: 0; padding: 18px 18px 14px; border: 1px solid var(--border); border-radius: 16px;
  background: var(--panel); box-shadow: 0 10px 28px rgba(70, 52, 30, .08); }
.preview-label { display: block; color: var(--gold); font-size: 11px; letter-spacing: 2px; }
.hero-preview svg { display: block; width: 100%; height: auto; margin-top: 6px; }
.preview-arc { fill: none; stroke: rgba(173, 68, 51, .5); stroke-width: 1.6; stroke-dasharray: 5 5; }
.preview-dot { fill: var(--panel); stroke: var(--accent); stroke-width: 2; }
.preview-dot.is-start { fill: var(--accent); }
.preview-time { fill: var(--text-dim); font-size: 10px; letter-spacing: .5px; }
.hero-preview figcaption { margin-top: 6px; color: var(--text-dim); font-size: 11px; line-height: 1.6; }
.submission-layout { max-width: 1080px; margin: 0 auto; display: grid;
  grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.submission-form-card, .submission-guide, .submission-card { background: var(--panel); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); }
.submission-form-card { padding: 32px; border-radius: 18px; box-shadow: 0 12px 32px rgba(70, 52, 30, .10); }
.form-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.form-step, .guide-label { color: var(--accent); font-size: 11px; letter-spacing: 2px; }
.form-card-head h2 { margin-top: 6px; font-size: 21px; }
.required-note { color: var(--text-dim); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field > span { color: var(--text); font-size: 14px; font-weight: 650; }
.field small { color: var(--text-dim); font-size: 12px; line-height: 1.6; }
.field input, .field textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px;
  background: #fffdf9; color: var(--text); padding: 12px 14px; font: inherit; font-size: 15px;
  line-height: 1.65; outline: none; resize: vertical; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(164,63,50,.10); }
.field input::placeholder, .field textarea::placeholder { color: #8a7c68; }
.field-error { display: none; color: var(--red); font-size: 12px; line-height: 1.5; }
.field.invalid .field-error { display: block; }
.field.invalid input, .field.invalid textarea { border-color: var(--red); box-shadow: 0 0 0 3px rgba(176,82,69,.08); }
.field-hint { display: flex; flex-wrap: wrap; gap: 6px; }
.field-hint [data-counter] { font-variant-numeric: tabular-nums; }
.field-hint [data-counter].ok { color: var(--green); }
.primary-btn, .secondary-btn, .danger-btn { display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 700; }
.primary-btn { background: linear-gradient(90deg, var(--accent), var(--accent2)); color: #fffaf0; }
.secondary-btn { background: rgba(255,255,255,.05); color: var(--text); border: 1px solid var(--border); }
.danger-btn { background: rgba(176,82,69,.08); color: var(--red); border: 1px solid rgba(176,82,69,.25); }
.primary-btn:hover, .secondary-btn:hover, .danger-btn:hover { filter: brightness(1.12); }
.form-alert { max-width: 1080px; margin: 0 0 18px; padding: 13px 15px; border-radius: 10px; font-size: 13px; line-height: 1.6; }
.form-alert.success { color: var(--green); background: rgba(78,118,94,.08); border: 1px solid rgba(78,118,94,.25); }
.form-alert.error { color: var(--red); background: rgba(176,82,69,.08); border: 1px solid rgba(176,82,69,.25); }
.form-alert.success b, .form-alert.success span { display: block; }
.submission-guide { padding: 24px; }
.submission-guide .guide-line { margin-top: 16px; color: var(--text-dim); font-size: 12.5px; line-height: 1.8; }
.node-section { margin: 32px 0 28px; padding-top: 24px; border-top: 1px dashed var(--border); }
.node-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.node-section-title { display: block; color: var(--text); font-size: 15px; font-weight: 700; }
.node-count { flex: none; padding: 5px 10px; border-radius: 999px; background: rgba(164,63,50,.10); color: var(--accent); font-size: 12px; }
.node-list { position: relative; display: flex; flex-direction: column; gap: 16px; }
.node-list::before { content: ''; position: absolute; left: 13px; top: 14px; bottom: 14px; width: 2px;
  background: rgba(91,68,43,.18); }
.node-item { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 16px; align-items: start; }
.node-dot { position: relative; z-index: 1; width: 28px; height: 28px; margin-top: 6px; display: grid; place-items: center;
  border: 2px solid rgba(173,68,51,.4); border-radius: 50%; background: var(--panel-solid);
  color: var(--accent); font-size: 12px; font-weight: 700; }
.node-item:first-child .node-dot { background: var(--accent); border-color: var(--accent); color: #fffaf0; }
.node-body { padding: 14px 16px 16px; border: 1px solid var(--border); border-radius: 12px; background: rgba(120,94,58,.03); }
.node-body-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.node-kicker { color: var(--text-dim); font-size: 12px; font-weight: 650; letter-spacing: 1px; }
.node-item:first-child .node-kicker { color: var(--accent); }
.node-remove { min-height: 32px; padding: 0 10px; border-radius: 8px; background: transparent; color: var(--text-dim); font-size: 12px; }
.node-remove:hover { color: var(--red); background: rgba(176,82,69,.08); }
.node-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.node-add { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 16px;
  align-items: center; min-height: 44px; padding: 2px 0; background: transparent; text-align: left; }
.node-add-dot { width: 28px; height: 28px; display: grid; place-items: center; border: 1.5px dashed rgba(173,68,51,.55);
  border-radius: 50%; background: var(--panel-solid); color: var(--accent); font-size: 16px; line-height: 1; }
.node-add-text b { display: block; color: var(--accent); font-size: 14px; font-weight: 650; }
.node-add:hover .node-add-dot { background: rgba(173,68,51,.08); border-color: var(--accent); }
.node-add:disabled { opacity: .55; cursor: not-allowed; }
.optional-panel { margin: 4px 0 8px; padding-top: 20px; border-top: 1px dashed var(--border); }
.optional-panel > summary { display: flex; align-items: center; gap: 12px; min-height: 44px; list-style: none; cursor: pointer; }
.optional-panel > summary::-webkit-details-marker { display: none; }
.optional-title { color: var(--text); font-size: 14px; font-weight: 650; }
.optional-panel > summary::after { content: '+'; color: var(--accent); font-size: 18px; line-height: 1; }
.optional-panel[open] > summary::after { content: '−'; }
.optional-grid { margin-top: 16px; }
.form-actions { position: relative; z-index: 20; margin: 32px -32px -32px; padding: 16px 32px 18px;
  border-top: 1px solid var(--border); border-radius: 0 0 18px 18px;
  background: rgba(255,253,247,.96); backdrop-filter: blur(10px); }
.form-actions-row { display: flex; align-items: center; gap: 24px; }
.form-page .form-actions .consent { flex: 1; min-width: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; font-size: 12px; line-height: 1.65; }
.form-actions .consent.invalid { color: var(--red); }
.form-actions .primary-btn { flex: none; min-height: 48px; padding: 0 28px; border-radius: 12px;
  background: linear-gradient(92deg, #ad4433, #8a5a3c); font-size: 15px;
  box-shadow: 0 6px 16px rgba(173,68,51,.18); transition: transform .18s ease-out, box-shadow .18s ease-out; }
.form-actions .primary-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(173,68,51,.24); filter: none; }
.form-actions .primary-btn span { margin-left: 14px; }
.form-actions .form-privacy { margin-top: 10px; font-size: 12px; }
.page-footer-utility { max-width: 1080px; margin: 28px auto 44px; text-align: center; }
.staff-link { display: inline-block; padding: 8px 6px; color: var(--text-dim); font-size: 12px;
  border-bottom: 1px dashed transparent; }
.staff-link:hover { color: var(--text); border-bottom-color: currentColor; }
.admin-page { padding-top: 96px; }
.admin-head, .admin-tabs, .submission-records { max-width: 1080px; margin-left: auto; margin-right: auto; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.admin-head h1 { font-size: 28px; }
.admin-head p { margin-top: 8px; }
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.admin-tabs a { padding: 9px 13px; border: 1px solid var(--border); border-radius: 10px; color: var(--text-dim); font-size: 13px; }
.admin-tabs a.active { color: var(--text); background: rgba(164,63,50,.12); border-color: rgba(164,63,50,.35); }
.admin-tabs a span { margin-left: 6px; color: var(--accent); }
.submission-card { margin-bottom: 14px; overflow: hidden; }
.submission-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 18px 20px; cursor: pointer; list-style: none; }
.submission-card > summary::-webkit-details-marker { display: none; }
.submission-summary { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.submission-summary h2 { font-size: 16px; line-height: 1.5; }
.submission-summary p { margin-top: 4px; color: var(--text-dim); font-size: 12px; }
.status-badge { flex: none; padding: 4px 8px; border-radius: 999px; font-size: 11px; }
.status-badge.pending { color: var(--gold); background: rgba(154,113,46,.12); }
.status-badge.approved { color: var(--accent); background: rgba(164,63,50,.12); }
.status-badge.published { color: var(--green); background: rgba(78,118,94,.12); }
.status-badge.rejected { color: var(--red); background: rgba(176,82,69,.12); }
.edit-hint { flex: none; color: var(--accent); font-size: 12px; }
.admin-form { padding: 22px; border-top: 1px solid var(--border); background: rgba(120,94,58,.035); }
.record-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 20px; color: var(--text-dim); font-size: 11px; }
.curation-section { margin-top: 22px; padding: 18px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.02); }
.curation-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.curation-title > span { color: var(--accent); font-size: 13px; font-weight: 700; }
.curation-title small { color: var(--text-dim); font-size: 11px; }
.node-review-list { display: flex; flex-direction: column; gap: 12px; list-style: none; }
.node-review-list li { display: flex; gap: 12px; }
.node-review-index { flex: none; width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(164,63,50,.13); color: var(--accent); font-size: 11px; }
.node-review-meta { color: var(--text); font-size: 12.5px; font-weight: 650; }
.node-review-summary { margin-top: 4px; color: var(--text-dim); font-size: 12px; line-height: 1.7; white-space: pre-wrap; }
.admin-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.admin-empty { padding: 70px 20px; text-align: center; color: var(--text-dim); }
.admin-empty > span { color: var(--green); font-size: 30px; }
.admin-empty h2 { margin-top: 12px; color: var(--text); font-size: 18px; }
.admin-empty p { margin-top: 8px; font-size: 13px; }
.admin-empty .secondary-btn { margin-top: 16px; }

@media (max-width: 760px) {
  .submission-layout { grid-template-columns: 1fr; }
  .submission-guide { order: 2; }
  .form-hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-preview { max-width: 360px; }
  .admin-head { align-items: flex-start; }
  .contribute-entry { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 680px) {
  header { padding: 0 12px; }
  .brand .sub { display: none; }
  .brand .logo { font-size: 16px; letter-spacing: 1px; }
  nav { gap: 2px; }
  nav a { padding: 7px; font-size: 12px; white-space: nowrap; }
  .form-page, .admin-page { padding: 88px 14px 40px; }
  .form-hero { margin-bottom: 24px; }
  .form-hero h1 { font-size: 26px; letter-spacing: 1px; }
  .form-hero p { font-size: 14px; }
  .submission-form-card { padding: 20px 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 16px; }
  .field-full { grid-column: auto; }
  .field input, .field textarea { font-size: 16px; }
  .node-grid { grid-template-columns: 1fr; }
  .node-section-head { flex-direction: column; gap: 8px; }
  .node-list { gap: 14px; }
  .node-list::before { left: 11px; }
  .node-item { grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; }
  .node-dot { width: 24px; height: 24px; margin-top: 4px; font-size: 11px; }
  .node-body { padding: 12px 12px 14px; }
  .node-remove { min-height: 44px; padding: 0 12px; }
  .node-add { grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; }
  .node-add-dot { width: 24px; height: 24px; }
  .form-actions { margin: 24px -16px -20px; padding: 12px 16px 14px; border-radius: 0 0 14px 14px; }
  .form-actions-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .form-actions .primary-btn { width: 100%; min-height: 52px; }
  .form-actions .form-privacy { margin-top: 8px; }
  .page-footer-utility { margin: 24px 0 8px; }
  .contribute-entry { width: calc(100% - 32px); padding: 20px; }
  .contribute-entry h2 { font-size: 18px; }
  .admin-head { flex-direction: column; }
  .admin-head h1 { font-size: 25px; }
  .submission-card > summary { padding: 16px; }
  .submission-summary { flex-direction: column; gap: 8px; }
  .edit-hint { display: none; }
  .admin-form { padding: 16px; }
  .curation-section { padding: 14px; }
  .curation-title { align-items: flex-start; flex-direction: column; gap: 5px; }
  .admin-actions { justify-content: stretch; }
  .admin-actions button { flex: 1 1 140px; }
}

/* ---------- 3D 地球 ---------- */
#globe { position: fixed; inset: 60px 0 0; background: var(--bg); }
.globe-loading { position: fixed; top: 50%; left: 50%; z-index: 900; transform: translate(-50%, -50%);
  padding: 12px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
  color: var(--text-dim); font-size: 13px; letter-spacing: 1px; }
.globe-panel { left: 20px; right: auto; z-index: 800; }
.globe-panel .chip { flex: none; padding: 9px 10px; }
.globe-panel .chip .stops { margin-left: 4px; }
.mode-switch { display: flex; flex: none; gap: 6px; margin: 14px 18px 12px; }
.mode-switch button { flex: 1; min-height: 32px; padding: 6px 10px; border: 1px solid transparent;
  border-radius: 9px; background: rgba(255,255,255,.035); color: var(--text-dim); font-size: 11px; }
.mode-switch button:hover { color: var(--text); border-color: var(--border); }
.mode-switch button.active { color: var(--cinnabar); background: rgba(201,74,56,.09); border-color: rgba(201,74,56,.28); }
.globe-actions { position: fixed; left: 320px; bottom: 18px; z-index: 800; display: flex; gap: 8px; align-items: center; }
.globe-actions button, .globe-actions a { min-height: 38px; padding: 9px 14px; border: 1px solid var(--border);
  border-radius: 11px; background: var(--panel); color: var(--text-dim); font-size: 12px; backdrop-filter: blur(12px); }
.globe-actions button:hover, .globe-actions a:hover { color: var(--text); border-color: var(--accent); }
.globe-actions button.active { color: #fffaf0; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.globe-actions a { color: var(--accent); }
.globe-info, .globe-spot { position: fixed; right: 20px; z-index: 800; width: 320px; padding: 18px;
  border: 1px solid var(--border); border-radius: 18px; background: var(--panel); box-shadow: var(--shadow);
  backdrop-filter: blur(20px); }
.globe-info { top: 76px; }
.globe-info .gi-color { width: 10px; height: 10px; border-radius: 50%; background: var(--cinnabar); }
.globe-info .gi-avatar { display: block; width: 36px; height: 36px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border); background: rgba(255,255,255,.04); }
.globe-info .gi-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.globe-info h3 { margin-top: 8px; font-size: 22px; letter-spacing: 1px; }
.globe-info .gi-role { margin-top: 4px; color: var(--text-dim); font-size: 12px; }
.globe-info .gi-text { margin-top: 12px; color: var(--text-dim); font-size: 12.5px; line-height: 1.7; }
.globe-info .gi-stats { display: flex; gap: 12px; margin-top: 12px; color: var(--text-dim); font-size: 11px; }
.globe-info .gi-stats b { margin-right: 3px; color: var(--text); }
.globe-info .gi-link { display: inline-block; margin-top: 14px; color: var(--accent); font-size: 12px; }
.globe-spot { bottom: 76px; }
.globe-spot .gs-close { position: absolute; top: 8px; right: 10px; background: none; color: var(--text-dim); font-size: 18px; }
.globe-spot .gs-kind { font-size: 10px; letter-spacing: 1px; }
.globe-spot h4 { margin-top: 6px; font-size: 16px; }
.globe-spot p { margin-top: 6px; color: var(--text-dim); font-size: 12px; line-height: 1.6; }
.globe-spot .gs-area { color: var(--accent); }
.globe-label { position: absolute; white-space: nowrap; pointer-events: none; letter-spacing: .5px;
  color: var(--text-dim); text-shadow: 0 1px 2px var(--bg), 0 0 6px var(--bg); }
.globe-label.globe-country { font-size: 11px; }
.globe-label.globe-city { font-size: 9.5px; opacity: .8; }
body.mode-texture .globe-label { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 7px rgba(0,0,0,.8); }
.maplibregl-ctrl-group { background: var(--panel-solid); }
.maplibregl-ctrl-group button { background: transparent; }
.maplibregl-ctrl-attrib { background: var(--panel); color: var(--text-dim); }
.maplibregl-ctrl-attrib a { color: var(--accent); }

/* ---------- 需求调研看板 ---------- */
#research { height: 100vh; padding: 92px 0 60px; overflow-y: auto; }
.rs-hero { max-width: 1100px; margin: 0 auto; padding: 0 24px 10px; }
.rs-eyebrow { color: var(--accent); font-size: 10px; letter-spacing: 3px; }
#research h1 { margin-top: 8px; font-size: 32px; letter-spacing: 3px; }
.rs-lead { max-width: 800px; margin-top: 12px; color: var(--text-dim); font-size: 13.5px; line-height: 1.8; }
.rs-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.rs-stat { flex: 1 1 130px; padding: 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--panel); box-shadow: var(--shadow); }
.rs-stat b { display: block; color: var(--gold); font-size: 22px; }
.rs-stat span { color: var(--text-dim); font-size: 11px; }
.rs-block { max-width: 1100px; margin: 34px auto 0; padding: 0 24px; }
.rs-block h2 { padding-bottom: 8px; border-bottom: 1px solid var(--border); color: var(--text); font-size: 16px; letter-spacing: 2px; }
.rs-note { margin-top: 10px; color: var(--text-dim); font-size: 12px; line-height: 1.7; }
.rs-method { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 14px; }
.rs-card, .rs-group { padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.rs-card h3 { color: var(--accent); font-size: 13px; letter-spacing: 1px; }
.rs-card p { margin-top: 8px; color: var(--text-dim); font-size: 12px; line-height: 1.75; }
.rs-card .rs-formula { color: var(--gold); font-size: 11.5px; }
.rs-table-wrap { margin-top: 14px; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.rs-table { width: 100%; border-collapse: collapse; background: var(--panel); font-size: 12px; }
.rs-table th { padding: 10px; background: var(--bg-soft); color: var(--text-dim); font-weight: 500;
  text-align: left; white-space: nowrap; }
.rs-table td { padding: 9px 10px; border-top: 1px solid var(--border); vertical-align: top; }
.rs-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.rs-table .mono { color: var(--text-dim); font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; }
.rs-table .rs-note-cell { max-width: 320px; color: var(--text-dim); font-size: 11px; }
.rs-table a { color: var(--accent); }
.rs-badge { display: inline-block; padding: 2px 7px; border-radius: 999px; background: rgba(120,109,94,.12);
  color: var(--text-dim); font-size: 10px; white-space: nowrap; }
.rs-badge.ok { background: rgba(78,118,94,.13); color: var(--green); }
.rs-badge.warn { background: rgba(176,82,69,.12); color: var(--red); }
.rs-tag { display: inline-block; margin: 0 4px 2px 0; padding: 2px 6px; border-radius: 5px;
  background: rgba(128,103,74,.10); color: var(--accent2); font-size: 10px; }
.rs-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 14px; }
.rs-shot { display: block; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.rs-shot img { display: block; width: 100%; height: 120px; object-fit: cover; object-position: top; }
.rs-shot span { display: block; padding: 7px 8px; color: var(--text-dim); font-size: 10.5px; }
.rs-shot:hover { border-color: var(--accent); }
.rs-bars { display: grid; gap: 7px; margin-top: 14px; }
.rs-bar { display: grid; grid-template-columns: 84px 1fr 110px; gap: 10px; align-items: center; font-size: 12px; }
.rs-bar-name { color: var(--text); }
.rs-bar-track { height: 8px; overflow: hidden; border-radius: 4px; background: rgba(120,109,94,.12); }
.rs-bar-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--cinnabar), var(--accent2)); }
.rs-bar-val { color: var(--text-dim); font-size: 10.5px; text-align: right; }
.rs-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.rs-filters button { padding: 7px 14px; border: 1px solid transparent; border-radius: 8px;
  background: rgba(255,255,255,.035); color: var(--text-dim); font-size: 12px; }
.rs-filters button.active { color: var(--cinnabar); background: rgba(201,74,56,.09); border-color: rgba(201,74,56,.28); }
.rs-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; margin-top: 14px; }
.rs-group.on { border-color: rgba(78,118,94,.4); background: rgba(78,118,94,.06); }
.rs-group-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rs-group-meta { margin-top: 8px; color: var(--text-dim); font-size: 10.5px; }
.rs-group-members { margin: 10px 0 0; padding: 0; list-style: none; }
.rs-group-members li { display: grid; grid-template-columns: 78px 1fr auto; gap: 6px; align-items: center;
  padding: 5px 0; border-top: 1px dashed var(--border); color: var(--text); font-size: 12px; }
.rs-group-members li:first-child { border-top: 0; }
.rs-group-members b { font-weight: 500; }
.rs-group-members .rs-gm-tags { min-width: 0; }
.rs-group-members em { color: var(--gold); font-style: normal; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.rs-group-sec { margin-top: 10px; color: var(--text-dim); font-size: 10.5px; line-height: 1.7; }
.rs-group-sec > b { display: block; margin-bottom: 2px; color: var(--text); font-weight: 500; }
.rs-checks { margin: 0; padding: 0; list-style: none; }
.rs-checks li { display: flex; justify-content: space-between; gap: 8px; padding: 1px 0; }
.rs-checks li.ok { color: var(--green); }
.rs-checks li.bad { color: var(--red); }
.rs-checks li span:last-child { color: var(--text-dim); }
.rs-group-dim { margin-top: 10px; color: var(--text-dim); font-size: 10.5px; line-height: 1.6; }
.rs-sub { margin-top: 22px; color: var(--text); font-size: 13px; letter-spacing: 1px; }
.rs-plan-meta { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-soft); color: var(--text-dim); font-size: 11.5px; line-height: 1.8; }
.rs-plan-meta b { color: var(--accent); font-weight: 500; }
.rs-batch-table td { font-size: 11.5px; line-height: 1.7; }
.rs-batch-table td:first-child { white-space: nowrap; }
.rs-batch-table .rs-batch-members { min-width: 250px; color: var(--text-dim); }
.rs-batch-table .rs-batch-members b { color: var(--text); font-weight: 500; }
.rs-verdict.ok { color: var(--green); }
.rs-verdict.bad { color: var(--red); }
.rs-verdict.none { color: var(--text-dim); }

/* ---------- 状态摘要 / 上线核对 ---------- */
.rs-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-top: 14px; }
.rs-status-card p { line-height: 1.9; }
.rs-verify { margin-top: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.rs-verify-head { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-dim); font-size: 11.5px; }
.rs-verify-head b { color: var(--gold); font-weight: 500; font-variant-numeric: tabular-nums; }
.rs-criteria { display: grid; gap: 4px; margin: 10px 0 0; padding: 0; list-style: none; }
.rs-criteria li { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--text-dim); font-size: 11.5px; line-height: 1.6; }
.rs-criteria b { color: var(--text); font-weight: 500; }
.rs-verify-details { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.rs-verify-details summary { color: var(--accent); font-size: 11.5px; cursor: pointer; }
.rs-verify-details ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-dim); font-size: 11.5px; line-height: 1.8; }
.rs-verify-details li b { color: var(--text); font-weight: 500; }
.rs-warn-note { padding: 8px 12px; border-left: 2px solid var(--red); border-radius: 0 8px 8px 0;
  background: rgba(176, 82, 69, .06); }

/* ---------- 批次表 ---------- */
.rs-batch-traits { min-width: 150px; line-height: 1.9; }

/* ---------- 页内导航：宽屏右侧竖排，窄屏收成可展开按钮 ---------- */
.rs-page-nav { position: fixed; right: 16px; bottom: 16px; z-index: 900; width: 44px; }
.rs-nav-toggle { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 50%;
  background: var(--panel); color: var(--text-dim); cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28); }
.rs-nav-toggle span { display: block; width: 18px; height: 2px; border-radius: 1px; background: currentColor; }
.rs-nav-toggle:hover { color: var(--cinnabar); border-color: rgba(201, 74, 56, .45); }
.rs-nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rs-page-nav-inner { position: absolute; right: 0; bottom: 54px; display: none; flex-direction: column;
  gap: 2px; width: 188px; max-height: 62vh; overflow-y: auto; padding: 8px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--panel);
  box-shadow: 0 14px 38px rgba(0, 0, 0, .32); scrollbar-width: thin; }
.rs-page-nav.open .rs-page-nav-inner { display: flex; }
.rs-page-nav-inner::-webkit-scrollbar { width: 6px; }
.rs-page-nav-inner::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.rs-page-nav a { display: block; width: 100%; padding: 8px 12px; border-radius: 8px;
  color: var(--text-dim); font-size: 12px; line-height: 1.4; text-align: left;
  white-space: nowrap; transition: color .2s, background .2s; }
.rs-page-nav a::before { content: none; }
.rs-page-nav a:hover { color: var(--text); background: rgba(116, 88, 52, .07); }
.rs-page-nav a.active { color: var(--cinnabar); background: rgba(201, 74, 56, .10); }

/* 宽屏：右侧竖排固定章节导航，并为它留出正文空间，不压住正文 */
@media (min-width: 960px) {
  #research { padding-right: 224px; }
  .rs-page-nav { top: 50%; right: 20px; bottom: auto; width: 190px; transform: translateY(-50%); }
  .rs-nav-toggle { display: none; }
  .rs-page-nav-inner { position: static; display: flex; width: 100%;
    max-height: calc(100vh - 140px); padding: 8px;
    border-left: 2px solid var(--accent); border-radius: 0 14px 14px 0;
    background: var(--panel); box-shadow: 0 10px 30px rgba(0, 0, 0, .16); }
  .rs-page-nav a { white-space: normal; }
}

/* ---------- 候选人池滚动区 ---------- */
.rs-candidates-scroll { max-height: min(62vh, 560px); overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent; scrollbar-gutter: stable; }
.rs-candidates-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.rs-candidates-scroll::-webkit-scrollbar-track { background: transparent; }
.rs-candidates-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.rs-candidates-scroll::-webkit-scrollbar-thumb:hover { background: var(--accent); }
.rs-candidates-scroll .rs-table thead th { position: sticky; top: 0; z-index: 2;
  box-shadow: inset 0 -1px 0 var(--border); }

@media (max-width: 860px) {
  .globe-actions { left: 12px; }
  .globe-info, .globe-spot { right: 12px; }
}
@media (max-width: 780px) {
  .rs-bar { grid-template-columns: 64px 1fr; }
  .rs-bar-val { grid-column: 2; text-align: left; }
}
@media (max-width: 680px) {
  .globe-panel { height: min(48dvh, 460px); }
  .globe-actions { top: 68px; bottom: auto; left: 10px; }
  .globe-actions button, .globe-actions a { min-height: 34px; padding: 7px 10px; font-size: 11px; }
  .globe-info { top: 110px; left: 10px; right: 10px; width: auto; max-height: 22dvh; overflow-y: auto; padding: 14px; }
  .globe-info .gi-text { display: none; }
  .globe-spot { left: 10px; right: 10px; bottom: 52dvh; width: auto; }
  #research { padding-top: 82px; }
  #research h1 { font-size: 26px; }
  .rs-hero, .rs-block { padding-left: 16px; padding-right: 16px; }
  .rs-candidates-scroll { max-height: 58vh; }
}

/* ---------- 全局主题 ---------- */
.header-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.theme-toggle { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 7px;
  min-width: 70px; height: 36px; padding: 0 11px; border: 1px solid var(--border); border-radius: 11px;
  background: rgba(255,255,255,.035); color: var(--text-dim); font-size: 12px; transition: all .2s; }
.theme-toggle:hover { color: var(--cinnabar); border-color: rgba(201,74,56,.4); background: rgba(201,74,56,.07); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-sun { display: none; }
[data-theme='dark'] .theme-icon-sun { display: block; }
[data-theme='dark'] .theme-icon-moon { display: none; }

:root[data-theme='dark'] {
  --bg: #171814;
  --bg-soft: #24231d;
  --panel: rgba(39, 38, 31, 0.90);
  --panel-solid: #28271f;
  --border: rgba(211, 190, 153, 0.19);
  --text: #e9dfcf;
  --text-dim: #b6a894;
  --accent: #dc8a70;
  --accent2: #bba07b;
  --gold: #d2af6c;
  --green: #91b598;
  --red: #e08b77;
  --cinnabar: #d63b27;
  --seal-red: #d65b45;
  --mountains-ink: #d8c7ac;
  --paper-fiber: rgba(235,215,180,.025);
  --seal-shadow: 0 0 0 3px rgba(214,91,69,.20);
  --ink: #eee2cf;
  --paper: #211f1a;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}
[data-theme='dark'] body {
  background-image: radial-gradient(1100px 700px at 75% -10%, rgba(214,180,125,.055), transparent 65%),
    repeating-linear-gradient(3deg, rgba(235,215,180,.018) 0 1px, transparent 1px 5px);
}
[data-theme='dark'] header { background: rgba(28, 28, 23, .90); }
[data-theme='dark'] nav a:hover { background: rgba(220,138,112,.08); }
[data-theme='dark'] nav a.active { background: rgba(214,91,69,.10); }
[data-theme='dark'] .hero,
[data-theme='dark'] .form-page,
[data-theme='dark'] .admin-page { background: radial-gradient(800px 400px at 50% 0%, rgba(214,91,69,.075), transparent); }
/* 首页人物图：深色背景改用反相 + 滤色，避免 multiply 叠在深色上整体消失 */
[data-theme='dark'] .hero-fig,
[data-theme='dark'] .fig-item {
  mix-blend-mode: screen;
  filter: grayscale(1) invert(1) contrast(1.05) brightness(.9);
  opacity: .10;
}
[data-theme='dark'] #map { background: #211f19; }
[data-theme='dark'] #map::before { opacity: .16; mix-blend-mode: screen; }
[data-theme='dark'] #map::after { box-shadow: inset 0 0 130px rgba(0,0,0,.30); }
[data-theme='dark'] .amap-maps > .amap-layers > canvas.amap-layer { filter: contrast(1.12) brightness(.78) sepia(.20) saturate(.68); }
[data-theme='dark'] .map-dock,
[data-theme='dark'] .map-detail { background: linear-gradient(155deg, rgba(43,41,33,.97), rgba(29,29,24,.96));
  border-color: rgba(211,190,153,.20); box-shadow: 0 18px 45px rgba(0,0,0,.34); }
[data-theme='dark'] .map-search input,
[data-theme='dark'] .field input,
[data-theme='dark'] .field textarea { background: rgba(27,27,22,.68); }
[data-theme='dark'] .location-note { background: rgba(39,38,31,.97); box-shadow: 0 4px 14px rgba(0,0,0,.28); }
[data-theme='dark'] .legend { background: rgba(39,38,31,.92); box-shadow: 0 8px 25px rgba(0,0,0,.28); }
[data-theme='dark'] .detail-footer { background: rgba(28,27,22,.62); }
[data-theme='dark'] .popup-dock { background: rgba(35,34,27,.97); }
[data-theme='dark'] .popup-actions button,
[data-theme='dark'] .popup-sequence button,
[data-theme='dark'] .overview-btn,
[data-theme='dark'] .secondary-btn,
[data-theme='dark'] .mode-switch button,
[data-theme='dark'] .rs-filters button,
[data-theme='dark'] .theme-toggle { background: rgba(255,248,230,.035); }
[data-theme='dark'] .maplibregl-ctrl-group { box-shadow: 0 0 0 1px var(--border); }
[data-theme='dark'] .maplibregl-ctrl-group button span { filter: invert(1) brightness(1.5); }
[data-theme='dark'] .maplibregl-ctrl-attrib { background: rgba(39,38,31,.86); }
[data-theme='dark'] .staff-link { color: var(--text-dim); }
[data-theme='dark'] .form-page { --panel: #28271f; --panel-solid: #28271f;
  --text-dim: #b6a894; --gold: #d2af6c; --border: rgba(211,190,153,.19); }
[data-theme='dark'] .submission-form-card { box-shadow: 0 12px 32px rgba(0,0,0,.35); }
[data-theme='dark'] .hero-preview { box-shadow: 0 10px 28px rgba(0,0,0,.30); }
[data-theme='dark'] .node-body { background: rgba(255,248,230,.025); }
[data-theme='dark'] .form-page .field input::placeholder,
[data-theme='dark'] .form-page .field textarea::placeholder { color: #a99a84; }
[data-theme='dark'] .form-actions { background: rgba(40,39,31,.96); }

@media (max-width: 900px) {
  .brand .sub { display: none; }
  .header-actions { gap: 7px; }
  nav a { padding-left: 10px; padding-right: 10px; }
}
@media (max-width: 680px) {
  .brand { flex: none; }
  .header-actions { flex: 1; justify-content: flex-end; gap: 5px; }
  nav { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { flex: none; }
  .theme-toggle { min-width: 36px; width: 36px; height: 34px; padding: 0; }
  .theme-toggle-text { display: none; }
}
@media (max-width: 420px) {
  .brand .logo { font-size: 14px; }
  nav a { padding-left: 6px; padding-right: 6px; }
}

/* ---------- 打印 / 导出 PDF ---------- */
@media print {
  @page { margin: 12mm; }
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body { background-image: none !important; color: #111; }
  header, .rs-page-nav, .rs-filters, .theme-toggle { display: none !important; }
  #research { height: auto !important; padding: 0 !important; overflow: visible !important; }
  .rs-hero, .rs-block { max-width: none; margin: 0 0 8mm; padding: 0; }
  .rs-block h2 { color: #111; border-bottom-color: #999; }
  .rs-lead, .rs-note, .rs-card p, .rs-table td, .rs-table th, .rs-verify,
  .rs-criteria li, .rs-verify-details ul, .rs-bar-val, .rs-dist-label, .rs-dist-val,
  .rs-sample-sum p, .rs-plan-meta, .rs-status-card p, .rs-verify-head {
    color: #222 !important;
  }
  .rs-card, .rs-table-wrap, .rs-verify, .rs-dist, .rs-stat, .rs-sample-sum,
  .rs-plan-meta, .rs-group { background: #fff !important; box-shadow: none !important; border-color: #999 !important; }
  .rs-table { background: #fff !important; font-size: 9pt; }
  .rs-table th { background: #eee !important; color: #000 !important; }
  .rs-table tr, .rs-table td, .rs-table th { break-inside: avoid; page-break-inside: avoid; }
  .rs-table thead { display: table-header-group; }
  .rs-table-wrap, .rs-candidates-scroll { overflow: visible !important; max-height: none !important; }
  .rs-candidates-scroll .rs-table thead th { position: static; box-shadow: none; }
  .rs-badge, .rs-tag, .rs-dist-track i, .rs-bar-track i {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .rs-dist-track, .rs-bar-track { border: 1px solid #bbb; }
  .rs-shot { break-inside: avoid; page-break-inside: avoid; }
  .rs-shot img { height: auto; max-height: 34mm; }
  .rs-hero, .rs-sub, .rs-criteria { break-after: avoid; page-break-after: avoid; }
  a { color: #000 !important; text-decoration: none !important; }
}

/* ---------- 通用补充 ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.flash-stack { position: fixed; top: 74px; right: 20px; z-index: 1200; display: flex;
  flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 40px)); }
.flash { padding: 12px 15px; border-radius: 10px; font-size: 13px; line-height: 1.6;
  background: var(--panel-solid); border: 1px solid var(--border); box-shadow: var(--shadow); }
.flash.success { color: var(--green); border-color: rgba(78,118,94,.35); }
.flash.error { color: var(--red); border-color: rgba(176,82,69,.35); }

/* ---------- 登录 ---------- */
.auth-body { overflow-y: auto; }
.auth-body header { display: none; }
.auth-page { position: relative; min-height: 100dvh; display: grid; place-items: center;
  padding: 42px 18px; overflow: hidden;
  background: radial-gradient(900px 500px at 20% 0%, rgba(164,63,50,.14), transparent 62%),
    radial-gradient(700px 500px at 100% 100%, rgba(128,103,74,.16), transparent 60%); }
.auth-deco { position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(3deg, rgba(89,65,38,.025) 0 1px, transparent 1px 6px); }
.auth-card { position: relative; width: min(430px, 100%); padding: 36px 34px 28px;
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: 0 24px 60px rgba(78,58,33,.18); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.auth-seal { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  color: #fff7ea; background: linear-gradient(135deg, var(--accent), var(--cinnabar));
  font-family: "Songti SC", "STSong", serif; font-size: 20px; box-shadow: var(--seal-shadow); }
.auth-brand b { display: block; font-family: "Songti SC", "STSong", serif; font-size: 18px; letter-spacing: 2px; }
.auth-brand small { display: block; margin-top: 2px; color: var(--text-dim); font-size: 11px; letter-spacing: 1px; }
.auth-card h1 { font-size: 26px; letter-spacing: 1px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; margin-top: 20px; }
.auth-card .form-alert { margin-top: 14px; }
.auth-submit { width: 100%; min-height: 46px; margin-top: 4px; }
.auth-foot { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px;
  padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-dim); font-size: 11px; }
.auth-foot a:hover { color: var(--accent); }

/* ---------- 后台工具栏 / 搜索 / 分页 ---------- */
.admin-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 460px; }
.admin-head-actions .secondary-btn { min-height: 36px; padding: 8px 12px; font-size: 12px; }
.inline-form { display: inline-flex; }
.inline-form button { min-height: 36px; }
.admin-search { max-width: 1080px; margin: 0 auto 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-search input[type="search"] { flex: 1 1 260px; min-width: 0; padding: 10px 13px;
  border: 1px solid var(--border); border-radius: 10px; background: rgba(255,252,244,.72);
  color: var(--text); font: inherit; font-size: 13px; outline: none; }
.admin-search input[type="search"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(164,63,50,.10); }
.admin-search .secondary-btn { min-height: 40px; }
.search-clear { color: var(--text-dim); font-size: 12px; padding: 0 6px; }
.search-clear:hover { color: var(--accent); }
.admin-total { max-width: 1080px; margin: 16px auto 0; color: var(--text-dim); font-size: 12px; text-align: center; }
.pagination { max-width: 1080px; margin: 22px auto 0; display: flex; align-items: center;
  justify-content: center; gap: 18px; color: var(--text-dim); font-size: 12px; }
.pagination a, .pagination .disabled { padding: 8px 12px; border: 1px solid var(--border);
  border-radius: 9px; background: rgba(255,252,244,.6); }
.pagination a:hover { color: var(--accent); border-color: rgba(164,63,50,.35); }
.pagination .disabled { opacity: .45; }
.page-info { color: var(--text-dim); }

/* ---------- 投稿卡片补充 ---------- */
.submission-body { padding: 18px 22px 20px; border-top: 1px solid var(--border);
  background: rgba(120,94,58,.035); }
.submission-body .admin-form { padding: 0; border-top: 0; background: transparent; }
.record-contact { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 18px;
  padding: 10px 12px; border-radius: 10px; background: rgba(154,113,46,.06);
  border: 1px solid rgba(154,113,46,.16); color: var(--text-dim); font-size: 12px; }
.record-contact b { color: var(--text); font-weight: 650; }
.record-contact a { color: var(--accent); }
.delete-form { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--border); text-align: right; }
.link-danger { background: none; color: var(--red); font-size: 12px; padding: 4px; }
.link-danger:hover { text-decoration: underline; }
.hp-field { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px;
  overflow: hidden; }
.consent { display: flex; flex-direction: row; align-items: flex-start; gap: 9px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 10px; background: rgba(255,252,244,.55);
  color: var(--text-dim); font-size: 12px; line-height: 1.7; cursor: pointer; }
.consent input { margin-top: 3px; width: 15px; height: 15px; accent-color: var(--accent); flex: none; }
.form-privacy { margin-top: 12px; color: var(--text-dim); font-size: 12px; line-height: 1.7; }
.form-alert a { color: inherit; text-decoration: underline; }

/* ---------- 投稿回执 / 进度 ---------- */
.receipt-page { display: block; }
.receipt-card { max-width: 860px; margin: 0 auto; padding: 30px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.receipt-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.receipt-top h1 { margin-top: 8px; font-size: 28px; letter-spacing: 1px; }
.receipt-top p { margin-top: 9px; color: var(--text-dim); font-size: 13px; line-height: 1.7; }
.receipt-id { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 22px 0;
  padding: 12px 14px; border: 1px dashed rgba(164,63,50,.35); border-radius: 10px;
  background: rgba(164,63,50,.05); color: var(--text-dim); font-size: 12px; }
.receipt-id code { color: var(--accent); font-size: 15px; letter-spacing: 1px; }
.copy-btn { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: rgba(255,252,244,.7); color: var(--text); font-size: 11px; }
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-feedback { color: var(--green); font-size: 11px; }
.status-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 24px 0; }
.status-steps .step { display: flex; align-items: center; gap: 9px; padding: 11px 12px;
  border-radius: 10px; border: 1px solid var(--border); color: var(--text-dim); font-size: 12px; }
.status-steps .step b { width: 22px; height: 22px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: rgba(120,94,58,.10); color: var(--text-dim); font-size: 11px; }
.status-steps .step.active { color: var(--accent); border-color: rgba(164,63,50,.35); background: rgba(164,63,50,.05); }
.status-steps .step.active b { background: var(--accent); color: #fffaf0; }
.status-steps .step.done { color: var(--green); border-color: rgba(78,118,94,.30); background: rgba(78,118,94,.05); }
.status-steps .step.done b { background: var(--green); color: #fffaf0; }
.status-steps .step.rejected { color: var(--red); border-color: rgba(176,82,69,.30); background: rgba(176,82,69,.05); }
.status-steps .step.rejected b { background: var(--red); color: #fffaf0; }
.receipt-story { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.receipt-story h2 { margin-top: 8px; font-size: 21px; }
.receipt-meta { margin-top: 6px; color: var(--text-dim); font-size: 12px; }
.receipt-summary { margin-top: 16px; white-space: pre-wrap; font-size: 14px; line-height: 1.95; }
.receipt-nodes { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; list-style: none; }
.receipt-nodes li { display: flex; gap: 12px; }
.receipt-node-index { flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(164,63,50,.13); color: var(--accent); font-size: 12px; }
.receipt-node-meta { color: var(--text); font-size: 13px; font-weight: 650; }
.receipt-node-summary { margin-top: 5px; color: var(--text-dim); font-size: 14px; line-height: 1.9; white-space: pre-wrap; }
.receipt-source { margin-top: 18px; padding: 12px 14px; border-radius: 10px;
  background: rgba(154,113,46,.06); color: var(--text-dim); font-size: 12px; line-height: 1.8; }
.receipt-source b { color: var(--gold); }
.receipt-source p { margin-top: 5px; white-space: pre-wrap; }
.receipt-meta-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12px; }
.receipt-meta-list dt { color: var(--text-dim); }
.receipt-meta-list dd { margin-top: 3px; }
.receipt-privacy { margin-top: 20px; color: var(--text-dim); font-size: 11px; line-height: 1.8; }
.receipt-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---------- 公开故事库 ---------- */
.stories-hero { max-width: 1080px; margin: 0 auto 28px; text-align: center; }
.stories-hero h1 { margin-top: 10px; font-size: 32px; letter-spacing: 2px; }
.stories-hero p { max-width: 640px; margin: 12px auto 0; color: var(--text-dim); font-size: 14px; line-height: 1.8; }
.stories-meta { margin-top: 14px; color: var(--text-dim); font-size: 12px; }
.stories-meta a { color: var(--accent); }
.story-grid { max-width: 1080px; margin: 0 auto; display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.story-card { display: flex; flex-direction: column; padding: 22px; min-height: 230px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); transition: transform .2s, border-color .2s; }
.story-card:hover { transform: translateY(-3px); border-color: rgba(164,63,50,.38); }
.story-card-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.story-person { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: 1px; }
.story-year { color: var(--text-dim); font-size: 11px; }
.story-card h2 { margin-top: 10px; font-size: 18px; line-height: 1.5; }
.story-place { margin-top: 6px; color: var(--text-dim); font-size: 12px; }
.story-route { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-span { margin-top: 3px; }
.story-nodes-badge { flex: none; padding: 2px 8px; border-radius: 999px; font-size: 11px;
  color: var(--accent); background: rgba(164,63,50,.1); border: 1px solid rgba(164,63,50,.2); }
.story-excerpt { margin-top: 12px; color: var(--text-dim); font-size: 12px; line-height: 1.85;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.story-more { margin-top: auto; padding-top: 16px; color: var(--accent); font-size: 12px; font-weight: 700; }
.story-more span { margin-left: 6px; }
.stories-empty { max-width: 1080px; margin: 0 auto; }
.stories-empty .primary-btn { margin-top: 20px; }
.story-page { display: block; }
.story-article { max-width: 760px; margin: 0 auto; padding: 32px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.back-link { display: inline-block; margin-bottom: 20px; color: var(--text-dim); font-size: 12px; }
.back-link:hover { color: var(--accent); }
.story-article h1 { margin-top: 10px; font-size: 34px; letter-spacing: 2px; }
.story-article h2 { margin-top: 8px; color: var(--accent); font-size: 20px; font-weight: 600; }
.story-article-meta { margin-top: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--border);
  color: var(--text-dim); font-size: 12px; }
.story-article-body { margin-top: 22px; white-space: pre-wrap; font-size: 15px; line-height: 2; }
.story-nodes { display: flex; flex-direction: column; gap: 18px; list-style: none;
  margin-top: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.story-nodes li { display: flex; gap: 12px; }
.story-node-index { flex: none; width: 24px; height: 24px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(164,63,50,.13); color: var(--accent); font-size: 12px; }
.story-node-meta { color: var(--text); font-size: 13px; font-weight: 650; }
.story-node-body { margin-top: 6px; white-space: pre-wrap; font-size: 15px; line-height: 2; }
.story-source { margin-top: 24px; padding: 14px 16px; border-radius: 10px;
  background: rgba(154,113,46,.06); color: var(--text-dim); font-size: 12px; line-height: 1.8; }
.story-source b { color: var(--gold); }
.story-source p { margin-top: 5px; white-space: pre-wrap; }
.story-article-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: 11px; }
.story-article-foot a { color: var(--accent); }

/* ---------- 账号安全 / 错误页 ---------- */
.settings-page { display: block; }
.settings-card { max-width: 720px; margin: 0 auto; padding: 28px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.settings-lead { margin-bottom: 18px; color: var(--text-dim); font-size: 13px; line-height: 1.8; }
.settings-note { margin-top: 24px; padding: 13px 15px; border-left: 3px solid var(--gold);
  background: rgba(154,113,46,.06); color: var(--text-dim); font-size: 12px; line-height: 1.8; }
.settings-note code { padding: 1px 4px; border-radius: 4px; background: rgba(120,94,58,.10); font-size: 11px; }
.error-page { display: grid; place-items: center; text-align: center; }
.error-card { max-width: 520px; padding: 40px 30px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow); }
.error-code { display: block; color: rgba(164,63,50,.28); font-family: "Songti SC", "STSong", serif;
  font-size: 72px; font-weight: 800; line-height: 1; }
.error-card h1 { margin-top: 12px; font-size: 24px; }
.error-card p { margin-top: 10px; color: var(--text-dim); font-size: 13px; line-height: 1.8; }
.error-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }

@media (max-width: 900px) {
  .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .admin-head-actions { max-width: none; justify-content: flex-start; }
  .receipt-top { flex-direction: column; }
  .receipt-card { padding: 22px; }
  .receipt-top h1 { font-size: 23px; }
  .status-steps { grid-template-columns: 1fr; }
  .story-article { padding: 24px 20px; }
  .story-article h1 { font-size: 28px; }
}

@media (max-width: 680px) {
  .flash-stack { top: 66px; right: 10px; left: 10px; max-width: none; }
  .story-grid { grid-template-columns: 1fr; }
  .stories-hero h1 { font-size: 27px; }
  .admin-search input[type="search"] { flex-basis: 100%; }
  .record-contact { flex-direction: column; gap: 6px; }
  .receipt-meta-list { grid-template-columns: 1fr; }
  .receipt-actions { justify-content: stretch; }
  .receipt-actions a { flex: 1 1 140px; }
  .auth-card { padding: 28px 22px 22px; }
  .auth-card h1 { font-size: 23px; }
  .story-article-foot { flex-direction: column; align-items: flex-start; }
}

/* ---------- 投稿模块深色模式适配（补充源文件未覆盖的浅色底） ---------- */
[data-theme='dark'] .admin-search input[type="search"],
[data-theme='dark'] .consent,
[data-theme='dark'] .copy-btn {
  background: rgba(255, 255, 255, .06);
}
[data-theme='dark'] .pagination a,
[data-theme='dark'] .pagination .disabled {
  background: rgba(255, 255, 255, .05);
}
[data-theme='dark'] .admin-form,
[data-theme='dark'] .submission-body {
  background: rgba(255, 255, 255, .03);
}

/* ---------- 全站导航：logo + 背景音乐胶囊 ---------- */
.header-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-audio {
  position: relative; display: inline-flex; flex: none; align-items: center;
  height: 36px; padding: 3px;
  border: 1px solid var(--border); border-radius: 999px;
  background: rgba(255, 255, 255, .34);
  transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.brand-audio:hover,
.brand-audio:focus-within,
.brand-audio.is-open {
  border-color: rgba(154, 113, 46, .38);
  background: rgba(255, 252, 244, .72);
  box-shadow: 0 2px 10px rgba(78, 58, 33, .08);
}
[data-theme='dark'] .brand-audio { background: rgba(255, 248, 230, .045); }
[data-theme='dark'] .brand-audio:hover,
[data-theme='dark'] .brand-audio:focus-within,
[data-theme='dark'] .brand-audio.is-open { background: rgba(255, 248, 230, .09); }

.brand-audio-logo {
  display: block; flex: none; width: 28px; height: 28px; border-radius: 50%;
  overflow: hidden; line-height: 0;
  box-shadow: 0 0 0 1px rgba(154, 113, 46, .45), 0 1px 3px rgba(60, 44, 26, .18);
  transition: box-shadow .18s ease;
}
.brand-audio-logo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-audio-logo:hover { box-shadow: 0 0 0 1px rgba(214, 59, 39, .5), 0 2px 7px rgba(60, 44, 26, .24); }
.brand-audio-logo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-theme='dark'] .brand-audio-logo { box-shadow: 0 0 0 1px rgba(232, 214, 180, .6), 0 1px 6px rgba(0, 0, 0, .5); }

.brand-audio-toggle {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin-left: 2px; padding: 0; border-radius: 50%;
  background: transparent; color: var(--text-dim);
  transition: color .18s ease, background-color .18s ease;
}
.brand-audio-toggle:hover { color: var(--cinnabar); background: rgba(214, 59, 39, .08); }
.brand-audio-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brand-audio-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round; }
.brand-audio .bgm-icon-mute { display: none; }
.brand-audio[data-bgm='off'] .bgm-icon-note { display: none; }
.brand-audio[data-bgm='off'] .bgm-icon-mute { display: block; }
.brand-audio[data-bgm='on'] .brand-audio-toggle { color: var(--cinnabar); }
[data-theme='dark'] .brand-audio[data-bgm='on'] .brand-audio-toggle { color: var(--accent); }

.brand-audio-volume {
  display: flex; align-items: center; width: 0; opacity: 0; overflow: hidden;
  transition: width .18s ease, opacity .18s ease;
}
.brand-audio:hover .brand-audio-volume,
.brand-audio:focus-within .brand-audio-volume,
.brand-audio.is-open .brand-audio-volume { width: 82px; opacity: 1; }
#bgmVolume {
  width: 72px; height: 16px; margin: 0 5px 0 4px; padding: 0;
  -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer;
}
#bgmVolume::-webkit-slider-runnable-track { height: 2px; border-radius: 999px; background: rgba(91, 68, 43, .32); }
#bgmVolume::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 9px; height: 9px; margin-top: -3.5px;
  border: none; border-radius: 50%; background: var(--cinnabar);
  box-shadow: 0 0 0 2px rgba(255, 252, 244, .7);
}
#bgmVolume::-moz-range-track { height: 2px; border-radius: 999px; background: rgba(91, 68, 43, .32); }
#bgmVolume::-moz-range-thumb {
  width: 9px; height: 9px; border: none; border-radius: 50%; background: var(--cinnabar);
  box-shadow: 0 0 0 2px rgba(255, 252, 244, .7);
}
#bgmVolume:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 999px; }
[data-theme='dark'] #bgmVolume::-webkit-slider-runnable-track { background: rgba(232, 214, 180, .3); }
[data-theme='dark'] #bgmVolume::-moz-range-track { background: rgba(232, 214, 180, .3); }
[data-theme='dark'] #bgmVolume::-webkit-slider-thumb { box-shadow: 0 0 0 2px rgba(39, 38, 31, .8); }
[data-theme='dark'] #bgmVolume::-moz-range-thumb { box-shadow: 0 0 0 2px rgba(39, 38, 31, .8); }

@media (max-width: 900px) {
  .header-brand { gap: 9px; }
}
@media (max-width: 680px) {
  .brand-audio { height: 34px; padding: 2px; }
  .brand-audio-logo { width: 26px; height: 26px; }
  .brand-audio-toggle { width: 26px; height: 26px; }
  .brand-audio:hover .brand-audio-volume,
  .brand-audio:focus-within .brand-audio-volume,
  .brand-audio.is-open .brand-audio-volume { width: 68px; }
  #bgmVolume { width: 58px; }
}
@media (max-width: 420px) {
  .header-brand { gap: 7px; }
  .brand-audio:hover .brand-audio-volume,
  .brand-audio:focus-within .brand-audio-volume,
  .brand-audio.is-open .brand-audio-volume { width: 60px; }
  #bgmVolume { width: 50px; }
}

/* 后台恢复时浏览器拒绝自动播放：给一次可点的提示，而不是静默失败 */
.bgm-resume-hint {
  position: fixed; top: 72px; left: 24px; z-index: 60; max-width: calc(100% - 32px);
  padding: 9px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); color: var(--text); font: inherit; font-size: 12.5px; line-height: 1;
  box-shadow: 0 6px 20px rgba(78, 58, 33, .14); cursor: pointer;
  animation: bgm-hint-in .2s ease both;
}
.bgm-resume-hint:hover { border-color: rgba(214, 59, 39, .45); color: var(--cinnabar); }
.bgm-resume-hint:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes bgm-hint-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 680px) {
  .bgm-resume-hint { left: 16px; top: 66px; }
}

/* ============================================================
   首页精选人物：三张可点播卡，点卡片切换上方影片
   ============================================================ */
#home .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#home .card.film-card { cursor: pointer; }
#home .card.film-card.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 28px rgba(164, 63, 50, .16);
}
#home .card.film-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
#home .film-note {
  margin-top: 16px; padding: 9px; text-align: center; font-size: 12.5px;
  color: var(--text-dim); border: 1px dashed var(--border); border-radius: 10px;
}
@media (max-width: 860px) {
  #home .cards { grid-template-columns: 1fr; }
}

/* ============================================================
   ⓘ 提示气泡：必要的解释默认收起，悬停或键盘聚焦时展开
   ============================================================ */
.info-tip { position: relative; display: inline-flex; vertical-align: middle; margin-left: 6px; }
.info-tip-btn {
  width: 16px; height: 16px; display: inline-grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--border); background: transparent;
  color: var(--text-dim); font-size: 10px; line-height: 1; font-style: normal;
  cursor: help;
}
.info-tip-btn:hover, .info-tip:focus-within .info-tip-btn { color: var(--accent); border-color: var(--accent); }
.info-tip-bubble {
  position: absolute; top: calc(100% + 6px); left: -8px; z-index: 30;
  width: max-content; max-width: 240px; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel-solid); color: var(--text-dim);
  box-shadow: var(--shadow); font-size: 11.5px; line-height: 1.7; font-weight: 400;
  text-align: left; white-space: normal;
  opacity: 0; visibility: hidden; transform: translateY(-2px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  pointer-events: none;
}
.info-tip:hover .info-tip-bubble,
.info-tip:focus-within .info-tip-bubble { opacity: 1; visibility: visible; transform: none; }
/* 面板内空间窄，气泡以标题行定位并铺满面板宽度，避免被 overflow 裁掉 */
.map-dock .info-tip { position: static; }
.map-dock-title { position: relative; }
.map-dock .info-tip-bubble { top: calc(100% + 8px); left: 16px; right: 16px; width: auto; max-width: none; }
