:root {
  --bg-deep: #020818;
  --bg-panel: rgba(6, 30, 60, 0.65);
  --cyan: #00e5ff;
  --cyan-dim: #00a8cc;
  --blue-glow: rgba(0, 180, 255, 0.45);
  --border-glow: rgba(0, 229, 255, 0.35);
  --text-dim: #7eb8d8;
  --accent-orange: #ff9f43;
  --accent-green: #00ff88;
}

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

html, body {
  width: 100%;
  min-height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-deep);
  color: #e8f4fc;
}

.bigscreen {
  position: relative;
  width: 100%;
  min-height: 100vh;
}

/* 嵌入侧栏系统内：不锁滚动、不撑出视口 */
body.bigscreen-mode:not(.demo-immersive),
body.supplier-bigscreen-mode:not(.demo-immersive) {
  overflow-x: hidden;
}
body.bigscreen-mode:not(.demo-immersive) .bigscreen-embed-wrap,
body.supplier-bigscreen-mode:not(.demo-immersive) .bigscreen-embed-wrap {
  overflow-x: hidden;
  overflow-y: auto;
}
body.bigscreen-mode .bigscreen-embed-wrap .bigscreen,
body.supplier-bigscreen-mode .bigscreen-embed-wrap .bigscreen {
  width: 100% !important;
  height: auto !important;
  min-height: calc(100vh - var(--header-height, 56px));
}
body.bigscreen-mode .bigscreen-embed-wrap .bg-layer,
body.supplier-bigscreen-mode .bigscreen-embed-wrap .bg-layer {
  position: absolute;
  inset: 0;
}

/* 全屏演示模式 */
body.demo-immersive { overflow: hidden !important; }
body.demo-immersive .bigscreen {
  width: 100vw;
  min-height: 100vh;
  height: 100vh;
}
body.demo-immersive .bigscreen-embed-wrap .bg-layer {
  position: fixed;
  inset: 0;
}

/* 背景 */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 45%, rgba(0, 100, 180, 0.25) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 20% 80%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
    linear-gradient(180deg, #020818 0%, #051228 50%, #020818 100%);
}
.grid-floor {
  position: absolute;
  bottom: 0;
  left: -20%;
  width: 140%;
  height: 45%;
  background:
    linear-gradient(transparent 0%, rgba(0, 180, 255, 0.03) 100%),
    repeating-linear-gradient(90deg, transparent, transparent 49px, rgba(0, 229, 255, 0.06) 49px, rgba(0, 229, 255, 0.06) 50px),
    repeating-linear-gradient(0deg, transparent, transparent 49px, rgba(0, 229, 255, 0.06) 49px, rgba(0, 229, 255, 0.06) 50px);
  transform: perspective(500px) rotateX(68deg);
  transform-origin: center bottom;
  animation: gridPulse 4s ease-in-out infinite;
}
@keyframes gridPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--cyan);
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  0% { transform: translateY(100vh); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-10vh); opacity: 0; }
}

.scan-line {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.35;
  animation: scan 6s linear infinite;
  pointer-events: none;
}
@keyframes scan {
  0% { top: 15%; }
  100% { top: 85%; }
}

/* 顶栏 */
.screen-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-glow);
  background: linear-gradient(180deg, rgba(0, 40, 80, 0.5) 0%, transparent 100%);
}
.screen-title {
  flex: 1;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 6px;
  background: linear-gradient(90deg, #fff, var(--cyan), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px var(--blue-glow);
  animation: titleGlow 3s ease-in-out infinite;
}
@keyframes titleGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}
.header-meta {
  font-size: 12px;
  color: var(--text-dim);
  min-width: 160px;
}
.header-meta.right { text-align: right; }
.btn-exit {
  margin-left: 12px;
  padding: 6px 14px;
  background: rgba(0, 229, 255, 0.15);
  border: 1px solid var(--border-glow);
  color: var(--cyan);
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-exit:hover { background: rgba(0, 229, 255, 0.3); }

/* KPI 六边形 */
.kpi-row {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 16px 24px 8px;
  flex-wrap: wrap;
}
.hex-card {
  position: relative;
  width: 140px;
  text-align: center;
  padding: 20px 12px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  clip-path: polygon(10% 0%, 90% 0%, 100% 50%, 90% 100%, 10% 100%, 0% 50%);
  box-shadow: 0 0 20px rgba(0, 180, 255, 0.15), inset 0 0 20px rgba(0, 229, 255, 0.05);
  animation: hexFloat 3s ease-in-out infinite;
}
.hex-card:nth-child(2) { animation-delay: 0.3s; }
.hex-card:nth-child(3) { animation-delay: 0.6s; }
.hex-card:nth-child(4) { animation-delay: 0.9s; }

.kpi-row-sub {
  margin-top: -8px;
  margin-bottom: 12px;
  gap: 12px;
}
.kpi-row-sub .hex-card.hex-sm {
  width: 120px;
  height: 72px;
  animation: none;
}
.kpi-row-sub .hex-label { font-size: 10px; }
.kpi-row-sub .hex-value { font-size: 16px; }

@keyframes hexFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.hex-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  clip-path: polygon(10% 0%, 90% 0%, 100% 50%, 90% 100%, 10% 100%, 0% 50%);
  background: linear-gradient(135deg, var(--cyan), transparent, var(--cyan-dim));
  z-index: -1;
  opacity: 0.4;
}
.hex-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.hex-value {
  font-size: 28px;
  font-weight: 800;
  font-family: "DIN Alternate", "Segoe UI", sans-serif;
  color: var(--cyan);
  text-shadow: 0 0 20px var(--blue-glow);
  line-height: 1.1;
}
.hex-sub {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
  opacity: 0.85;
}
.hex-unit { font-size: 14px; color: var(--text-dim); }

#sync-status { color: var(--accent-green); font-size: 11px; }

/* 三栏布局 */
.screen-body {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 300px 1fr 300px;
  gap: 12px;
  padding: 8px 16px 12px;
  min-height: 520px;
}

.screen-bottom {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 12px;
  padding: 0 16px 16px;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(0, 100, 200, 0.2), inset 0 1px 0 rgba(0, 229, 255, 0.1);
  overflow: hidden;
}
.panel-head {
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--cyan);
  border-bottom: 1px solid rgba(0, 229, 255, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-head::before {
  content: '';
  width: 4px;
  height: 14px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}
.panel-body { padding: 12px 14px; }

.col-left, .col-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.col-left .panel, .col-right .panel { flex: 0 0 auto; }
.col-center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}
.panel-scroll { max-height: 200px; overflow-y: auto; scrollbar-width: thin; }
.panel-scroll::-webkit-scrollbar { width: 3px; }
.panel-scroll::-webkit-scrollbar-thumb { background: rgba(0,229,255,0.3); }
.panel-hourly { flex-shrink: 0; }

.stat-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.mini-stat {
  padding: 8px 10px;
  background: rgba(0, 60, 100, 0.35);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 4px;
}
.mini-stat .lbl { display: block; font-size: 10px; color: var(--text-dim); margin-bottom: 2px; }
.mini-stat strong { font-size: 13px; color: var(--cyan); }

.chart-tall { height: 80px; }
.chart-caption { font-size: 10px; color: var(--text-dim); text-align: center; margin-top: 4px; }

/* 品类 */
.cat-row {
  display: grid;
  grid-template-columns: 56px 1fr 32px 48px;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
}
.cat-name { color: #cce8f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-bar-wrap { height: 6px; background: rgba(0,60,100,0.6); border-radius: 3px; overflow: hidden; }
.cat-bar { height: 100%; border-radius: 3px; animation: barGrow 1s ease-out forwards; transform-origin: left; }
.cat-pct { color: var(--text-dim); text-align: right; }
.cat-amt { color: var(--accent-orange); font-weight: 600; text-align: right; font-size: 10px; }

/* 支付 */
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.pay-cell {
  text-align: center;
  padding: 10px 6px;
  background: rgba(0, 60, 100, 0.4);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 4px;
}
.pay-cell.ok .pay-num { color: var(--accent-green); }
.pay-cell.warn .pay-num { color: var(--accent-orange); }
.pay-num { font-size: 18px; font-weight: 700; color: var(--cyan); }
.pay-lbl { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.pay-detail { font-size: 11px; margin-bottom: 8px; }
.pay-line { display: flex; justify-content: space-between; padding: 4px 0; color: var(--text-dim); }
.pay-line strong { color: #cce8f5; }
.split-progress { height: 4px; background: rgba(0,60,100,0.6); border-radius: 2px; overflow: hidden; }
.split-bar { height: 100%; background: linear-gradient(90deg, var(--cyan-dim), var(--accent-green)); border-radius: 2px; animation: barGrow 1.2s ease-out; }
.split-label { font-size: 10px; color: var(--text-dim); margin-top: 4px; text-align: right; }

/* 供应链 */
.supply-block { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px dashed rgba(0,229,255,0.15); }
.supply-block:last-child { border: none; margin: 0; padding: 0; }
.sup-title { font-size: 12px; font-weight: 600; color: var(--cyan); display: block; margin-bottom: 6px; }
.sup-row { display: flex; justify-content: space-between; font-size: 11px; padding: 3px 0; color: var(--text-dim); }
.sup-row strong { color: #cce8f5; }

/* 中心统计 */
.center-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px 0;
}
.cs-item {
  text-align: center;
  padding: 8px 4px;
  background: rgba(0, 40, 80, 0.5);
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: 4px;
  font-size: 11px;
}
.cs-item span { display: block; color: var(--text-dim); margin-bottom: 2px; }
.cs-item strong { color: var(--accent-green); font-size: 15px; }
.cs-item strong.up { color: var(--accent-green); }

/* 24h 分布 */
.hourly-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 56px;
}
.hour-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.hour-bar {
  width: 100%;
  max-width: 8px;
  background: linear-gradient(180deg, var(--cyan), rgba(0,100,180,0.2));
  border-radius: 1px 1px 0 0;
  min-height: 2px;
}
.hour-col.peak .hour-bar { background: linear-gradient(180deg, var(--accent-orange), rgba(255,159,67,0.3)); box-shadow: 0 0 6px rgba(255,159,67,0.4); }
.hour-col span { font-size: 8px; color: var(--text-dim); margin-top: 2px; min-height: 10px; }

.globe-label { font-size: 14px; font-weight: 700; color: var(--cyan); display: flex; align-items: center; justify-content: center; height: 100%; }

.map-dot.labeled {
  width: auto;
  height: auto;
  background: transparent;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.dot-pulse {
  width: 8px; height: 8px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--cyan);
  animation: dotBlink 2s ease-in-out infinite;
}
.dot-label {
  font-size: 9px;
  color: var(--cyan);
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(0,229,255,0.8);
  background: rgba(0,20,40,0.7);
  padding: 1px 4px;
  border-radius: 2px;
}

/* 底部 */
.order-ticker { overflow: hidden; height: 120px; mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.ticker-track { display: flex; flex-direction: column; gap: 6px; }
.ticker-track.animate { animation: tickerScroll 25s linear infinite; }
@keyframes tickerScroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}
.ticker-item {
  display: grid;
  grid-template-columns: 64px 56px 72px 64px 56px;
  gap: 8px;
  font-size: 11px;
  padding: 6px 8px;
  background: rgba(0, 50, 90, 0.4);
  border-radius: 3px;
  align-items: center;
}
.tk-time { color: var(--text-dim); font-family: monospace; }
.tk-user { color: #cce8f5; }
.tk-school { color: var(--text-dim); }
.tk-amt { color: var(--accent-orange); font-weight: 600; }
.tk-status { font-size: 10px; padding: 2px 6px; border-radius: 2px; text-align: center; }
.tk-status.ok { background: rgba(0,255,136,0.15); color: var(--accent-green); }
.tk-status.ship { background: rgba(0,229,255,0.15); color: var(--cyan); }
.tk-status.wait { background: rgba(255,159,67,0.15); color: var(--accent-orange); }
.tk-status.pend { background: rgba(100,116,139,0.2); color: #94a3b8; }

.bs-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.bs-table th { padding: 6px 4px; color: var(--text-dim); font-weight: 500; border-bottom: 1px solid rgba(0,229,255,0.15); text-align: left; }
.bs-table td { padding: 7px 4px; border-bottom: 1px solid rgba(0,229,255,0.06); color: #cce8f5; }
.bs-table .rank-no { width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 10px; }

.dual-legend { display: flex; gap: 16px; font-size: 10px; margin-bottom: 8px; }
.leg-sales { color: var(--cyan); }
.leg-profit { color: var(--accent-green); }
.dual-bars { display: flex; align-items: flex-end; gap: 6px; height: 72px; }
.dual-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dual-stack { display: flex; align-items: flex-end; gap: 2px; height: 60px; }
.dual-bar { width: 8px; border-radius: 2px 2px 0 0; animation: barUp 0.8s ease-out forwards; transform-origin: bottom; }
.dual-bar.sales { background: linear-gradient(180deg, var(--cyan), rgba(0,100,180,0.3)); }
.dual-bar.profit { background: linear-gradient(180deg, var(--accent-green), rgba(0,180,100,0.3)); }
.dual-col span { font-size: 9px; color: var(--text-dim); }

.return-boxes { display: flex; gap: 8px; }
.return-box { flex: 1; text-align: center; padding: 10px 6px; background: rgba(0, 60, 100, 0.4); border: 1px solid rgba(0, 229, 255, 0.2); border-radius: 4px; }
.return-box .num { font-size: 20px; font-weight: 700; color: var(--accent-orange); }
.return-box .lbl { font-size: 10px; color: var(--text-dim); margin-top: 2px; }

.map-stage {
  position: relative;
  width: 100%;
  min-height: 200px;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 排行条 */
.rank-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 12px;
}
.rank-no {
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  background: rgba(0, 229, 255, 0.2);
  border-radius: 2px;
  color: var(--cyan);
  font-weight: 700;
  font-size: 11px;
}
.rank-no.top { background: linear-gradient(135deg, #ff9f43, #ff6b35); color: #fff; }
.rank-name { flex: 1; color: #cce8f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(0, 60, 100, 0.6);
  border-radius: 3px;
  overflow: hidden;
}
.rank-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cyan-dim), var(--cyan));
  border-radius: 3px;
  animation: barGrow 1.5s ease-out forwards;
  transform-origin: left;
}
@keyframes barGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.rank-val { color: var(--accent-orange); font-weight: 600; min-width: 48px; text-align: right; }

.orbit-ring {
  position: absolute;
  border: 1px solid rgba(0, 229, 255, 0.25);
  border-radius: 50%;
  animation: rotateRing 20s linear infinite;
}
.orbit-ring.r1 { width: 280px; height: 280px; }
.orbit-ring.r2 { width: 200px; height: 200px; animation-duration: 15s; animation-direction: reverse; }
.orbit-ring.r3 { width: 120px; height: 120px; animation-duration: 10s; }
@keyframes rotateRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.globe-core {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(0, 229, 255, 0.4), rgba(0, 80, 150, 0.3));
  box-shadow: 0 0 40px var(--blue-glow), inset 0 0 30px rgba(0, 229, 255, 0.2);
  animation: corePulse 2s ease-in-out infinite;
}
@keyframes corePulse {
  0%, 100% { box-shadow: 0 0 40px var(--blue-glow); }
  50% { box-shadow: 0 0 60px rgba(0, 229, 255, 0.6); }
}

.map-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--cyan);
  animation: dotBlink 2s ease-in-out infinite;
}
@keyframes dotBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* 图表区 */
.chart-area {
  height: 100px;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding-top: 8px;
}
.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.chart-bar-col .bar {
  width: 100%;
  max-width: 24px;
  background: linear-gradient(180deg, var(--cyan), rgba(0, 100, 180, 0.3));
  border-radius: 2px 2px 0 0;
  box-shadow: 0 0 8px var(--blue-glow);
  animation: barUp 1s ease-out forwards;
  transform-origin: bottom;
}
@keyframes barUp {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
.chart-bar-col span { font-size: 10px; color: var(--text-dim); }

.area-chart {
  height: 90px;
  width: 100%;
}
.area-chart svg { width: 100%; height: 100%; }

/* 环形进度 */
.gauge-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}
.gauge {
  width: 72px;
  height: 72px;
  position: relative;
}
.gauge svg { transform: rotate(-90deg); }
.gauge-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--cyan);
}
.gauge-info { font-size: 12px; color: var(--text-dim); line-height: 1.6; }
.gauge-info strong { color: var(--accent-green); }

.stat-mini {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
}
.stat-mini .val { color: var(--cyan); font-weight: 600; }

@media (max-width: 1200px) {
  .screen-body, .screen-bottom { grid-template-columns: 1fr; }
  .col-center { min-height: 240px; }
  html, body { overflow: auto; }
  .bigscreen { min-height: 100vh; height: auto; }
}
