:root {
  --root-fs: 15px;
  --bg-obsidian: rgba(8, 12, 20, 0.72);
  --bg-surface: rgba(15, 23, 42, 0.62);
  --bg-hover: rgba(56, 189, 248, 0.14);
  --border-hairline: 1px solid rgba(255, 255, 255, 0.10);
  --accent-cyan: #38BDF8;
  --ok-emerald: #10B981;
  --warn-amber: #F59E0B;
  --danger-red: #EF4444;
  --text-primary: #F1F5F9;
  --text-muted: #94A3B8;
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Consolas", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: var(--root-fs, 15px); }

html, body {
  margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden;
  background: #04070D; color: var(--text-primary);
  font-family: var(--font-sans); -webkit-font-smoothing: antialiased;
}

body { font-size: 0.92rem; line-height: 1.45; }

#cesium-container { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1; }
.cesium-widget-credits { opacity: 0.35; font-size: 0.72rem !important; pointer-events: none; }

#hud-shell {
  position: fixed; inset: 0; z-index: 20;
  padding: 0.55rem 0.75rem 1.45rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.25s ease;
}

#hud-workspace {
  flex: 1 1 0%; min-height: 0; width: 100%;
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 0.65rem; pointer-events: none;
}

.hud-glass {
  background: var(--bg-obsidian);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: var(--border-hairline); border-radius: 0.65rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  transition: opacity 0.22s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

button {
  font-family: inherit; font-size: 0.88rem; color: var(--text-primary);
  border: var(--border-hairline); background: var(--bg-surface);
  border-radius: 0.42rem; padding: 0.34rem 0.6rem; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
button:hover { background: var(--bg-hover); border-color: rgba(56, 189, 248, 0.45); }
button.active {
  background: rgba(56, 189, 248, 0.20); border-color: var(--accent-cyan);
  color: var(--accent-cyan); font-weight: 600;
}

.accent-btn { background: rgba(56, 189, 248, 0.18); border-color: rgba(56, 189, 248, 0.5); color: var(--accent-cyan); }
.ghost-btn { background: transparent; color: var(--text-muted); }
.ghost-btn:hover { color: var(--text-primary); }

#top-bar {
  position: relative; flex-shrink: 0; width: 100%; min-height: 3.15rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 0.35rem 0.85rem; gap: 0.42rem 0.65rem; pointer-events: auto;
}
.hud-brand, .hud-status-group, .mode-pills { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; max-width: 100%; }
.brand-dot {
  width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan); flex-shrink: 0;
}
.brand-name { font-weight: 700; letter-spacing: 0.1em; font-size: 0.96rem; color: #FFFFFF; }
.crumb-text {
  color: var(--text-muted); font-size: 0.86rem; max-width: 17.5rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mode-btn { padding: 0.34rem 0.82rem; border-radius: 999px; font-size: 0.88rem; }

.pill-badge {
  padding: 0.22rem 0.58rem; border-radius: 999px; font-size: 0.84rem;
  border: var(--border-hairline); background: rgba(15, 23, 42, 0.7); color: var(--text-muted);
}
.pill-badge.is-ok { color: var(--ok-emerald); border-color: rgba(16, 185, 129, 0.45); }
.pill-badge.is-warn { color: var(--warn-amber); border-color: rgba(245, 158, 11, 0.45); }
.pill-badge.is-err { color: var(--danger-red); border-color: rgba(239, 68, 68, 0.45); }
#btn-font-dec, #btn-font-inc { padding: 0.22rem 0.5rem; font-size: 0.84rem; font-weight: 600; }

#btn-restore-hud {
  display: none; position: fixed; top: 0.9rem; right: 0.9rem; z-index: 30;
  padding: 0.45rem 0.95rem; border-radius: 999px; color: var(--accent-cyan);
  border-color: rgba(56, 189, 248, 0.45);
}

body.pure-cinema #hud-shell { opacity: 0; transform: translateY(-0.35rem); }
body.pure-cinema #top-bar,
body.pure-cinema .panel-dock,
body.pure-cinema #bottom-timeline { pointer-events: none; }
body.pure-cinema #btn-restore-hud { display: inline-flex; align-items: center; gap: 0.4rem; }

::-webkit-scrollbar { width: 0.28rem; height: 0.28rem; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.28); border-radius: 0.28rem; }
