:root {
  color-scheme: dark;
  --ink: #e8eff0;
  --muted: #aab9be;
  --gold: #f4bd59;
  --plate: #172229;
  --edge: #33434a;
  --body: #111a20;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--body); color: var(--ink); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, canvas:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button:disabled { cursor: default; opacity: .56; }
.masthead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 75px; padding: 12px 25px; background: #121d23; border-bottom: 1px solid var(--edge);
}
.identity, .masthead-actions { display: flex; align-items: center; gap: 13px; }
.brand { width: 43px; height: 43px; color: var(--gold); border: 1px solid #695737; border-radius: 8px; background: #3b3122; flex: none; }
h1 { font-size: 19px; font-weight: 700; letter-spacing: .08em; margin: 0 0 3px; }
.identity p { font-size: 11px; margin: 0; letter-spacing: .08em; color: var(--muted); }
.mode-select {
  display: flex; align-items: center; padding: 3px; gap: 2px; border: 1px solid var(--edge);
  border-radius: 7px; background: #0d171c; white-space: nowrap;
}
.mode-select button {
  border: 0; background: none; border-radius: 4px; color: var(--muted); font-size: 12px;
  padding: 8px 13px; transition: background .18s, color .18s;
}
.mode-select button[aria-pressed="true"] { color: var(--gold); background: #393226; }
.mode-select button:hover { color: var(--gold); }
.icon-button {
  width: 37px; height: 37px; display: grid; place-items: center; border-radius: 6px;
  border: 1px solid var(--edge); background: #18252b;
}
.icon-button svg { width: 19px; }
.icon-button:hover, .quiet:hover { color: var(--gold); border-color: #746449; }
.layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; min-height: calc(100dvh - 75px); }
.viewport {
  position: relative; min-height: 530px; overflow: hidden; isolation: isolate; background: #9eaeb0;
}
.viewport:fullscreen { min-height: 100dvh; }
.poster, #scene { width: 100%; height: 100%; position: absolute; inset: 0; display: block; }
.poster { object-fit: cover; pointer-events: none; transition: opacity .35s ease; }
#scene { cursor: grab; opacity: 0; touch-action: none; outline-offset: -1px; }
#scene:focus-visible { outline: 1px solid #f4bd5980; }
#scene:active { cursor: grabbing; }
.viewport.ready #scene { opacity: 1; }
.viewport.ready .poster { opacity: 0; }
.stage-caption {
  position: absolute; top: 21px; left: 22px; display: flex; gap: 9px; align-items: center;
  padding: 9px 12px; border: 1px solid #8a989b73; border-radius: 6px;
  background: #142129de; color: #edf4f3; font-size: 12px; pointer-events: none;
}
.stage-lamp { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px #ffd78b6b; }
.load-card {
  position: absolute; top: 48%; left: 50%; transform: translate(-50%,-50%);
  min-width: min(245px,80%); display: grid; gap: 11px; justify-items: start; padding: 18px 20px;
  border: 1px solid #83969c8c; border-radius: 8px; background: #121f27ed; box-shadow: 0 9px 32px #0a141a38;
}
.load-lead { font-size: 13px; line-height: 1.55; }
progress { accent-color: var(--gold); height: 6px; width: 100%; }
.retry { border: 1px solid #7c6849; border-radius: 4px; background: #342b21; color: var(--gold); padding: 6px 10px; }
.crosshair { display: none; position: absolute; top: 50%; left: 50%; width: 5px; height: 5px; border-radius: 50%; background: #fdfdfe; box-shadow: 0 0 5px #19282d; pointer-events: none; }
.viewport.locked .crosshair { display: block; }
.view-controls {
  position: absolute; left: 22px; bottom: 20px; display: flex; align-items: center; gap: 9px;
  touch-action: none;
}
.action, .desktop-hints {
  border: 1px solid #86999e71; border-radius: 6px; background: #132128ed; color: var(--ink);
  display: flex; gap: 7px; align-items: center; min-height: 40px; padding: 8px 11px;
}
.action { color: var(--gold); font-size: 12px; }
.action svg { width: 17px; height: 17px; }
.action:hover { background: #263741; }
.viewport[data-mode="overview"] #capture { display: none; }
.desktop-hints { font-size: 11px; color: #d7e0e1; }
.desktop-hints i { height: 14px; width: 1px; background: #62767d; margin-inline: 2px; }
kbd {
  display: inline-grid; place-items: center; width: 18px; padding-block: 2px; font: 11px ui-monospace, monospace;
  color: #ecf0ef; background: #293a44; border: 1px solid #53646b; border-radius: 3px;
}
.rail { padding: 22px 18px 18px; background: var(--plate); border-left: 1px solid var(--edge); display: flex; flex-direction: column; gap: 25px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 23px; margin-bottom: 10px; }
.section-title h2 { font-size: 13px; letter-spacing: .08em; margin: 0; }
.quiet { border: 0; padding: 3px 0 3px 6px; background: none; font-size: 11px; color: var(--muted); }
.quiet span { font-size: 16px; margin-inline-start: 3px; }
.shots { display: grid; gap: 8px; }
.shot {
  display: flex; align-items: center; gap: 10px; padding: 6px; width: 100%; text-align: left;
  border: 1px solid var(--edge); background: #1c2a31; border-radius: 7px;
  transition: border-color .18s, background .18s;
}
.shot img { width: 67px; height: 52px; object-fit: cover; border-radius: 4px; border: 1px solid #43545c; flex-shrink: 0; }
.shot strong, .shot small { display: block; white-space: nowrap; line-height: 1.55; }
.shot strong { font-size: 12px; font-weight: 650; }
.shot small { font-size: 10px; color: var(--muted); }
.shot b { margin-inline-start: auto; padding-inline: 2px; color: #a7b8bd; font-weight: 400; font-size: 13px; }
.shot[aria-current="true"], .shot:hover { border-color: #a88448; background: #2b2d29; }
.shot[aria-current="true"] b { color: var(--gold); }
.map-wrap { padding: 11px 8px; border: 1px solid var(--edge); border-radius: 7px; background: #101c23; }
#map { display: block; width: 100%; height: 69px; cursor: crosshair; }
.rail-hint, .rail-note { color: var(--muted); font-size: 11px; margin: 8px 0 0; line-height: 1.7; }
.rail-note { margin-top: auto; border-top: 1px solid var(--edge); padding-top: 12px; }
.touch-nav { display: none; }
@media (pointer: coarse) {
  .view-controls { left: 12px; bottom: 14px; }
  .desktop-hints { display: none; }
  #capture { display: none; }
  .viewport[data-mode="walk"] .touch-nav:not([hidden]) {
    position: absolute; bottom: 15px; left: 14px; display: grid; grid-template-columns: repeat(3,44px); gap: 5px;
  }
  .touch-nav button {
    display: grid; place-items: center; min-width: 44px; min-height: 44px; background: #132129e6;
    border: 1px solid #72868e; border-radius: 8px; color: #f4f5ee; font-size: 19px;
    touch-action: none; user-select: none;
  }
  .touch-nav button:active { background: #6b542f; }
  .touch-up { grid-column: 2; }
  .touch-nav button:nth-child(2) { grid-column: 1; }
}
@media (max-width: 760px) {
  .masthead { min-height: 68px; padding: 10px 12px; }
  .identity, .masthead-actions { gap: 8px; }
  .brand { width: 36px; height: 36px; }
  h1 { font-size: 15px; letter-spacing: .03em; }
  .identity p { font-size: 9px; letter-spacing: 0; }
  .mode-select button { font-size: 11px; padding: 7px 9px; }
  .icon-button { width: 33px; height: 33px; }
  .layout { display: block; min-height: 0; }
  .viewport { height: max(370px,60dvh); min-height: 0; }
  .stage-caption { top: 12px; left: 12px; }
  .rail { padding: 14px 12px 18px; border-left: 0; border-top: 1px solid var(--edge); gap: 16px; }
  .shots { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .shot { display: block; padding: 5px 5px 7px; }
  .shot img { width: 100%; height: auto; aspect-ratio: 1.9; display: block; margin-bottom: 4px; }
  .shot strong { font-size: 11px; }
  .shot small { font-size: 9px; white-space: normal; }
  .shot b { display: none; }
  #map { height: 81px; }
}
@media (max-width: 380px) {
  .masthead { gap: 5px; }
  .masthead-actions { gap: 5px; }
  .mode-select button { padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; } }
