:root {
  color-scheme: light;
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #edf6fb;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #edf6fb;
  overscroll-behavior: none;
  touch-action: none;
}

button,
canvas {
  -webkit-tap-highlight-color: transparent;
}

#euler-museum {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 420px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.98), rgba(223, 239, 249, 0.92) 55%, #c9e1ef);
  user-select: none;
}

#panorama-stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform-origin: center center;
  will-change: transform;
}

#panorama-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

#transition-veil {
  --transition-blur: 0px;
  position: absolute;
  inset: -3%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.08) 0 18%, rgba(226, 244, 255, 0.18) 58%, rgba(255, 246, 213, 0.34) 100%);
  -webkit-backdrop-filter: blur(var(--transition-blur));
  backdrop-filter: blur(var(--transition-blur));
  will-change: opacity, backdrop-filter;
}

#loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: #173d63;
  background: rgba(239, 248, 252, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 260ms ease, visibility 260ms ease;
}

#loading-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

#loading-overlay.is-error {
  padding: 32px;
  text-align: center;
  pointer-events: auto;
}

#loading-overlay p {
  max-width: 580px;
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.08em;
  line-height: 1.8;
}

.loading-orbit {
  position: relative;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(37, 98, 145, 0.2);
  border-radius: 50%;
}

.loading-orbit::before,
.loading-orbit::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(204, 157, 54, 0.35);
  border-radius: 50%;
}

.loading-orbit::after {
  inset: 18px;
  background: #d1a43e;
  box-shadow: 0 0 22px rgba(209, 164, 62, 0.55);
}

.loading-orbit span {
  position: absolute;
  inset: -1px;
  border: 2px solid transparent;
  border-top-color: #286a9a;
  border-radius: 50%;
  animation: orbit 1s linear infinite;
}

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

#enter-overlay {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #173d63;
  background:
    linear-gradient(110deg, rgba(240, 248, 252, 0.76), rgba(255, 251, 234, 0.58)),
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.82), rgba(221, 239, 248, 0.35) 52%, rgba(177, 211, 230, 0.42));
  -webkit-backdrop-filter: blur(16px) saturate(0.95);
  backdrop-filter: blur(16px) saturate(0.95);
  opacity: 1;
  transition: opacity 700ms cubic-bezier(0.4, 0, 0.2, 1), transform 700ms cubic-bezier(0.4, 0, 0.2, 1);
}

#enter-overlay.is-leaving {
  opacity: 0;
  transform: scale(1.035);
  pointer-events: none;
}

#enter-overlay.has-error {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.entry-glow {
  position: absolute;
  width: min(76vw, 860px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.82), rgba(255, 240, 185, 0.14) 36%, rgba(67, 135, 182, 0.08) 55%, transparent 69%);
  animation: breathe 5.4s ease-in-out infinite;
}

@keyframes breathe {
  50% { transform: scale(1.08); opacity: 0.72; }
}

.entry-card {
  position: relative;
  z-index: 1;
  width: min(88vw, 660px);
  padding: clamp(28px, 5vw, 58px);
  text-align: center;
  border: 1px solid rgba(45, 104, 149, 0.18);
  border-radius: 36px;
  background: rgba(255, 255, 255, 0.54);
  box-shadow:
    0 28px 80px rgba(30, 78, 111, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.entry-kicker {
  margin: 0 0 14px;
  color: #9b792f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(11px, 1.3vw, 14px);
  letter-spacing: 0.28em;
}

.entry-card h1 {
  margin: 0;
  font-family: "Songti SC", "Noto Serif SC", Georgia, serif;
  font-size: clamp(40px, 7vw, 76px);
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.12;
}

.entry-subtitle {
  margin: 18px 0 30px;
  color: rgba(23, 61, 99, 0.72);
  font-size: clamp(13px, 1.8vw, 17px);
  letter-spacing: 0.1em;
  line-height: 1.75;
}

#enter-button {
  position: relative;
  min-width: min(80vw, 286px);
  padding: 17px 34px 15px;
  color: white;
  border: 0;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(115deg, #174a73, #2679aa 58%, #1c577e);
  box-shadow:
    0 15px 32px rgba(24, 78, 116, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  cursor: pointer;
  transition: opacity 420ms ease, transform 420ms ease, box-shadow 200ms ease;
}

#enter-overlay.is-ready #enter-button {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#enter-button:hover,
#enter-button:focus-visible {
  box-shadow:
    0 18px 38px rgba(24, 78, 116, 0.32),
    0 0 0 5px rgba(223, 180, 75, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

#enter-button:active {
  transform: translateY(1px) scale(0.99);
}

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

#enter-button span {
  font-size: 16px;
  letter-spacing: 0.12em;
}

#enter-button small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.entry-note {
  margin: 22px 0 0;
  color: rgba(23, 61, 99, 0.52);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.7;
}

#first-hint {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: max(26px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(12, 38, 57, 0.55);
  box-shadow: 0 9px 28px rgba(4, 20, 32, 0.2);
  -webkit-backdrop-filter: blur(13px);
  backdrop-filter: blur(13px);
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity 520ms ease, transform 520ms ease;
}

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

#first-hint i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #e3b950;
  box-shadow: 0 0 9px rgba(227, 185, 80, 0.85);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 720px) {
  .entry-card {
    border-radius: 26px;
  }

  #first-hint {
    max-width: calc(100vw - 28px);
    gap: 8px;
    padding-inline: 13px;
    font-size: 9px;
    letter-spacing: 0.03em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .entry-glow,
  .loading-orbit span {
    animation: none;
  }
}
