/* ============================================
   亚视云 · 全国CDN智能云网 · AI算力中枢
   运营指挥大屏 - 科技感暗黑主题
   ============================================ */

:root {
    --bg-primary: #060a14;
    --bg-secondary: #0a1020;
    --bg-card: rgba(8, 16, 38, 0.88);
    --border-color: rgba(0, 180, 255, 0.12);
    --border-glow: rgba(0, 180, 255, 0.45);
    --cyan: #00c3ff;
    --cyan-dim: rgba(0, 195, 255, 0.25);
    --blue: #1a6dff;
    --blue-bright: #4d9aff;
    --purple: #8b5cf6;
    --green: #00e676;
    --orange: #ff9100;
    --red: #ff3d71;
    --yellow: #ffd600;
    --gold: #ffc107;
    --gold-bright: #ffe082;
    --text-primary: #e8edf5;
    --text-secondary: #7a8ba7;
    --text-dim: #4a5568;
    --font-tech: 'Orbitron', monospace;
    --font-body: 'Noto Sans SC', 'Rajdhani', sans-serif;
    --font-num: 'Rajdhani', 'Orbitron', monospace;
    --glow-cyan: 0 0 15px rgba(0, 195, 255, 0.3);
    --glow-gold: 0 0 15px rgba(255, 193, 7, 0.3);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    width: 100%; height: 100%; overflow: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

#particleBg { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.scanline {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,195,255,0.006) 2px, rgba(0,195,255,0.006) 4px);
    pointer-events: none; z-index: 1000;
}

/* === Dashboard === */
.dashboard { position: relative; width: 100%; height: 100vh; display: flex; flex-direction: column; z-index: 1; padding: 6px 10px; gap: 5px; }

/* === Header === */
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 16px; height: 54px; flex-shrink: 0;
    background: linear-gradient(180deg, rgba(0,180,255,0.06) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
    position: relative;
}
.header::after { content: ''; position: absolute; bottom: 0; left: 5%; right: 5%; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); }

.brand-logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; font-size: 18px;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    color: #fff; box-shadow: var(--glow-cyan);
}
.brand-name { font-size: 20px; font-weight: 900; background: linear-gradient(135deg, var(--cyan), #fff); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; letter-spacing: 3px; }
.brand-sub { display: block; font-family: var(--font-tech); font-size: 8px; letter-spacing: 2px; color: var(--text-secondary); opacity: .6; }
.logo-text { display: flex; flex-direction: column; }

.header-center { text-align: center; flex: 1; }
.main-title { font-size: 17px; font-weight: 700; letter-spacing: 3px; margin-bottom: 1px; }
.title-glow { background: linear-gradient(135deg, var(--cyan), var(--blue-bright), var(--purple)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; filter: drop-shadow(0 0 8px rgba(0,195,255,0.3)); }
.title-dot { color: var(--cyan); margin: 0 6px; animation: pulse 1.5s ease-in-out infinite; }
.header-time { font-family: var(--font-tech); font-size: 11px; color: var(--text-secondary); display: flex; align-items: center; justify-content: center; gap: 8px; }
.status-badge { font-size: 9px; padding: 2px 8px; border-radius: 10px; letter-spacing: .5px; }
.status-badge.online { background: rgba(0,230,118,.12); color: var(--green); border: 1px solid rgba(0,230,118,.25); }
.status-badge.revenue { background: rgba(255,193,7,.1); color: var(--gold); border: 1px solid rgba(255,193,7,.2); }

.header-right { min-width: 200px; text-align: right; }
.header-revenue { display: flex; gap: 16px; align-items: center; }
.rev-label { display: block; font-size: 9px; color: var(--text-dim); letter-spacing: .5px; }
.rev-value { font-family: var(--font-num); font-size: 18px; font-weight: 700; color: var(--cyan); }
.rev-value.gold { color: var(--gold-bright); text-shadow: 0 0 12px rgba(255,193,7,.4); }

/* === KPI Bar === */
.kpi-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; flex-shrink: 0; }
.kpi-item {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px;
    padding: 8px 10px; display: flex; align-items: center; gap: 8px;
    transition: all .3s ease; position: relative; overflow: hidden;
}
.kpi-item::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: .4; }
.kpi-item:hover { border-color: var(--border-glow); box-shadow: var(--glow-cyan); }
.kpi-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: rgba(0,195,255,.08); color: var(--cyan); font-size: 14px; flex-shrink: 0; }
.kpi-icon.revenue-icon { background: rgba(255,193,7,.1); color: var(--gold); }
.kpi-value { font-family: var(--font-num); font-size: 18px; font-weight: 700; color: #fff; line-height: 1.1; }
.kpi-value.gold { color: var(--gold-bright); text-shadow: 0 0 10px rgba(255,193,7,.3); }
.kpi-label { font-size: 10px; color: var(--text-secondary); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-trend { font-family: var(--font-tech); font-size: 10px; padding: 2px 6px; border-radius: 3px; white-space: nowrap; flex-shrink: 0; }
.kpi-trend.up { background: rgba(0,230,118,.1); color: var(--green); }
.kpi-trend.down { background: rgba(0,195,255,.1); color: var(--cyan); }
.kpi-trend.stable { background: rgba(0,230,118,.1); color: var(--green); }

/* === Main Content - 地图放大 === */
.main-content { flex: 1; display: grid; grid-template-columns: 235px 1fr 265px; gap: 5px; min-height: 0; overflow: hidden; }

/* === Panel Cards === */
.panel-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.panel-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan-dim), transparent); }
.panel-title { padding: 6px 10px; font-size: 12px; font-weight: 600; color: var(--cyan); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 6px; flex-shrink: 0; letter-spacing: .3px; }
.panel-title i { font-size: 11px; opacity: .8; }
.panel-badge { margin-left: auto; font-family: var(--font-tech); font-size: 8px; padding: 2px 6px; border-radius: 3px; background: rgba(0,195,255,.08); color: var(--text-secondary); letter-spacing: 1px; }
.panel-badge.live { background: rgba(255,61,113,.12); color: var(--red); animation: pulse 2s ease-in-out infinite; }
.panel-body { flex: 1; padding: 6px; overflow: hidden; min-height: 0; }

/* === Left Panel === */
.panel-left { display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.panel-left .panel-card:nth-child(1) { flex: 1.3; }
.panel-left .panel-card:nth-child(2) { flex: 1.1; }
.panel-left .panel-card:nth-child(3) { flex: 0.8; }

/* === Center - Map BIGGER === */
.panel-center { display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.map-card { flex: 4; position: relative; }
.map-body { padding: 0 !important; }
.throughput-card { flex: 0.8; }
.map-overlay-stats {
    position: absolute; bottom: 42px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 18px; background: rgba(6,10,20,.88); border: 1px solid var(--border-color);
    border-radius: 6px; padding: 6px 16px; z-index: 10;
}
.map-stat { text-align: center; }
.map-stat-val { font-family: var(--font-num); font-size: 16px; font-weight: 700; color: var(--cyan); display: block; }
.map-stat-val.gold { color: var(--gold-bright); }
.map-stat-label { font-size: 9px; color: var(--text-secondary); }
.revenue-stat { border-left: 1px solid var(--border-color); padding-left: 18px; }

.map-bottom-bar { display: flex; align-items: center; padding: 4px 8px; border-top: 1px solid var(--border-color); flex-shrink: 0; }
.node-health-mini { display: flex; align-items: center; gap: 6px; width: 100%; }
.mini-label { font-size: 9px; color: var(--text-secondary); white-space: nowrap; display: flex; align-items: center; gap: 4px; }
.mini-label i { font-size: 8px; color: var(--cyan); }
.health-grid-mini { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.health-cell { width: 12px; height: 12px; border-radius: 2px; cursor: pointer; transition: all .3s; position: relative; flex-shrink: 0; }
.health-cell:hover { transform: scale(1.6); z-index: 10; }
.health-cell.optimal { background: rgba(0,195,255,.5); box-shadow: 0 0 4px rgba(0,195,255,.3); }
.health-cell.healthy { background: rgba(0,230,118,.45); }
.health-cell.warning { background: rgba(255,145,0,.5); animation: pulse 2s infinite; }
.health-cell.critical { background: rgba(255,61,113,.6); animation: pulse 1s infinite; }
.health-cell::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: rgba(6,10,20,.95); border: 1px solid var(--border-glow); border-radius: 3px; padding: 2px 6px; font-size: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 100; }
.health-cell:hover::after { opacity: 1; }

/* === Right Panel === */
.panel-right { display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.panel-right .panel-card:nth-child(1) { flex: 1.2; }
.panel-right .panel-card:nth-child(2) { flex: 1; }
.panel-right .panel-card:nth-child(3) { flex: 1; }

/* === AI Panel === */
.ai-panel { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.ai-section { padding: 2px 0; }
.ai-section-title { font-size: 10px; color: var(--text-secondary); margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.ai-section-title i { color: var(--cyan); font-size: 9px; }

.gpu-clusters { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.gpu-cluster { background: rgba(0,195,255,.03); border: 1px solid rgba(0,195,255,.08); border-radius: 4px; padding: 6px; }
.gpu-cluster-name { font-size: 9px; color: var(--text-secondary); font-family: var(--font-tech); letter-spacing: .3px; margin-bottom: 3px; }
.gpu-bar-bg { height: 5px; background: rgba(255,255,255,.04); border-radius: 3px; overflow: hidden; margin-bottom: 2px; }
.gpu-bar-fill { height: 100%; border-radius: 3px; transition: width .8s ease; }
.gpu-bar-fill.high { background: linear-gradient(90deg, var(--red), var(--orange)); }
.gpu-bar-fill.medium { background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.gpu-bar-fill.normal { background: linear-gradient(90deg, var(--cyan), var(--green)); }
.gpu-stats { display: flex; justify-content: space-between; font-size: 8px; color: var(--text-dim); font-family: var(--font-tech); }
.gpu-stat-val { color: var(--cyan); }

.model-schedule { display: flex; flex-direction: column; gap: 3px; }
.model-item { display: flex; align-items: center; gap: 6px; padding: 4px 6px; background: rgba(0,195,255,.02); border-radius: 3px; font-size: 10px; }
.model-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.model-dot.active { background: var(--green); box-shadow: 0 0 5px var(--green); }
.model-dot.loading { background: var(--yellow); animation: pulse 1s infinite; }
.model-dot.idle { background: var(--text-dim); }
.model-name { flex: 1; color: var(--text-primary); font-size: 9px; }
.model-qps { font-family: var(--font-tech); color: var(--cyan); font-size: 9px; }
.model-gpu { font-size: 8px; color: var(--text-dim); }

/* === Agent Panel === */
.agent-panel { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.agent-section { padding: 2px 0; flex: 1; min-height: 0; }
.agent-log-stream { height: 80px; overflow: hidden; font-family: 'Courier New', monospace; font-size: 9px; line-height: 1.5; position: relative; }
.agent-log-item { display: flex; gap: 4px; padding: 1px 0; opacity: 0; animation: logSlideIn .3s ease forwards; }
.agent-log-time { color: var(--text-dim); white-space: nowrap; }
.agent-log-agent { color: var(--purple); }
.agent-log-action { color: var(--green); }
.agent-log-error { color: var(--red); }

/* === Video Panel === */
.video-panel { padding: 4px !important; }
.video-grid { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; height: 100%; }
.video-cell { position: relative; border-radius: 3px; overflow: hidden; border: 1px solid rgba(0,195,255,.1); background: #000; }
.video-feed { width: 100%; height: 100%; position: relative; }
.video-feed canvas { width: 100%; height: 100%; display: block; }
.video-info { position: absolute; bottom: 0; left: 0; right: 0; padding: 2px 5px; background: linear-gradient(transparent, rgba(0,0,0,.85)); display: flex; justify-content: space-between; align-items: center; }
.cam-name { font-size: 8px; color: rgba(255,255,255,.7); }
.cam-status { font-size: 7px; font-family: var(--font-tech); }
.cam-status.online { color: var(--red); animation: blink 1s infinite; }

/* === Agent Revenue List - Ultra Compact === */
.agent-revenue-item {
    display: flex; align-items: center; padding: 2px 4px; border-radius: 2px;
    margin-bottom: 1px; background: rgba(0,195,255,.02); transition: background .3s;
    font-family: var(--font-num); line-height: 1.2;
}
.agent-revenue-item:hover { background: rgba(0,195,255,.08); }
.agent-rank { font-family: var(--font-tech); font-size: 9px; width: 14px; text-align: center; flex-shrink: 0; color: var(--text-dim); }
.agent-rank.top1 { color: var(--gold); font-weight: 700; }
.agent-rank.top2 { color: #c0c0c0; font-weight: 600; }
.agent-rank.top3 { color: #cd7f32; font-weight: 600; }
.agent-code { font-family: var(--font-tech); font-size: 9px; color: var(--cyan); width: 34px; flex-shrink: 0; letter-spacing: .5px; }
.agent-meta { font-size: 8px; color: var(--text-dim); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-trend { font-size: 8px; width: 32px; text-align: right; flex-shrink: 0; }
.agent-trend.up { color: var(--green); }
.agent-rev { font-family: var(--font-num); font-size: 11px; font-weight: 700; color: var(--gold-bright); text-align: right; min-width: 58px; flex-shrink: 0; }
.agent-rev-bar { width: 30px; height: 3px; background: rgba(255,255,255,.04); border-radius: 2px; overflow: hidden; margin-left: 3px; flex-shrink: 0; }
.agent-rev-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--gold), var(--orange)); }

/* === Client Usage List - Ultra Compact === */
.client-usage-item {
    display: flex; align-items: center; padding: 2px 4px; margin-bottom: 1px;
    border-radius: 2px; background: rgba(0,195,255,.02);
    font-family: var(--font-num); line-height: 1.2;
}
.client-usage-item:hover { background: rgba(0,195,255,.08); }
.client-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.client-code { font-family: var(--font-tech); font-size: 9px; color: var(--text-primary); width: 34px; flex-shrink: 0; margin-left: 4px; letter-spacing: .5px; }
.client-tb { font-size: 8px; color: var(--text-dim); width: 42px; flex-shrink: 0; text-align: right; }
.client-cost { font-family: var(--font-num); font-size: 11px; font-weight: 700; color: var(--cyan); text-align: right; min-width: 58px; flex-shrink: 0; }
.client-bar { width: 28px; height: 3px; background: rgba(255,255,255,.04); border-radius: 2px; overflow: hidden; margin-left: 3px; flex-shrink: 0; }
.client-bar-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--cyan), var(--purple)); }

/* === Log Stream === */
.log-stream { height: 100%; overflow: hidden; font-family: 'Courier New', monospace; font-size: 9px; line-height: 1.5; }
.log-item { padding: 1px 0; opacity: 0; animation: logSlideIn .3s ease forwards; }
.log-time { color: var(--text-dim); }
.log-level-info { color: var(--cyan); }
.log-level-warn { color: var(--yellow); }
.log-level-error { color: var(--red); }
.log-level-ok { color: var(--green); }
.log-level-revenue { color: var(--gold); }
.log-msg { color: var(--text-secondary); }

/* === Animations === */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes logSlideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dataFlash { 0% { color: #fff; text-shadow: 0 0 10px var(--cyan); } 100% { color: inherit; text-shadow: none; } }
@keyframes revenueFlash { 0% { color: #fff; text-shadow: 0 0 12px var(--gold); } 100% { color: var(--gold-bright); text-shadow: 0 0 5px rgba(255,193,7,.2); } }
.value-flash { animation: dataFlash .5s ease; }
.revenue-flash { animation: revenueFlash .6s ease; }

/* === Scrollbar === */
::-webkit-scrollbar { width: 2px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cyan-dim); border-radius: 2px; }

/* === Responsive === */
@media (max-width: 1600px) {
    .main-content { grid-template-columns: 210px 1fr 240px; }
    .main-title { font-size: 15px; }
    .kpi-value { font-size: 16px; }
}
