:root {
  --bg: #050a18;
  --panel-bg: rgba(13, 26, 51, 0.55);
  --panel-bg-solid: #0a1426;
  --border: rgba(25, 224, 255, 0.22);
  --border-strong: rgba(25, 224, 255, 0.55);
  --primary: #19e0ff;
  --primary-2: #2f80ff;
  --accent: #ffd166;
  --danger: #ff5c7c;
  --text: #dbeeff;
  --text-dim: #8fb0d6;
  --text-mute: #4f6f97;
  --glow: 0 0 14px rgba(25, 224, 255, 0.45);
  --font: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC", -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
}

/* 动态网格背景（铺满视口，letterbox 区也一致） */
body::before {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(rgba(25, 224, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(25, 224, 255, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  z-index: -2;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(900px 560px at 12% -8%, rgba(25, 224, 255, 0.16), transparent 60%),
    radial-gradient(820px 540px at 100% 4%, rgba(47, 128, 255, 0.16), transparent 58%),
    radial-gradient(700px 520px at 50% 120%, rgba(25, 224, 255, 0.10), transparent 60%);
  z-index: -1;
}

/* ===== 1920×1080 等比缩放舞台 ===== */
#screen-stage {
  position: absolute;
  width: 1920px;
  height: 1080px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--stage-scale, 1));
  transform-origin: center center;
  display: flex;
  flex-direction: column;
  padding: 16px 26px 14px;
  gap: 14px;
}

/* ===== 顶部标题栏 ===== */
.topbar {
  position: relative;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
}
.topbar-title { text-align: center; flex: 1; }
.topbar-title h1 {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 6px;
  background: linear-gradient(90deg, #7af0ff, #ffffff 50%, #7ab8ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 22px rgba(25, 224, 255, 0.35);
}
.topbar-title .subtitle {
  margin-top: 4px; font-size: 13px; letter-spacing: 5px; color: var(--text-mute);
}
.topbar-side { display: flex; align-items: center; gap: 16px; min-width: 360px; }
.topbar-side.right { justify-content: flex-end; }
.topbar-side .clock { font-size: 22px; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.topbar-side .bar-line {
  width: 200px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  box-shadow: 0 0 10px rgba(25, 224, 255, 0.4);
}
.topbar-side.left .bar-line { background: linear-gradient(270deg, transparent, var(--primary), transparent); }
.bar-meta { font-size: 14px; color: var(--text-dim); letter-spacing: 1px; }
.topbar .status { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-dim); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-mute); }
.dot.ok { background: #2bff88; box-shadow: 0 0 10px #2bff88; }
.dot.err { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.topbar-deco { position: absolute; bottom: 4px; width: 120px; height: 3px; }
.topbar-deco.l { left: 26px; background: linear-gradient(90deg, var(--primary), transparent); }
.topbar-deco.r { right: 26px; background: linear-gradient(270deg, var(--primary), transparent); }

/* ===== KPI 卡片行 ===== */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; height: 132px; flex: 0 0 auto; }
.kpi {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, rgba(16, 32, 62, 0.75), rgba(9, 18, 38, 0.55));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 22px;
  overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; right: -40px; top: -40px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(25, 224, 255, 0.18), transparent 70%);
}
.kpi-ic { width: 56px; height: 56px; border-radius: 13px; flex: 0 0 auto;
  background: #0a1830 center / 58% no-repeat;
  border: 1px solid rgba(25, 224, 255, 0.35);
  box-shadow: inset 0 0 16px rgba(25, 224, 255, 0.18), 0 0 12px rgba(25, 224, 255, 0.12); }
.ic-today { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2319e0ff' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E"); }
.ic-total { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2319e0ff' stroke-width='2'%3E%3Cpath d='M4 19V9M10 19V5M16 19v-7M22 19H2'/%3E%3C/svg%3E"); }
.ic-sys { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2319e0ff' stroke-width='2'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E"); }
.ic-user { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2319e0ff' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E"); }
.kpi-main { flex: 1 1 auto; }
.kpi-label { font-size: 15px; color: var(--text-dim); letter-spacing: 1px; }
.kpi-value { font-size: 46px; font-weight: 800; color: #fff; line-height: 1.1;
  font-variant-numeric: tabular-nums; text-shadow: 0 0 18px rgba(25, 224, 255, 0.45); }
.kpi-delta { position: absolute; bottom: 14px; right: 22px; font-size: 13px; color: var(--text-mute); }
.kpi-delta.up { color: #2bff88; }
.kpi-delta.down { color: var(--danger); }

/* ===== 主体三栏 ===== */
.main {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 41% 29.5% 29.5%;
  gap: 16px;
  min-height: 0;
}
.detail-panel { height: 230px; flex: 0 0 auto; }

/* ===== 通用面板 + 四角科技边框 ===== */
.panel {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px 10px;
  backdrop-filter: blur(2px);
  min-height: 0;
}
.corner { position: absolute; width: 14px; height: 14px; border: 2px solid var(--primary); opacity: 0.85; }
.corner.tl { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.corner.tr { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.corner.bl { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.corner.br { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.panel-hd {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px; flex: 0 0 auto;
  padding-bottom: 8px; border-bottom: 1px solid rgba(25, 224, 255, 0.14);
}
.panel-hd .hd-icon { color: var(--primary); font-size: 14px; text-shadow: var(--glow); }
.panel-hd .hd-title { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.panel-hd .hd-extra { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.panel-hd .hd-tag { font-size: 12px; color: var(--text-mute); border: 1px solid var(--border); border-radius: 4px; padding: 1px 8px; }

.panel-bd { flex: 1 1 auto; min-height: 0; position: relative; }
.chart { width: 100%; height: 100%; }

/* ===== 分段切换 ===== */
.seg-group { display: flex; gap: 6px; }
.seg {
  background: rgba(255,255,255,0.04); color: var(--text-dim);
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; padding: 4px 14px; cursor: pointer; font-family: var(--font);
}
.seg:hover { color: var(--text); }
.seg.active { color: #04121f; background: linear-gradient(var(--primary), var(--primary-2)); border-color: transparent; font-weight: 700; box-shadow: var(--glow); }

/* ===== 状态徽标 ===== */
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 11px; font-size: 13px; }
.status-pill.live { background: rgba(43,255,136,0.16); color: #2bff88; border: 1px solid rgba(43,255,136,0.4); }
.status-pill.idle { background: rgba(255,209,102,0.16); color: var(--accent); border: 1px solid rgba(255,209,102,0.4); }

/* ===== 明细表 ===== */
table.detail { width: 100%; border-collapse: collapse; font-size: 14px; }
table.detail th, table.detail td { padding: 7px 12px; text-align: left; }
table.detail thead th {
  color: var(--text-dim); font-weight: 600; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--panel-bg-solid); letter-spacing: 1px;
}
table.detail tbody tr { border-bottom: 1px solid rgba(255,255,255,0.04); }
table.detail tbody tr:hover { background: rgba(25,224,255,0.07); }
table.detail td.num { text-align: right; font-variant-numeric: tabular-nums; color: #fff; font-weight: 600; }
table.detail td.name { color: #fff; }

.search-box {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 4px 10px; font-size: 13px; width: 200px; outline: none;
}
.search-box::placeholder { color: var(--text-mute); }

/* ===== 加载遮罩 / 跑马灯 ===== */
.veil {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-mute); font-size: 14px; background: rgba(5,10,24,0.5); z-index: 5;
}
.map-legend {
  position: absolute; left: 14px; bottom: 10px; z-index: 6; display: flex; gap: 16px;
  font-size: 12px; color: var(--text-dim);
  background: rgba(5,12,26,0.55); padding: 5px 10px; border-radius: 6px;
  border: 1px solid rgba(25,224,255,0.18);
}
.map-legend .lg-item { display: inline-flex; align-items: center; gap: 6px; }
.map-legend .lg-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block;
  box-shadow: 0 0 6px currentColor; }
.hidden { display: none !important; }
.marquee { height: 0; overflow: hidden; transition: height .2s; }
.marquee.show { height: 32px; }
.marquee .track { display: inline-block; white-space: nowrap; padding-left: 100%;
  animation: scroll-left 26s linear infinite; font-size: 14px; color: var(--text-dim); line-height: 32px; }
.marquee .track b { color: var(--primary); }
@keyframes scroll-left { from { transform: translateX(0); } to { transform: translateX(-100%); } }
