* { box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #090d13;
  color: #edf2f8;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
body.theme-school { background: #0d1420; }
canvas { display: block; touch-action: none; cursor: grab; }
canvas:active { cursor: grabbing; }

#ui {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

/* ---------- 左上角品牌标题与双场景切换胶囊 ---------- */
.brand-stack {
  position: absolute;
  left: 24px;
  top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.78);
}
.brand-mark {
  width: 9px;
  height: 40px;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffdf75, #f07b20);
  box-shadow: 0 0 22px rgba(246, 167, 44, 0.65);
  flex: none;
}
.crest {
  width: 42px;
  height: 42px;
  border: 2px solid #ffe394;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #e05249, #a92b24);
  box-shadow: 0 0 24px rgba(255, 196, 90, 0.42);
  flex: none;
}
.crest::after {
  content: "校";
  font-size: 19px;
  font-weight: 900;
  color: #fff8dc;
}
.brand h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.16em;
  font-weight: 850;
}
.brand p {
  margin: 4px 0 0;
  font-size: 11px;
  color: #c2d0e2;
  letter-spacing: 0.12em;
}

.scene-nav {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(12, 19, 31, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}
.scene-tab {
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #aebdce;
  text-decoration: none;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.scene-tab:hover { color: #ffffff; }
.scene-tab.active {
  color: #141922;
  background: linear-gradient(180deg, #ffe48f, #f5aa36);
  box-shadow: 0 2px 12px rgba(245, 170, 54, 0.5);
}

/* ---------- 右上角实时监控、一键四时切换与声效面板 ---------- */
.telemetry {
  pointer-events: auto;
  position: absolute;
  right: 24px;
  top: 20px;
  width: 266px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(14, 22, 35, 0.85);
  box-shadow: 0 16px 46px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(11px);
}
body.theme-school .telemetry {
  background: rgba(18, 30, 49, 0.86);
}
.telemetry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: #a6b7cc;
  font-size: 10px;
  letter-spacing: 0.14em;
}
.live {
  color: #72e69e;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  margin-top: 10px;
  font-size: 12px;
}
.telemetry-grid .k { color: #92a3b9; }
.telemetry-grid .v {
  font-weight: 700;
  color: #f2f6fc;
  text-align: right;
}
.telemetry-grid .ctrl-val {
  cursor: pointer;
  padding: 1px 6px;
  margin-right: -6px;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
}
.telemetry-grid .ctrl-val:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffd978;
}
.weather { color: #84c9ff; transition: color 0.2s; }
.weather.is-wet { color: #ffe07d; }

/* 一键时段胶囊与 24h 滑块 */
.time-box {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.time-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.time-pill {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 4px 2px;
  background: rgba(255, 255, 255, 0.05);
  color: #c7d4e5;
  font: 600 10.5px/1.2 inherit;
  cursor: pointer;
  transition: all 0.16s;
}
.time-pill:hover {
  border-color: rgba(255, 216, 120, 0.55);
  color: #fff;
}
.time-pill.active {
  background: linear-gradient(180deg, rgba(255, 212, 108, 0.28), rgba(240, 148, 42, 0.24));
  border-color: #ffd36b;
  color: #ffe8a3;
}
.time-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}
.time-slider-wrap span {
  font-size: 10px;
  color: #8c9eb5;
  white-space: nowrap;
}
.time-slider {
  flex: 1;
  height: 4px;
  accent-color: #f6b945;
  cursor: pointer;
}

.hud-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.hud-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  padding: 6px 4px;
  background: rgba(255, 255, 255, 0.06);
  color: #e3ecf7;
  font: 600 10.5px/1.2 inherit;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.16s, border-color 0.16s, color 0.16s;
}
.hud-btn:hover {
  background: rgba(255, 212, 112, 0.16);
  border-color: rgba(255, 212, 112, 0.55);
  color: #fff4d2;
}
.hud-btn.active {
  background: rgba(102, 182, 255, 0.24);
  border-color: rgba(132, 201, 255, 0.72);
  color: #ffe28a;
}

/* ---------- 底部沉浸漫游机位切换坞 & 交互提示 ---------- */
.focus-guide {
  position: absolute;
  left: 24px;
  bottom: 20px;
  font-size: 10.5px;
  line-height: 1.65;
  color: #96a8be;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.bottom-dock {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.cam-bar {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 6px;
  border-radius: 999px;
  background: rgba(11, 18, 29, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.48);
}
.cam-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 5px 12px;
  background: transparent;
  color: #b7c6d9;
  font: 700 11px/1.2 inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s;
}
.cam-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.cam-btn.active {
  color: #131922;
  background: linear-gradient(180deg, #ffe28a, #f5a833);
  box-shadow: 0 2px 10px rgba(245, 168, 51, 0.45);
}

.sub-hint {
  font-size: 10.5px;
  color: #cad6e5;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.sub-hint kbd {
  padding: 1px 5px;
  margin: 0 2px;
  border: 1px solid #6b7b8e;
  border-radius: 4px;
  background: rgba(34, 46, 61, 0.85);
  color: #fff;
  font-family: inherit;
}
.hint-mobile { display: none; }

/* 鼠标悬停可互动 3D 玩具时的浮动提示牌 */
.hover-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 8;
  pointer-events: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 23, 38, 0.92);
  border: 1px solid #ffd36b;
  color: #fff2c6;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.14s;
}
.hover-tip.on { opacity: 1; }

.toast {
  position: absolute;
  left: 50%;
  top: 14%;
  transform: translate(-50%, -10px);
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(14, 22, 36, 0.94);
  border: 1px solid rgba(255, 208, 98, 0.68);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
  color: #fff3cf;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0;
  transition: opacity 0.24s, transform 0.24s;
}
.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tag {
  pointer-events: auto;
  position: absolute;
  left: 0;
  top: 0;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(14, 23, 37, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #e6eff9;
  font-size: 10px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  opacity: 0.88;
  cursor: pointer;
  will-change: transform, opacity;
  transition: border-color 0.15s, background 0.15s, color 0.15s, opacity 0.18s;
}
.tag:hover, .tag.is-focused {
  opacity: 1;
  background: rgba(28, 45, 70, 0.95);
  border-color: #ffd36b;
  color: #ffe8a3;
}
.tag.is-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ---------- 备案页脚 ---------- */
.beian-records {
  position: fixed;
  right: 16px;
  bottom: 15px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  background: rgba(16, 25, 38, 0.8);
  backdrop-filter: blur(6px);
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
}
.beian-records a {
  color: #dce5ed;
  text-decoration: none;
  transition: color 0.18s;
}
.beian-records a:hover { color: #fff; }
.beian-records:hover { border-color: rgba(255, 255, 255, 0.34); }
.beian-sep { color: rgba(255, 255, 255, 0.22); }
.mps-record { display: inline-flex; align-items: center; gap: 4px; }
.mps-record img { width: 14px; height: 14px; display: block; flex: none; }

@media (max-width: 980px) {
  .beian-records { flex-direction: column; align-items: flex-end; gap: 3px; }
  .beian-sep { display: none; }
  .focus-guide { display: none; }
}
@media (max-width: 720px) {
  .brand-stack { left: 11px; top: 11px; gap: 6px; }
  .crest { width: 32px; height: 32px; }
  .crest::after { font-size: 15px; }
  .brand-mark { height: 28px; width: 7px; }
  .brand h1 { font-size: 13.5px; letter-spacing: 0.08em; }
  .brand p { display: none; }
  .scene-tab { padding: 4px 9px; font-size: 10.5px; }
  .telemetry { right: 10px; top: 10px; width: 196px; padding: 9px 10px; }
  .telemetry-grid { font-size: 10.5px; gap: 4px 8px; margin-top: 7px; }
  .time-slider-wrap { display: none; }
  .time-pill { font-size: 9.5px; padding: 3px 1px; }
  .hud-actions { margin-top: 7px; padding-top: 6px; gap: 4px; }
  .hud-btn { padding: 4px 3px; font-size: 9.5px; }
  .bottom-dock { bottom: 8px; gap: 3px; width: 96vw; }
  .cam-bar { max-width: 96vw; overflow-x: auto; padding: 4px; }
  .cam-btn { padding: 4px 9px; font-size: 10px; }
  .sub-hint { font-size: 9.5px; }
  .hint-desktop { display: none; }
  .hint-mobile { display: inline; }
  .tag { display: none; }
  .beian-records { right: 10px; bottom: 64px; padding: 4px 7px; font-size: 9px; }
  .mps-record img { width: 11px; height: 11px; }
}
