:root {
  color-scheme: light;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #152923;
  background: #f5f2e9;
  --ink-muted: #4f6259;
  --line: #d9dcd0;
  --teal: #23695f;
  --gold: #ffdfa1;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, .viewport:focus-visible {
  outline: 2px solid #e8a33d;
  outline-offset: 3px;
}

.page { width: min(100%, 1480px); margin: auto; padding: 0 clamp(16px, 5vw, 72px); }

.masthead, .credits {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--ink-muted);
  font-size: 13px;
}

.masthead { padding: 24px 0 18px; border-bottom: 1px solid var(--line); }
.series { display: flex; align-items: center; gap: 10px; color: #183a32; letter-spacing: .12em; }
.series-mark { width: 15px; height: 10px; border: 1.5px solid var(--teal); transform: skewX(-18deg); }
.introduction { padding: clamp(24px, 4.4vw, 55px) 0 23px; }
h1 {
  margin: 0;
  font: 700 clamp(36px, 6.3vw, 84px)/1.14 "Songti SC", "Noto Serif CJK SC", "STIX Two Text", serif;
  letter-spacing: .025em;
}
h1 span { color: var(--teal); white-space: nowrap; }
.introduction p { margin: 12px 0 0; color: var(--ink-muted); font-size: clamp(14px, 1.5vw, 17px); }

.scene {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  height: clamp(330px, 43vw, 520px);
  border-radius: 14px;
  background: #102e37;
}

.viewport { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.viewport:focus-visible { outline-offset: -3px; z-index: 1; }
.viewport.is-dragging { cursor: grabbing; }

.panorama {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  transform-origin: 0 0;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}

.markers { position: absolute; inset: 0; pointer-events: none; }
.marker {
  position: absolute;
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  padding: 0;
  border: 1px solid #fff7de;
  border-radius: 50%;
  box-shadow: 0 0 0 4px #173c4660, 0 4px 10px #06151a55;
  background: #173b45e8;
  color: #fff8e5;
  font-size: 13px;
  font-weight: 700;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}
.marker:is(:hover, [aria-pressed="true"]) { background: var(--gold); color: #222315; }

.gesture, .tools, .story { position: absolute; bottom: 15px; z-index: 2; }
.gesture {
  left: 15px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 6px;
  background: #0b222ce8;
  color: #fffaf0;
  font-size: 12px;
  pointer-events: none;
}
.touch-hint { display: none; }
.tools {
  right: 15px;
  display: flex;
  align-items: stretch;
  border-radius: 8px;
  background: #102b34f5;
  color: #fffaf0;
  box-shadow: 0 3px 16px #091b224a;
}
.tools button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 22px;
}
.tools button:last-child { font-size: 13px; padding-inline: 14px; }
.tools button:disabled { opacity: .47; cursor: default; }
.tools button:not(:disabled):hover { background: #ffffff21; }

.story {
  left: 15px;
  bottom: 15px;
  width: min(340px, calc(100% - 185px));
  padding: 16px 18px;
  border: 1px solid #fff8e3;
  border-radius: 9px;
  color: #192d25;
  background: #f9f4e7fa;
  box-shadow: 0 6px 26px #091b224a;
}
.story-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.story h2 { margin: 0; font: 700 21px/1.1 "Songti SC", "Noto Serif CJK SC", serif; }
.story button {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink-muted);
  font-size: 23px;
  line-height: 1;
}
.story button:hover { background: #163f3012; }
.story p { margin: 6px 0 0; font-size: 13px; line-height: 1.65; color: #374d43; }

.navigation {
  display: grid;
  grid-template-columns: clamp(150px, 19vw, 252px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 2.5vw, 32px);
  padding: 15px 0;
}
.overview {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 5px;
  overflow: hidden;
  background: #11343e;
}
.overview img { display: block; width: 100%; height: auto; pointer-events: none; }
.view-box {
  position: absolute;
  pointer-events: none;
  border: 2px solid var(--gold);
  border-radius: 3px;
  box-shadow: 0 0 0 420px #0a252c66;
}
.stops { display: flex; gap: 7px; min-width: 0; flex-wrap: wrap; }
.stop {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 7px 12px;
  border: 1px solid #d5dacf;
  border-radius: 6px;
  background: #fffdf571;
  white-space: nowrap;
  font-size: 13px;
}
.stop span { color: var(--teal); font-variant-numeric: tabular-nums; font-size: 11px; }
.stop:is(:hover, [aria-pressed="true"]) { background: #deebe2; border-color: #a3bdb0; }
.credits { padding: 15px 0 20px; border-top: 1px solid var(--line); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (pointer: coarse) {
  .desktop-hint { display: none; }
  .touch-hint { display: inline; }
}

@media (max-width: 600px) {
  .masthead { padding: 17px 0 13px; }
  .introduction { padding-bottom: 18px; }
  .scene { height: clamp(340px, 58svh, 500px); border-radius: 10px; }
  .navigation { grid-template-columns: 1fr; gap: 10px; padding-block: 12px; }
  .overview { max-width: 286px; }
  .stop { min-height: 38px; padding-inline: 8px; font-size: 12px; }
  .gesture, .story { left: 10px; }
  .gesture, .tools { bottom: 10px; }
  .tools { right: 10px; }
  .story { bottom: 64px; width: min(340px, calc(100% - 20px)); padding: 11px 13px; }
  .credits { font-size: 11px; }
}
