/* ============================================
   ONNDA 集卡识别演示系统
   Hero保持原尺寸 / 左侧+视频区+1/3
   ============================================ */

:root {
  --bg: #040913;
  --panel-bg: rgba(9, 16, 31, 0.95);
  --panel-bg-soft: rgba(10, 20, 38, 0.92);
  --line: rgba(113, 246, 255, 0.2);
  --accent: #71f6ff;
  --text: #eaf7ff;
  --text-dim: rgba(206, 232, 255, 0.7);
  --success: #7dffc6;
  --warning: #ffcc71;
}

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

html, body {
  height: 100%; overflow: hidden;
  background: var(--bg); color: var(--text);
  font-family: "Noto Sans SC","Microsoft YaHei",sans-serif;
  font-size: 17px;
}

body {
  background:
    radial-gradient(ellipse at 25% 15%, rgba(66,135,245,.09), transparent 45%),
    radial-gradient(ellipse at 75% 10%, rgba(113,246,255,.06), transparent 40%),
    var(--bg);
}

button { font: inherit; cursor: pointer; }

.screen-grid {
  pointer-events: none; position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(113,246,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113,246,255,.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle at 50% 30%, black 45%, transparent 80%);
}

.app-shell {
  position: relative; z-index: 1;
  width: 100%; height: 100vh; max-width: 1920px; margin: 0 auto;
  padding: 8px 14px 6px; display: flex; flex-direction: column; gap: 6px;
}

/* ========== HERO (保持不变) ========== */
.hero-panel {
  display: grid; grid-template-columns: 1fr auto;
  gap: 32px; padding: 20px 32px; border-radius: 18px;
  background: linear-gradient(135deg,
    rgba(9,16,31,.97), rgba(14,22,42,.94), rgba(9,16,31,.97));
  border: 1px solid rgba(113,246,255,.15);
  flex-shrink: 0; position: relative; overflow: hidden;
}

.hero-panel::before {
  content: ""; position: absolute;
  top: 0; left: 5%; right: 5%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(113,246,255,.35), transparent);
}

.hero-brand { display: flex; align-items: center; gap: 18px; }

.brand-icon {
  flex-shrink: 0; width: 60px; height: 60px;
  color: var(--accent); opacity: .85;
  filter: drop-shadow(0 0 14px rgba(113,246,255,.3));
  animation: brand-glow 3s ease-in-out infinite;
}

@keyframes brand-glow {
  0%,100% { filter: drop-shadow(0 0 10px rgba(113,246,255,.25)); }
  50% { filter: drop-shadow(0 0 20px rgba(113,246,255,.5)); }
}

.brand-icon svg { width: 100%; height: 100%; }
.brand-body { min-width: 0; }

.brand-status {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 16px; border-radius: 999px;
  background: rgba(125,255,198,.06);
  border: 1px solid rgba(125,255,198,.15);
  font-size: 14px; color: var(--text-dim); letter-spacing: .05em;
  margin-bottom: 10px;
}

.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px rgba(125,255,198,.7);
  animation: pulse 2s infinite;
}

#hero-title {
  font-family: "Noto Sans SC","Microsoft YaHei",sans-serif;
  font-size: clamp(26px, 2.8vw, 48px); font-weight: 700;
  line-height: 1.2; color: #fff; letter-spacing: .03em;
  text-shadow: 0 0 36px rgba(113,246,255,.14);
}

.brand-divider {
  width: 70px; height: 3px; margin: 10px 0 8px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 1px;
  box-shadow: 0 0 10px rgba(113,246,255,.4);
}

#hero-subtitle {
  font-size: clamp(16px, 1.3vw, 22px);
  color: var(--accent); letter-spacing: .18em; font-weight: 500;
}

#hero-tagline { margin-top: 6px; font-size: 14px; color: var(--text-dim); }

.hero-metrics {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 12px; align-content: center; align-self: center;
}

.metric-card {
  padding: 16px 20px; border-radius: 14px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(113,246,255,.1);
  min-width: 140px; transition: border-color .3s;
}

.metric-card:hover { border-color: rgba(113,246,255,.3); }

.metric-label {
  font-size: 13px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-dim);
}

.metric-value {
  display: block; margin-top: 8px;
  font-family: "Orbitron",sans-serif;
  font-size: clamp(18px, 1.6vw, 28px); font-weight: 700;
}

.status-live { color: var(--success); }

/* ========== COMMAND (保持不变) ========== */
.command-panel {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; padding: 12px 18px; border-radius: 16px;
  background: var(--panel-bg-soft); border: 1px solid var(--line);
  flex-shrink: 0;
}

.tab-bar { display: flex; gap: 12px; flex-wrap: wrap; }

.tab-button {
  min-width: 170px; padding: 14px 18px;
  border: 1px solid rgba(113,246,255,.2);
  background: rgba(10,20,38,.7); color: var(--text);
  border-radius: 14px; text-align: left;
  transition: border-color .2s, box-shadow .2s;
}

.tab-button:hover { border-color: rgba(113,246,255,.5); }
.tab-button.active {
  border-color: rgba(113,246,255,.85);
  box-shadow: 0 0 16px rgba(113,246,255,.22);
}

.tab-code { font-size: 12px; letter-spacing: .22em; color: var(--text-dim); }
.tab-name { display: block; margin-top: 4px; font-size: 18px; font-weight: 700; }

.command-actions { display: flex; gap: 10px; }

.action-button {
  padding: 14px 26px;
  border: 1px solid rgba(113,246,255,.2);
  background: rgba(10,20,38,.7); color: var(--text);
  border-radius: 14px; font-size: 16px;
  transition: border-color .2s, box-shadow .2s;
}

.action-button:hover { border-color: rgba(113,246,255,.5); }
.action-button.primary {
  background: linear-gradient(135deg, rgba(64,133,255,.22), rgba(113,246,255,.12));
}

/* ========== CONTENT ========== */
.content-layout {
  display: grid;
  grid-template-columns: 580px minmax(0,1fr);
  gap: 10px; flex: 1; min-height: 0;
}

.intel-panel {
  border-radius: 20px; padding: 20px;
  background: var(--panel-bg-soft); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
}

.panel-kicker {
  font-size: 17px; letter-spacing: .24em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
}

.panel-head h2 {
  margin: 8px 0 6px;
  font-family: "Orbitron",sans-serif;
  font-size: 1.8vw;
}

.panel-head p { font-size: 19px; color: var(--text-dim); line-height: 1.5; }

/* 摘要 */
.summary-grid { display: none; }

.summary-card {
  padding: 18px 20px; border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(113,246,255,.12);
}

.summary-card .metric-label { font-size: 18px; }

.summary-value {
  display: block; margin-top: 8px;
  font-family: "Orbitron",sans-serif;
  font-size: 1.7vw;
}

.summary-card.ready .summary-value { color: var(--success); }
.summary-card.watch .summary-value { color: var(--warning); }

/* 时间线 */
.timeline-panel {
  padding: 18px 20px; border-radius: 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(113,246,255,.12);
}

.timeline-head { display: flex; justify-content: space-between; font-size: 19px; }
.timeline-head strong { font-family: "Orbitron",sans-serif; font-size: 24px; }

.timeline-bar {
  height: 8px; margin: 10px 0 8px; border-radius: 999px;
  background: rgba(255,255,255,.06); overflow: hidden;
}

.timeline-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(100,255,216,.4), rgba(113,246,255,.85));
  box-shadow: 0 0 16px rgba(113,246,255,.35);
  transition: width .2s linear;
}

.timeline-labels {
  display: flex; justify-content: space-between;
  font-size: 17px; color: var(--text-dim);
}

/* 聚合 */
.aggregate-panel { display: grid; gap: 6px; }

.aggregate-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 15px; border-radius: 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(113,246,255,.08);
  font-size: 18px;
}

.aggregate-key { color: var(--text-dim); }
.aggregate-value {
  font-family: "Orbitron",sans-serif; color: var(--success);
  font-size: 21px; font-weight: 700;
}

/* 识别结果 */
.results-panel {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex; flex-direction: column; gap: 12px;
}

.results-panel .results-title {
  font-size: 20px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--accent); font-weight: 700;
}

.result-item {
  padding: 16px 18px; border-radius: 14px;
  background: rgba(113,246,255,.06);
  border: 1px solid rgba(113,246,255,.18);
  animation: result-pop .4s ease;
}

.result-item .result-camera {
  font-size: 20px; color: var(--accent);
  margin-bottom: 10px; font-weight: 600;
}

.result-item .result-rows { display: flex; flex-direction: column; gap: 5px; }

.result-item .result-row {
  display: flex; justify-content: space-between;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(255,255,255,.04);
  font-size: 20px;
}

.result-row .row-key { color: var(--text-dim); }
.result-row .row-val {
  font-family: "Orbitron",sans-serif;
  font-weight: 700; font-size: 21px;
}

/* ========== VIDEO STAGE ========== */
.stage-area { min-width: 0; min-height: 0; overflow: hidden; }
.stage-section { display: none; height: 100%; }
.stage-section.active { display: block; height: 100%; animation: fade-up .3s ease; }

.panel-grid {
  display: grid; grid-template-columns: repeat(2,1fr);
  grid-template-rows: repeat(2,1fr);
  gap: 8px; height: 100%;
}

.video-card {
  border-radius: 18px; padding: 14px;
  background: var(--panel-bg); border: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}

.video-head {
  display: flex; justify-content: space-between;
  align-items: center; flex-shrink: 0; margin-bottom: 10px;
}

.camera-tag { font-size: 16px; letter-spacing: .22em; color: var(--text-dim); }
.camera-name { font-size: 1.3vw; margin-top: 4px; font-weight: 700; }
.camera-state { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; }

.state-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 14px rgba(125,255,198,.6);
  animation: pulse 2s infinite;
}

.video-frame {
  position: relative; flex: 1; min-height: 0;
  border-radius: 16px; overflow: hidden;
  background: #03060d; border: 1px solid rgba(113,246,255,.12);
}

.video-frame video {
  width: 100%; height: 100%; display: block;
  object-fit: contain;
  will-change: transform; transform: translateZ(0);
}

.progress-track {
  height: 6px; margin-top: 10px; border-radius: 999px;
  background: rgba(255,255,255,.06); overflow: hidden; flex-shrink: 0;
}

.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(100,255,216,.4), rgba(113,246,255,.85));
  box-shadow: 0 0 12px rgba(113,246,255,.35);
  transition: width .2s linear;
}

/* ========== ANIM ========== */
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.7); opacity: .6; }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes result-pop {
  0% { transform: scale(.97); opacity: .5; }
  100% { transform: scale(1); opacity: 1; }
}

/* ========== RESPONSIVE ========== */

@media (min-width: 2400px) {
  .app-shell { max-width: 2400px; padding: 14px 28px 10px; gap: 10px; }
  .content-layout { grid-template-columns: 680px minmax(0,1fr); gap: 14px; }
  .hero-panel { padding: 28px 44px; }
  .brand-icon { width: 80px; height: 80px; }
  .panel-grid { gap: 12px; }
  .video-card { padding: 18px; }
  .intel-panel { padding: 24px; gap: 16px; }
}

@media (max-width: 1500px) {
  .content-layout { grid-template-columns: 460px minmax(0,1fr); }
  .app-shell { padding: 6px 8px 4px; gap: 4px; }
  .hero-panel { padding: 14px 20px; gap: 20px; }
  .brand-icon { width: 46px; height: 46px; }
  .hero-brand { gap: 12px; }
  .panel-grid { gap: 5px; }
  .video-card { padding: 10px; border-radius: 14px; }
}

@media (max-width: 900px) {
  .content-layout { grid-template-columns: 1fr; }
  .hero-panel { grid-template-columns: 1fr; }
  .command-panel { flex-direction: column; align-items: stretch; }
  .panel-grid { grid-template-columns: 1fr; }
  .intel-panel { display: none; }
}
