/* ────────────────────────────────────────────────────────────
   紫禁城 · 中轴 —— 界面层
   深色半透明底 + 金色描边（PRD §7.1），刻意压得很轻，
   不与场景抢注意力；中文一律衬线，贴题材。
   ──────────────────────────────────────────────────────────── */

:root {
  --gold: #c8a24a;
  --gold-dim: rgba(200, 162, 74, 0.34);
  --gold-soft: rgba(232, 214, 170, 0.72);
  --ink: #f1e7d1;
  --ink-dim: rgba(241, 231, 209, 0.52);
  --panel: rgba(10, 13, 18, 0.55);
  --serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #080a0e;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }

/* ── 标题 ───────────────────────────────────────────── */
.masthead {
  position: fixed;
  top: 30px;
  left: 36px;
  pointer-events: none;
  z-index: 6;
}
.eyebrow {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: rgba(200, 162, 74, 0.82);
}
.masthead h1 {
  margin: 11px 0 0;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  letter-spacing: 0.26em;
  line-height: 1.1;
  color: #f4ecdb;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}
.masthead h1 em {
  font-style: normal;
  color: var(--gold);
  margin: 0 0.06em;
  opacity: 0.9;
}
.rule {
  width: 52px;
  height: 1px;
  margin: 15px 0 11px;
  background: linear-gradient(90deg, var(--gold), rgba(200, 162, 74, 0));
}
.tagline {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--ink-dim);
}

/* ── 工具条 ─────────────────────────────────────────── */
.tools {
  position: fixed;
  top: 32px;
  right: 36px;
  display: flex;
  align-items: center;
  gap: 7px;
  z-index: 8;
}
.tool {
  position: relative;
  appearance: none;
  padding: 8px 12px 8px 13px;
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: 0.18em;
  color: #ddc9a2;
  background: var(--panel);
  border: 1px solid var(--gold-dim);
  border-radius: 2px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.22s, color 0.22s, border-color 0.22s;
}
.tool em {
  font-family: var(--sans);
  font-style: normal;
  font-size: 8px;
  letter-spacing: 0.06em;
  margin-left: 5px;
  color: rgba(200, 162, 74, 0.62);
  vertical-align: super;
  text-transform: uppercase;
}
.tool:hover {
  color: #fff3d8;
  border-color: rgba(200, 162, 74, 0.72);
  background: rgba(26, 30, 36, 0.72);
}
.tool.is-on {
  color: #1b1409;
  background: rgba(200, 162, 74, 0.94);
  border-color: #d8b45c;
}
.tool.is-on em { color: rgba(27, 20, 9, 0.6); }
.sep {
  width: 1px;
  height: 17px;
  margin: 0 3px;
  background: rgba(200, 162, 74, 0.22);
}

/* ── 操作提示 / 版权条 ───────────────────────────────── */
.hint {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(241, 231, 209, 0.34);
  z-index: 6;
  white-space: nowrap;
}
.hint span { color: rgba(200, 162, 74, 0.66); }

.colophon {
  position: fixed;
  left: 36px;
  bottom: 24px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 18px;
}
.colophon p {
  margin: 0;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: rgba(241, 231, 209, 0.3);
}
.gh {
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: rgba(200, 162, 74, 0.62);
  text-decoration: none;
  border-bottom: 1px solid rgba(200, 162, 74, 0.24);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.gh:hover { color: #f0d79a; border-color: rgba(240, 215, 154, 0.6); }

/* ── 建筑标注 ───────────────────────────────────────── */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#labels.is-hidden { display: none; }

.label {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  transition: opacity 0.4s ease;
}
.label-box {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 13px 7px;
  white-space: nowrap;
  background: rgba(9, 12, 17, 0.5);
  border: 1px solid rgba(200, 162, 74, 0.3);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.label-name {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.24em;
  padding-left: 0.24em;
  color: #f5ecd8;
}
.label-sub {
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(200, 162, 74, 0.7);
}
.label-stem {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 30px;
  transform: translateX(-50%);
  background: linear-gradient(to top, rgba(200, 162, 74, 0.8), rgba(200, 162, 74, 0.05));
}

/* ── 加载遮罩 ───────────────────────────────────────── */
#loading {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 44%, #1a2430 0%, #0b0e13 55%, #07080b 100%);
  transition: opacity 0.75s ease, visibility 0.75s ease;
}
#loading.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.load-inner { text-align: center; }
.load-title {
  margin: 0;
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: 0.34em;
  padding-left: 0.34em;
  color: #ede2c8;
}
.load-note {
  margin: 18px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.36em;
  padding-left: 0.36em;
  color: rgba(200, 162, 74, 0.8);
}
.load-bar {
  width: 168px;
  height: 1px;
  margin: 22px auto 0;
  background: rgba(200, 162, 74, 0.16);
  overflow: hidden;
}
.load-bar i {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, rgba(200, 162, 74, 0), var(--gold), rgba(200, 162, 74, 0));
  animation: slide 1.5s ease-in-out infinite;
}
@keyframes slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(310%); }
}
#loading.is-failed .load-bar { display: none; }
#loading.is-failed .load-title { color: #c9b48a; }
#loading.is-failed .load-note {
  max-width: 560px;
  margin: 22px auto 0;
  font-size: 12.5px;
  line-height: 2;
  letter-spacing: 0.04em;
  color: #e6c9a4;
  text-align: center;
}
#loading.is-failed .load-note b { color: #f0d79a; font-weight: 600; }
.hint-code {
  display: inline-block;
  margin: 4px 3px;
  padding: 3px 9px;
  border: 1px solid rgba(200, 162, 74, 0.32);
  border-radius: 2px;
  background: rgba(200, 162, 74, 0.07);
  color: #ecd9a8;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 11.5px;
  letter-spacing: 0;
}
.hint-sub {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(241, 231, 209, 0.42);
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #0b0e13;
  color: var(--ink-dim);
  font-size: 13px;
  letter-spacing: 0.1em;
  z-index: 60;
}

/* ── 截图模式 ───────────────────────────────────────── */
body.hud-off .masthead,
body.hud-off .tools,
body.hud-off .hint,
body.hud-off .colophon,
body.hud-off #labels { display: none !important; }

/* ── 断点：移动端（FR-3D-06）─────────────────────────── */
@media (max-width: 720px) {
  .masthead { top: 18px; left: 18px; }
  .eyebrow { font-size: 8.5px; letter-spacing: 0.28em; }
  .masthead h1 { font-size: 23px; letter-spacing: 0.2em; margin-top: 8px; }
  .rule { margin: 10px 0 8px; width: 38px; }
  .tagline { font-size: 10px; letter-spacing: 0.1em; max-width: 72vw; line-height: 1.5; }
  .tag-extra { display: none; }

  .tools {
    top: auto;
    bottom: 14px;
    left: 10px;
    right: 10px;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
    justify-content: center;
  }
  .tools::-webkit-scrollbar { display: none; }
  .tool { font-size: 10.5px; padding: 6px 7px; letter-spacing: 0.06em; flex: 0 0 auto; }
  .tool em { display: none; }
  .sep { display: none; }
  .hint { display: none; }
  .colophon { display: none; }
  .label-box { padding: 4px 9px 5px; bottom: 24px; }
  .label-name { font-size: 12px; letter-spacing: 0.16em; }
  .label-sub { display: none; }
  .label-stem { height: 24px; }
}
