:root {
  --bg-deep: #050d1f;
  --bg-base: #06122e;
  --bg-elev: #0a1a3a;
  --bg-card: rgba(10, 26, 58, 0.7);
  --bg-card-solid: #0e2148;
  --border-cyan: #00e5ff;
  --border-soft: rgba(0, 229, 255, 0.25);
  --border-line: rgba(120, 200, 255, 0.18);
  --text-primary: #e0f2fe;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-cyan: #00e5ff;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-orange: #f59e0b;
  --accent-red: #ef4444;
  --accent-purple: #a855f7;
  --grid-color: rgba(0, 229, 255, 0.06);
  --glow-cyan: 0 0 18px rgba(0, 229, 255, 0.45);
  --glow-soft: 0 0 30px rgba(59, 130, 246, 0.18);
  --font-display: "Orbitron", "Rajdhani", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-number: "DSEG7 Classic", "Orbitron", "DIN Alternate", "Roboto Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: radial-gradient(ellipse at top, #0a1f4a 0%, var(--bg-deep) 65%) fixed;
  position: relative;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 80%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 22%, rgba(0, 229, 255, 0.12) 0%, transparent 22%),
    radial-gradient(circle at 88% 18%, rgba(59, 130, 246, 0.16) 0%, transparent 25%),
    radial-gradient(circle at 18% 82%, rgba(168, 85, 247, 0.12) 0%, transparent 22%),
    radial-gradient(circle at 82% 88%, rgba(16, 185, 129, 0.10) 0%, transparent 22%);
  pointer-events: none;
  z-index: 0;
}
.scan-line {
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255,255,255,0.012) 0px,
    rgba(255,255,255,0.012) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 1;
}

.dashboard {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: 88px 36px 1fr;
  height: 100vh;
  width: 100vw;
  padding: 14px 18px 18px 18px;
  gap: 14px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: relative;
  height: 88px;
}
.topbar::before, .topbar::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 28%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
}
.topbar::before { left: 0; }
.topbar::after { right: 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-left: 6px;
}
.brand-logo {
  width: 46px;
  height: 46px;
  position: relative;
  display: grid;
  place-items: center;
}
.brand-logo svg { width: 100%; height: 100%; filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.6)); }
.brand-text { display: flex; flex-direction: column; }
.brand-text .title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #fff;
  font-family: var(--font-display);
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}
.brand-text .subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  letter-spacing: 6px;
  margin-top: 4px;
}

.title-center {
  position: relative;
  height: 88px;
  display: grid;
  place-items: center;
  padding: 0 40px;
}
.title-center h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #88e1ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
  font-family: var(--font-display);
  white-space: nowrap;
}
.title-deco {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 28px;
  pointer-events: none;
}
.title-deco.left { left: -10px; }
.title-deco.right { right: -10px; transform: translateY(-50%) scaleX(-1); }
.title-deco svg { width: 100%; height: 100%; }

.topbar-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
  padding-right: 6px;
}
.clock { display: flex; flex-direction: column; align-items: flex-end; }
.clock .time {
  font-family: var(--font-number);
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.4);
}
.clock .date {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
  letter-spacing: 2px;
}
.weather {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  font-size: 13px;
}

.marquee {
  position: relative;
  width: 60%;
  height: 36px;
  margin: 0 auto;
  display: flex;
  align-items: stretch;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.08), transparent);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  border-radius: 2px;
  overflow: hidden;
  z-index: 3;
}
.marquee-label {
  flex: 0 0 auto;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 12px;
  line-height: 1;
  color: #fff;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
  font-weight: 700;
  letter-spacing: 2px;
}
.marquee-track {
  flex: 1;
  height: 100%;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}
.marquee-text {
  position: absolute;
  white-space: nowrap;
  top: 0;
  left: 0;
  height: 100%;
  display: flex;
  align-items: center;
  font-size: 13px;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: 1px;
  animation: marquee 32s linear infinite;
}
.marquee-text span { color: var(--accent-cyan); font-weight: 600; margin: 0 16px; }
@keyframes marquee {
  from { left: 100%; }
  to { left: -100%; }
}

.main-area {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  grid-template-rows: 130px 1fr 160px;
  gap: 14px;
  min-height: 0;
}

.kpi-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.kpi-card {
  position: relative;
  display: flex;
  align-items: center;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(10, 26, 58, 0.85), rgba(14, 33, 72, 0.55));
  border: 1px solid var(--border-line);
  border-radius: 4px;
  overflow: hidden;
}
.kpi-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-cyan);
  box-shadow: 0 0 14px var(--accent-cyan);
}
.kpi-card.cyan::before { background: var(--accent-cyan); box-shadow: 0 0 14px var(--accent-cyan); }
.kpi-card.blue::before { background: var(--accent-blue); box-shadow: 0 0 14px var(--accent-blue); }
.kpi-card.green::before { background: var(--accent-green); box-shadow: 0 0 14px var(--accent-green); }
.kpi-card.orange::before { background: var(--accent-orange); box-shadow: 0 0 14px var(--accent-orange); }

.kpi-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  margin-right: 18px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid var(--border-soft);
  border-radius: 4px;
  flex-shrink: 0;
}
.kpi-card.blue .kpi-icon { background: rgba(59, 130, 246, 0.10); border-color: rgba(59, 130, 246, 0.4); }
.kpi-card.green .kpi-icon { background: rgba(16, 185, 129, 0.10); border-color: rgba(16, 185, 129, 0.4); }
.kpi-card.orange .kpi-icon { background: rgba(245, 158, 11, 0.10); border-color: rgba(245, 158, 11, 0.4); }
.kpi-icon svg { width: 30px; height: 30px; }

.kpi-content { flex: 1; min-width: 0; }
.kpi-label {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.kpi-value {
  font-family: var(--font-number);
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  gap: 6px;
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.4);
}
.kpi-value .unit { font-size: 14px; color: var(--text-secondary); font-family: var(--font-body); font-weight: 400; }
.kpi-trend {
  margin-top: 4px;
  font-size: 12px;
  color: var(--accent-cyan);
  letter-spacing: 1px;
}

.kpi-card::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  border-top: 2px solid var(--accent-cyan);
  border-right: 2px solid var(--accent-cyan);
  opacity: 0.6;
}
.kpi-card::before { content: ""; }
.kpi-card .corner-bl, .kpi-card .corner-br {
  position: absolute;
  bottom: 8px;
  width: 12px;
  height: 12px;
  opacity: 0.6;
}
.kpi-card .corner-bl { left: 8px; border-bottom: 2px solid var(--accent-cyan); border-left: 2px solid var(--accent-cyan); }
.kpi-card .corner-br { right: 8px; border-bottom: 2px solid var(--accent-cyan); border-right: 2px solid var(--accent-cyan); }

.panel {
  position: relative;
  background: linear-gradient(180deg, rgba(10, 26, 58, 0.85), rgba(6, 18, 46, 0.7));
  border: 1px solid var(--border-line);
  border-radius: 4px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel::before, .panel::after,
.panel .corner-tl, .panel .corner-tr,
.panel .corner-bl, .panel .corner-br {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent-cyan);
}
.panel::before { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.panel::after { top: -1px; right: -1px; border-top: 2px solid; border-right: 2px solid; }
.panel .corner-bl { bottom: -1px; left: -1px; border-bottom: 2px solid; border-left: 2px solid; }
.panel .corner-br { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  margin-bottom: 10px;
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
}
.panel-title::before {
  content: "";
  width: 4px;
  height: 16px;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-cyan);
}
.panel-title .en {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  font-weight: 400;
  font-family: var(--font-display);
  text-transform: uppercase;
}
.panel-action {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.panel-action .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.chart-host { flex: 1; min-height: 0; position: relative; }

.col-left { grid-row: 2 / 4; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.col-center { grid-row: 2 / 4; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.col-right { grid-row: 2 / 4; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.col-left > .panel, .col-center > .panel, .col-right > .panel { flex: 1; min-height: 0; }

.ranking-list { flex: 1; overflow: hidden; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.ranking-item {
  display: grid;
  grid-template-columns: 32px 1fr 90px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.04), transparent);
  border-left: 2px solid rgba(0, 229, 255, 0.3);
  font-size: 13px;
  position: relative;
  animation: slideIn 0.6s ease forwards;
  opacity: 0;
}
.ranking-item:nth-child(1) { border-left-color: var(--accent-cyan); }
.ranking-item:nth-child(2) { border-left-color: var(--accent-blue); }
.ranking-item:nth-child(3) { border-left-color: var(--accent-green); }
.ranking-item:nth-child(1) { animation-delay: 0.05s; }
.ranking-item:nth-child(2) { animation-delay: 0.1s; }
.ranking-item:nth-child(3) { animation-delay: 0.15s; }
.ranking-item:nth-child(4) { animation-delay: 0.2s; }
.ranking-item:nth-child(5) { animation-delay: 0.25s; }
.ranking-item:nth-child(6) { animation-delay: 0.3s; }
.ranking-item:nth-child(7) { animation-delay: 0.35s; }
.ranking-item:nth-child(8) { animation-delay: 0.4s; }
.ranking-item:nth-child(9) { animation-delay: 0.45s; }
.ranking-item:nth-child(10) { animation-delay: 0.5s; }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.rank-num {
  font-family: var(--font-number);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-align: center;
}
.ranking-item:nth-child(1) .rank-num { color: #ffd700; text-shadow: 0 0 8px rgba(255,215,0,0.6); }
.ranking-item:nth-child(2) .rank-num { color: #c0c0c0; text-shadow: 0 0 8px rgba(192,192,192,0.6); }
.ranking-item:nth-child(3) .rank-num { color: #cd7f32; text-shadow: 0 0 8px rgba(205,127,50,0.6); }
.rank-name { color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar-wrap { display: flex; align-items: center; gap: 6px; }
.rank-bar { flex: 1; height: 6px; background: rgba(0, 229, 255, 0.08); border-radius: 3px; overflow: hidden; position: relative; }
.rank-bar-fill { position: absolute; left: 0; top: 0; height: 100%; background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue)); box-shadow: 0 0 6px var(--accent-cyan); border-radius: 3px; transition: width 1.2s ease; }
.rank-amount { font-family: var(--font-number); font-size: 13px; color: var(--text-primary); white-space: nowrap; }

.summary-strip {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}
.summary-cell {
  position: relative;
  display: flex;
  align-items: center;
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.05), rgba(0, 229, 255, 0.0));
  border: 1px solid var(--border-line);
  border-radius: 4px;
  font-size: 13px;
  overflow: hidden;
}
.summary-cell::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent-cyan);
}
.summary-cell .lbl { color: var(--text-secondary); flex: 1; letter-spacing: 1px; }
.summary-cell .val { font-family: var(--font-number); color: #fff; font-size: 18px; font-weight: 700; }

.footer-strip {
  position: absolute;
  bottom: 4px;
  left: 18px;
  right: 18px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  pointer-events: none;
  z-index: 3;
}
.footer-strip .left, .footer-strip .right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-strip .pill {
  padding: 2px 10px;
  border: 1px solid var(--border-line);
  border-radius: 10px;
  color: var(--text-secondary);
}

@media (max-width: 1600px) {
  .kpi-value { font-size: 30px; }
  .title-center h1 { font-size: 28px; letter-spacing: 6px; }
}
@media (max-width: 1366px) {
  .dashboard { padding: 10px; }
  .title-center h1 { font-size: 22px; letter-spacing: 4px; }
  .kpi-value { font-size: 26px; }
  .kpi-icon { width: 48px; height: 48px; }
  .kpi-icon svg { width: 24px; height: 24px; }
}
