:root {
  --bg-deep: #060b16;
  --bg-panel: rgba(13, 22, 40, 0.94);
  --bg-card: rgba(20, 32, 56, 0.88);
  --border-subtle: rgba(56, 189, 248, 0.24);
  --border-bright: rgba(6, 182, 212, 0.6);
  --cyan: #06b6d4;
  --sky: #38bdf8;
  --emerald: #10b981;
  --amber: #f59e0b;
  --rose: #f43f5e;
  --purple: #a855f7;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at 20% 0%, #0e1e38 0%, var(--bg-deep) 65%);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Top Global Header */
.top-header {
  height: 60px;
  background: linear-gradient(90deg, rgba(8, 16, 32, 0.98), rgba(15, 29, 54, 0.96), rgba(8, 16, 32, 0.98));
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  flex-shrink: 0;
  z-index: 30;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 6px;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.platform-switcher {
  display: flex;
  background: rgba(6, 12, 24, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 4px;
  gap: 6px;
}

.plat-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 8px 18px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.plat-btn:hover {
  color: #fff;
}

.plat-btn.active {
  background: linear-gradient(135deg, #0284c7, #0d9488);
  color: #fff;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.45);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
}

select, input, textarea {
  background: rgba(9, 16, 30, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text-main);
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

select:focus, input:focus {
  border-color: var(--cyan);
}

.btn {
  border: 1px solid rgba(56, 189, 248, 0.38);
  background: rgba(14, 116, 144, 0.32);
  color: #e0f2fe;
  padding: 7px 13px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}

.btn:hover {
  background: rgba(6, 182, 212, 0.5);
  border-color: var(--sky);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7, #0891b2);
  border-color: #38bdf8;
  color: #fff;
}

.btn-hero {
  background: linear-gradient(135deg, #059669, #10b981);
  border: 1px solid #6ee7b7;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 10px;
  width: 100%;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.4);
}

.btn-hero:hover {
  background: linear-gradient(135deg, #10b981, #34d399);
  transform: translateY(-1px);
}

.btn-success {
  background: rgba(16, 185, 129, 0.28);
  border-color: #10b981;
  color: #a7f3d0;
}

.btn-warn {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fde68a;
}

.btn-danger {
  background: linear-gradient(135deg, #be123c, #e11d48);
  border-color: #fb7185;
  color: #fff;
}

.btn-sm {
  padding: 5px 9px;
  font-size: 12px;
}

/* Main Workspace Views */
.view-root {
  flex: 1;
  display: none;
  overflow: hidden;
  position: relative;
}

.view-root.active {
  display: flex;
}

/* ==================== Guided Demo Wizard + 3D Digital Twin Layout ==================== */
.wizard-sidebar {
  width: 355px;
  background: rgba(9, 17, 32, 0.97);
  border-right: 1px solid var(--border-subtle);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 15;
}

.wizard-card {
  background: rgba(18, 30, 54, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wizard-card.highlight-auto {
  border-color: rgba(16, 185, 129, 0.65);
  background: linear-gradient(180deg, rgba(6, 78, 59, 0.35), rgba(15, 28, 50, 0.92));
}

.wizard-step-title {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wizard-hint {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.5;
}

.arrival-popup {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(16, 185, 129, 0.25));
  border: 2px solid #fbbf24;
  border-radius: 9px;
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 7px;
  animation: pulseGold 1.1s infinite alternate;
}

@keyframes pulseGold {
  from { box-shadow: 0 0 4px rgba(251, 191, 36, 0.4); }
  to { box-shadow: 0 0 16px rgba(251, 191, 36, 0.95); }
}

.simple-joy-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.twin-stage {
  flex: 1;
  position: relative;
  background: #050b16;
  overflow: hidden;
}

#twinCanvasWrap {
  position: absolute;
  inset: 0;
}

/* 5-Step Top Flow Bar inside 3D Stage */
.step-progress-bar {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: rgba(8, 16, 32, 0.88);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 8px 14px;
  z-index: 12;
}

.step-pill {
  flex: 1;
  text-align: center;
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid transparent;
  transition: all 0.25s;
}

.step-pill.done {
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.4);
}

.step-pill.current {
  background: linear-gradient(135deg, #0284c7, #10b981);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.6);
}

.twin-top-cameras {
  position: absolute;
  top: 66px;
  left: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: rgba(8, 16, 32, 0.84);
  border: 1px solid var(--border-subtle);
  padding: 5px 8px;
  border-radius: 8px;
  z-index: 12;
}

.twin-mini-hud-box {
  position: absolute;
  top: 66px;
  right: 16px;
  width: 240px;
  background: rgba(8, 16, 32, 0.84);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 7px;
  z-index: 12;
}

/* Presenter Teleprompter Banner at Bottom of 3D Stage */
.teleprompter-box {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  background: rgba(7, 15, 30, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.55);
  border-left: 5px solid #10b981;
  border-radius: 10px;
  padding: 12px 16px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55);
}

.teleprompter-tag {
  font-size: 12px;
  font-weight: 700;
  color: #34d399;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.teleprompter-script {
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.55;
}

/* ==================== Platform 1 Full Management Backend ==================== */
.ops-sidebar {
  width: 220px;
  background: rgba(9, 16, 30, 0.95);
  border-right: 1px solid var(--border-subtle);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.nav-item {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  text-align: left;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.nav-item:hover {
  background: rgba(30, 41, 59, 0.6);
  color: #fff;
}

.nav-item.active {
  background: rgba(6, 182, 212, 0.18);
  border-color: var(--border-bright);
  color: var(--sky);
}

.ops-main {
  flex: 1;
  overflow-y: auto;
  padding: 14px 18px;
}

.tab-guide-tip {
  background: rgba(2, 132, 199, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 13px;
  color: #e0f2fe;
}

.subtab {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.subtab.active {
  display: flex;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px 14px;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
}

.kpi-val {
  font-size: 22px;
  font-weight: 700;
  color: var(--sky);
  margin-top: 4px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 14px;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  padding-bottom: 8px;
}

.panel-title {
  font-size: 14px;
  font-weight: 700;
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.panel-title::before {
  content: "";
  width: 4px;
  height: 14px;
  background: var(--cyan);
  border-radius: 2px;
}

.device-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.device-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  font-size: 12px;
  color: #cbd5e1;
}

.locker-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.locker-box {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.85);
  border-radius: 6px;
  padding: 6px 4px;
  text-align: center;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.locker-box.occupied {
  border-color: var(--amber);
  background: rgba(245, 158, 11, 0.16);
}

.locker-box.open {
  border-color: var(--rose);
  background: rgba(244, 63, 94, 0.24);
  animation: pulseBorder 1.1s infinite alternate;
}

@keyframes pulseBorder {
  from { box-shadow: 0 0 2px rgba(244, 63, 94, 0.4); }
  to { box-shadow: 0 0 10px rgba(244, 63, 94, 0.9); }
}

.badge {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.badge-ok { background: rgba(16, 185, 129, 0.18); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.4); }
.badge-warn { background: rgba(245, 158, 11, 0.18); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-err { background: rgba(244, 63, 94, 0.2); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.45); }
.badge-info { background: rgba(56, 189, 248, 0.16); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
.badge-muted { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th, .data-table td {
  padding: 8px 9px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  text-align: left;
}

.data-table th {
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(15, 23, 42, 0.65);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.form-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.map2d-canvas {
  width: 100%;
  height: 330px;
  background: #091326;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  cursor: crosshair;
}

.flow-nodes {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 4px;
}

.flow-node {
  min-width: 132px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(15, 28, 52, 0.95);
  border: 1px solid var(--border-bright);
  text-align: center;
}

.flow-node.active-step {
  border-color: var(--emerald);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45);
}

.flow-arrow {
  color: var(--cyan);
  font-weight: 700;
  font-size: 16px;
}

.video-hud {
  width: 100%;
  height: 260px;
  background: #050a14;
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.dpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 76px);
  grid-template-rows: repeat(2, 46px);
  gap: 6px;
  justify-content: center;
}

.proto-log {
  height: 210px;
  overflow-y: auto;
  background: #040811;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 6px;
  padding: 8px;
  font-family: Consolas, monospace;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.label-3d {
  position: absolute;
  transform: translate(-50%, -100%);
  background: rgba(7, 15, 30, 0.88);
  border: 1px solid var(--sky);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 6;
}

.edu-tag-3d {
  position: absolute;
  transform: translate(-50%, -100%);
  background: rgba(168, 85, 247, 0.92);
  border: 1px solid #e9d5ff;
  color: #fff;
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  z-index: 7;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
}

.toast-container {
  position: fixed;
  top: 72px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.toast {
  background: rgba(10, 20, 38, 0.96);
  border-left: 4px solid var(--cyan);
  border-top: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 11px 15px;
  border-radius: 8px;
  font-size: 13px;
  color: #f8fafc;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}
