/* 共时·凌空 第二版 — 全画面转播 HUD */
:root {
  --hud: #eef1f4;
  --hud-dim: #9aa3ad;
  --hud-faint: rgba(255, 255, 255, 0.28);
  --line: rgba(255, 255, 255, 0.38);
  --bg: #050506;
  --bar: rgba(0, 0, 0, 0.92);
  --brand: #6fe0d4;
  --on: #f5f7fa;
  --off: #2a2e33;
  --throttled: #b8c0c8;
  --danger: #e24b4b;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --bottom-h: clamp(104px, 12.5vh, 142px);
  --ctrl-h: 40px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #app {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--hud);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}
#view3d {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  background: #05070b;
}
#hud {
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* ——— top left clock + fueling ——— */
.hud-tl {
  position: absolute;
  top: 18px; left: 22px;
  z-index: 6;
}
.clock-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  background: linear-gradient(90deg, rgba(0,0,0,0.72), rgba(0,0,0,0.28));
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 100%, 0 100%);
  padding: 6px 28px 6px 14px;
}
.t-sign { font-size: 15px; letter-spacing: 0.08em; color: var(--hud); font-weight: 600; }
.t-digits {
  font-size: 28px; font-weight: 600; letter-spacing: 0.06em;
  font-feature-settings: "tnum";
}
.mission-name {
  margin-top: 6px; padding-left: 14px;
  font-size: 12px; letter-spacing: 0.16em;
  color: var(--hud-dim); text-transform: none;
}
.mission-en {
  padding-left: 14px;
  font-size: 10px; letter-spacing: 0.22em;
  color: rgba(238,241,244,0.45);
}

.fuel-strip {
  margin-top: 18px;
  display: flex; gap: 10px; align-items: stretch;
  background: rgba(0,0,0,0.62);
  padding: 12px 12px 12px 10px;
  width: 196px;
  opacity: 1;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fuel-strip.hidden { opacity: 0; pointer-events: none; transform: translateX(-8px); }
.fuel-silhouette {
  width: 36px; position: relative;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 16px 16px 4px 4px;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.sil-s2, .sil-s1 { position: relative; flex: 1; border-top: 1px solid rgba(255,255,255,0.1); }
.sil-s2 { flex: 0.42; border-top: 0; }
.fill {
  position: absolute; left: 2px; right: 2px; bottom: 0;
  background: rgba(220,230,240,0.55);
  transition: height 0.2s linear;
}
.fill.ch4 { left: 2px; right: 52%; background: rgba(180,200,210,0.45); }
.fill.lox { left: 52%; right: 2px; background: rgba(220,230,240,0.62); }
.fuel-reads { display: flex; flex-direction: column; justify-content: space-between; flex: 1; }
.fuel-hd { font-size: 10px; letter-spacing: 0.18em; color: var(--hud-dim); margin-bottom: 2px; }
.fuel-kv { display: flex; align-items: baseline; gap: 6px; font-size: 11px; color: var(--hud-dim); }
.fuel-kv strong { font-size: 15px; color: var(--hud); font-weight: 600; }
.fuel-kv em { font-style: normal; font-size: 10px; color: var(--hud-dim); }

/* size overlay (prelaunch) */
.size-overlay {
  position: absolute;
  left: 18%; top: 22%;
  display: flex; align-items: flex-end; gap: 28px;
  opacity: 0.9;
  transition: opacity 0.6s ease;
  text-shadow: 0 1px 2px #000, 0 2px 10px rgba(0,0,0,0.8);
}
.size-overlay.hidden { opacity: 0; pointer-events: none; }
.size-plane {
  width: 86px; height: 22px;
  border: 1.5px solid rgba(255,255,255,0.85);
  border-radius: 40% 40% 20% 20%;
  position: relative;
}
.size-plane::before, .size-plane::after {
  content: ""; position: absolute; background: rgba(255,255,255,0.85);
}
.size-plane::before { /* wings */
  left: -34px; right: -34px; height: 4px; top: 8px;
}
.size-plane::after { /* tail */
  width: 4px; height: 14px; right: 10px; bottom: 16px;
}
.size-cap, .size-label { font-size: 12px; letter-spacing: 0.08em; color: #fff; margin-top: 8px; filter: drop-shadow(0 1px 2px #000); }
.size-rocket-dim { display: flex; align-items: stretch; gap: 8px; height: 160px; }
.size-line { width: 1px; background: rgba(255,255,255,0.8); position: relative; }
.size-line::before, .size-line::after {
  content: ""; position: absolute; left: -4px; width: 9px; height: 1px; background: #fff;
}
.size-line::before { top: 0; } .size-line::after { bottom: 0; }
.size-label strong { font-size: 20px; font-weight: 600; }

/* banners + lesson */
.event-banner {
  position: absolute;
  left: 50%; top: 18%;
  transform: translateX(-50%);
  font-size: clamp(22px, 3.2vw, 42px);
  letter-spacing: 0.18em;
  font-weight: 500;
  text-align: center;
  text-shadow: 0 2px 18px rgba(0,0,0,0.7);
  pointer-events: none;
  animation: bannerIn 0.35s ease;
}
.event-banner[hidden] { display: none; }
.coast-card {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  width: min(520px, 86vw);
  padding: 18px 20px 16px;
  background: rgba(6, 10, 16, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f4f7fb;
  text-align: center;
  pointer-events: auto;
  z-index: 6;
}
.coast-card[hidden] { display: none; }
.coast-kicker { letter-spacing: 0.22em; font-size: 12px; opacity: 0.72; }
.coast-clock {
  margin: 8px 0 10px;
  font-size: clamp(22px, 3vw, 36px);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.coast-card p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; }
.coast-card button {
  background: transparent;
  color: #f4f7fb;
  border: 1px solid rgba(255,255,255,0.45);
  padding: 6px 14px;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.coast-card button:disabled { opacity: 0.4; cursor: default; }
@keyframes bannerIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%); } }
.lesson-line {
  position: absolute;
  left: 50%;
  bottom: calc(var(--bottom-h) + var(--ctrl-h) + 8px);
  transform: translateX(-50%);
  max-width: min(820px, 70vw);
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: rgba(238,241,244,0.78);
  text-shadow: 0 1px 10px rgba(0,0,0,0.8);
  line-height: 1.55;
}

/* ——— bottom bar ——— */
.hud-bottom {
  position: absolute;
  left: 0; right: 0; bottom: var(--ctrl-h);
  height: var(--bottom-h);
  background: linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.82) 22%, #000 48%);
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr minmax(480px, 560px);
  align-items: end;
  padding: 0 18px 6px;
  z-index: 7;
}
.hb-left, .hb-right {
  display: flex; align-items: flex-end; gap: 12px;
  padding-bottom: 8px;
}
.hud-bottom .gauge,
.hud-bottom .eng-bezel,
.hud-bottom .att-bezel,
.hud-bottom .earth-bezel { flex-shrink: 0; }
.hb-right { justify-content: flex-end; }
.hb-mid { position: relative; height: 100%; }

.eng-bezel {
  width: 108px; height: 108px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  position: relative;
  background: radial-gradient(circle at 50% 50%, rgba(20,22,24,0.9), rgba(0,0,0,0.6));
  pointer-events: auto;
}
.eng-bezel.s2 { width: 108px; height: 108px; }
.eng-dot {
  position: absolute;
  width: 11px; height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: var(--off);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
  cursor: pointer;
  transition: background 0.08s linear, box-shadow 0.08s linear;
}
.eng-dot.on {
  background: #ff4a1a;
  box-shadow:
    0 0 6px 1px rgba(255, 90, 20, 0.95),
    0 0 12px rgba(255, 60, 0, 0.7),
    inset 0 0 3px rgba(255, 220, 120, 0.85);
}
.eng-dot.throttled {
  background: #c43a14;
  box-shadow:
    0 0 5px 1px rgba(220, 70, 16, 0.7),
    0 0 8px rgba(180, 50, 0, 0.45),
    inset 0 0 2px rgba(255, 180, 80, 0.55);
}
.eng-dot:focus { outline: 1px solid #fff; }
.eng-bezel.s2 .eng-dot { width: 16px; height: 16px; margin: -8px 0 0 -8px; }

.eng-cluster {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: auto;
}
.eng-cap {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--hud-dim, rgba(238,241,244,0.7));
  text-shadow: 0 1px 6px #000;
  white-space: nowrap;
  line-height: 1.2;
}
.eng-bezel.heavy {
  width: 108px;
  height: 108px;
}
.eng-bezel.heavy .eng-dot {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
}
.eng-bezel.heavy .eng-dot.on {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
}
.eng-bezel.heavy .eng-dot.throttled {
  width: 6.5px;
  height: 6.5px;
  margin: -3.25px 0 0 -3.25px;
}
.eng-bezel.mid .eng-dot {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
}
.eng-bezel.s2.quiet .eng-dot,
.eng-bezel.s2.heavy-s2 .eng-dot {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  opacity: 0.72;
}
.eng-bezel.s2.quiet .eng-dot.on,
.eng-bezel.s2.heavy-s2 .eng-dot.on {
  opacity: 1;
}
.hud-bottom.has-heavy {
  --bottom-h: clamp(148px, 16vh, 186px);
}

.att-bezel, .earth-bezel {
  width: 108px; height: 108px;
  border: 1.5px solid rgba(255, 255, 255, 0.88);
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  background: #0b0d10;
}
.att-bezel { background: transparent; box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45); }
.att-bezel canvas, .earth-bezel canvas { width: 100%; height: 100%; display: block; }
.n-mark {
  position: absolute; top: 4px; left: 50%; transform: translateX(-50%);
  font-size: 9px; letter-spacing: 0.12em; color: var(--hud-dim);
}

.clock-center {
  position: absolute;
  left: 50%; bottom: 4px;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.clock-row { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.clock-center .t-digits { font-size: clamp(28px, 3.4vw, 46px); line-height: 1; }
.clock-center .t-sign { font-size: clamp(16px, 1.8vw, 22px); }
.mission-sub {
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--hud-dim);
}

#timeline {
  position: absolute;
  left: 0; right: 0; bottom: 44px;
  width: 100%; height: calc(100% - 36px);
  overflow: visible;
}
#timeline .arc { fill: none; stroke: rgba(255,255,255,0.35); stroke-width: 1.4; }
#timeline .arc-now { fill: none; stroke: #fff; stroke-width: 1.8; }
#timeline .tick { fill: #fff; }
#timeline .tick-past { fill: rgba(255,255,255,0.55); }
#timeline .lab {
  fill: rgba(255,255,255,0.78);
  font-size: 9px; letter-spacing: 0.12em;
  font-family: var(--font);
  text-anchor: middle;
}

.gauge { width: 108px; height: 108px; aspect-ratio: 1/1; position: relative; }
.gauge-arc { position: absolute; inset: 0; width: 100%; height: 100%; }
.arc-bg { fill: none; stroke: rgba(255,255,255,0.18); stroke-width: 3; }
.arc-fg { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0 100; }
.gauge-read { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 2px; }
.gauge-lab { font-size: 8px; letter-spacing: 0.18em; color: var(--hud-dim); }
.gauge-num { font-size: 20px; font-weight: 600; line-height: 1.05; }
.gauge-unit { font-size: 8px; letter-spacing: 0.14em; color: var(--hud-dim); }

/* ——— controls ——— */
.hud-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: var(--ctrl-h);
  background: #000;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  pointer-events: auto;
  z-index: 8;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
}
.brand-mini {
  display: flex; align-items: center; gap: 8px;
  margin-right: 8px;
  letter-spacing: 0.12em;
  color: var(--hud-dim);
  font-size: 11px;
}
.brand-mini img { width: 18px; height: 18px; border-radius: 3px; }
.btn, .seg button {
  appearance: none;
  background: transparent;
  color: var(--hud);
  border: 1px solid rgba(255,255,255,0.22);
  height: 26px; padding: 0 10px;
  font: inherit; font-size: 11px; letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 0;
}
.btn:hover, .seg button:hover { background: rgba(255,255,255,0.08); }
.btn.primary { border-color: #fff; background: #fff; color: #111; }
.btn.primary:hover { background: #e8eaee; }
.btn.on, .seg button.on { background: #fff; color: #111; border-color: #fff; }
.seg { display: inline-flex; }
.seg button { border-right-width: 0; }
.seg button:last-child { border-right-width: 1px; }

/* drawers */
.drawer {
  position: absolute;
  top: 16px; right: 16px;
  bottom: calc(var(--bottom-h) + var(--ctrl-h) + 12px);
  width: min(520px, 42vw);
  background: rgba(6,7,9,0.92);
  border: 1px solid rgba(255,255,255,0.16);
  z-index: 9;
  pointer-events: auto;
  display: flex; flex-direction: column;
  backdrop-filter: blur(8px);
  color: var(--hud);
}
.drawer[hidden] { display: none; }
.drawer-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.drawer-hd h2 { font-size: 14px; font-weight: 500; letter-spacing: 0.16em; }
.icon-x {
  appearance: none; background: none; border: 0; color: var(--hud);
  font-size: 22px; cursor: pointer; line-height: 1; padding: 0 4px;
}
.drawer-note, .hint-line {
  padding: 10px 14px 0;
  font-size: 12px; line-height: 1.6; color: var(--hud-dim);
}
.hint-line { padding-bottom: 16px; }
.totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--hud-dim);
}
.totals strong { display: block; color: var(--hud); font-size: 16px; font-weight: 600; }
.eng-table-wrap { flex: 1; overflow: auto; padding: 0 8px 12px; }
.eng-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px;
}
.eng-table th {
  text-align: left; font-weight: 500;
  color: var(--hud-dim); letter-spacing: 0.08em;
  font-size: 10px; padding: 6px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.eng-table td { padding: 6px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.eng-table tr.active { background: rgba(255,255,255,0.06); }
.eng-table tr { cursor: pointer; }
.st-on { color: #fff; }
.st-th { color: var(--throttled); }
.st-off { color: var(--hud-dim); }

.field { display: block; padding: 12px 14px; }
.field > span { display: block; margin-bottom: 8px; font-size: 12px; color: var(--hud-dim); }
.field strong { color: var(--hud); }
.field input[type=range] { width: 100%; accent-color: #fff; }

/* focus */
button:focus-visible, input:focus-visible { outline: 1px solid #fff; outline-offset: 2px; }

@media (max-width: 1100px) {
  .hud-bottom { grid-template-columns: 180px 1fr 240px; }
  .att-bezel, .earth-bezel { display: none; }
  .size-overlay { display: none; }
  .lesson-line { display: none; }
  .hud-controls { overflow-x: auto; }
}
@media (max-width: 720px) {
  .fuel-strip { display: none; }
  .gauge,
  .eng-bezel,
  .eng-bezel.s2,
  .eng-bezel.heavy,
  .att-bezel,
  .earth-bezel { width: 70px; height: 70px; }
  .eng-bezel.heavy .eng-dot { width: 5.5px; height: 5.5px; margin: -2.75px 0 0 -2.75px; }
  .eng-bezel.heavy .eng-dot.on { width: 6.5px; height: 6.5px; margin: -3.25px 0 0 -3.25px; }
}

/* ——— v3: bilingual subtitles ——— */
#subs {
  position: absolute;
  left: 50%;
  bottom: calc(var(--bottom-h) + var(--ctrl-h) + 36px);
  transform: translateX(-50%);
  width: min(920px, 58vw);
  text-align: center;
  z-index: 8;
  pointer-events: none;
  text-shadow: 0 1px 2px #000, 0 2px 14px rgba(0,0,0,0.85);
}
body.dash-open #subs { width: min(820px, calc(100vw - 420px)); margin-left: -10px; }
.sub-zh {
  font-size: clamp(16px, 1.65vw, 24px);
  font-weight: 600;
  line-height: 1.5;
  color: #fff;
  letter-spacing: 0.04em;
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: normal;
  text-wrap: pretty;
}
.sub-zh .nowrap { white-space: nowrap; }
.sub-en {
  margin-top: 4px;
  font-size: clamp(11px, 1.05vw, 15px);
  line-height: 1.45;
  color: rgba(220, 230, 240, 0.82);
  letter-spacing: 0.02em;
}
.lesson-line { bottom: calc(var(--bottom-h) + var(--ctrl-h) + 96px); opacity: 0.7; font-size: 12px; }

#camHint {
  position: absolute;
  left: 22px; top: 48%;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(111,224,212,0.55);
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  letter-spacing: 0.08em;
  z-index: 8;
  animation: bannerIn 0.3s ease;
}
#camHint[hidden] { display: none; }

/* ——— colorful right dashboard ——— */
.dash {
  position: absolute;
  top: 10px; right: 10px;
  bottom: calc(var(--bottom-h) + var(--ctrl-h) + 8px);
  width: min(368px, 32vw);
  background: linear-gradient(180deg, rgba(8,14,28,0.88), rgba(6,8,14,0.92));
  border: 1px solid rgba(111,224,212,0.28);
  box-shadow: 0 0 0 1px rgba(76,141,255,0.12), 0 12px 40px rgba(0,0,0,0.45);
  z-index: 9;
  pointer-events: auto;
  display: none;
  flex-direction: column;
  backdrop-filter: blur(10px);
  color: var(--hud);
  overflow: hidden;
}
.dash.open { display: flex; }
.dash-hd {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(111,224,212,0.2);
  background: transparent;
}
.dash-hd h2 { font-size: 13px; font-weight: 600; letter-spacing: 0.2em; flex: 1; }
.dash-live {
  font-size: 9px; letter-spacing: 0.2em;
  color: #081018; background: #7dffa6;
  padding: 2px 6px; font-weight: 700;
  animation: livePulse 1.2s ease-in-out infinite;
}
@keyframes livePulse { 50% { opacity: 0.45; } }
.dash-scroll { flex: 1; overflow: auto; padding: 8px 8px 16px; }
.dash-card {
  position: relative;
  margin: 0 0 8px;
  background: rgba(6, 10, 16, 0.45);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  overflow: hidden;
}
.dash-card-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; cursor: grab; user-select: none;
  font-size: 12px; letter-spacing: 0.14em;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dash-card-hd b { font-weight: 650; }
.card-dock {
  margin-left: auto;
  width: 22px; height: 22px; padding: 0;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.04);
  color: inherit;
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
}
.card-dock::before {
  content: "";
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
}
.card-dock.is-back::before {
  border-left: 0;
  border-right: 7px solid currentColor;
}
.resize-grip {
  position: absolute;
  right: 2px; bottom: 2px;
  width: 16px; height: 16px;
  cursor: nwse-resize;
  z-index: 4;
  background:
    linear-gradient(135deg, transparent 46%, rgba(255,255,255,0.7) 46%, rgba(255,255,255,0.7) 58%, transparent 58%),
    linear-gradient(135deg, transparent 68%, rgba(255,255,255,0.7) 68%, rgba(255,255,255,0.7) 80%, transparent 80%);
}
.dash-card.parked {
  position: fixed; z-index: 20; margin: 0;
  max-height: min(68vh, 620px); overflow: auto;
  background: rgba(8, 12, 18, 0.94);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  backdrop-filter: blur(10px);
}
.dash-card.dragging { opacity: 0.94; cursor: grabbing; }
.gauge-dial { overflow: hidden; }
.layer-kicker {
  font-size: 9px; letter-spacing: 0.18em;
  color: rgba(238,241,244,0.55); margin-bottom: 4px;
}
.layer-card {
  padding: 10px 10px 8px;
  border: 1px solid rgba(46,204,138,0.35);
  background: linear-gradient(180deg, rgba(46,204,138,0.14), rgba(0,0,0,0.2));
  margin-bottom: 8px;
}
.layer-name { font-size: 28px; font-weight: 700; letter-spacing: 0.04em; line-height: 1.1; }
.layer-en { font-size: 11px; letter-spacing: 0.12em; color: rgba(238,241,244,0.7); margin: 2px 0 6px; }
.layer-hint { font-size: 12px; line-height: 1.45; color: #e8fff4; margin-bottom: 8px; }
.layer-stack { position: relative; height: 14px; display: flex; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.15); }
.layer-band { flex: 1; position: relative; }
.layer-band .lab { display: none; }
.layer-marker {
  position: absolute; top: -3px; bottom: -3px; width: 3px;
  background: #fff; box-shadow: 0 0 8px #fff;
  transform: translateX(-1px);
}
.atm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.atm-cell {
  position: relative;
  padding: 6px 8px 10px;
  background: rgba(0,0,0,0.28);
  overflow: hidden;
  min-height: 58px;
}
.atm-cell span { display: block; font-size: 9px; letter-spacing: 0.12em; color: rgba(238,241,244,0.6); }
.atm-cell strong {
  display: block; font-size: 18px; font-weight: 700; line-height: 1.2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}
.atm-cell em { font-style: normal; font-size: 10px; color: rgba(238,241,244,0.55); }
.atm-cell i {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 40%;
  background: currentColor;
}
.atm-cell.c-temp { color: #ff6b8a; }
.atm-cell.c-hum { color: #6fe0d4; }
.atm-cell.c-pres { color: #4c8dff; }
.atm-cell.c-rho { color: #c9a0ff; }
.atm-cell.c-cs { color: #ffb347; }
.atm-cell.c-comp { color: #eef1f4; grid-column: 1 / -1; min-height: auto; }
.atm-cell.c-comp strong { font-size: 12px; font-weight: 600; font-family: var(--font); }

.gauges-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  margin: 8px 0;
  background: radial-gradient(circle at 50% 0%, rgba(76,141,255,0.12), transparent 60%);
}
.gauges-grid canvas { width: 100%; height: 100%; aspect-ratio: 1/1; display: block; }

.reads { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.read {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 6px;
  padding: 5px 8px;
  background: rgba(255,255,255,0.03);
  border-left: 2px solid rgba(111,224,212,0.5);
}
.read:nth-child(odd) { background: rgba(76,141,255,0.06); border-left-color: #4c8dff; }
.read span { font-size: 10px; letter-spacing: 0.08em; color: rgba(238,241,244,0.7); position: relative; }
.read .tip {
  display: none;
  position: absolute; left: 0; top: 100%;
  width: 200px; z-index: 3;
  background: rgba(0,0,0,0.92); color: #fff;
  padding: 6px 8px; font-size: 11px; letter-spacing: 0;
  border: 1px solid rgba(255,255,255,0.2);
}
.read span:hover .tip { display: block; }
.read strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 18px; font-weight: 700; color: #fff;
}
.read em, .read i { font-style: normal; font-size: 10px; color: rgba(238,241,244,0.5); }
.read b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; font-weight: 600; color: #6fe0d4;
}

.orbit-block {
  margin: 8px 0;
  padding: 8px;
  border: 1px solid rgba(154,208,255,0.35);
  background: linear-gradient(180deg, rgba(76,141,255,0.16), rgba(0,0,0,0.2));
}
.orbit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.orbit-grid span { display: block; font-size: 9px; letter-spacing: 0.1em; color: rgba(238,241,244,0.55); }
.orbit-grid strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 20px;
}
.orbit-grid em { font-style: normal; font-size: 10px; color: rgba(238,241,244,0.5); }

.chart-box { margin-bottom: 6px; }
.chart-lab { font-size: 9px; letter-spacing: 0.12em; color: rgba(238,241,244,0.55); margin-bottom: 2px; }
.chart-box canvas { width: 100%; height: 72px; display: block; background: rgba(0,0,0,0.35); }

.node-pills { display: flex; flex-wrap: wrap; gap: 4px; }
.node-pill {
  font-size: 10px; letter-spacing: 0.04em;
  padding: 3px 7px;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(238,241,244,0.55);
  background: rgba(0,0,0,0.25);
}
.node-pill.done {
  color: #081018;
  background: #7dffa6;
  border-color: #7dffa6;
  font-weight: 700;
}
.node-pill.flash {
  animation: nodeFlash 0.9s ease;
}
@keyframes nodeFlash {
  0%, 100% { box-shadow: none; }
  20%, 60% { box-shadow: 0 0 0 3px rgba(255,255,255,0.7), 0 0 18px #6fe0d4; transform: scale(1.06); }
}

.odo { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.odo.tick { animation: odoTick 0.18s linear; }
@keyframes odoTick { from { filter: brightness(1.6); } to { filter: none; } }

.drawer-left {
  right: auto; left: 16px;
  width: min(460px, 38vw);
}
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { border-right-width: 1px; margin: 0 4px 4px 0; }
.design-sum {
  margin: 0 14px 8px;
  padding: 8px 10px;
  font-size: 12px; line-height: 1.5;
  background: rgba(111,224,212,0.1);
  border-left: 3px solid #6fe0d4;
  color: var(--hud);
}

#btnMute.on { background: #e24b4b; color: #fff; border-color: #e24b4b; }

@media (max-width: 1100px) {
  .dash { width: min(300px, 40vw); }
  .layer-name { font-size: 22px; }
  #subs { width: min(640px, 54vw); }
}
@media (max-width: 720px) {
  .dash { width: 100%; left: 0; right: 0; top: auto; height: 42vh; }
  .gauges-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
  #subs { width: 92vw; }
}


/* space-cam fix: one caption only, orbit data on first dashboard screen */
body.has-subs #lesson,
#lesson[hidden] { display: none !important; }
#camSeg button.live {
  box-shadow: inset 0 -2px 0 #6fe0d4;
  color: #6fe0d4;
}
#camSeg button.live.on { color: #111; box-shadow: inset 0 -2px 0 #0a3; }
.orbit-block {
  position: sticky;
  top: 0;
  z-index: 3;
  margin: 8px 0 6px;
  padding: 8px 8px 6px;
  background: linear-gradient(180deg, rgba(8, 28, 48, 0.96), rgba(6, 16, 32, 0.96));
}
.orbit-grid strong { font-size: 18px; }


/* dual-cam + true angular size */
#shotChip {
  margin-top: 8px;
  margin-left: 14px;
  display: inline-block;
  padding: 3px 10px 3px 8px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(238,241,244,0.88);
  background: rgba(0,0,0,0.55);
  border-left: 2px solid #6fe0d4;
}
#shotChip.is-parked { display: none; }
#paneTags {
  position: absolute;
  left: 0; right: auto; top: 46px; bottom: auto;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
  z-index: 6;
}
#paneTags[hidden] { display: none !important; }
.pane-tag {
  position: static;
  padding: 3px 9px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #eef2f5;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(111,224,212,0.35);
  white-space: nowrap;
}
#camSeg button[data-cam="far"] { opacity: 0.85; }
#camSeg button[data-cam="dual"].live {
  box-shadow: inset 0 -2px 0 #6fe0d4;
  color: #6fe0d4;
}
#camSeg button[data-cam="dual"].live.on { color: #111; box-shadow: inset 0 -2px 0 #0a3; }


/* mission + classroom */
#classPanel {
  position: absolute;
  top: 148px;
  left: 16px;
  width: 320px;
  max-height: calc(100% - 200px);
  overflow: auto;
  z-index: 7;
  background: linear-gradient(180deg, rgba(8,18,32,0.92), rgba(6,12,22,0.92));
  border: 1px solid rgba(111,224,212,0.35);
  color: #eef3f7;
  padding: 12px 14px 16px;
  pointer-events: auto;
}
#classPanel[hidden] { display: none !important; }
.class-hd { display: flex; justify-content: space-between; align-items: baseline; letter-spacing: 0.16em; font-size: 11px; color: #6fe0d4; cursor: grab; user-select: none; }
.class-hd em { color: #ffb347; font-style: normal; }
#classTitle { margin: 10px 0 8px; font-size: 18px; font-weight: 600; }
.class-zh { font-size: 13.5px; line-height: 1.55; margin: 0 0 6px; word-break: keep-all; }
.class-en { font-size: 11px; line-height: 1.45; color: rgba(220,230,240,0.72); margin: 0 0 12px; }
.class-formula {
  font-family: "Times New Roman", "Songti SC", serif;
  font-size: 18px;
  letter-spacing: 0.02em;
  padding: 8px 10px;
  background: rgba(255,255,255,0.06);
  border-left: 3px solid #6fe0d4;
}
.class-fname { margin-top: 6px; font-size: 11px; letter-spacing: 0.12em; color: rgba(238,241,244,0.55); }
.class-still { margin: 8px 0; height: 110px; background: #0a1018 center/cover no-repeat; border: 1px solid rgba(255,255,255,0.12); }
.mission-board {
  margin: 8px 0 10px;
  padding: 8px;
  background: linear-gradient(180deg, rgba(10,24,20,0.9), rgba(6,16,18,0.9));
}
.payload-row { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,0.06); font-size: 13px; }
.payload-row span { flex: 1; color: rgba(238,241,244,0.8); }
.payload-row strong { font-size: 13px; color: #ffb347; }
.payload-row em { font-size: 11px; color: #9ad0ff; min-width: 72px; text-align: right; }
.payload-row[data-st="operating"] strong, .payload-row[data-st="recovered"] strong { color: #7dffa6; }
.payload-row[data-st="reentry"] strong { color: #ff8a5b; }
.science-row { margin-top: 8px; font-size: 11px; color: rgba(238,241,244,0.75); display: flex; flex-wrap: wrap; gap: 6px 10px; }
.science-row em { width: 100%; color: rgba(238,241,244,0.45); }
#endCard {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  z-index: 12; width: min(560px, 70vw);
  background: linear-gradient(180deg, rgba(6,16,28,0.95), rgba(4,10,18,0.96));
  border: 1px solid rgba(111,224,212,0.5);
  padding: 28px 32px 24px; text-align: center; color: #eef3f7;
}
#endCard[hidden] { display: none !important; }
.end-kicker { letter-spacing: 0.2em; font-size: 12px; color: #6fe0d4; }
#endCard h2 { margin: 8px 0 12px; font-size: 28px; }
#endCard p { line-height: 1.6; }
.end-en { font-size: 13px; color: rgba(220,230,240,0.7); }
.end-hint { margin-top: 16px; letter-spacing: 0.12em; color: #ffb347; }
#btnSkipWait:not([hidden]) { border-color: #ffb347; color: #ffb347; }
#btnClass.on { background: #fff; color: #111; }
body.class-open #classPanel { display: block; }

/* v4 hangar, fail card, velocity pair */
#hangar { z-index: 10; width: min(420px, 40vw); }
.hangar-tabs { display: flex; flex-wrap: wrap; gap: 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.hangar-tabs button {
  appearance: none; background: transparent; color: var(--hud);
  border: 0; border-right: 1px solid rgba(255,255,255,0.1);
  height: 32px; padding: 0 12px; font: inherit; font-size: 12px; cursor: pointer;
}
.hangar-tabs button.on { background: #fff; color: #111; }
.hangar-pane { padding: 12px 14px 18px; overflow: auto; }
.series-card, .sat-card, .part-card, .ver-card {
  margin: 0 0 10px; padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
}
.series-card.on, .sat-card.on { border-color: #6fe0d4; background: rgba(111,224,212,0.1); }
.series-card h3, .sat-card h3, .part-card h3 { margin: 0 0 4px; font-size: 15px; }
.series-card p, .sat-card p, .part-card p, .ver-card p { margin: 0; font-size: 12px; line-height: 1.5; color: rgba(238,241,244,0.78); }
.series-card em, .sat-card em, .ver-card em { display: block; margin-top: 4px; font-style: normal; font-size: 11px; color: #ffb347; }
.scheme-note { font-size: 12px; line-height: 1.55; color: rgba(238,241,244,0.8); padding: 8px 0; }
.hangar-links { display: flex; gap: 8px; margin-top: 8px; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; }
.fact-list { margin-top: 14px; }
.fact-item { margin: 0 0 10px; font-size: 12px; line-height: 1.55; }
.fact-item strong { display: block; color: #6fe0d4; letter-spacing: 0.08em; font-size: 11px; margin-bottom: 2px; }
.copy-line { font-size: 13px; line-height: 1.6; }
.help-h { margin: 16px 0 6px; font-size: 13px; letter-spacing: 0.14em; color: #6fe0d4; }
.doc-links { margin: 0; padding-left: 18px; font-size: 12px; line-height: 1.8; }
.doc-links a { color: #9ad0ff; }
.part-kv { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
#classPair[hidden] { display: none !important; }
.class-mini {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px solid rgba(111,224,212,0.25);
}
.class-mini h4 { margin: 0 0 4px; font-size: 14px; }
.class-mini .class-formula { font-size: 15px; margin-top: 6px; }
#failCard {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%);
  z-index: 13; width: min(640px, 78vw);
  background: linear-gradient(180deg, rgba(28,10,8,0.96), rgba(12,6,6,0.96));
  border: 1px solid rgba(255,120,80,0.55);
  padding: 24px 28px 20px; color: #eef3f7;
}
#failCard[hidden] { display: none !important; }
#failCard h2 { margin: 6px 0 14px; }
.fail-grid { display: grid; gap: 10px; }
.fail-grid h3 { margin: 0 0 4px; font-size: 12px; letter-spacing: 0.14em; color: #ffb347; }
.fail-grid p { margin: 0; font-size: 13px; line-height: 1.55; }
#btnHangar.on { background: #fff; color: #111; }
body.hangar-open #classPanel { opacity: 0.08; pointer-events: none; }


/* ——— v5 themes, weight-class UI, emergency, toolbar, recap ——— */
body.theme-lk2 {
  --brand: #6fe0d4;
  --brand-2: #4c8dff;
  --panel: rgba(6, 16, 22, 0.72);
  --dash-w: 328px;
}
body.theme-moon {
  --brand: #d4c4ff;
  --brand-2: #e8d5a3;
  --panel: rgba(14, 10, 32, 0.78);
  --dash-w: 372px;
  --hud: #f4f0ff;
}
body.theme-moon #dash { width: min(372px, 42vw); }
body.theme-moon .dash-hd h2 { letter-spacing: 0.28em; font-size: 14px; }
body.theme-moon .layer-kicker { color: #e8d5a3; }
body.theme-moon .dash { font-size: 13px; }
body.theme-mars {
  --brand: #ff8a4a;
  --brand-2: #ff5a5a;
  --panel: rgba(28, 10, 8, 0.80);
  --dash-w: 420px;
  --hud: #fff4ec;
}
body.theme-mars #dash { width: min(420px, 46vw); }
body.theme-mars .dash-hd h2 { letter-spacing: 0.32em; font-size: 15px; font-weight: 700; }
body.theme-mars .dash-scroll { padding-right: 4px; }
body.theme-mars .layer-kicker { color: #ffb080; letter-spacing: 0.18em; }
body.theme-mars .atm-cell strong { font-size: 22px; }

.dash, .drawer, .fuel-strip, .clock-chip {
  background: var(--panel, rgba(0,0,0,0.72));
  backdrop-filter: blur(10px);
}

#dataTicker {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  z-index: 6; width: min(720px, 56vw);
  overflow: hidden; height: 22px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--panel), transparent);
  color: var(--brand);
  font-size: 11px; letter-spacing: 0.08em; line-height: 22px;
  white-space: nowrap;
}
#dataTickerInner { display: inline-block; padding-left: 100%; animation: tickscroll 28s linear infinite; }
@keyframes tickscroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
body.theme-lk2 #dataTicker { display: none !important; } /* 二号更利落，滚动条主要给远征/奔月 */

#hudHotzone {
  position: absolute; left: 0; right: 0; bottom: 0; height: 10px;
  z-index: 8; pointer-events: auto;
}
body.hud-autohide #hudControls {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
body.hud-autohide #hudControls.show,
body.hud-autohide #hudHotzone:hover + #hud, /* fallback */
body.hud-autohide.hud-peek #hudControls {
  transform: none; opacity: 1; pointer-events: auto;
}
#hudControls { transition: transform 0.35s ease, opacity 0.35s ease; }

#emergencyMask {
  position: absolute; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto;
}
#emergencyMask[hidden] { display: none !important; }
.em-pulse {
  position: absolute; inset: 0;
  border: 10px solid rgba(220, 20, 20, 0.0);
  box-shadow: inset 0 0 80px rgba(200, 0, 0, 0.35);
  animation: emflash 0.7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes emflash {
  0%, 100% { box-shadow: inset 0 0 40px rgba(180,0,0,0.18); background: rgba(120,0,0,0.04); }
  50% { box-shadow: inset 0 0 90px rgba(220,0,0,0.42); background: rgba(160,0,0,0.10); }
}
body.emergency-on .dash, body.emergency-on #subs, body.emergency-on .clock-chip {
  /* keep numbers readable */
  filter: none;
  outline: 1px solid rgba(255,80,80,0.45);
}
.em-card {
  position: relative;
  width: min(560px, 88vw);
  background: rgba(20, 4, 4, 0.88);
  color: #fff5f2;
  border: 1px solid rgba(255,80,80,0.6);
  padding: 22px 24px 18px;
  z-index: 1;
}
.em-kicker { color: #ff8a8a; letter-spacing: 0.2em; font-size: 11px; }
.em-card h2 { font-size: 22px; margin: 8px 0 10px; color: #fff; }
.em-card p { line-height: 1.55; color: #ffe8e4; }
.em-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 8px; }
.em-actions .btn { pointer-events: auto; background: #3a1010; color: #fff; border: 1px solid #ff8a8a; padding: 8px 12px; }
.em-actions .btn.primary { background: #a01818; }
.em-note { font-size: 11px; color: #e0b8b0; }

#recapCard {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  z-index: 16; width: min(720px, 90vw); max-height: 80vh; overflow: auto;
  background: var(--panel, rgba(8,10,14,0.92));
  backdrop-filter: blur(16px);
  padding: 22px 24px; border: 1px solid var(--brand);
  color: var(--hud);
}
#recapCard[hidden] { display: none !important; }
.recap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin: 12px 0; font-size: 13px; }
.recap-grid div span { display: block; color: var(--hud-dim); font-size: 11px; }
.recap-grid div strong { font-size: 15px; }
.recap-brand { display: flex; align-items: center; gap: 10px; }
.recap-brand img { width: 40px; height: 40px; object-fit: contain; }
.end-quote { margin-top: 12px; font-size: 16px; }

#switchToast {
  position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%);
  z-index: 18; background: rgba(20,10,8,0.92); color: #fff; padding: 10px 16px;
  border: 1px solid var(--brand);
}
#switchToast[hidden] { display: none !important; }

#schoolLogoHud { width: 22px; height: 22px; object-fit: contain; margin-right: 4px; }

.series-card { position: relative; }
.series-card .card-opts { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 12px; }
.series-card .card-opts label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.series-card.weight-lk2 { border-left: 3px solid #6fe0d4; }
.series-card.weight-moon { border-left: 3px solid #d4c4ff; padding-bottom: 10px; }
.series-card.weight-mars { border-left: 4px solid #ff8a4a; }
.series-card .weight-tag { font-size: 10px; letter-spacing: 0.14em; color: var(--hud-dim); }

.custom-form .field { margin: 8px 0; }
.custom-form input[type="text"], .custom-form textarea, .custom-form select {
  width: 100%; background: rgba(0,0,0,0.35); color: #fff; border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 8px; border-radius: 2px;
}
.logo-preview { width: 64px; height: 64px; object-fit: contain; background: #111; margin: 6px 0; }

.transfer-board, .station-board { border: 1px solid var(--brand); background: var(--panel); }

body.theme-moon .hud-tl .mission-name { letter-spacing: 0.22em; }
body.theme-mars .t-digits { font-size: 32px; }

/* ——— v6: launch button, fleet bar, flight HUD, recap mask, split ——— */
.btn-launch {
  appearance: none;
  width: 58px; height: 58px;
  margin: 0 6px 0 2px;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe7a0 0%, #ff9a2e 38%, #e04810 78%, #7a1a00 100%);
  color: #fffaf0;
  font: 700 14px/1 inherit;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(255, 140, 40, 0.35), 0 8px 18px rgba(255, 80, 0, 0.35);
  text-shadow: 0 1px 0 rgba(0,0,0,0.35);
  flex: 0 0 auto;
}
.btn-launch:hover { filter: brightness(1.08); }
.btn-launch.is-armed { animation: launchpulse 1.6s ease-in-out infinite; }
.btn-launch.is-flight, .btn-launch.is-count {
  background: radial-gradient(circle at 35% 30%, #ffd0a8 0%, #d44820 50%, #5a1008 100%);
  box-shadow: 0 0 0 3px rgba(220, 40, 20, 0.4);
  font-size: 12px;
}
.btn-launch.is-done, .btn-launch:disabled {
  background: #2a2e33;
  color: #9aa3ad;
  box-shadow: none;
  animation: none;
  cursor: default;
}
@keyframes launchpulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,140,40,0.35), 0 8px 18px rgba(255,80,0,0.3); }
  50% { box-shadow: 0 0 0 6px rgba(255,180,60,0.55), 0 8px 22px rgba(255,100,0,0.5); }
}

#fleetBar {
  position: absolute; left: 16px; top: 86px; z-index: 12;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  pointer-events: auto;
  max-width: min(54vw, 640px);
}
#fleetBar[hidden] { display: none !important; }
.fleet-pills { display: flex; gap: 8px; }
.fleet-pill {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 92px; height: 34px; padding: 0 12px;
  border-radius: 999px; border: 1px solid transparent;
  color: #fff; cursor: pointer; font: 600 12px/1 inherit; letter-spacing: 0.06em;
  background: rgba(8,10,14,0.7); backdrop-filter: blur(8px);
}
.fleet-pill i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.fleet-pill.lk2 { border-color: #6fe0d4; } .fleet-pill.lk2 i { background: #6fe0d4; }
.fleet-pill.moon { border-color: #d4c4ff; } .fleet-pill.moon i { background: #d4c4ff; }
.fleet-pill.mars { border-color: #ff8a4a; } .fleet-pill.mars i { background: #ff8a4a; }
.fleet-pill.on { box-shadow: 0 0 0 2px #fff inset; filter: brightness(1.15); }
.sound-mode { color: var(--hud-dim); font-size: 11px; display: inline-flex; gap: 6px; align-items: center; }
.sound-mode select { background: rgba(0,0,0,0.55); color: #fff; border: 1px solid rgba(255,255,255,0.25); padding: 3px 6px; }

#flightHud {
  position: absolute; left: 210px; right: 150px; top: 8px; z-index: 9;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  pointer-events: none;
}
body.flight-hud-on #dataTicker { display: none !important; }
#flightHud[hidden] { display: none !important; }
.fh-main {
  display: flex; flex-wrap: wrap; gap: 6px 8px;
  pointer-events: none;
  max-width: 78%;
}
.fh-chip {
  background: var(--fh-bg, rgba(6,10,14,0.72));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px; padding: 4px 8px 3px;
  min-width: 76px; color: var(--hud, #eef3f7);
  backdrop-filter: blur(8px);
}
.fh-chip span { display: block; font-size: 9px; letter-spacing: 0.12em; color: var(--hud-dim, #9aa3ad); }
.fh-chip strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.fh-chip em { font-style: normal; font-size: 9px; margin-left: 3px; color: var(--hud-dim); }
.fh-tools {
  pointer-events: auto;
  display: flex; flex-direction: column; gap: 2px;
  font-size: 10px; color: var(--hud-dim);
  background: var(--fh-bg, rgba(6,10,14,0.72));
  padding: 4px 8px; border-radius: 4px;
}
.fh-tools input { width: 84px; vertical-align: middle; }
body.fleet-split #flightHud { max-width: 100%; }
body.fleet-split .fh-main { display: none; }

#splitLanes {
  position: absolute; inset: 0; z-index: 6; pointer-events: none; display: flex;
}
#splitLanes[hidden] { display: none !important; }
.split-lane { position: relative; flex: 1; border-left: 1px solid rgba(255,255,255,0.12); }
.split-lane:first-child { border-left: 0; }
.split-lane.on { outline: 2px solid var(--brand, #6fe0d4); outline-offset: -2px; }
.lane-hud {
  position: absolute; top: 8px; left: 8px; right: 8px;
  background: rgba(6,10,14,0.62); backdrop-filter: blur(6px);
  padding: 6px 8px; font-size: 11px; color: #eef3f7;
  border-left: 3px solid var(--lane, #6fe0d4);
}
.lane-hud strong { display: block; font-size: 13px; }
.lane-hud em { font-style: normal; color: #ffb080; }

#cutToast {
  position: absolute; right: 18px; top: 92px; z-index: 18;
  background: rgba(8,12,18,0.9); color: #fff; padding: 8px 12px;
  border: 1px solid var(--brand, #6fe0d4); font-size: 12px; letter-spacing: 0.06em;
}
#cutToast[hidden] { display: none !important; }

#recapMask {
  position: absolute; inset: 0; z-index: 16;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto;
}
#recapMask[hidden] { display: none !important; }
#recapCard {
  position: relative; left: auto; top: auto; transform: none;
  z-index: 17; width: min(720px, 90vw); max-height: 80vh; overflow: auto;
  background: var(--panel, rgba(8,10,14,0.92));
  backdrop-filter: blur(16px);
  padding: 22px 24px; border: 1px solid var(--brand);
  color: var(--hud);
}
.recap-x { position: absolute; top: 10px; right: 10px; }
.recap-actions { display: flex; gap: 8px; margin-top: 12px; }

.prime-reads {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px;
  margin: 0 0 12px; padding: 8px 0 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.prime-reads .read { padding: 2px 0; }
.gauges-prime { margin-bottom: 12px; }
.chart-toggle {
  appearance: none; background: transparent; color: var(--hud-dim);
  border: 1px solid rgba(255,255,255,0.2); width: 100%;
  text-align: left; padding: 6px 8px; cursor: pointer; font: inherit; font-size: 11px;
  letter-spacing: 0.12em; margin-bottom: 6px;
}
.chart-toggle.on { color: var(--hud); }
#chartSection.collapsed #chartBody { display: none; }

body.theme-moon #fleetBar { top: 94px; }
body.theme-mars .prime-reads .read strong { font-size: 20px; color: #ffd4b0; }
body.theme-mars .fh-chip strong { color: #ffd4b0; }
body.theme-lk2 .fh-chip { border-radius: 2px; }
body.theme-moon .fh-chip { border-radius: 10px; }

/* ——— v6 module switcher ——— */
#moduleBar {
  position: absolute; left: 0; right: 0; top: 0; height: 40px;
  z-index: 40;
  display: flex; align-items: center; gap: 12px;
  padding: 0 12px;
  background: rgba(6, 8, 12, 0.94);
  border-bottom: 1px solid rgba(255,255,255,0.12);
  color: var(--hud, #eef3f7);
  font-size: 12px;
  letter-spacing: 0.04em;
  pointer-events: auto;
}
#moduleBar .mb-brand { display: flex; align-items: center; gap: 8px; margin-right: 8px; }
#moduleBar .mb-brand img { width: 18px; height: 18px; border-radius: 3px; }
#moduleBar .mb-mods, #moduleBar .mb-modes { display: flex; gap: 6px; }
#moduleBar button {
  appearance: none; background: transparent; color: var(--hud-dim, #9aa3ad);
  border: 1px solid rgba(255,255,255,0.18); height: 26px; padding: 0 10px;
  font: inherit; font-size: 12px; cursor: pointer; border-radius: 3px;
}
#moduleBar button.on, #moduleBar button.active {
  background: #fff; color: #111; border-color: #fff;
}
#moduleBar #btnModuleTwin.on { background: #6fe0d4; color: #06201c; border-color: #6fe0d4; }
#moduleBar .mb-note { margin-left: auto; color: var(--hud-dim, #9aa3ad); font-size: 11px; }
#moduleBar .mb-modes[hidden], #moduleTwin[hidden] { display: none !important; }

/* body already 100% height; pad the app below the bar */
body.module-orbit #app,
body:not(.module-twin) #app {
  position: absolute; left: 0; right: 0; bottom: 0; top: 40px;
}
body.module-twin #app { visibility: hidden; pointer-events: none; }
#moduleTwin {
  position: absolute; left: 0; right: 0; top: 40px; bottom: 0;
  z-index: 24;
  display: flex; flex-direction: column;
  overflow: hidden;
}
#moduleTwin #mrApp { flex: 1; min-height: 0; }

/* ——— v13 界面讲解 ——— */
#btnExplain.on,
body.explain-on #btnExplain {
  color: #041014;
  background: #6fe0d4;
  border-color: #6fe0d4;
}
#explainHint {
  position: absolute;
  left: 50%;
  top: 54px;
  transform: translateX(-50%);
  z-index: 26;
  max-width: min(640px, 70vw);
  padding: 6px 14px;
  background: rgba(6, 14, 16, 0.88);
  border: 1px solid rgba(111, 224, 212, 0.55);
  color: #eef1f4;
  font-size: 12px;
  letter-spacing: 0.04em;
  pointer-events: none;
  border-radius: 2px;
}
#explainHint[hidden] { display: none !important; }
#explainCard {
  position: fixed;
  z-index: 28;
  width: min(392px, 38vw);
  max-height: min(62vh, 560px);
  overflow: auto;
  padding: 12px 14px 14px;
  background: rgba(7, 10, 14, 0.94);
  border: 1px solid rgba(111, 224, 212, 0.45);
  box-shadow: 0 12px 36px rgba(0,0,0,0.45);
  color: #eef1f4;
  pointer-events: auto;
  border-radius: 2px;
}
#explainCard { display: block; }
#explainCard[hidden] { display: none !important; }
#explodePanel {
  position: fixed;
  z-index: 26;
  left: 16px;
  top: 150px;
  width: min(360px, 34vw);
  max-height: min(70vh, 640px);
  overflow: auto;
  padding: 10px 12px 16px;
  background: rgba(8, 12, 18, 0.94);
  border: 1px solid rgba(111, 224, 212, 0.4);
  color: #eef1f4;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
}
#explodePanel[hidden] { display: none !important; }
.explode-hd { display: flex; align-items: center; justify-content: space-between; cursor: grab; user-select: none; letter-spacing: 0.14em; font-size: 12px; }
.explode-fig { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 10px 0; }
.explode-bit {
  border: 0; color: #eef1f4; cursor: pointer;
  min-width: 120px; padding: 6px 10px;
  background: #2a3038;
  font: 500 12px/1.3 inherit;
}
.explode-bit.on { outline: 2px solid #6fe0d4; }
.explode-bit.fairing { background: #8d939b; color: #111; width: 70px; border-radius: 40px 40px 6px 6px; }
.explode-bit.stage2 { background: #4a5560; width: 86px; }
.explode-bit.payload { background: #1d3f8f; width: 64px; }
.explode-bit.tiles { background: #1c1f24; width: 108px; letter-spacing: 0.2em; }
.explode-bit.tank { background: #c8c6c0; color: #111; width: 100px; }
.explode-bit.fins { background: #3a4148; width: 140px; }
.explode-bit.legs { background: #9aa0a6; color: #111; width: 150px; }
.explode-bit.engines { background: #5a4638; width: 92px; border-radius: 0 0 10px 10px; }
#explodePanel h3 { margin: 8px 0 6px; font-size: 16px; }
#explodePanel p { margin: 0 0 8px; font-size: 13px; line-height: 1.5; }
#explainHint { display: block; }
#explainCard .ex-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #6fe0d4;
  margin-bottom: 4px;
}
#explainCard h3 {
  font-size: 16px;
  font-weight: 650;
  margin: 0 0 8px;
  letter-spacing: 0.04em;
}
#explainCard .ex-sec { margin: 0 0 8px; }
#explainCard .ex-sec h4 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(238,241,244,0.72);
  margin: 0 0 3px;
}
#explainCard .ex-sec p,
#explainCard #explainExtra p,
#explainCard #explainExtra li {
  font-size: 12.5px;
  line-height: 1.55;
  color: #e8eef2;
}
#explainCard #explainExtra ul { margin: 4px 0 0 1.1em; padding: 0; }
#explainMore {
  margin-top: 4px;
  background: transparent;
  color: #6fe0d4;
  border: 1px solid rgba(111, 224, 212, 0.45);
  padding: 4px 10px;
  font: 600 12px/1.2 inherit;
  letter-spacing: 0.06em;
  cursor: pointer;
}
#explainMore:hover { background: rgba(111, 224, 212, 0.12); }
body.explain-on [data-explain] {
  pointer-events: auto !important;
  outline: 1px dashed rgba(111, 224, 212, 0.28);
  outline-offset: 2px;
}
body.explain-on [data-explain].explain-hot {
  outline: 2px solid rgba(111, 224, 212, 0.9);
  outline-offset: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
}
body.explain-on #flightHud,
body.explain-on #flightHud .fh-main,
body.explain-on #hud {
  pointer-events: none;
}
body.explain-on #flightHud [data-explain],
body.explain-on #hud [data-explain],
body.explain-on #hudControls,
body.explain-on #dash,
body.explain-on #fleetBar,
body.explain-on #classPanel,
body.explain-on #explainCard {
  pointer-events: auto;
}
