:root {
  --bg: #0b1116;
  --panel: rgba(11, 17, 23, 0.9);
  --border: rgba(145, 196, 214, 0.25);
  --accent: #3cd4b8;
  --amber: #f0a854;
  --danger: #f25244;
  --text: #e7eef2;
  --muted: #8ea0ad;
  --font: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  user-select: none;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
}

#vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 52%, rgba(4, 7, 10, 0.68) 100%);
}

#damage-flash {
  pointer-events: none;
  position: fixed;
  inset: 0;
  box-shadow: inset 0 0 110px rgba(242, 60, 42, 0.9);
  opacity: 0;
  transition: opacity 0.14s ease-out;
}

#topbar {
  position: fixed;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 30;
  pointer-events: none;
}

#topbar > * { pointer-events: auto; }

.brand-back {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
}

.tag-badge {
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(60, 212, 184, 0.16);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.brand-back strong { font-size: 13px; letter-spacing: 0.12em; }
.brand-back small { font-size: 11px; color: var(--amber); margin-left: 4px; }

.sector-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.sector-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.top-controls { display: flex; gap: 8px; }
.top-controls button {
  padding: 7px 12px;
  border-radius: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

/* 开屏界面 */
.overlay-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 64px 7vw 32px;
  background: linear-gradient(90deg, rgba(8, 12, 17, 0.9) 0%, rgba(8, 12, 17, 0.56) 52%, rgba(8, 12, 17, 0.18) 100%);
  z-index: 20;
}

.overlay-screen[hidden] { display: none; }

.intro-shell {
  max-width: 540px;
}

.intro-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 10px;
}

.intro-shell h1 {
  margin: 0 0 14px;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 0.95;
  letter-spacing: 0.06em;
  color: #f4f8fb;
}

.intro-shell h1 span { color: var(--amber); }

.intro-lead {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.7;
  color: #c8d5de;
}

.intro-specs {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(12, 18, 25, 0.78);
  border: 1px solid var(--border);
}

.intro-specs div {
  display: flex;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.45;
}

.intro-specs b {
  flex-shrink: 0;
  color: var(--amber);
  min-width: 34px;
}

.intro-specs span { color: #d3e0e8; }

.btn-primary {
  padding: 12px 24px;
  border-radius: 6px;
  border: 1px solid #6cf0d6;
  background: linear-gradient(135deg, #1b8c78, #0f564c);
  color: #f2fffd;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.btn-secondary {
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

/* 战术 HUD */
#hud {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 15;
}

#hud[hidden] { display: none; }

.compass-bar {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(9, 14, 19, 0.65);
  border: 1px solid rgba(145, 196, 214, 0.18);
  font-size: 11px;
  color: var(--muted);
}

.compass-bar b { color: var(--accent); font-size: 12px; }
.compass-bar i { width: 1px; height: 10px; background: rgba(255, 255, 255, 0.16); }

.mission-card {
  position: fixed;
  top: 72px;
  left: 18px;
  width: 248px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.mission-card small {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 4px;
}

.mission-card em { font-style: normal; color: var(--muted); }
.mission-card strong { display: block; font-size: 14px; margin-bottom: 8px; }

.mission-progress {
  position: relative;
  height: 16px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.mission-progress > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1b8c78, #3cd4b8);
  transition: width 0.25s ease;
}

.mission-progress > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 11px;
}

/* 准星 */
#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
}

#crosshair.ads { opacity: 0.22; transform: translate(-50%, -50%) scale(0.6); }

#crosshair i {
  position: absolute;
  background: rgba(240, 252, 255, 0.9);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.75);
}

.ch-t { left: 13px; top: 0; width: 2px; height: 7px; }
.ch-b { left: 13px; bottom: 0; width: 2px; height: 7px; }
.ch-l { top: 13px; left: 0; width: 7px; height: 2px; }
.ch-r { top: 13px; right: 0; width: 7px; height: 2px; }

#crosshair b {
  position: absolute;
  top: 13px;
  left: 13px;
  width: 2px;
  height: 2px;
  background: var(--accent);
}

#hitmarker {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.1s, transform 0.1s;
}

#hitmarker.show { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
#hitmarker.crit { color: #ff5b45; }

#interact-prompt {
  position: fixed;
  left: 50%;
  bottom: 132px;
  transform: translateX(-50%);
  padding: 8px 16px;
  border-radius: 6px;
  background: rgba(14, 34, 30, 0.92);
  border: 1px solid var(--accent);
  color: #e9fff9;
  font-size: 13px;
}

#interact-prompt[hidden] { display: none; }
#interact-prompt kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #06211c;
  font-weight: 800;
  margin-right: 6px;
}

#status-toast {
  position: fixed;
  left: 50%;
  top: 112px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid rgba(240, 168, 84, 0.5);
  color: #ffdfb2;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.25s;
}

#status-toast.show { opacity: 1; }

.vital-card {
  position: fixed;
  left: 18px;
  bottom: 24px;
  width: 220px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
}

.vital-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.vital-head strong { font-size: 22px; color: var(--text); }
.vital-bar {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.vital-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #3cd4b8, #7cf5db);
  transition: width 0.2s;
}

.ammo-card {
  position: fixed;
  right: 18px;
  bottom: 24px;
  min-width: 192px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  text-align: right;
}

.weapon-name { font-size: 12px; color: var(--amber); font-weight: 700; }
.weapon-name span { color: var(--muted); font-weight: 400; margin-left: 4px; }
.ammo-nums { display: flex; justify-content: flex-end; align-items: baseline; gap: 4px; margin: 2px 0; }
.ammo-nums strong { font-size: 26px; }
.ammo-nums em { font-style: normal; color: var(--muted); }
.ammo-nums span { font-size: 15px; color: var(--muted); }
.ammo-card small { font-size: 11px; color: var(--accent); }

.hud-hints {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(9, 14, 19, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.hud-hints kbd { color: var(--text); font-weight: 700; }

/* 弹窗 */
.overlay-dialog {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 14, 0.76);
  display: grid;
  place-items: center;
  z-index: 40;
}

.overlay-dialog[hidden] { display: none; }

.dialog-box {
  width: min(460px, 92vw);
  padding: 24px;
  border-radius: 10px;
  background: #10171f;
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
}

.dialog-box small { display: block; font-size: 11px; color: var(--accent); letter-spacing: 0.12em; margin-bottom: 6px; }
.dialog-box h2 { margin: 0 0 10px; font-size: 24px; }
.dialog-box p { margin: 0 0 18px; font-size: 13px; line-height: 1.6; color: var(--muted); }

.form-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.form-grid label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.form-grid select {
  padding: 5px 8px;
  border-radius: 4px;
  background: #0a1016;
  border: 1px solid var(--border);
  color: var(--text);
}

.checkbox-row { justify-content: flex-start !important; gap: 8px; }
.dialog-btns { display: flex; flex-wrap: wrap; gap: 10px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
}

.stat-cell {
  padding: 9px 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-cell span { display: block; font-size: 11px; color: var(--muted); }
.stat-cell b { font-size: 16px; color: var(--amber); }

body.photo-mode #hud,
body.photo-mode #topbar {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 960px) {
  .hud-hints, .sector-pill { display: none; }
}
