/* =========================================================
   中国石化河南省公司 智能眼镜前线增强系统 · Demo
   网页模拟 AR 眼镜第一视角 HUD · 多场景
   ========================================================= */

:root {
  --cnpc-red: #c8102e;
  --cnpc-red-dark: #8a0a1f;
  --cnpc-gold: #ffd24a;
  --ar-cyan: #00e5ff;
  --ar-cyan-glow: rgba(0, 229, 255, 0.55);
  --ar-green: #00ff88;
  --ar-amber: #ffb84a;
  --ar-red: #ff3b3b;
  --ar-red-glow: rgba(255, 59, 59, 0.55);
  --hud-bg: rgba(6, 18, 32, 0.72);
  --hud-bg-strong: rgba(6, 18, 32, 0.88);
  --hud-border: rgba(0, 229, 255, 0.35);
  --hud-border-danger: rgba(255, 59, 59, 0.45);
  --text: #eaf6ff;
  --text-dim: #9ab3c8;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
          "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "Menlo", "Consolas", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: #000;
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Stage ---------- */
.stage {
  position: relative;
  width: 100vw; height: 100vh;
  overflow: hidden;
  background: #000;
}

/* ---------- Scene ---------- */
.scene { position: absolute; inset: 0; z-index: 1; }
.scene img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 68% 38%;
  filter: contrast(1.06) saturate(1.08) brightness(0.9);
  transition: opacity 0.4s ease;
}
.scene-tint {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 18%, transparent 32%),
    radial-gradient(circle at 55% 55%, transparent 35%, rgba(0,18,36,0.5) 100%),
    linear-gradient(180deg, rgba(0,30,60,0.22), rgba(0,0,0,0.4));
  pointer-events: none;
}

/* ---------- Glasses-frame vignette ---------- */
.vignette {
  position: absolute; inset: 0; z-index: 50;
  pointer-events: none;
  box-shadow:
    inset 0 0 240px 80px rgba(0,0,0,0.92),
    inset 0 0 80px 16px rgba(0,0,0,0.65);
  border-radius: 48px;
  background-image: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.018) 0px,
    rgba(255,255,255,0.018) 1px,
    transparent 1px,
    transparent 3px);
}
.vp-corner {
  position: absolute;
  width: 52px; height: 52px;
  border: 2px solid var(--ar-cyan);
  z-index: 45;
  pointer-events: none;
  box-shadow: 0 0 14px var(--ar-cyan-glow);
  opacity: 0.85;
}
.vp-tl { top: 18px; left: 18px;   border-right: none; border-bottom: none; border-top-left-radius: 6px; }
.vp-tr { top: 18px; right: 18px;  border-left: none;  border-bottom: none; border-top-right-radius: 6px; }
.vp-bl { bottom: 18px; left: 18px; border-right: none; border-top: none;    border-bottom-left-radius: 6px; }
.vp-br { bottom: 18px; right: 18px; border-left: none; border-top: none;    border-bottom-right-radius: 6px; }
/* Scenario B: turn corners red for danger */
body[data-scenario="b"] .vp-corner {
  border-color: var(--ar-red);
  box-shadow: 0 0 14px var(--ar-red-glow);
}

/* ---------- HUD layer (per-scenario) ---------- */
.hud {
  position: absolute; inset: 0;
  z-index: 10;
  pointer-events: none;
}
.hud > * { pointer-events: auto; }

/* show/hide controls */
[data-show-from], [data-only-step] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}
[data-show-from].visible, [data-only-step].visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ---------- Shared chrome: top bar ---------- */
.chrome { z-index: 20; }
.chrome-top {
  position: absolute;
  top: 18px; left: 90px; right: 90px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-left: 3px solid var(--cnpc-red);
  border-radius: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.brand-mark { font-size: 18px; filter: drop-shadow(0 0 6px var(--cnpc-red)); }
.brand-text { font-weight: 600; color: #fff; }
.brand-text em { font-style: normal; font-weight: 400; color: var(--text-dim); margin-left: 6px; }

/* Scenario tabs */
.scenario-tabs {
  display: flex; gap: 4px;
  padding: 4px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab:hover { color: #fff; background: rgba(255,255,255,0.06); }
.tab.active {
  background: var(--cnpc-red);
  color: #fff;
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 0 12px rgba(200,16,46,0.5);
}
.tab-code {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 5px;
  background: rgba(255,255,255,0.18);
  border-radius: 3px;
  font-weight: 700;
}
.tab.active .tab-code { background: rgba(255,255,255,0.28); }

/* Status indicators */
.status { display: flex; gap: 8px; }
.status-item {
  padding: 6px 12px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ar-cyan);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.dot-red { background: #ff3b3b; box-shadow: 0 0 8px #ff3b3b; animation: pulse 1.4s infinite ease-in-out; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ---------- Idle hint ---------- */
.idle-hint {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column;
  align-items: center; gap: 18px;
  text-align: center;
}
.idle-hint.visible { transform: translate(-50%, -50%); }
.idle-pulse {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 2px solid var(--ar-cyan);
  position: relative;
  box-shadow: 0 0 24px var(--ar-cyan-glow);
}
.idle-pulse::before, .idle-pulse::after {
  content: ""; position: absolute; inset: -8px;
  border: 2px solid var(--ar-cyan);
  border-radius: 50%;
  opacity: 0;
  animation: idleRipple 2.2s infinite ease-out;
}
.idle-pulse::after { animation-delay: 1.1s; }
.idle-pulse.safe { border-color: var(--ar-green); box-shadow: 0 0 24px rgba(0,255,136,0.5); }
.idle-pulse.safe::before, .idle-pulse.safe::after { border-color: var(--ar-green); }
@keyframes idleRipple {
  0%   { opacity: 0.7; transform: scale(0.6); }
  100% { opacity: 0;   transform: scale(2.2); }
}
.idle-text {
  font-size: 14px;
  color: var(--ar-cyan);
  letter-spacing: 0.08em;
  padding: 8px 18px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 4px;
}

/* ---------- Reticle ---------- */
.reticle {
  position: absolute;
  transform: translate(-50%, -50%) !important;
}
.reticle.visible { transform: translate(-50%, -50%) !important; }
.reticle-bracket {
  position: absolute;
  width: 28px; height: 28px;
  border: 3px solid var(--ar-cyan);
  box-shadow: 0 0 12px var(--ar-cyan-glow);
}
.reticle-bracket.tl { top: 0; left: 0; border-right: none; border-bottom: none; }
.reticle-bracket.tr { top: 0; right: 0; border-left: none; border-bottom: none; }
.reticle-bracket.bl { bottom: 0; left: 0; border-right: none; border-top: none; }
.reticle-bracket.br { bottom: 0; right: 0; border-left: none; border-top: none; }
.reticle-scanline {
  position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--ar-cyan), transparent);
  box-shadow: 0 0 12px var(--ar-cyan);
  animation: scan 1.6s infinite ease-in-out;
}
@keyframes scan {
  0%   { top: 0;    opacity: 0.4; }
  50%  { top: 100%; opacity: 1;   }
  100% { top: 0;    opacity: 0.4; }
}
.reticle-label {
  position: absolute; top: -26px; left: 0;
  font-family: var(--mono); font-size: 12px;
  color: var(--ar-cyan);
  letter-spacing: 0.1em;
  white-space: nowrap;
}
.danger-label {
  color: var(--ar-red) !important;
  text-shadow: 0 0 8px var(--ar-red-glow);
  font-weight: 700;
}

/* When the chip appears (step 2+ for A, step 1+ for D) — lock reticle green */
body[data-scenario="a"][data-step="2"] .reticle .reticle-bracket,
body[data-scenario="a"][data-step="3"] .reticle .reticle-bracket,
body[data-scenario="a"][data-step="4"] .reticle .reticle-bracket {
  border-color: var(--ar-green);
  box-shadow: 0 0 14px rgba(0,255,136,0.6);
}
/* Scenario B: red reticle from step 2 */
.reticle-danger .reticle-bracket { border-color: var(--ar-red); box-shadow: 0 0 14px var(--ar-red-glow); animation: dangerPulse 0.9s infinite ease-in-out; }
.reticle-danger .reticle-scanline { background: linear-gradient(90deg, transparent, var(--ar-red), transparent); box-shadow: 0 0 12px var(--ar-red); }
@keyframes dangerPulse { 0%,100%{ opacity: 1 } 50%{ opacity: 0.4 } }
/* Scenario D: amber reticle (fault) */
.reticle-fault .reticle-bracket { border-color: var(--ar-amber); box-shadow: 0 0 14px rgba(255,184,74,0.6); }
.reticle-fault .reticle-scanline { background: linear-gradient(90deg, transparent, var(--ar-amber), transparent); box-shadow: 0 0 12px var(--ar-amber); }
.reticle-fault .reticle-label { color: var(--ar-amber); }

/* ---------- Plate / chip ---------- */
.plate-chip {
  position: absolute;
  transform: translateX(-50%) translateY(8px);
  display: flex; align-items: center; gap: 14px;
  padding: 10px 22px;
  background: var(--hud-bg-strong);
  border: 1px solid var(--ar-green);
  border-radius: 8px;
  box-shadow: 0 0 32px rgba(0,255,136,0.25), 0 6px 24px rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.plate-chip.visible { transform: translateX(-50%) translateY(0); }
.plate-icon { color: var(--ar-green); }
.plate-text {
  font-family: var(--mono);
  font-size: 22px; font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 0 0 8px rgba(0,255,136,0.5);
}
.plate-confidence {
  font-family: var(--mono); font-size: 11px;
  color: var(--text-dim);
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.15);
}
.fault-chip { border-color: var(--ar-amber) !important; box-shadow: 0 0 32px rgba(255,184,74,0.25), 0 6px 24px rgba(0,0,0,0.4) !important; }

/* ---------- Customer / profile / knowledge card (shared) ---------- */
.profile-card {
  position: absolute;
  top: 90px; right: 90px;
  width: 360px;
  padding: 18px;
  background: var(--hud-bg-strong);
  border: 1px solid var(--hud-border);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(0,229,255,0.06);
  transform: translateX(20px);
}
.profile-card.visible { transform: translateX(0); }
.profile-card-danger { border-color: var(--hud-border-danger); box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 32px rgba(255,59,59,0.15); }
.fault-card        { border-color: rgba(255,184,74,0.45); box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 32px rgba(255,184,74,0.18); }

.profile-header {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.profile-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cnpc-red), var(--cnpc-red-dark));
  color: #fff;
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.avatar-warn    { background: linear-gradient(135deg, #ff5a5a, #b81010); }
.avatar-success { background: linear-gradient(135deg, #00d484, #008a55); }
.avatar-fault   { background: linear-gradient(135deg, #ff9f4a, #d46a10); font-family: var(--mono); }
.profile-name-block { flex: 1; min-width: 0; }
.profile-name { font-size: 16px; font-weight: 700; color: #fff; }
.profile-tag {
  display: inline-block;
  font-size: 10px; font-weight: 500;
  padding: 2px 6px; margin-left: 6px;
  background: rgba(255,184,74,0.18);
  color: var(--ar-amber);
  border-radius: 3px;
  vertical-align: middle;
}
.tag-warn { background: rgba(255,59,59,0.18); color: #ff8a8a; }
.profile-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.profile-level {
  text-align: center;
  font-size: 9px; color: var(--cnpc-gold);
  line-height: 1.1;
  padding: 4px 8px;
  border: 1px solid var(--cnpc-gold);
  border-radius: 4px;
}
.profile-level b { font-size: 16px; display: block; margin-top: 2px; color: var(--cnpc-gold); }

.profile-grid {
  display: grid; grid-template-columns: 1fr; gap: 8px;
  padding: 14px 0 10px;
}
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 12px; }
.kv .k { color: var(--text-dim); flex-shrink: 0; }
.kv .v { color: #fff; font-family: var(--mono); font-size: 12px; text-align: right; }
.kv .v.hl { color: var(--ar-cyan); font-weight: 600; }

.profile-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.tag { font-size: 11px; padding: 3px 8px; border-radius: 3px; font-weight: 500; }
.tag-blue  { background: rgba(0,229,255,0.15);  color: var(--ar-cyan); }
.tag-amber { background: rgba(255,184,74,0.15); color: var(--ar-amber); }
.tag-green { background: rgba(0,255,136,0.15);  color: var(--ar-green); }
.tag-red   { background: rgba(255,59,59,0.18);  color: #ff8a8a; }

/* ---------- Service prompt panel (shared) ---------- */
.service-prompt {
  position: absolute;
  bottom: 90px; left: 90px;
  right: 480px;
  max-width: 720px;
  padding: 16px 20px;
  background: var(--hud-bg-strong);
  border: 1px solid var(--hud-border);
  border-left: 3px solid var(--cnpc-red);
  border-radius: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(20px);
}
.service-prompt.visible { transform: translateY(0); }
.service-prompt-danger { border-left-color: var(--ar-red); }
.fault-steps           { border-left-color: var(--ar-amber); }
.sop-step              { border-left-color: var(--cnpc-gold); }

.service-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--cnpc-gold);
  text-transform: uppercase;
}
.service-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cnpc-gold);
  box-shadow: 0 0 8px var(--cnpc-gold);
  animation: pulse 1.4s infinite ease-in-out;
}
.service-quote {
  margin: 10px 0 14px;
  font-size: 15px;
  line-height: 1.65;
  color: #fff;
}
.service-quote b { color: var(--cnpc-gold); font-weight: 700; }
.service-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.action {
  background: rgba(200,16,46,0.85);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  font-size: 12px;
  font-family: var(--font);
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
.action:hover { background: var(--cnpc-red); }
.action:active { transform: translateY(1px); }
.action-ghost { background: transparent; border: 1px solid rgba(255,255,255,0.25); color: var(--text); }
.action-ghost:hover { background: rgba(255,255,255,0.08); }

.step-list {
  margin: 12px 0 14px;
  padding-left: 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
.step-list li { margin: 4px 0; }
.step-list b { color: var(--cnpc-gold); }

/* ---------- Scenario B: danger banner ---------- */
.danger-banner {
  position: absolute;
  top: 95px; left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: min(640px, 70%);
  padding: 14px 20px;
  background: rgba(80,0,0,0.85);
  border: 1px solid var(--ar-red);
  border-radius: 8px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: 0 0 32px rgba(255,59,59,0.35), 0 12px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.danger-banner.visible { transform: translateX(-50%) translateY(0); }
.danger-icon { font-size: 32px; line-height: 1; flex-shrink: 0; }
.danger-text { flex: 1; }
.danger-text b { font-size: 16px; color: #fff; }
.danger-sub { font-size: 12px; color: #ffd0d0; margin-top: 2px; }
.danger-meta {
  display: flex; flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  border-left: 1px solid rgba(255,255,255,0.1);
  padding-left: 14px;
}
.danger-meta b { font-family: var(--font); }

.success-banner { background: rgba(0,80,40,0.85) !important; border-color: var(--ar-green) !important; }
.success-banner .danger-sub { color: #c0ffe0; }

/* ---------- Scenario C: task card + SOP arrow + warn ---------- */
.task-card {
  position: absolute;
  top: 95px; right: 90px;
  width: 320px;
  padding: 14px 18px;
  background: var(--hud-bg-strong);
  border: 1px solid var(--hud-border);
  border-left: 3px solid var(--ar-amber);
  border-radius: 10px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateX(20px);
}
.task-card.visible { transform: translateX(0); }
.task-card-header { display: flex; justify-content: space-between; font-size: 11px; }
.task-tag { color: var(--ar-amber); letter-spacing: 0.1em; }
.task-source { color: var(--text-dim); font-family: var(--mono); }
.task-main { display: flex; gap: 14px; align-items: center; margin: 12px 0; padding: 12px 0; border-top: 1px solid rgba(255,255,255,0.08); border-bottom: 1px solid rgba(255,255,255,0.08); }
.task-fuel {
  font-family: var(--mono); font-size: 44px; font-weight: 700;
  color: var(--ar-amber);
  line-height: 1;
  text-shadow: 0 0 16px rgba(255,184,74,0.6);
}
.task-fuel span { font-size: 22px; opacity: 0.8; }
.task-detail { flex: 1; }
.task-row { display: flex; justify-content: space-between; font-size: 12px; padding: 3px 0; }
.task-row span { color: var(--text-dim); }
.task-row b { color: #fff; font-family: var(--mono); }
.task-check {
  font-size: 12px;
  color: var(--ar-green);
  background: rgba(0,255,136,0.1);
  border-radius: 4px;
  padding: 6px 10px;
  text-align: center;
}

/* SOP highlight arrow (pointing at correct button) */
.sop-arrow {
  position: absolute;
  transform: translate(-50%, -50%) !important;
  pointer-events: none;
}
.sop-arrow.visible { transform: translate(-50%, -50%) !important; }
.sop-arrow-circle {
  width: 130px; height: 130px;
  border: 4px solid var(--ar-green);
  border-radius: 50%;
  box-shadow: 0 0 36px rgba(0,255,136,0.75), inset 0 0 36px rgba(0,255,136,0.28);
  animation: targetPulse 1.4s infinite ease-in-out;
}
@keyframes targetPulse {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.06); opacity: 0.85; }
}
.sop-arrow-label {
  position: absolute; bottom: -32px; left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ar-green);
  text-shadow: 0 0 8px rgba(0,255,136,0.6);
  white-space: nowrap;
  font-weight: 700;
}

/* SOP wrong-button bracket */
.sop-warn {
  position: absolute;
  border: 2px dashed var(--ar-red);
  box-shadow: 0 0 18px rgba(255,59,59,0.3) inset;
  border-radius: 4px;
  pointer-events: none;
}
.sop-warn-x {
  position: absolute; top: -10px; right: -10px;
  width: 26px; height: 26px;
  background: var(--ar-red);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 0 12px var(--ar-red);
}
.sop-warn-label {
  position: absolute; bottom: -28px; left: 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ar-red);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.sop-checklist { width: 380px; }

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  top: 80px; left: 50%;
  z-index: 30;
  transform: translateX(-50%) translateY(-8px);
  padding: 10px 22px;
  background: var(--hud-bg-strong);
  border: 1px solid var(--ar-cyan);
  border-radius: 24px;
  font-size: 13px;
  color: var(--ar-cyan);
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast::before { content: "🔊 "; margin-right: 4px; }

/* ---------- Bottom control bar ---------- */
.chrome-bottom {
  position: absolute;
  bottom: 22px; left: 90px; right: 90px;
  display: flex; align-items: center; gap: 18px;
  font-size: 11px;
  color: var(--text-dim);
  z-index: 20;
}
.step-track { display: flex; gap: 6px; }
.step-dot {
  width: 28px; height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.15);
  transition: background 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}
.step-dot.on { background: var(--ar-cyan); box-shadow: 0 0 6px var(--ar-cyan-glow); }
body[data-scenario="b"] .step-dot.on { background: var(--ar-red); box-shadow: 0 0 6px var(--ar-red-glow); }
body[data-scenario="c"] .step-dot.on { background: var(--ar-amber); box-shadow: 0 0 6px rgba(255,184,74,0.6); }
body[data-scenario="d"] .step-dot.on { background: var(--ar-amber); box-shadow: 0 0 6px rgba(255,184,74,0.6); }

.step-label {
  font-family: var(--mono);
  color: var(--ar-cyan);
  flex: 1;
}
body[data-scenario="b"] .step-label { color: var(--ar-red); }
body[data-scenario="c"] .step-label { color: var(--ar-amber); }
body[data-scenario="d"] .step-label { color: var(--ar-amber); }

.controls-hint { color: var(--text-dim); }
kbd {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-bottom-width: 2px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10px;
  color: #fff;
  margin: 0 2px;
}

/* ---------- 律动 AI brand mark (text-only, CSS) ---------- */
:root {
  --ldai-violet: #a78bfa;
  --ldai-violet-deep: #7c3aed;
  --ldai-violet-glow: rgba(167, 139, 250, 0.55);
}
.brand-ldai {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font);
  line-height: 1;
  vertical-align: middle;
}
.brand-ldai-wave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  width: 18px;
  height: 14px;
}
.brand-ldai-wave span {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: linear-gradient(180deg, var(--ldai-violet), var(--ldai-violet-deep));
  box-shadow: 0 0 4px var(--ldai-violet-glow);
  transform-origin: bottom center;
  animation: ldaiWave 1.4s infinite ease-in-out;
}
.brand-ldai-wave span:nth-child(1) { height: 50%;  animation-delay: 0s; }
.brand-ldai-wave span:nth-child(2) { height: 100%; animation-delay: 0.15s; }
.brand-ldai-wave span:nth-child(3) { height: 70%;  animation-delay: 0.30s; }
.brand-ldai-wave span:nth-child(4) { height: 90%;  animation-delay: 0.45s; }
@keyframes ldaiWave {
  0%, 100% { transform: scaleY(0.35); opacity: 0.7; }
  50%      { transform: scaleY(1);    opacity: 1; }
}
.brand-ldai-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #ddd6fe 0%, var(--ldai-violet) 50%, var(--ldai-violet-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.brand-ldai-text em {
  font-style: normal;
  margin-left: 3px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

/* Big variant — start overlay */
.brand-ldai-big {
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.brand-ldai-big .brand-ldai-wave {
  width: 36px;
  height: 30px;
  gap: 4px;
}
.brand-ldai-big .brand-ldai-wave span { width: 6px; border-radius: 2px; }
.brand-ldai-big .brand-ldai-text { font-size: 22px; letter-spacing: 0.1em; }
.brand-ldai-big .brand-ldai-text em { letter-spacing: 0.14em; }

/* Persistent watermark — above the bottom chrome, low-key */
.brand-watermark {
  position: absolute;
  z-index: 22;
  bottom: 54px;
  left: 90px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(167, 139, 250, 0.28);
  border-radius: 6px;
  font-size: 11px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0.92;
}
.brand-watermark .ldai-tag {
  color: var(--text-dim);
  font-size: 10px;
}
.brand-watermark .brand-ldai-text { font-size: 11px; }

/* Start-overlay "技术支持" credit block */
.start-credit {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.start-credit-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* In-HUD label highlight — service-label can use this */
.brand-ldai-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: baseline;
}
.brand-ldai-inline .brand-ldai-wave {
  width: 12px;
  height: 10px;
  gap: 1.5px;
}
.brand-ldai-inline .brand-ldai-wave span { width: 2px; }
.brand-ldai-inline .brand-ldai-text { font-size: inherit; }

/* ---------- Subtitle bar ---------- */
.subtitle {
  position: absolute;
  z-index: 28;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  max-width: min(86vw, 1100px);
  padding: 12px 28px;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 17px;
  line-height: 1.55;
  text-align: center;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 6px rgba(0,0,0,0.8);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.subtitle.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.subtitle::before {
  content: "🎙 ";
  opacity: 0.7;
  margin-right: 4px;
}

/* ---------- Start overlay ---------- */
.start-overlay {
  position: absolute;
  inset: 0;
  z-index: 70;
  background: radial-gradient(circle at center, rgba(10, 20, 35, 0.85), rgba(0, 0, 0, 0.96));
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 1;
  transition: opacity 0.5s ease;
}
.start-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}
.start-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 56px;
  max-width: 520px;
  text-align: center;
}
.start-logo {
  font-size: 52px;
  filter: drop-shadow(0 0 16px var(--cnpc-red));
  margin-bottom: 4px;
}
.start-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
}
.start-subtitle {
  font-size: 15px;
  color: var(--ar-cyan);
  letter-spacing: 0.08em;
}
.start-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin: 6px 0 16px;
  letter-spacing: 0.06em;
}
.start-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  background: var(--cnpc-red);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(200,16,46,0.55), 0 0 0 1px rgba(255,255,255,0.1) inset;
  transition: transform 0.08s ease, background 0.15s ease;
}
.start-button:hover { background: #e0142e; }
.start-button:active { transform: translateY(1px) scale(0.98); }
.start-button-icon {
  font-size: 14px;
  background: rgba(255,255,255,0.18);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.start-skip {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-dim);
  padding: 8px 18px;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.start-skip:hover { color: #fff; background: rgba(255,255,255,0.06); }
.start-hint {
  margin-top: 20px;
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ---------- Touch controls (floating, bottom-right) ---------- */
.touch-controls {
  position: absolute;
  z-index: 25;
  bottom: 60px;
  right: 24px;
  display: none;     /* shown only on touch / small screens */
  gap: 8px;
  align-items: center;
}
.tc-btn {
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  background: var(--hud-bg-strong);
  border: 1px solid var(--hud-border);
  border-radius: 8px;
  color: var(--ar-cyan);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
  transition: transform 0.05s ease, background 0.15s ease;
}
.tc-btn:active { transform: translateY(1px) scale(0.97); }
.tc-btn-primary {
  background: var(--cnpc-red);
  border-color: rgba(255,255,255,0.2);
  color: #fff;
  box-shadow: 0 6px 20px rgba(200,16,46,0.45);
}

/* ---------- Portrait orientation hint (phones only) ---------- */
.portrait-hint {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,8,18,0.96);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  padding: 24px;
}
.portrait-hint-icon {
  font-size: 64px;
  animation: rotateHint 2.4s infinite ease-in-out;
}
@keyframes rotateHint {
  0%, 100% { transform: rotate(-12deg); }
  50%      { transform: rotate(90deg); }
}
.portrait-hint-text { font-size: 17px; color: #fff; line-height: 1.6; }
.portrait-hint-text span { color: var(--text-dim); font-size: 14px; }
.portrait-hint-dismiss {
  margin-top: 12px;
  background: transparent;
  color: var(--ar-cyan);
  border: 1px solid var(--ar-cyan);
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
}

/* ---------- Responsive: ≤1280px (small desktop / large tablet) ---------- */
@media (max-width: 1280px) {
  .chrome-top, .chrome-bottom { left: 24px; right: 24px; }
  .profile-card, .task-card { right: 24px; width: 320px; }
  .service-prompt { left: 24px; right: 380px; }
  .vp-corner { width: 40px; height: 40px; }
}

/* ---------- Subtitle responsive overrides ---------- */
@media (max-width: 1280px) {
  .subtitle { font-size: 15px; padding: 10px 22px; bottom: 64px; }
}

/* ---------- Responsive: ≤900px (landscape phone, small tablet) ---------- */
@media (max-width: 900px) {
  .vp-corner { width: 32px; height: 32px; top: 12px; left: 12px; }
  .vp-tr { left: auto; right: 12px; }
  .vp-bl { top: auto; bottom: 12px; }
  .vp-br { top: auto; bottom: 12px; left: auto; right: 12px; }
  .vignette { border-radius: 28px; box-shadow: inset 0 0 140px 40px rgba(0,0,0,0.9), inset 0 0 50px 10px rgba(0,0,0,0.6); }

  .chrome-top {
    top: 12px; left: 12px; right: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .brand { padding: 6px 10px; font-size: 11px; }
  .brand-text em { display: none; }
  .scenario-tabs { order: 3; flex-basis: 100%; justify-content: center; padding: 3px; }
  .tab { padding: 5px 9px; font-size: 11px; }
  .status-item { padding: 4px 8px; font-size: 11px; }
  .status-item:nth-child(2) { display: none; }  /* hide 5G chip to save space */

  .profile-card, .task-card {
    top: auto;
    bottom: 130px;        /* sit above the touch controls */
    right: 12px;
    left: 12px;
    width: auto;
    max-height: 38vh;
    overflow-y: auto;
    padding: 12px 14px;
  }
  .profile-grid { gap: 5px; }
  .profile-grid .kv { font-size: 11px; }
  .profile-header { padding-bottom: 10px; }
  .profile-name { font-size: 14px; }
  .profile-sub { font-size: 10px; }

  .service-prompt {
    bottom: 130px;
    left: 12px;
    right: 12px;
    max-width: none;
    padding: 12px 14px;
  }
  .service-quote { font-size: 13px; line-height: 1.55; margin: 8px 0 10px; }
  .service-actions { gap: 6px; }
  .action { padding: 6px 10px; font-size: 11px; }
  .step-list { font-size: 12px; padding-left: 20px; }

  /* When both profile + service prompt visible (step 4), stack them */
  body[data-step="4"] .profile-card { bottom: auto; top: 70px; max-height: 30vh; }
  body[data-step="4"] .service-prompt { bottom: 130px; }

  .chrome-bottom { bottom: 12px; left: 12px; right: 12px; gap: 8px; }
  .step-label { font-size: 10px; }
  .controls-kbd { display: none; }     /* hide keyboard hint on small screens */

  /* Show touch controls on small screens */
  .touch-controls { display: flex; bottom: 50px; right: 12px; }
  .tc-btn { min-width: 40px; height: 40px; padding: 0 10px; font-size: 13px; }

  /* Subtitle clears the touch controls vertically */
  .subtitle {
    bottom: 110px;
    font-size: 14px;
    padding: 8px 16px;
    max-width: 92vw;
  }

  /* Watermark smaller + repositioned on mobile */
  .brand-watermark {
    bottom: auto;
    top: 64px;       /* sit just below the top chrome on mobile */
    left: 12px;
    padding: 3px 8px;
    font-size: 10px;
  }
  .brand-watermark .ldai-tag { display: none; }

  /* Start overlay tighter on small screens */
  .start-card { padding: 28px 24px; max-width: 92vw; }
  .start-title { font-size: 18px; }
  .start-subtitle { font-size: 13px; }
  .start-button { padding: 14px 28px; font-size: 15px; }

  /* Reposition reticles slightly so HUD has room */
  .danger-banner { top: 70px; width: 92%; padding: 10px 14px; }
  .danger-banner b { font-size: 14px; }
  .danger-sub { font-size: 11px; }
  .danger-meta { font-size: 10px; padding-left: 8px; }

  .task-fuel { font-size: 32px; }
  .sop-arrow-circle { width: 90px; height: 90px; border-width: 3px; }
  .sop-arrow-label { font-size: 12px; bottom: -26px; }

  .toast { top: 56px; font-size: 12px; padding: 8px 16px; }
}

/* ---------- Responsive: ≤640px (phone landscape, very small tablet) ---------- */
@media (max-width: 640px) {
  .brand-text { font-size: 11px; }
  .brand-mark { font-size: 14px; }
  .tab { padding: 4px 7px; font-size: 10px; gap: 5px; }
  .tab-code { padding: 1px 4px; font-size: 9px; }

  /* Floor the visible HUD elements to the bottom sheet */
  .profile-card, .task-card, .service-prompt {
    bottom: 120px;
    max-height: 36vh;
  }

  .reticle .reticle-label { font-size: 10px; top: -20px; }
  .plate-text { font-size: 18px; }
  .plate-confidence { font-size: 10px; padding-left: 8px; }
}

/* ---------- Portrait orientation on phones ---------- */
@media (max-width: 640px) and (orientation: portrait) {
  .portrait-hint { display: flex; }
  body.portrait-dismissed .portrait-hint { display: none; }

  /* Compact stacked layout when dismissed */
  body.portrait-dismissed .chrome-top {
    top: 8px; left: 8px; right: 8px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  body.portrait-dismissed .brand { font-size: 10px; padding: 5px 10px; }
  body.portrait-dismissed .status { justify-content: space-between; }
  body.portrait-dismissed .scenario-tabs { padding: 3px; overflow-x: auto; }

  /* Scene takes top ~45% so HUD can dock at bottom */
  body.portrait-dismissed .scene img { object-position: center 40%; }

  body.portrait-dismissed .profile-card,
  body.portrait-dismissed .task-card,
  body.portrait-dismissed .service-prompt {
    top: auto;
    bottom: 130px;
    left: 8px;
    right: 8px;
    max-height: 40vh;
  }
  body.portrait-dismissed .danger-banner {
    top: 130px;
    width: 92%;
  }
  body.portrait-dismissed .reticle {
    /* Reticles use their inline width; keep but slightly smaller */
    transform: translate(-50%, -50%) scale(0.85) !important;
  }
  body.portrait-dismissed .touch-controls {
    bottom: 50px;
    left: 8px;
    right: 8px;
    justify-content: space-between;
  }
  body.portrait-dismissed .tc-btn { flex: 1; }
  body.portrait-dismissed .tc-btn-primary { flex: 2; }

  body.portrait-dismissed .chrome-bottom {
    bottom: 8px;
    flex-wrap: wrap;
    font-size: 9px;
  }
  body.portrait-dismissed .step-label { flex-basis: 100%; }
}

/* ---------- Touch-device hint (any touch screen, regardless of size) ---------- */
@media (hover: none) and (pointer: coarse) {
  .controls-kbd { display: none; }
  .touch-controls { display: flex; }
}
