/* 京吹圣地巡礼攻略站 样式
   世界方向：巡礼手帐 + 铁道图鉴。苔纸底、墨色字、朱色唯一强调。
   桌面优先（1280 到 1600px 主体验），向下兼容手机单列。 */

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  --paper: #F4F5EE;
  --panel: #EAEDE1;
  --panel-2: #DEE3D2;
  --ink: #202B26;
  --ink-2: #55645A;
  --line: #C8D1C1;
  --accent: #A73A2A;
  --accent-2: #C4543C;
  --credit: #3D5A76; /* 授权署名（作者名与二级菜单）：靛蓝，与朱色区分但仍属同一纸感 */
  --credit-strong: #2F4A63;
  --plate-bg: #202B26;
  --plate-fg: #F4F5EE;
  --topbar: rgba(244, 245, 238, .9);
  --topbar-h: 65px; /* 64px 内容高 + 1px 下边框；满屏区块按一屏高度扣除它 */
  --shadow: 0 12px 34px rgba(32, 43, 38, .16);
  --serif: "Noto Serif SC Variable", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --sans: "MiSans", "PingFang SC", "HarmonyOS Sans SC", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  --radius: 14px;
  --radius-img: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --z-chips: 30;
  --z-rail: 40;
  --z-header: 50;
  --z-lightbox: 100;
  --z-skip: 200;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 84px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  caret-color: var(--accent);
}

::selection { background: var(--accent); color: #F7F8F2; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

img { max-width: 100%; display: block; }
a { color: inherit; }
figure { margin: 0; }

* { scrollbar-width: thin; scrollbar-color: rgba(85, 100, 90, .45) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(85, 100, 90, .45);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.28;
}

.lede { color: var(--ink-2); max-width: 64ch; margin: 10px 0 0; }

.skip {
  position: fixed;
  left: 14px;
  top: -70px;
  z-index: var(--z-skip);
  background: var(--accent);
  color: #F7F8F2;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  transition: top .3s var(--ease);
}
.skip:focus { top: 14px; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--topbar);
  backdrop-filter: saturate(1.35) blur(10px);
  -webkit-backdrop-filter: saturate(1.35) blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-in {
  max-width: 1380px;
  margin: 0 auto;
  height: 64px;
  padding: 0 clamp(16px, 3vw, 36px);
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand { text-decoration: none; display: grid; gap: 1px; line-height: 1.15; padding: 4px 0; flex: 0 0 auto; white-space: nowrap; }
.brand-main { font-family: var(--serif); font-size: 17px; font-weight: 650; letter-spacing: .01em; }
.brand-sub { font-size: 11px; color: var(--ink-2); letter-spacing: .08em; }

.mainnav { margin-left: auto; display: flex; align-items: center; gap: clamp(10px, 1.6vw, 22px); min-width: 0; }
.navlink {
  font-size: 14px;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.navlink:hover { color: var(--ink); }
.navlink[aria-current="true"] { color: var(--ink); border-color: var(--accent); }

.progress { display: none; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; overflow: hidden; }
@supports (animation-timeline: scroll()) {
  .progress { display: block; }
  .progress i {
    display: block;
    height: 100%;
    width: 100%;
    background: var(--accent);
    transform-origin: 0 50%;
    transform: scaleX(0);
    animation: progressBar linear both;
    animation-timeline: scroll(root);
  }
  @keyframes progressBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ---------------------------------------------------------------- rail */
.rail { display: none; }

@media (min-width: 1240px) {
  .rail {
    display: block;
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: var(--z-rail);
    opacity: 0;
    visibility: hidden;
    transition: opacity .55s var(--ease), visibility .55s var(--ease), transform .55s var(--ease);
  }
  /* 首屏（头图）不显示章节进度条，翻过封面后淡入 */
  .rail.is-on {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
  }
  .rail:not(.is-on) { transform: translateY(-50%) translateX(-8px); }
  .rail ol { list-style: none; margin: 0; padding: 0; position: relative; display: grid; gap: 26px; }
  .rail ol::before {
    content: "";
    position: absolute;
    left: 9px;
    top: -14px;
    bottom: -14px;
    width: 1px;
    background: var(--line);
  }
  .rail li a { display: flex; align-items: center; gap: 10px; text-decoration: none; }
  .rail i {
    width: 10px;
    height: 10px;
    margin-left: 5px;
    border-radius: 50%;
    background: var(--paper);
    box-shadow: inset 0 0 0 2px var(--line);
    position: relative;
    z-index: 1;
    transition: transform .4s var(--ease), background .4s var(--ease), box-shadow .4s var(--ease);
  }
  .rail span {
    display: none;
    font-size: 12px;
    color: var(--ink-2);
    letter-spacing: .04em;
    transition: color .3s var(--ease);
  }
  .rail a:hover i { box-shadow: inset 0 0 0 2px var(--ink-2); }
  .rail a[aria-current="true"] i,
  .rail li.on i { background: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); transform: scale(1.25); }
  .rail li.on span { color: var(--ink); }
}

@media (min-width: 1460px) {
  .rail { left: 30px; }
  .rail span { display: inline; }
}

/* ---------------------------------------------------------------- layout */
.guide, .overview, .chapter, .pending, .end, .offmap {
  max-width: 1236px;
  margin-inline: auto;
  padding-inline: clamp(18px, 3.4vw, 48px);
}

.guide { padding-top: clamp(62px, 9vh, 116px); padding-bottom: clamp(44px, 7vh, 80px); }
.overview { padding-block: clamp(56px, 8vh, 96px) clamp(24px, 3vh, 40px); }
.chapter { padding-block: clamp(58px, 9vh, 106px) clamp(16px, 2.5vh, 30px); scroll-margin-top: 76px; }
.pending { padding-block: clamp(54px, 8vh, 92px); scroll-margin-top: 76px; }
.end { padding-block: clamp(56px, 9vh, 110px) clamp(40px, 6vh, 72px); scroll-margin-top: 76px; }

.sec-head { margin-bottom: clamp(26px, 4vh, 42px); }
.sec-head h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); }

/* 章节字：正文小标题上方的一行短标签（如「引子」） */
.sec-kicker {
  display: inline-block;
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(1.2rem, 1.6vw, 1.45rem);
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--accent);
}

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--topbar-h));
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #F7F8F2;
}
@supports (height: 100svh) { .hero { min-height: calc(100svh - var(--topbar-h)); } }

.hero-media { position: absolute; inset: 0; }
.hero-img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.95); }

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(9, 14, 11, .38) 0%, rgba(9, 14, 11, .08) 36%, rgba(9, 14, 11, .58) 78%, rgba(9, 14, 11, .82) 100%),
    linear-gradient(86deg, rgba(9, 14, 11, .5) 0%, rgba(9, 14, 11, .12) 52%, rgba(9, 14, 11, 0) 78%);
}

.hero-in {
  position: relative;
  z-index: 2;
  max-width: 760px;
  padding: 0 clamp(20px, 5vw, 72px) clamp(72px, 13vh, 132px);
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  margin: 0 0 18px;
  padding: 7px 15px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  background: rgba(12, 18, 14, .46);
  font-size: 12.5px;
  letter-spacing: .06em;
}

.hero-title {
  margin: 0 0 14px;
  font-size: clamp(1.75rem, 6.5vw, 3.8rem);
  line-height: 1.22;
  letter-spacing: -.01em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, .35);
}
.hero-title .l1, .hero-title .l2 { display: block; }

.hero-sub { margin: 0; color: rgba(255, 255, 255, .88); font-size: 15.5px; max-width: 40ch; }
.sub-br { display: none; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 47px;
  padding: 0 24px;
  border-radius: 999px;
  font-size: 15px;
  text-decoration: none;
  transition: transform .25s var(--ease), background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: #F7F8F2; color: #1C2620; border: 1px solid rgba(255, 255, 255, .2); }
.btn.primary:hover { background: #FFFFFF; }
.btn.ghost { background: rgba(12, 18, 14, .28); color: #F7F8F2; border: 1px solid rgba(255, 255, 255, .55); }
.btn.ghost:hover { border-color: #FFFFFF; background: rgba(255, 255, 255, .14); }

.hero-credit {
  position: absolute;
  right: clamp(20px, 5vw, 72px);
  bottom: clamp(22px, 5vh, 56px);
  z-index: 2;
  margin: 0;
  font-size: 12.5px;
  letter-spacing: .05em;
  color: rgba(255, 255, 255, .84);
}
.hero-credit b { font-family: var(--serif); font-weight: 600; color: #FFFFFF; margin-left: 3px; }

/* 首页作者主页入口：玻璃卡（桌面右下角悬浮，窄屏落回文档流） */
.hero-social {
  position: absolute;
  right: clamp(20px, 5vw, 72px);
  bottom: calc(clamp(22px, 5vh, 56px) + 34px);
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 14px;
  background:
    linear-gradient(158deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .04) 46%, rgba(255, 255, 255, 0) 74%),
    rgba(12, 18, 14, .54);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 18px 40px rgba(9, 14, 11, .36), inset 0 1px 0 rgba(255, 255, 255, .34), inset 0 -1px 0 rgba(255, 255, 255, .08);
}
.hs-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 102px;
  padding: 9px 8px 8px;
  border-radius: 10px;
  color: #FFFFFF;
  text-decoration: none;
  transition: background-color .22s var(--ease), transform .22s var(--ease);
}
.hs-item:hover { background: rgba(255, 255, 255, .17); transform: translateY(-2px); }
.hs-item:active { transform: translateY(1px); }
.hs-item:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
.hs-qr { display: block; width: 86px; height: 86px; border-radius: 10px; background: #FFFFFF; }
.hs-text { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.hs-name { font-size: 13.5px; font-weight: 650; letter-spacing: .02em; }
.hs-hint { font-size: 11px; color: rgba(255, 255, 255, .92); letter-spacing: .02em; }

@keyframes chRise { to { opacity: 1; transform: translateY(0); } }
@keyframes heroFade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.js .hero-title .split .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(.55em);
  animation: chRise .7s var(--ease) both;
  animation-delay: calc(var(--ci) * .048s + var(--ld, 0s));
}
.js .hero-title .l1:not(.split),
.js .hero-title .l2:not(.split) { opacity: 0; }
.js .hero-tag { animation: heroFade .9s var(--ease) both .1s; }
.js .hero-sub { animation: heroFade .9s var(--ease) both .78s; }
.js .hero-actions { animation: heroFade .9s var(--ease) both 1s; }
.js .hero-credit { animation: heroFade 1s var(--ease) both 1.12s; }
.js .hero-social { animation: heroFade 1s var(--ease) both 1.22s; }

/* ---------------------------------------------------------------- guide */
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(26px, 4vw, 56px); }

.gitem-txt { border-top: 1px solid var(--line); padding: 18px 0 28px; }
.gitem-txt h3 { font-family: var(--sans); font-size: 19px; font-weight: 650; margin-bottom: 8px; }
.gitem-txt p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.85; }

.demo-wrap { margin-top: clamp(30px, 4.6vh, 52px); }
.demo-cap { margin: 0 0 12px; color: var(--ink-2); font-size: 13.5px; }
.demo-wrap .pair { max-width: 1000px; }

/* ---------------------------------------------------------------- pair */
.pair { margin: 0; }

.pair-stage {
  position: relative;
  aspect-ratio: var(--ar, 1.78);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-2);
  touch-action: pan-y pinch-zoom;
}

.pair-stage .lyr { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lyr.real { clip-path: inset(0 calc(100% - var(--p, 100%)) 0 0); }

.pair-tag {
  position: absolute;
  top: 12px;
  z-index: 2;
  font-size: 12px;
  letter-spacing: .05em;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(14, 20, 16, .74);
  color: #F2F4EE;
  border: 1px solid rgba(255, 255, 255, .26);
}
.tag-real { left: 12px; }
.tag-draw { right: 12px; opacity: 0; transition: opacity .4s var(--ease); }
.pair.revealed .tag-draw { opacity: 1; }

.pair-range {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  touch-action: pan-y pinch-zoom;
}

/* Touch gestures belong to the photo surface, not the full-size native range. */
@media (any-pointer: coarse) {
  .js .pair-range { pointer-events: none; }
}

.pair-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: clamp(22px, var(--p, 100%), calc(100% - 22px));
  width: 2px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .16);
  pointer-events: none;
  z-index: 2;
}
.pair-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(252, 253, 250, .94);
  box-shadow: 0 3px 14px rgba(10, 15, 12, .35);
}
.pair-handle svg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 21px;
  height: 21px;
  transform: translate(-50%, -50%);
  fill: none;
  stroke: #23302A;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  z-index: 1;
}
.pair-stage.at-end .pair-handle,
.pair-stage.at-start .pair-handle { background: transparent; box-shadow: none; }
.pair-range:focus-visible + .pair-handle::after { box-shadow: 0 0 0 3px rgba(255, 255, 255, .7), 0 3px 14px rgba(10, 15, 12, .35); }

.pair-cap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 11px;
  color: var(--ink-2);
  font-size: 13px;
}
.cap-no { font-family: var(--mono); font-size: 12.5px; letter-spacing: .02em; }
.cap-meta { font-size: 12.5px; }
.cap-zoom { margin-left: auto; }

.btn-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 33px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font: 12.5px/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: color .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.btn-mini:hover { color: var(--ink); border-color: var(--ink-2); background: var(--panel); }
.btn-mini:active { transform: translateY(1px); }
.btn-mini.copied { color: var(--accent); border-color: var(--accent); }
.btn-mini.bus { color: var(--accent); border-color: var(--accent); }
.btn-mini.bus:hover { background: var(--panel); color: var(--accent); }

/* ---------------------------------------------------------------- overview */
.ov-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(280px, 1fr); gap: clamp(20px, 3vw, 40px); align-items: start; }

.station-jump { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.station-jump li { border-bottom: 1px solid var(--line); }
.station-jump a {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px 8px;
  text-decoration: none;
  transition: background .25s var(--ease), padding-left .25s var(--ease);
}
.station-jump a:hover { background: var(--panel); padding-left: 14px; }
.sroman { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }

/* ---------------------------------------------------------------- plate */
.plate {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(14px, 2.4vw, 30px);
  align-items: center;
  background: var(--plate-bg);
  color: var(--plate-fg);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 30px) clamp(20px, 3.4vw, 38px);
  margin-bottom: clamp(24px, 3.6vh, 38px);
}
.plate-no {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: .02em;
  color: #E08A6E;
}
.plate-name { font-size: clamp(26px, 3.4vw, 38px); margin-bottom: 4px; }
.plate-roman { font-family: var(--mono); font-size: 11.5px; letter-spacing: .24em; text-transform: uppercase; margin: 0; opacity: .64; }
.plate-sub { margin: 0 0 0 auto; max-width: 38ch; text-align: right; font-size: 13.5px; line-height: 1.75; opacity: .82; }

/* ---------------------------------------------------------------- chapter body */
.chapter-body {
  display: grid;
  grid-template-columns: minmax(0, 1.56fr) minmax(300px, 1fr);
  gap: clamp(20px, 3vw, 38px);
  align-items: start;
  margin-bottom: clamp(34px, 5vh, 58px);
}

.spot-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.spot-list li { border-bottom: 1px solid var(--line); }
.spot-list a {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  text-decoration: none;
  transition: background .25s var(--ease), padding-left .25s var(--ease);
}
.spot-list a:hover { background: var(--panel); padding-left: 14px; }
.sn { font-family: var(--mono); font-size: 12.5px; color: var(--accent); letter-spacing: .04em; }
.sname { font-size: 14.5px; }
.stag { font-size: 11.5px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }

/* ---------------------------------------------------------------- map */
.mapcard { margin: 0; }
.map-stage {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}
.map-img { width: 100%; height: 100%; object-fit: cover; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.map-svg a.node { pointer-events: auto; cursor: pointer; }
.map-svg .walk-case, .map-svg .walk, .map-svg .bus { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.map-svg .walk-case { stroke: #FFFFFF; stroke-opacity: .92; stroke-width: 13; }
.map-svg .walk { stroke: var(--accent); stroke-width: 6; }
.map-svg .bus { stroke: var(--accent-2); stroke-width: 5.5; stroke-dasharray: 11 13; }

.js .map-svg .walk-case, .js .map-svg .walk { stroke-dasharray: var(--len, 0); stroke-dashoffset: var(--len, 0); }
.js .mapcard.in .walk-case, .js .mapcard.in .walk { stroke-dashoffset: 0; transition: stroke-dashoffset 2.6s var(--ease) .12s; }
.js .map-svg .bus { opacity: 0; }
.js .mapcard.in .bus { opacity: 1; transition: opacity .9s var(--ease) 1.15s; }

.node-hit { fill: transparent; }
.node-dot { fill: var(--paper); stroke: var(--accent); stroke-width: 3.5; transition: fill .3s var(--ease); }
.node:hover .node-dot { fill: var(--accent); }
.node-n { font-family: var(--serif); font-size: 26px; font-weight: 600; fill: var(--ink); }
.node:hover .node-n { fill: #FFFFFF; }
.leader { stroke: var(--ink-2); stroke-width: 2; stroke-dasharray: 3 4; }
.node-label { font-size: 26px; fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 6; stroke-linejoin: round; }
.map-wp { font-size: 24px; fill: var(--ink-2); paint-order: stroke; stroke: var(--paper); stroke-width: 6; stroke-linejoin: round; }
.wp-dot { fill: var(--paper); stroke: var(--accent-2); stroke-width: 3.5; }

.js .map-svg .node { opacity: 0; }
.js .mapcard.in .node { opacity: 1; transition: opacity .55s var(--ease); transition-delay: var(--d, 0s); }
.js .map-svg .map-wp-g { opacity: 0; }
.js .mapcard.in .map-wp-g { opacity: 1; transition: opacity .7s var(--ease) 1.2s; }

.map-legend { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; }
.lg {
  position: relative;
  font-size: 11.5px;
  padding: 5px 11px 5px 24px;
  border-radius: 999px;
  background: rgba(252, 253, 250, .92);
  color: #22302A;
  border: 1px solid rgba(20, 30, 24, .16);
}
.lg::before { content: ""; position: absolute; left: 10px; top: 50%; width: 9px; height: 2.5px; transform: translateY(-50%); background: var(--accent); border-radius: 2px; }
.lg.bus::before { background: none; border-top: 2.5px dashed var(--accent-2); }
.map-cap { margin-top: 9px; font-size: 12px; color: var(--ink-2); }

/* ---------------------------------------------------------------- loc blocks */
.loc { scroll-margin-top: 84px; }
.loc + .loc { margin-top: clamp(36px, 5.4vh, 62px); }

.loc-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.loc-head h3 { display: flex; align-items: baseline; gap: 13px; font-size: clamp(19px, 2.3vw, 24px); }
.loc-no { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--accent); letter-spacing: .04em; }
.loc-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }

/* 地图跳转：主按钮指向原文档链接，悬停展开坐标入口 */
.mapswap { position: relative; display: inline-flex; gap: 8px; }
.swap-more {
  position: absolute;
  top: 100%;
  right: 0;
  padding-top: 7px;
  z-index: var(--z-chips);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .24s var(--ease), transform .24s var(--ease), visibility .24s;
}
.mapswap:hover .swap-more,
.mapswap:focus-within .swap-more { opacity: 1; visibility: visible; transform: none; }
.mapswap .gmap-coord { background: var(--paper); box-shadow: var(--shadow); white-space: nowrap; }
.mapswap u { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.gmap-menu-toggle, .mapswap .gmap-place, .gmap-label-mobile { display: none; }
.mapswap > .gmap { white-space: nowrap; }
.gmap-icon { display: block; flex: 0 0 24px; width: 24px; height: 24px; object-fit: contain; }
.mapswap .gmap-coord { justify-content: flex-start; text-align: left; }
.gmap-coordinate-label { display: inline-flex; align-items: flex-end; justify-content: flex-start; gap: 4px; }
.gmap-secondary-note { color: #687269; font: 400 10px/1 var(--sans); white-space: nowrap; }

@media (hover: none) {
  .swap-more {
    position: static;
    padding: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .mapswap { position: static; }
  .mapswap.map-menu-ready { position: relative; }
  .map-menu-ready > .gmap { display: none; }
  .map-menu-ready .gmap-menu-toggle { display: inline-flex; min-height: 44px; white-space: nowrap; }
  .mapswap.map-menu-ready .swap-more {
    position: absolute;
    top: calc(100% + 6px);
    left: auto;
    right: 0;
    display: grid;
    min-width: 180px;
    max-width: calc(100vw - 36px);
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
  }
  .mapswap.map-menu-ready.is-open .swap-more { opacity: 1; visibility: visible; pointer-events: auto; transform: none; }
  .map-menu-ready .swap-more .btn-mini { display: flex; min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; box-shadow: none; font-size: 13.5px; }
  .map-menu-ready .swap-more .btn-mini:hover { background: var(--panel); }
  .map-menu-ready .gmap-label-desktop { display: none; }
  .map-menu-ready .gmap-label-mobile { display: inline; }
}

.node-line { margin: 0; color: var(--ink-2); font-size: 14.5px; }

.notes {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 20px 17px;
  margin: 0 0 20px;
  display: grid;
  gap: 6px;
}
.note-badge {
  justify-self: start;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 3px;
}
.notes .note-badge ~ .note-badge { margin-top: 11px; }
.note { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.85; }

/* 授权署名：作者名可点击，二级菜单（桌面悬停 / 手机点按展开） */
.credit-group { position: relative; }
.credit-btn {
  font: inherit;
  color: var(--credit);
  background: none;
  border: 0;
  padding: 0 1px;
  cursor: pointer;
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
.credit-btn:hover { color: var(--credit-strong); text-decoration-style: solid; }
.credit-menu {
  display: none;
  margin-top: 10px;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.credit-group.is-open .credit-menu { display: flex; }
.credit-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 11px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  text-decoration: none;
}
.credit-item:hover { background: var(--panel-2); }
.ci-qr { width: 100%; max-width: 150px; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.ci-name { font-size: 13.5px; font-weight: 650; color: var(--ink); line-height: 1; }
.ci-hint { font-size: 11px; color: var(--ink-2); line-height: 1; letter-spacing: .02em; }
@media (hover: hover) {
  .credit-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    z-index: var(--z-chips);
    display: flex;
    margin-top: 0;
    width: min(336px, calc(100vw - 48px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-6px);
  }
  /* 悬停通道：菜单与名字之间有 10px 视觉间距，用一块不可见的命中区补住缝隙，
     鼠标从名字下移到菜单途中不会离开 .credit-group，菜单就不会提前收掉。 */
  .credit-menu::before {
    content: "";
    position: absolute;
    left: -6px;
    right: -6px;
    top: -14px;
    height: 15px;
  }
  .credit-group:hover .credit-menu,
  .credit-group:focus-within .credit-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .credit-menu { transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s; }
  .credit-item { transition: background-color .18s var(--ease); }
}

.groups { display: grid; gap: clamp(26px, 4.2vh, 46px); }
.groups > .pair { width: 100%; max-width: 1040px; }
.groups > .pair:nth-child(even) { margin-left: auto; }

/* ---------------------------------------------------------------- gallery */
.gal-block { margin-top: clamp(28px, 4.4vh, 44px); }
.gal-title { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-family: var(--sans); font-size: 16px; font-weight: 650; margin-bottom: 13px; }
.gal-tag { font-size: 11.5px; font-weight: 400; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }

.gallery { display: grid; gap: clamp(10px, 1.6vw, 16px); }
.gallery.one { grid-template-columns: minmax(0, 1fr); max-width: 930px; }
.gallery.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.gitem { position: relative; border-radius: var(--radius-img); overflow: hidden; background: var(--panel-2); }
.gimg { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; transition: transform .65s var(--ease); }
.gitem:hover .gimg { transform: scale(1.025); }

/* ---------------------------------------------------------------- slots / pending */
.slot {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  min-height: 200px;
  display: grid;
  place-items: center;
  padding: 22px;
  text-align: center;
  color: var(--ink-2);
  font-size: 13.5px;
}
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------------------------------------------------------------- offmap / end / foot */
.offmap { font-size: 13.5px; color: var(--ink-2); margin-block: clamp(18px, 3vh, 30px) 0; }
.offmap a { color: var(--accent); text-underline-offset: 4px; }

.end { text-align: center; }
.seal { width: 88px; height: 88px; margin: 0 auto 20px; opacity: .95; }
.end h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.end-line { color: var(--ink-2); margin: 14px auto 0; max-width: 40ch; }
.end-copy { font-size: 13px; color: var(--ink-2); max-width: 56ch; margin: 20px auto 0; line-height: 1.9; }
.end-upd { font-size: 12.5px; color: var(--ink-2); margin: 14px auto 0; }

.foot {
  border-top: 1px solid var(--line);
  max-width: 1236px;
  margin: 0 auto;
  padding: 26px clamp(18px, 3.4vw, 48px) 44px;
  color: var(--ink-2);
  font-size: 12.5px;
  text-align: center;
}
.foot p { margin: 0 0 6px; }
.foot-author { opacity: .9; }

/* ---------------------------------------------------------------- reveal */
.js .reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .gitem.reveal { transition-delay: calc(var(--i, 0) * 70ms); }

/* ---------------------------------------------------------------- lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  background: transparent;
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(6, 10, 8, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.lb-inner { position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; padding: clamp(14px, 3vh, 34px) clamp(14px, 3vw, 34px) clamp(10px, 2vh, 22px); }
.lb-media { min-height: 0; display: grid; place-items: center; }
.lb-img {
  max-width: min(94vw, 1560px);
  max-height: calc(100dvh - 132px);
  width: auto;
  height: auto;
  border-radius: var(--radius-img);
}
.lb-img.ready { animation: lbFade .35s var(--ease) both; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }

.lb-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px; padding-top: 14px; color: #F2F4EE; }
.lb-bar .btn-mini { color: #F2F4EE; border-color: rgba(255, 255, 255, .38); background: rgba(255, 255, 255, .07); }
.lb-bar .btn-mini:hover { background: rgba(255, 255, 255, .16); border-color: #FFFFFF; color: #FFFFFF; }
.lb-cap { font-size: 13px; color: rgba(255, 255, 255, .92); max-width: 48ch; text-align: center; }
.lb-count { font-family: var(--mono); font-size: 12px; color: rgba(255, 255, 255, .75); }
.lightbox.pair-mode .lb-prev,
.lightbox.pair-mode .lb-next,
.lightbox.pair-mode .lb-count { display: none; }
.lightbox.gallery-mode .lb-toggle { display: none; }

body.lb-open { overflow: hidden; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1120px) {
  .chapter-body { grid-template-columns: 1fr; }
  .ov-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1000px) {
  .hero-in { padding-bottom: 22px; }
  .hero-social {
    position: static;
    width: fit-content;
    max-width: calc(100% - 40px);
    margin: 20px clamp(20px, 5vw, 72px) clamp(60px, 8vh, 88px);
  }
}

@media (max-width: 960px) {
  .topbar-in { gap: 14px; }
  .mainnav { overflow-x: auto; scrollbar-width: none; }
  .mainnav::-webkit-scrollbar { display: none; }
  .navlink { font-size: 13px; }
  .guide-grid { grid-template-columns: 1fr; }
  .plate { grid-template-columns: auto 1fr; }
  .plate-sub { grid-column: 1 / -1; text-align: left; max-width: none; margin: 0; }
  .map-svg .node-label { display: none; }
  .map-svg .map-wp { display: none; }
}

@media (max-width: 640px), (max-width: 960px) and (pointer: coarse) and (hover: none) {
  .brand-main > span { display: block; }
  .brand-sub { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .brand-sub { display: none; }
  .gallery.two, .gallery.three { grid-template-columns: 1fr; }
  .slots { grid-template-columns: 1fr; }
  .groups > .pair { max-width: none; }
  .pair-tag { top: 9px; font-size: 11px; padding: 4px 10px; }
  .tag-real { left: 9px; }
  .tag-draw { right: 9px; }
  .pair-handle { left: clamp(16px, var(--p, 100%), calc(100% - 16px)); }
  .pair-handle::after { width: 34px; height: 34px; }
    .map-legend .lg { font-size: 11.5px; }
  .sub-br { display: inline; }
  .sub-sep { display: none; }
  /* 手机端顶栏：停在页面顶端时完全隐去（封面照片顶到屏幕最上沿），
     向下滚动的最初 140px 内按滚动比例线性淡入并下滑到位。 */
  .topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    opacity: var(--tb-p, 1);
    transform: translateY(calc((1 - var(--tb-p, 1)) * -10px));
  }
  .topbar.is-top { pointer-events: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .topbar:focus-within { opacity: 1; transform: none; }
  .hero { min-height: 100vh; }
  @supports (height: 100svh) { .hero { min-height: 100svh; } }
  /* 手机端封面重排：文字块靠上，两个按钮压到底部小字上方，主页小卡落在右下角 */
  .hero-in {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    padding: 14px 20px 46px;
  }
  .hero-tag { align-self: flex-start; }
  .hero-actions { flex-direction: column; align-items: flex-start; margin-top: auto; }
  .btn { padding: 0 20px; }
  .hero-social {
    position: absolute;
    left: auto;
    right: 16px;
    bottom: 20px;
    width: auto;
    max-width: calc(100% - 32px);
    margin: 0;
    padding: 5px;
    gap: 3px;
    flex-direction: column;
  }
  .hs-item { flex-direction: row; align-items: center; width: auto; gap: 7px; padding: 5px 6px; }
  .hs-qr { width: 42px; height: 42px; }
  .hs-text { align-items: flex-start; text-align: left; }
  .hs-name { font-size: 12px; }
  .hs-hint { font-size: 11px; white-space: nowrap; }
  .hero-credit { right: auto; left: 18px; bottom: 16px; font-size: 12px; }
}

@media (max-width: 370px) {
  .btn { padding: 0 16px; }
  .hero-social { padding: 4px; }
  .hs-item { gap: 6px; padding: 4px 5px; }
  .hs-qr { width: 38px; height: 38px; }
  .hs-name { font-size: 11.5px; }
}

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .hero-title .split .ch,
  .js .hero-tag, .js .hero-sub, .js .hero-actions, .js .hero-credit, .js .hero-social { animation: none; opacity: 1; }
  .js .hero-title .split .ch { transform: none; }
  .js .map-svg .walk-case, .js .map-svg .walk { stroke-dashoffset: 0; transition: none; }
  .js .map-svg .bus { opacity: 1; transition: none; }
  .js .map-svg .node { opacity: 1; transition: none; }
  .js .map-svg .map-wp-g { opacity: 1; transition: none; }
  .progress i { animation: none; transform: scaleX(0); }
  .gimg, .btn, .btn-mini, .pair-handle, .hs-item { transition: none; }
}
