:root {
        --bg-1: #060b1d;
        --bg-2: #0a1432;
        --panel: rgba(17, 28, 62, 0.72);
        --panel-2: rgba(12, 22, 52, 0.55);
        --line: rgba(66, 140, 255, 0.28);
        --ink: #e7efff;
        --sub: #9cb7ea;
        --title: #d9e7ff;
        --accent: #2ce8ff;
        --brand: #4b8cff;
        --good: #34e395;
        --warn: #ffd166;
        --bad: #ff6b6b;
        --glow: 0 0 22px rgba(44, 232, 255, 0.14);
    }

    body.theme-light {
        --bg-1: #eaeef5;
        --bg-2: #f6f8fb;
        --panel: #ffffff;
        --panel-2: #f7f9fc;
        --line: #e2e6ee;
        --ink: #1f2733;
        --sub: #6b7686;
        --title: #26303d;
        --accent: #2563a8;
        --brand: #3b6fb6;
        --good: #2f9e6e;
        --warn: #e0922f;
        --bad: #d05a4f;
        --glow: 0 4px 16px rgba(31, 39, 51, 0.06);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }

    html, body { width: 100%; height: 100%; }

    body {
        font-family: "Microsoft YaHei UI", "Microsoft YaHei", "微软雅黑", "PingFang SC", sans-serif;
        background:
            radial-gradient(circle at 14% 18%, rgba(44, 232, 255, 0.13), transparent 32%),
            radial-gradient(circle at 86% 14%, rgba(75, 140, 255, 0.18), transparent 30%),
            radial-gradient(circle at 50% 88%, rgba(52, 227, 149, 0.10), transparent 32%),
            linear-gradient(145deg, var(--bg-1) 0%, var(--bg-2) 100%);
        color: var(--ink);
        overflow: hidden;
        -webkit-font-smoothing: antialiased;
    }

    body.theme-light {
        background: linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 60%);
    }

    .screen-fit {
        position: fixed;
        left: 50%;
        top: 50%;
        width: 1920px;
        height: 1080px;
        transform: translate(-50%, -50%) scale(1);
        transform-origin: center center;
    }

    .screen {
        width: 100%;
        height: 100%;
        padding: 14px 22px 10px;
        display: grid;
        grid-template-rows: auto auto auto minmax(0, 1fr) auto;
        gap: 10px;
    }

    /* ---------- 顶栏 ---------- */
    .header {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        height: 62px;
    }

    .header-left { display: flex; align-items: center; gap: 14px; }

    .logo-card {
        width: 210px;
        height: 52px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
        flex: none;
    }

    .logo-card img { width: 100%; height: 100%; object-fit: contain; }

    .header-left-text { font-size: 12.5px; color: var(--sub); line-height: 1.5; }

    .title-box { text-align: center; }

    .title {
        font-size: 32px;
        font-weight: 700;
        letter-spacing: 2px;
        text-shadow: 0 0 18px rgba(44, 232, 255, 0.32);
    }

    body.theme-light .title { text-shadow: none; }

    .subtitle { color: var(--sub); font-size: 12.5px; margin-top: 3px; letter-spacing: 1px; }

    .header-right { text-align: right; font-size: 12.5px; color: var(--sub); line-height: 1.6; }
    .header-right .clock { font-size: 20px; font-weight: 600; color: var(--ink); letter-spacing: 1px; }

    /* ---------- 场景条 ---------- */
    .scene-bar {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        gap: 16px;
        height: 40px;
        background: var(--panel-2);
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 0 12px;
    }

    .scene-id { display: flex; align-items: baseline; gap: 9px; white-space: nowrap; }
    .scene-id .dot {
        width: 8px; height: 8px; border-radius: 50%;
        background: var(--accent); box-shadow: 0 0 10px var(--accent);
        align-self: center;
    }
    .scene-id b { font-size: 19px; font-weight: 700; color: var(--title); letter-spacing: 1px; }
    .scene-id em { font-style: normal; font-size: 12px; color: var(--sub); }

    .scene-nav { display: flex; gap: 6px; justify-content: center; overflow: hidden; }
    .scene-nav button {
        appearance: none;
        border: 1px solid transparent;
        background: transparent;
        color: var(--sub);
        font-family: inherit;
        font-size: 12.5px;
        padding: 4px 11px;
        border-radius: 14px;
        cursor: pointer;
        white-space: nowrap;
        transition: all 200ms ease;
    }
    .scene-nav button:hover { color: var(--ink); border-color: var(--line); }
    .scene-nav button.on {
        color: #fff;
        background: linear-gradient(120deg, var(--brand), var(--accent));
        border-color: transparent;
        font-weight: 600;
    }
    body.theme-light .scene-nav button.on { color: #fff; }

    .scene-tools { display: flex; align-items: center; gap: 8px; }
    .tbtn {
        appearance: none;
        border: 1px solid var(--line);
        background: transparent;
        color: var(--sub);
        font-family: inherit;
        font-size: 12px;
        height: 24px;
        min-width: 26px;
        padding: 0 8px;
        border-radius: 6px;
        cursor: pointer;
    }
    .tbtn:hover { color: var(--ink); border-color: var(--accent); }
    .cd-wrap { width: 70px; height: 4px; background: var(--line); border-radius: 3px; overflow: hidden; }
    .cd-bar { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width 900ms linear; }
    .cd-text { font-size: 12px; color: var(--sub); width: 30px; text-align: right; }

    /* ---------- KPI ---------- */
    .kpi-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }

    .kpi {
        position: relative;
        overflow: hidden;
        padding: 9px 12px 10px;
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 10px;
        box-shadow: var(--glow);
        animation: itemIn 460ms cubic-bezier(.2, .75, .2, 1) both;
    }
    .kpi i.bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
    .kpi.tone-good i.bar { background: var(--good); }
    .kpi.tone-warn i.bar { background: var(--warn); }
    .kpi.tone-bad i.bar { background: var(--bad); }
    .kpi .t { font-size: 12px; color: var(--sub); }
    .kpi .v { font-size: 25px; font-weight: 700; line-height: 1.15; margin-top: 3px; white-space: nowrap; }
    .kpi .v small { font-size: 12px; font-weight: 500; color: var(--sub); margin-left: 3px; }
    .kpi .x { font-size: 11.5px; color: var(--sub); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .kpi.tone-good .v { color: var(--good); }
    .kpi.tone-warn .v { color: var(--warn); }
    .kpi.tone-bad .v { color: var(--bad); }

    /* ---------- 面板栅格 ---------- */
    .grid {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
        grid-auto-rows: minmax(0, 1fr);
        gap: 10px;
        min-height: 0;
    }

    .panel {
        position: relative;
        min-height: 0;
        overflow: hidden;
        background: var(--panel);
        border: 1px solid var(--line);
        border-radius: 12px;
        box-shadow: var(--glow);
        animation: itemIn 520ms cubic-bezier(.2, .75, .2, 1) both;
    }

    .panel::after {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        border-radius: 12px;
        box-shadow: inset 0 0 26px rgba(44, 232, 255, 0.07);
    }
    body.theme-light .panel::after { box-shadow: none; }

    .panel-head { padding: 9px 12px 0; }
    .panel-title {
        font-size: 15px;
        font-weight: 600;
        color: var(--title);
        display: flex;
        align-items: center;
        gap: 7px;
    }
    .panel-title::before {
        content: "";
        width: 3px;
        height: 13px;
        border-radius: 2px;
        background: linear-gradient(180deg, var(--accent), var(--brand));
    }
    .panel-cap {
        font-size: 11.5px;
        color: var(--sub);
        margin: 3px 0 0 10px;
        height: 15px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .panel-body { height: calc(100% - 47px); display: flex; flex-direction: column; }
    .panel-body.split { gap: 2px; }
    .mini { flex: 1; min-height: 0; display: flex; flex-direction: column; }
    .mini-t { font-size: 11.5px; color: var(--sub); padding: 0 12px; }
    .chart { flex: 1; min-height: 0; width: 100%; }

    .fatal { padding: 40px; color: var(--bad); font-size: 16px; grid-column: span 12; }

    /* ---------- 底栏 ---------- */
    .footer {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        font-size: 12px;
        color: var(--sub);
        height: 52px;
    }
    .footer-power {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        height: 44px;
        padding: 0;
        background: none;
        box-shadow: none;
        width: max-content;
    }
    .footer-power img {
        height: 36px;
        width: auto;
        object-fit: contain;
        filter: brightness(0) invert(1);
        opacity: 0.95;
    }
    .footer-power-txt {
        font-size: 13px;
        color: #fff;
        letter-spacing: 0.2px;
        white-space: nowrap;
    }
    .footer-power-txt b {
        color: #fff;
        font-size: 13.5px;
        font-weight: 700;
        letter-spacing: 0.2px;
    }
    body.theme-light .footer-power img { filter: none; opacity: 0.9; }
    body.theme-light .footer-power-txt,
    body.theme-light .footer-power-txt b { color: #1f2733; }
    .footer .keys { justify-self: center; }
    .footer .keys span { border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; margin-right: 4px; }
    .footer #footRight { justify-self: end; text-align: right; }

    @keyframes itemIn {
        0% { opacity: 0; transform: translateY(10px); }
        100% { opacity: 1; transform: translateY(0); }
    }

    @media (prefers-reduced-motion: reduce) {
        .kpi, .panel { animation: none; }
    }