:root {
  color-scheme: dark;
  --gold: #f5cb72;
  --ivory: #fffaf0;
  --night: #07111d;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body,
#museum,
#canvas-host {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  position: fixed;
  inset: 0;
  background: var(--night);
  color: var(--ivory);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  overscroll-behavior: none;
  user-select: none;
}

#museum {
  position: relative;
  isolation: isolate;
  cursor: grab;
}

#museum.dragging {
  cursor: grabbing;
}

#museum.cursor-idle {
  cursor: none;
}

#canvas-host,
#canvas-host canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#canvas-host canvas {
  outline: none;
  touch-action: none;
}

.start-screen {
  position: absolute;
  z-index: 30;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 40%, rgba(12, 34, 54, 0.12), rgba(4, 10, 17, 0.82) 72%),
    linear-gradient(180deg, rgba(5, 15, 26, 0.18), rgba(5, 15, 26, 0.7));
  backdrop-filter: blur(2px) saturate(1.08);
  transition: opacity 700ms ease, visibility 700ms ease;
}

.start-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-card {
  width: min(680px, 92vw);
  text-align: center;
  padding: clamp(30px, 5vw, 58px);
  border: 1px solid rgba(245, 203, 114, 0.52);
  border-radius: 3px;
  background: linear-gradient(145deg, rgba(8, 24, 39, 0.8), rgba(5, 14, 25, 0.58));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.43), inset 0 0 70px rgba(245, 203, 114, 0.04);
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(10px, 1.2vw, 13px);
  letter-spacing: 0.22em;
}

.start-card h1 {
  margin: 0;
  font-family: "Songti SC", SimSun, Georgia, serif;
  font-size: clamp(46px, 8vw, 92px);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-shadow: 0 5px 36px rgba(0, 0, 0, 0.42);
}

.start-copy {
  margin: 18px 0 34px;
  color: rgba(255, 250, 240, 0.8);
  font-size: clamp(13px, 1.8vw, 18px);
  letter-spacing: 0.14em;
}

#enter-button {
  appearance: none;
  width: min(420px, 100%);
  padding: 15px 28px 13px;
  border: 1px solid rgba(255, 241, 205, 0.85);
  border-radius: 999px;
  color: #1b2530;
  background: linear-gradient(135deg, #fff5d8, #e9bd62);
  box-shadow: 0 12px 40px rgba(222, 169, 63, 0.26);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

#enter-button:hover,
#enter-button:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 15px 45px rgba(222, 169, 63, 0.38);
  outline: none;
}

#enter-button:disabled {
  cursor: wait;
  filter: saturate(0.35);
  opacity: 0.62;
}

#enter-button span,
#enter-button small {
  display: block;
}

#enter-button span {
  font-size: clamp(16px, 2.1vw, 20px);
  font-weight: 700;
  letter-spacing: 0.08em;
}

#enter-button small {
  margin-top: 5px;
  opacity: 0.72;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.start-note {
  margin: 18px 0 0;
  color: rgba(255, 250, 240, 0.54);
  font-size: 11px;
}

.loading {
  position: absolute;
  z-index: 25;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(255, 250, 240, 0.86);
  background: rgba(4, 12, 21, 0.68);
  backdrop-filter: blur(8px);
  transition: opacity 450ms ease, visibility 450ms ease;
  pointer-events: none;
}

.loading.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-ring {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.scene-card {
  position: absolute;
  z-index: 9;
  top: max(24px, env(safe-area-inset-top));
  left: max(26px, env(safe-area-inset-left));
  max-width: min(440px, 72vw);
  padding: 14px 18px 15px 16px;
  border-left: 2px solid var(--gold);
  background: linear-gradient(90deg, rgba(3, 13, 23, 0.72), rgba(3, 13, 23, 0));
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65);
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 650ms ease, transform 650ms ease;
  pointer-events: none;
}

.scene-card.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.scene-card #scene-number {
  display: block;
  margin-bottom: 7px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 11px;
  letter-spacing: 0.2em;
}

.scene-card h2 {
  margin: 0;
  font-family: "Songti SC", SimSun, serif;
  font-size: clamp(20px, 2.9vw, 34px);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.scene-card p {
  margin: 5px 0 0;
  color: rgba(255, 250, 240, 0.72);
  font-family: Georgia, serif;
  font-size: 12px;
  letter-spacing: 0.12em;
}

.subtitle {
  position: absolute;
  z-index: 10;
  left: 50%;
  bottom: max(40px, calc(env(safe-area-inset-bottom) + 24px));
  width: min(840px, calc(100vw - 48px));
  padding: 12px 22px 14px;
  border: 1px solid rgba(255, 245, 218, 0.16);
  border-radius: 5px;
  color: #fffdf7;
  background: rgba(2, 10, 18, 0.7);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(8px);
  font-size: clamp(14px, 1.8vw, 19px);
  line-height: 1.7;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 360ms ease, transform 360ms ease;
  pointer-events: none;
}

.subtitle.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hint {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: max(24px, env(safe-area-inset-top));
  transform: translateX(-50%);
  max-width: calc(100vw - 48px);
  padding: 8px 15px;
  border-radius: 999px;
  color: rgba(255, 250, 240, 0.83);
  background: rgba(3, 12, 22, 0.56);
  backdrop-filter: blur(7px);
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 500ms ease;
  pointer-events: none;
}

.hint.is-visible {
  opacity: 1;
}

.hotspot-label {
  position: absolute;
  z-index: 12;
  left: 0;
  top: 0;
  padding: 7px 11px;
  border: 1px solid rgba(255, 236, 186, 0.44);
  border-radius: 999px;
  color: #fff8e7;
  background: rgba(3, 12, 20, 0.76);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 18px));
  transition: opacity 150ms ease;
  pointer-events: none;
}

.hotspot-label.is-visible {
  opacity: 1;
}

.transition-veil {
  position: absolute;
  z-index: 7;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 241, 201, 0.03), rgba(2, 9, 16, 0.22)),
    linear-gradient(90deg, rgba(7, 20, 31, 0.08), rgba(245, 216, 151, 0.08), rgba(7, 20, 31, 0.08));
  opacity: 0;
  backdrop-filter: blur(0);
  pointer-events: none;
}

.quality-badge {
  position: absolute;
  z-index: 8;
  right: max(20px, env(safe-area-inset-right));
  top: max(20px, env(safe-area-inset-top));
  padding: 6px 9px;
  border: 1px solid rgba(255, 245, 218, 0.18);
  border-radius: 3px;
  color: rgba(255, 250, 240, 0.58);
  background: rgba(3, 12, 22, 0.38);
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.16em;
  opacity: 0;
  transition: opacity 500ms ease;
  pointer-events: none;
}

.quality-badge.is-visible {
  opacity: 1;
}

.fatal-error {
  position: absolute;
  z-index: 50;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 32px;
  text-align: center;
  background: #07111d;
}

.fatal-error[hidden] {
  display: none;
}

.fatal-error h2 {
  margin: 0 0 10px;
  font-family: "Songti SC", SimSun, serif;
  font-size: 28px;
}

.fatal-error p {
  margin: 0;
  color: rgba(255, 250, 240, 0.68);
}

@media (max-width: 620px) {
  .scene-card {
    top: max(16px, env(safe-area-inset-top));
    left: 16px;
  }

  .hint {
    top: auto;
    bottom: calc(max(28px, env(safe-area-inset-bottom)) + 2px);
    font-size: 9px;
  }

  .subtitle {
    bottom: max(60px, calc(env(safe-area-inset-bottom) + 48px));
    width: calc(100vw - 24px);
    padding: 10px 14px;
    line-height: 1.55;
  }

  .quality-badge {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
