:root {
    --sidebar-width: 168px;
    --topbar-height: 64px;
    --surface-bg: #0f233b;
    --card-bg: #152f4d;
    --line-color: rgba(98, 179, 255, 0.24);
    --accent: #4ad4ff;
    --accent-soft: rgba(74, 212, 255, 0.16);
    --accent-ai: #7f9fff;
    --accent-algo: #55e3ff;
    --accent-hot: #95a8ff;
    --accent-game: #55e3ff;
    --glow-cyan: rgba(74, 212, 255, 0.46);
    --glow-purple: rgba(127, 159, 255, 0.36);
    --glow-hot: rgba(85, 227, 255, 0.24);
    --text-main: #e8f3ff;
    --text-soft: #9fb8d6;
    --text-dim: #87a4c6;
    --text-disabled: #6f89a8;
    --table-muted: #a9c0db;
    --input-bg: #0b1d33;
    --topbar-grad-start: #132b48;
    --topbar-grad-end: #0f1f37;
    --sidebar-grad-start: #15304f;
    --sidebar-grad-mid: #112842;
    --sidebar-grad-end: #0b1c31;
    --bg-base: #091729;
    --bg-grad-start: #0c1f36;
    --bg-grad-end: #091729;
    --bg-glow-a: rgba(74, 212, 255, 0.18);
    --bg-glow-b: rgba(127, 159, 255, 0.16);
    --bg-glow-c: rgba(85, 227, 255, 0.1);
    --grid-line: rgba(98, 220, 255, 0.08);
    --grid-dot: rgba(255, 255, 255, 0.06);
    --topbar-line-glow-a: rgba(74, 212, 255, 0.92);
    --topbar-line-glow-b: rgba(127, 159, 255, 0.86);
    --topbar-line-glow-c: rgba(74, 212, 255, 0.7);
}

/* ==================== 全局模态框遮罩样式 ==================== */
/* Bootstrap 模态框遮罩 - 统一深色透明背景 */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.6) !important;
}

.modal-backdrop.show {
    opacity: 1 !important;
}

/* 确保模态框内容有阴影 */
.modal-content {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
}

body {
    padding-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    transition: padding-left 0.2s ease;
    background: radial-gradient(120% 100% at 8% 0%, color-mix(in srgb, var(--bg-glow-a) 80%, transparent) 0%, rgba(0, 0, 0, 0) 46%), radial-gradient(100% 90% at 92% 0%, color-mix(in srgb, var(--bg-glow-b) 80%, transparent) 0%, rgba(0, 0, 0, 0) 50%), radial-gradient(95% 85% at 50% 110%, color-mix(in srgb, var(--bg-glow-c) 75%, transparent) 0%, rgba(0, 0, 0, 0) 56%), var(--bg-base);
}

body.no-sidebar {
    padding-left: 0;
}

#onlineDeviceView,
#platformView,
.day-matrix-list,
.device-chart-stack,
.info-panel {
    scrollbar-width: thin;
}

#onlineDeviceView::-webkit-scrollbar,
#platformView::-webkit-scrollbar,
.day-matrix-list::-webkit-scrollbar,
.device-chart-stack::-webkit-scrollbar,
.info-panel::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}

#onlineDeviceView::-webkit-scrollbar-thumb,
#platformView::-webkit-scrollbar-thumb,
.day-matrix-list::-webkit-scrollbar-thumb,
.device-chart-stack::-webkit-scrollbar-thumb,
.info-panel::-webkit-scrollbar-thumb {
    background: rgba(135, 185, 255, 0.22);
    border-radius: 999px;
}

#onlineDeviceView::-webkit-scrollbar-track,
#platformView::-webkit-scrollbar-track,
.day-matrix-list::-webkit-scrollbar-track,
.device-chart-stack::-webkit-scrollbar-track,
.info-panel::-webkit-scrollbar-track {
    background: rgba(8, 20, 38, 0.35);
}

.info-title {
    color: var(--accent);
    font-size: 14px;
    border-bottom: 1px solid rgba(91, 202, 255, 0.32);
    padding-bottom: 4px;
    letter-spacing: 1px;
    animation: chroma-flicker 4.4s ease-in-out infinite;
}

.global-topbar {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    background: linear-gradient(90deg, var(--topbar-grad-start) 0%, var(--topbar-grad-end) 100%);
    border-bottom: 1px solid rgba(112, 245, 255, 0.3);
    box-shadow: 0 0 16px rgba(74, 212, 255, 0.16) inset, 0 8px 22px rgba(5, 16, 30, 0.45);
    color: var(--text-main);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
    z-index: 900;
}

.global-topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, rgba(74, 212, 255, 0), var(--topbar-line-glow-a), var(--topbar-line-glow-b), var(--topbar-line-glow-c), rgba(74, 212, 255, 0));
    background-size: 220% 100%;
    animation: topbar-scan 4.8s linear infinite;
}

.platform-top-toggle {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(112, 245, 255, 0.3);
    border-radius: 10px;
    background: rgba(22, 34, 70, 0.82);
    color: var(--text-main);
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-right: 10px;
}

#onlineDeviceView::-webkit-scrollbar,
#platformView::-webkit-scrollbar {
    width: 3px;
}

#onlineDeviceView::-webkit-scrollbar-thumb,
#platformView::-webkit-scrollbar-thumb {
    background: rgba(135, 185, 255, 0.22);
    border-radius: 999px;
}

#onlineDeviceView::-webkit-scrollbar-track,
#platformView::-webkit-scrollbar-track {
    background: rgba(8, 20, 38, 0.35);
}

.saas-sidebar {
    position: fixed;
    left: 0;
    top: var(--topbar-height);
    bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sidebar-grad-start) 0%, var(--sidebar-grad-mid) 42%, var(--sidebar-grad-end) 100%);
    border-right: 1px solid var(--line-color);
    box-shadow: 14px 0 40px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 5px 2px 5px;
    gap: 12px;
    transition: width 0.2s ease, padding 0.2s ease;
}

.saas-brand {
    color: var(--text-main);
    font-size: 17px;
    letter-spacing: 1px;
    font-weight: 700;
    margin-bottom: 2px;
    padding: 0 1px;
}

.saas-subtitle {
    color: var(--text-soft);
    font-size: 12px;
    margin-top: -2px;
    margin-bottom: 10px;
    line-height: 1.4;
    padding: 0 8px;
}

.nav-btn {
    width: 100%;
    flex: 0 0 auto;
    background: rgba(32, 49, 94, 0.34);
    border: 1px solid rgba(116, 238, 255, 0.24);
    color: var(--text-main);
    text-align: left;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s, box-shadow 0.25s ease;
    font-weight: 600;
    letter-spacing: 0.2px;
    display: block;
    position: relative;
    overflow: hidden;
}

body.ftd-global-fog::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9800;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.6);
}

body.ftd-global-fog.ftd-topbar-popup-open::before {
    display: none;
}

.nav-btn:hover {
    border-color: var(--accent);
    background: rgba(62, 232, 255, 0.14);
    box-shadow: 0 0 0 1px rgba(62, 232, 255, 0.25) inset, 0 0 18px rgba(62, 232, 255, 0.2);
}

.nav-btn.active {
    border-color: #74efff;
    background: linear-gradient(90deg, rgba(74, 212, 255, 0.32), rgba(127, 159, 255, 0.24));
    color: #ffffff;
    box-shadow: 0 0 0 1px rgba(74, 212, 255, 0.32) inset, 0 0 18px rgba(74, 212, 255, 0.18), 0 10px 20px rgba(18, 45, 88, 0.3);
    animation: neon-pulse 2.7s ease-in-out infinite alternate;
}

.nav-btn::after {
    content: "";
    position: absolute;
    top: -18%;
    left: -42%;
    width: 36%;
    height: 136%;
    pointer-events: none;
    transform: rotate(22deg);
    background: linear-gradient(90deg, rgba(74, 212, 255, 0) 0%, rgba(74, 212, 255, 0.52) 50%, rgba(127, 159, 255, 0) 100%);
    animation: neon-trail 3.4s linear infinite;
}

.nav-btn-title {
    font-size: 14px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.local-only {
    display: block;
}

#onlineDeviceView,
#platformView {
    display: none;
    position: fixed;
    left: var(--sidebar-width);
    top: var(--topbar-height);
    right: 0;
    bottom: 0;
    overflow: auto;
    background: radial-gradient(120% 120% at 0% 0%, var(--bg-glow-a) 0%, rgba(0, 0, 0, 0) 44%), radial-gradient(120% 120% at 100% 0%, var(--bg-glow-b) 0%, rgba(0, 0, 0, 0) 48%), radial-gradient(90% 80% at 50% 100%, var(--bg-glow-c) 0%, rgba(0, 0, 0, 0) 55%), linear-gradient(180deg, var(--bg-grad-start) 0%, var(--bg-grad-end) 100%);
    z-index: 120;
    padding: 20px;
    flex-direction: column;
    transition: left 0.2s ease;
}

#onlineDeviceView::before,
#platformView::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.34;
    background-image: linear-gradient(to bottom, var(--grid-dot) 1px, transparent 1px), linear-gradient(to right, var(--grid-line) 1px, transparent 1px);
    background-size: 100% 3px, 48px 48px;
    mix-blend-mode: screen;
    animation: hud-grid-pan 14s linear infinite;
}

#onlineDeviceView>*,
#platformView>* {
    position: relative;
    z-index: 1;
}

body.view-online .local-only {
    display: none !important;
}

body.view-online #onlineDeviceView {
    display: flex;
}

body.platform-shell #platformView {
    display: flex;
}

body.no-sidebar .saas-sidebar {
    display: none !important;
}

body.no-sidebar #onlineDeviceView,
body.no-sidebar #platformView {
    left: 0;
}

body.sidebar-collapsed {
    padding-left: 0;
}

body.sidebar-collapsed .saas-sidebar {
    display: none;
}

body.sidebar-collapsed #onlineDeviceView,
body.sidebar-collapsed #platformView {
    left: 0;
}

body.embed-mode {
    padding-left: 0;
    padding-top: 0;
    overflow: hidden;
}

body.embed-mode .global-topbar,
body.embed-mode .saas-sidebar {
    display: none !important;
}

body.embed-mode #onlineDeviceView,
body.embed-mode #platformView {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: auto;
    min-height: 0;
    padding: 14px;
}

.online-header {
    background: var(--surface-bg);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    padding: 8px 10px;
    margin-bottom: 10px;
}

.online-header-spacer {
    height: 2px;
}

.online-filters {
    background: var(--surface-bg);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(7, minmax(128px, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.online-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.online-field label {
    color: var(--text-soft);
    font-size: 12px;
}

.online-field-control {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%;
}

.online-field input,
.online-field select {
    background: var(--input-bg);
    border: 1px solid rgba(115, 194, 255, 0.36);
    border-radius: 6px;
    padding: 6px 8px;
    color: var(--text-main);
    font-size: 12px;
}

.online-field-control input,
.online-field-control select {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding-right: 26px;
}

.online-field-control.is-select-control select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 30px;
}

.online-select-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
    font-size: 11px;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 1;
}

.online-filter-clear-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--line-color) 85%, transparent);
    background: color-mix(in srgb, var(--surface-bg) 72%, var(--card-bg) 28%);
    color: var(--text-soft);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    font-size: 13px;
    transition: all 0.15s ease;
    z-index: 2;
}

.online-filter-clear-btn[hidden] {
    display: none !important;
}

.online-filter-clear-btn:hover {
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
    color: #fff;
    background: color-mix(in srgb, var(--accent) 36%, var(--card-bg) 64%);
}

.online-field-control.is-select-control .online-filter-clear-btn {
    opacity: 0;
    pointer-events: none;
}

.online-field-control.is-select-control.has-value:hover .online-select-arrow,
.online-field-control.is-select-control.has-value:focus-within .online-select-arrow {
    opacity: 0;
}

.online-field-control.is-select-control.has-value:hover .online-filter-clear-btn,
.online-field-control.is-select-control.has-value:focus-within .online-filter-clear-btn {
    opacity: 1;
    pointer-events: auto;
}

.online-field-control.is-input-control.has-value .online-filter-clear-btn {
    opacity: 1;
    pointer-events: auto;
}

.online-actions {
    grid-column: auto;
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    align-items: flex-end;
    margin-top: 18px;
}

.online-actions button,
.table-action-btn {
    border: 1px solid rgba(112, 245, 255, 0.35);
    background: #1b3162;
    color: #e9f3ff;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.online-actions button:hover,
.table-action-btn:hover {
    border-color: var(--accent);
    background: #274283;
}

.device-table-wrap {
    background: var(--surface-bg);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    overflow: hidden;
}

.table-footer {
    margin-top: 12px;
    background: var(--surface-bg);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-size-wrap,
.page-action-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cde9ff;
    font-size: 13px;
}

#pageSizeSelect {
    background: var(--input-bg);
    border: 1px solid rgba(115, 194, 255, 0.36);
    border-radius: 6px;
    padding: 6px 8px;
    color: var(--text-main);
}

.page-btn {
    border: 1px solid rgba(112, 245, 255, 0.35);
    background: #1b3162;
    color: #e9f3ff;
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.device-table {
    width: 100%;
    border-collapse: collapse;
}

.device-table th,
.device-table td {
    border-bottom: 1px solid rgba(112, 188, 255, 0.16);
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    color: var(--text-main);
}

.device-table th {
    background: var(--card-bg);
    color: #a6d5ff;
    font-weight: 600;
    white-space: nowrap;
}

.device-table tbody tr:hover {
    background: rgba(84, 167, 255, 0.12);
}

.table-empty,
.table-error {
    padding: 18px;
    text-align: center;
    color: var(--text-soft);
}

.table-error {
    color: #ffb3b3;
}

@media (max-width: 1180px) {
    .online-filters {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }

    .online-actions {
        grid-column: span 4;
        margin-top: 0;
        justify-content: flex-end;
    }

    .device-basic-grid {
        grid-template-columns: repeat(3, minmax(100px, 1fr));
    }

    .device-data-layout {
        grid-template-columns: minmax(280px, 320px) 1fr;
        height: 100%;
        min-height: 0;
    }

    .online-analysis-main {
        flex-direction: row;
    }

    .online-info-panel {
        width: 320px;
        min-width: 300px;
        max-width: 360px;
    }

    .day-matrix-list,
    .device-chart-stack {
        max-height: none;
    }

    .online-filters {
        gap: 6px;
    }

    .online-field label {
        font-size: clamp(10px, 1.1vw, 12px);
    }

    .online-field input,
    .online-field select {
        font-size: clamp(10px, 1.05vw, 12px);
        padding: 5px 7px;
    }

    .batch-controls-inline label,
    .batch-controls-inline span,
    .batch-controls-inline select,
    .batch-controls-inline input,
    .batch-query-btn,
    .batch-basic-btn,
    .batch-advanced-btn {
        font-size: clamp(10px, 1.05vw, 12px);
    }
}

@media (max-width: 1040px) {
    .device-data-panel.active {
        height: auto;
    }

    .device-data-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
    }

    .day-matrix-list,
    .device-chart-stack {
        height: auto;
    }
}

@media (max-width: 1024px) {
    body {
        padding-left: 0;
        padding-top: var(--topbar-height);
    }

    .saas-sidebar {
        position: sticky;
        width: 100%;
        height: auto;
        top: var(--topbar-height);
        z-index: 500;
    }

    #onlineDeviceView,
    #platformView {
        left: 0;
        top: calc(var(--topbar-height) + 78px);
    }

    body.sidebar-collapsed {
        padding-left: 0;
    }

    body.sidebar-collapsed #onlineDeviceView,
    body.sidebar-collapsed #platformView {
        left: 0;
    }
}

.online-status-line {
    margin: 0 0 8px;
    padding: 7px 10px;
    background: color-mix(in srgb, var(--surface-bg) 85%, transparent);
    border: 1px solid var(--line-color);
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 12px;
}

.online-device-tabs {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    flex-wrap: wrap;
    background: linear-gradient(90deg, var(--topbar-grad-start) 0%, var(--topbar-grad-end) 100%);
    border-bottom: 1px solid var(--line-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.online-device-tab {
    border: 1px solid rgba(112, 245, 255, 0.35);
    background: #1b3162;
    color: #e9f3ff;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* 新增：水平居中 */
    gap: 8px;
    max-width: 140px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    position: relative;
    overflow: hidden;
}

.online-device-tab.active {
    background: linear-gradient(90deg, rgba(74, 212, 255, 0.36), rgba(127, 159, 255, 0.3));
    border-color: #74efff;
    box-shadow: 0 0 14px rgba(62, 232, 255, 0.24);
    animation: neon-pulse 2.4s ease-in-out infinite alternate;
}

.online-device-tab::after {
    content: "";
    position: absolute;
    top: -20%;
    left: -48%;
    width: 38%;
    height: 140%;
    pointer-events: none;
    transform: rotate(24deg);
    background: linear-gradient(90deg, rgba(74, 212, 255, 0) 0%, rgba(74, 212, 255, 0.46) 48%, rgba(127, 159, 255, 0) 100%);
    animation: neon-trail 3.8s linear infinite;
}

.tab-close-btn {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: rgba(6, 15, 28, 0.35);
    font-weight: 700;
}

.online-device-panels {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.online-device-panel {
    display: none;
}

.online-device-panel.active {
    display: block;
    min-height: 0;
}

.device-data-panel {
    display: none;
}

.device-data-panel.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    position: relative;
    overflow: hidden;
}

.device-basic-card {
    background: var(--surface-bg);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    padding: 8px 9px;
    margin-bottom: 8px;
}

.device-basic-title {
    font-size: 13px;
    color: var(--text-main);
    margin-bottom: 8px;
    font-weight: 700;
}

.device-basic-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(100px, 1fr));
    gap: 5px;
}

.device-basic-grid div {
    background: color-mix(in srgb, var(--card-bg) 68%, transparent);
    border: 1px solid var(--line-color);
    border-radius: 8px;
    padding: 5px 7px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.device-basic-grid span {
    color: var(--text-soft);
    font-size: 11px;
}

.device-basic-grid strong {
    color: var(--text-main);
    font-size: 12px;
}

.batch-controls-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-bg);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    padding: 6px 8px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.batch-controls-inline label,
.batch-controls-inline span {
    font-size: 11px;
    color: #a7cfed;
}

.batch-controls-inline select,
.batch-controls-inline input {
    background: var(--input-bg);
    border: 1px solid rgba(115, 194, 255, 0.36);
    border-radius: 6px;
    padding: 4px 7px;
    color: var(--text-main);
    font-size: 11px;
}

.batch-start,
.batch-end {
    min-width: 172px;
}

.batch-query-btn {
    border: 1px solid rgba(119, 197, 255, 0.35);
    background: #163d66;
    color: #e9f3ff;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    width: auto;
    flex: 0 0 auto;
}

.batch-open-infer-btn,
.batch-open-ingest-btn {
    border: 1px solid rgba(119, 197, 255, 0.35);
    background: #1a466f;
    color: #e9f3ff;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    width: auto;
    flex: 0 0 auto;
    margin-left: auto;
}

.batch-open-ingest-btn {
    background: #21578c;
}

.batch-op-drawer {
    position: absolute;
    top: 54px;
    right: 8px;
    width: 340px;
    min-width: 300px;
    max-width: 420px;
    max-height: calc(100% - 64px);
    overflow: auto;
    background: color-mix(in srgb, var(--surface-bg) 92%, #071527 8%);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(4, 12, 24, 0.45);
    padding: 10px;
    z-index: 9;
}

.batch-op-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-main);
    margin-bottom: 6px;
}

.batch-op-close-btn {
    border: 1px solid rgba(119, 197, 255, 0.35);
    background: #163d66;
    color: #e9f3ff;
    border-radius: 6px;
    width: 28px;
    height: 24px;
    cursor: pointer;
}

.batch-op-context {
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.45;
    margin-bottom: 8px;
}

.batch-op-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.batch-op-mode button {
    border: 1px solid rgba(119, 197, 255, 0.35);
    background: #163d66;
    color: #dfefff;
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 12px;
}

.batch-op-mode button.active {
    background: #2b6ca5;
    color: #fff;
}

.batch-op-body {
    display: none;
    gap: 8px;
}

.batch-op-body.active {
    display: grid;
}

.batch-op-body select,
.batch-op-body input {
    background: var(--input-bg);
    border: 1px solid rgba(115, 194, 255, 0.36);
    border-radius: 6px;
    padding: 7px 8px;
    color: var(--text-main);
    font-size: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.batch-op-body button {
    border: 1px solid rgba(119, 197, 255, 0.35);
    background: #21578c;
    color: #e9f3ff;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    width: auto;
}

.batch-infer-result,
.batch-ingest-result {
    border: 1px solid var(--line-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--card-bg) 72%, transparent);
    color: var(--text-soft);
    padding: 8px;
    font-size: 12px;
    line-height: 1.5;
}

.batch-ingest-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.batch-ingest-row label {
    font-size: 11px;
    color: var(--text-soft);
}

.batch-ingest-range {
    border: 1px solid var(--line-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--card-bg) 60%, transparent);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.batch-ingest-range-title,
.batch-preview-title {
    font-size: 11px;
    color: var(--text-soft);
    font-weight: 600;
}

.batch-ingest-range-info {
    font-size: 12px;
    color: var(--text-main);
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.batch-ingest-range-info .batch-range-count {
    color: var(--accent);
}

.batch-ingest-range-btns {
    display: flex;
    gap: 6px;
}

.batch-ingest-range-btns button {
    flex: 1;
    font-size: 11px;
    padding: 5px 6px;
    background: #163d66;
}

.batch-ingest-slider {
    width: 100%;
    accent-color: var(--accent);
    cursor: pointer;
}

.batch-ingest-preview {
    border: 1px solid var(--line-color);
    border-radius: 8px;
    background: color-mix(in srgb, var(--bg-base) 80%, transparent);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    height: 140px;
}

.batch-preview-chart {
    flex: 1;
    min-height: 0;
    border-radius: 6px;
    overflow: hidden;
}

.batch-ingest-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.batch-ingest-dedupe-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-soft);
    cursor: pointer;
}

.batch-ingest-dedupe-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    cursor: pointer;
}

.dt-picker-popover {
    position: absolute;
    z-index: 1200;
}

.dt-picker-card {
    min-width: 280px;
    background: var(--input-bg);
    border: 1px solid rgba(115, 194, 255, 0.35);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(2, 9, 22, 0.55);
    padding: 8px;
}

.dt-range-picker-card {
    min-width: 700px;
    max-width: min(92vw, 760px);
}

.dt-range-layout {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 10px;
}

.dt-range-quick {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-right: 1px solid rgba(115, 194, 255, 0.2);
    padding-right: 8px;
}

.dt-quick-btn {
    border: 1px solid color-mix(in srgb, var(--line-color) 85%, transparent);
    background: color-mix(in srgb, var(--surface-bg) 72%, var(--card-bg) 28%);
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: 6px;
    text-align: left;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.dt-quick-btn.is-active {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 38%, var(--card-bg) 62%) 0%, color-mix(in srgb, var(--accent-ai) 36%, var(--card-bg) 64%) 100%);
    border-color: color-mix(in srgb, var(--accent) 75%, #ffffff 25%);
    color: #ffffff;
    font-weight: 700;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent) inset, 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent);
}

.dt-quick-btn:hover {
    border-color: color-mix(in srgb, var(--accent) 58%, transparent);
    background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface-bg) 45%);
}

.dt-range-main {
    min-width: 0;
}

.dt-range-inputs {
    display: grid;
    grid-template-columns: 1fr 112px auto 1fr 112px;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
}

.dt-start-date,
.dt-end-date,
.dt-start-time,
.dt-end-time {
    background: #0a1d32;
    border: 1px solid rgba(115, 194, 255, 0.35);
    color: var(--text-main);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12px;
}

.dt-range-sep {
    color: #a7cfed;
    font-size: 12px;
    text-align: center;
}

.dt-cal-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dt-cal-panel {
    border: 1px solid rgba(115, 194, 255, 0.2);
    border-radius: 8px;
    padding: 6px;
    background: rgba(6, 21, 36, 0.4);
}

.dt-cal-head {
    display: grid;
    grid-template-columns: 24px 1fr 24px;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.dt-cal-title {
    text-align: center;
    color: var(--text-main);
    font-size: 13px;
    font-weight: 600;
}

.dt-nav-btn {
    border: 1px solid rgba(119, 197, 255, 0.25);
    background: rgba(23, 61, 102, 0.5);
    color: #e8f3ff;
    border-radius: 6px;
    height: 22px;
    cursor: pointer;
}

.dt-cal-weekdays,
.dt-cal-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
}

.dt-cal-weekdays span {
    color: var(--text-soft);
    font-size: 11px;
    text-align: center;
}

.dt-day {
    border: 1px solid color-mix(in srgb, var(--line-color) 68%, transparent);
    background: color-mix(in srgb, var(--surface-bg) 74%, var(--card-bg) 26%);
    color: var(--text-main);
    border-radius: 6px;
    min-height: 28px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.16s ease;
}

.dt-day.is-muted {
    opacity: 0.45;
}

.dt-day.is-future {
    opacity: 0.35;
    background: color-mix(in srgb, var(--surface-bg) 82%, #334a63 18%);
    border-color: color-mix(in srgb, var(--line-color) 40%, transparent);
    color: var(--text-disabled);
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
}

.dt-day.is-future:hover {
    border-color: color-mix(in srgb, var(--line-color) 40%, transparent);
}

.dt-day.is-in-range {
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 38%, var(--surface-bg) 62%) 0%, color-mix(in srgb, var(--accent) 24%, var(--surface-bg) 76%) 100%);
    border-color: color-mix(in srgb, var(--accent) 72%, transparent);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 48%, transparent) inset, 0 0 8px color-mix(in srgb, var(--accent) 28%, transparent);
}

.dt-day.is-selected {
    background: color-mix(in srgb, var(--accent) 78%, #1f3f61 22%);
    border-color: color-mix(in srgb, var(--accent) 88%, #ffffff 12%);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 70%, transparent) inset, 0 0 12px color-mix(in srgb, var(--accent) 40%, transparent);
}

.dt-day.is-start {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 85%, #21456b 15%) 0%, color-mix(in srgb, var(--accent-ai) 50%, #21456b 50%) 100%);
    border-color: color-mix(in srgb, var(--accent) 92%, #ffffff 8%);
    color: #fff;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 85%, transparent) inset, 0 0 14px color-mix(in srgb, var(--accent) 55%, transparent);
}

.dt-day.is-end {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-hot) 76%, #0f4d43 24%) 0%, color-mix(in srgb, var(--accent-game) 64%, #0f4d43 36%) 100%);
    border-color: color-mix(in srgb, var(--accent-game) 80%, #ffffff 20%);
    color: #fff;
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-game) 80%, transparent) inset, 0 0 14px color-mix(in srgb, var(--accent-game) 48%, transparent);
}

.dt-day.is-start.is-end {
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent-ai) 84%, #2a406c 16%) 0%, color-mix(in srgb, var(--accent) 72%, #2a406c 28%) 100%);
    border-color: color-mix(in srgb, var(--accent-ai) 86%, #ffffff 14%);
}

.dt-day:hover {
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
    transform: translateY(-1px);
}

.dt-picker-row {
    display: flex;
    gap: 8px;
}

.dt-picker-date,
.dt-picker-time {
    flex: 1;
    background: #0a1d32;
    border: 1px solid rgba(115, 194, 255, 0.35);
    color: var(--text-main);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12px;
}

.dt-picker-actions {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dt-picker-spacer {
    flex: 1;
}

.dt-picker-cancel,
.dt-picker-ok {
    border: 1px solid rgba(119, 197, 255, 0.35);
    background: #163d66;
    color: #e9f3ff;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
}

.dt-picker-ok {
    background: #21578c;
}

.batch-advanced-btn {
    border: 1px solid rgba(131, 209, 255, 0.4);
    background: #21578c;
    color: #f1f8ff;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    width: auto;
    flex: 0 0 auto;
}

.batch-basic-btn {
    border: 1px solid rgba(131, 209, 255, 0.4);
    background: #1a466f;
    color: #f1f8ff;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    width: auto;
    flex: 0 0 auto;
}

.batch-status {
    margin-left: auto;
    font-size: 11px;
}

.device-data-layout {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 10px;
    height: 100%;
    min-height: 0;
    flex: 1;
    min-height: 0;
}

.day-matrix-list {
    background: var(--surface-bg);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    padding: 6px;
    max-height: none;
    height: 100%;
    overflow: auto;
    width: fit-content;
    max-width: 100%;
}

.day-matrix-card {
    background: color-mix(in srgb, var(--card-bg) 72%, transparent);
    border: 1px solid var(--line-color);
    border-radius: 8px;
    padding: 6px;
    margin-bottom: 8px;
}

.day-matrix-title {
    color: var(--text-soft);
    font-size: 11px;
    margin-bottom: 6px;
}

.day-matrix-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(28px, 1fr));
    gap: 4px;
    width: fit-content;
}

.matrix-cell {
    border: 1px solid color-mix(in srgb, var(--text-main) 14%, transparent);
    color: var(--text-main);
    font-size: 11px;
    border-radius: 4px;
    height: 26px;
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
    padding: 0 2px;
}

.matrix-cell.active {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-main) 86%, transparent) inset, 0 0 0 1px color-mix(in srgb, var(--bg-base) 80%, transparent), 0 0 16px color-mix(in srgb, var(--text-main) 35%, transparent);
}

.device-chart-stack {
    background: var(--surface-bg);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    padding: 6px;
    max-height: none;
    height: 100%;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.online-analysis-main {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex: 1;
    min-height: 220px;
}

.online-viz-area {
    display: grid;
    grid-template-rows: 220px minmax(0, 1fr) 90px;
    grid-template-columns: 1fr;
    gap: 8px;
    min-height: 0;
    flex: 1;
    position: relative;
}

.online-viz-area::before,
.online-viz-area::after {
    content: "";
    position: absolute;
    pointer-events: none;
    z-index: 0;
    filter: blur(30px);
    opacity: 0.42;
    animation: ai-glow-flow 6.2s ease-in-out infinite alternate;
}

.online-viz-area::before {
    width: 280px;
    height: 180px;
    top: -50px;
    left: -70px;
    background: radial-gradient(circle, var(--glow-cyan) 0%, rgba(62, 232, 255, 0) 70%);
}

.online-viz-area::after {
    width: 260px;
    height: 180px;
    right: -80px;
    bottom: -60px;
    background: radial-gradient(circle, var(--glow-purple) 0%, rgba(143, 123, 255, 0) 72%);
    animation-duration: 7.3s;
}

.online-viz-area>* {
    position: relative;
    z-index: 1;
}

.online-viz-area .view-window {
    background: color-mix(in srgb, var(--card-bg) 76%, transparent);
    border: 1px solid color-mix(in srgb, var(--line-color) 75%, transparent);
    border-radius: 6px;
    overflow: hidden;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.online-viz-area .view-window::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.34;
    background-image: radial-gradient(circle at 16% 26%, rgba(62, 232, 255, 0.36) 0 1px, rgba(62, 232, 255, 0) 2px), radial-gradient(circle at 68% 42%, rgba(143, 123, 255, 0.34) 0 1px, rgba(143, 123, 255, 0) 2px), radial-gradient(circle at 44% 70%, rgba(255, 79, 216, 0.3) 0 1px, rgba(255, 79, 216, 0) 2px);
    background-size: 220px 180px, 260px 200px, 240px 190px;
    animation: particle-drift 8s linear infinite;
}

.online-viz-area .view-window>* {
    position: relative;
    z-index: 1;
}

.online-viz-area .top-wave-container {
    min-height: 0;
    position: relative;
}

.online-viz-area .top-wave-container .enlarge-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
}

.top-wave-echarts {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 1;
}

.online-mini-chart,
.online-vb-chart {
    width: 100%;
    height: 100%;
    position: relative;
}

.wave-zoom-echarts {
    width: 100%;
    height: 100%;
    position: relative;
}

.wave-zoom-echarts-main {
    width: 100%;
    height: 100%;
}

.wave-zoom-echarts.with-band-details {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-x: hidden;
}

.wave-zoom-echarts.with-band-details .wave-zoom-echarts-main {
    flex: 1 1 auto;
    min-height: 220px;
    height: auto;
    min-width: 0;
}

.wave-zoom-band-details {
    flex: 0 0 42%;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--surface-bg, #0f233b);
    border-top: 1px solid var(--line-color, rgba(98, 179, 255, 0.24));
    padding: 8px 10px;
    box-sizing: border-box;
}

.wave-band-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(159, 184, 214, 0.24);
    width: 100%;
    min-width: 0;
}

.wave-band-detail-item:last-child {
    border-bottom: none;
}

.wave-band-detail-title {
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
}

.wave-band-detail-canvas {
    display: block;
    width: 100%;
    height: 52px;
    max-width: 100%;
    border-radius: 4px;
    background: var(--bg-base, #091729);
}

.online-viz-area .middle-3d-container {
    display: flex;
    gap: 8px;
    min-height: 0;
}

.online-viz-area .axis-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.online-viz-area .canvas-3d-wrapper {
    flex: 1;
    position: relative;
    background: rgba(14, 24, 52, 0.76);
    border: 1px solid rgba(112, 245, 255, 0.18);
    border-radius: 6px;
    overflow: hidden;
    min-height: 140px;
}

.online-viz-area .canvas-2d-mini-wrapper {
    flex: 0 0 120px;
    background: rgba(14, 24, 52, 0.76);
    border: 1px solid rgba(112, 245, 255, 0.18);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    min-height: 120px;
}

.online-viz-area .axis-label {
    position: absolute;
    top: 5px;
    left: 10px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
    pointer-events: none;
    z-index: 5;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    border: 1px solid rgba(175, 219, 255, 0.2);
}

.online-viz-area canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.online-info-panel {
    width: 320px;
    min-width: 320px;
    max-width: 380px;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}

.online-info-panel .info-section {
    min-height: 0;
}

/* 上半部分：模型推理 + 块信息 */
.info-top-half {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}

.info-top-half .block-infer-section {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.info-top-half .info-section:not(.block-infer-section) {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* 下半部分：频带通道 */
.info-bottom-half {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* 右侧面板字体大小自适应 */
.info-top-half .info-title,
.info-bottom-half .info-title {
    font-size: clamp(10px, 1.6vh, 14px);
}

.info-top-half .block-infer-controls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 4px;
    overflow: hidden;
}

.info-top-half .block-infer-controls select,
.info-top-half .block-infer-result {
    font-size: clamp(9px, 1.4vh, 12px);
}

.block-infer-result-highlight {
    color: var(--accent, #4ad4ff);
    font-weight: 700;
    font-size: 1.05em;
    text-shadow: 0 0 8px color-mix(in srgb, var(--accent, #4ad4ff) 70%, transparent);
    filter: drop-shadow(0 0 2px color-mix(in srgb, var(--accent, #4ad4ff) 60%, transparent));
}

.block-infer-windows {
    overflow-x: hidden !important;
    padding-right: 2px;
}

.info-top-half .chart-meta-grid {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    gap: 4px;
}

.info-top-half .meta-item {
    padding: 4px;
    gap: 2px;
}

.info-top-half .meta-item span {
    font-size: clamp(8px, 1.3vh, 11px);
}

.info-top-half .meta-item strong {
    font-size: clamp(9px, 1.4vh, 12px);
}

.band-table-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.band-table-wrap .batch-band-table {
    width: 100%;
    table-layout: fixed;
}

/* Compact view (right panel): fills container height, larger font, no whitespace */
.band-table-wrap .batch-band-table.compact {
    height: 100%;
}

.band-table-wrap .batch-band-table.compact tbody {
    height: 100%;
}

.band-table-wrap .batch-band-table.compact tbody tr {
    height: calc(100% / 10);
}

.band-table-wrap .batch-band-table.compact th,
.band-table-wrap .batch-band-table.compact td {
    padding: 1px 2px;
    line-height: 1;
    vertical-align: middle;
    white-space: normal;
    word-break: break-word;
    font-size: clamp(9px, 1.8vh, 15px);
}

.band-table-wrap .batch-band-table.compact th:first-child,
.band-table-wrap .batch-band-table.compact td:first-child {
    width: 32px;
}

/* Full view (zoom modal): smaller text for full details */
.band-table-wrap .batch-band-table:not(.compact) {
    font-size: clamp(8px, 0.55vw, 11px);
}

.band-table-wrap .batch-band-table:not(.compact) th,
.band-table-wrap .batch-band-table:not(.compact) td {
    padding: 3px 2px;
    line-height: 1.2;
    white-space: normal;
    word-break: break-word;
}

.band-table-wrap .batch-band-table:not(.compact) th:first-child,
.band-table-wrap .batch-band-table:not(.compact) td:first-child {
    width: 36px;
}

.batch-band-table th {
    color: var(--text-soft);
    background: color-mix(in srgb, var(--surface-bg) 60%, transparent);
}

.batch-band-table tbody tr td {
    color: inherit !important;
}

.chart-card {
    background: rgba(14, 24, 52, 0.76);
    border: 1px solid rgba(112, 245, 255, 0.2);
    border-radius: 8px;
    padding: 6px;
    margin-bottom: 0;
    flex: 0 0 90px;
    position: relative;
    box-sizing: border-box;
}

.online-viz-area .chart-card {
    min-height: 90px;
    height: 90px;
}

.chart-card canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.chart-card .enlarge-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
}

.vb-canvas {
    height: 100%;
}

.chart-head {
    font-size: 12px;
    color: #d5ecff;
    margin-bottom: 6px;
    animation: chroma-flicker 5s ease-in-out infinite;
}

.xyz-legend {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.xyz-legend button {
    border: 1px solid rgba(112, 245, 255, 0.3);
    background: #202f60;
    color: #cde7ff;
    border-radius: 6px;
    font-size: 11px;
    padding: 2px 7px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.xyz-legend button.active {
    background: linear-gradient(90deg, rgba(74, 212, 255, 0.4), rgba(127, 159, 255, 0.32));
    border-color: #74efff;
    box-shadow: 0 0 15px rgba(62, 232, 255, 0.28);
}

.xyz-legend button::after {
    content: "";
    position: absolute;
    top: -24%;
    left: -52%;
    width: 40%;
    height: 148%;
    pointer-events: none;
    transform: rotate(24deg);
    background: linear-gradient(90deg, rgba(74, 212, 255, 0) 0%, rgba(74, 212, 255, 0.5) 52%, rgba(127, 159, 255, 0) 100%);
    animation: neon-trail 3.9s linear infinite;
}

@keyframes ai-glow-flow {
    0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.36;
    }

    100% {
        transform: translate3d(8px, -6px, 0) scale(1.1);
        opacity: 0.52;
    }
}

@keyframes topbar-scan {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -20% 0;
    }
}

@keyframes frame-breathe {
    0% {
        box-shadow: 0 0 18px rgba(20, 52, 84, 0.36), 0 0 0 1px rgba(127, 159, 255, 0.1) inset;
    }

    50% {
        box-shadow: 0 0 24px rgba(74, 212, 255, 0.24), 0 0 0 1px rgba(74, 212, 255, 0.18) inset;
    }

    100% {
        box-shadow: 0 0 28px rgba(127, 159, 255, 0.28), 0 0 0 1px rgba(74, 212, 255, 0.16) inset;
    }
}

@keyframes neon-pulse {
    0% {
        filter: brightness(1);
    }

    100% {
        filter: brightness(1.13);
    }
}

@keyframes particle-drift {
    0% {
        background-position: 0 0, 0 0, 0 0;
    }

    100% {
        background-position: 90px -70px, -80px 60px, 70px 80px;
    }
}

@keyframes neon-trail {
    0% {
        left: -52%;
    }

    58% {
        left: 128%;
    }

    100% {
        left: 128%;
    }
}

@keyframes chroma-flicker {
    0% {
        text-shadow: 0 0 0 rgba(74, 212, 255, 0), 0 0 0 rgba(127, 159, 255, 0);
    }

    52% {
        text-shadow: 0 0 7px rgba(74, 212, 255, 0.44), 0 0 11px rgba(127, 159, 255, 0.3);
    }

    100% {
        text-shadow: 0 0 4px rgba(74, 212, 255, 0.28), 0 0 8px rgba(127, 159, 255, 0.22);
    }
}

@keyframes hud-grid-pan {
    0% {
        background-position: 0 0, 0 0;
    }

    100% {
        background-position: 0 42px, 52px 0;
    }
}

.chart-row-3d,
.chart-row-mini {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.advanced-modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999 !important;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.6) !important;
}

.basic-modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999 !important;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.6) !important;
}

.wave-zoom-modal {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6) !important;
    z-index: 999999 !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

.advanced-modal>* {
    pointer-events: auto;
}

.basic-modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999 !important;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.6) !important;
}

.basic-modal>* {
    pointer-events: auto;
}

.basic-modal[hidden] {
    display: none !important;
}

.basic-dialog {
    width: min(900px, 92%);
    max-height: min(600px, 80vh);
    background: var(--card-bg);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    padding: 16px;
    overflow: auto;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.basic-head {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.basic-close-btn {
    border: 1px solid var(--line-color);
    background: color-mix(in srgb, var(--surface-bg) 70%, transparent);
    color: var(--text-main);
    border-radius: 6px;
    width: 20px;
    height: 20px;
    font-size: 13px;
    line-height: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: absolute;
    right: 0;
    top: 0;
}

.basic-modal .device-basic-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.basic-modal .device-basic-grid span,
.basic-modal .device-basic-grid strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.advanced-modal[hidden] {
    display: none !important;
}

.advanced-dialog {
    width: min(1100px, 94%);
    height: min(760px, 85vh);
    max-height: 85vh;
    background: var(--card-bg);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    padding: 16px;
    display: grid;
    grid-template-rows: auto 3fr 2fr;
    gap: 8px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.advanced-head {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 700;
    min-height: 26px;
    padding-right: 86px;
}

.advanced-status-line {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 500;
    margin-left: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.advanced-close-btn {
    border: 1px solid var(--line-color);
    background: color-mix(in srgb, var(--surface-bg) 70%, transparent);
    color: var(--text-main);
    border-radius: 6px;
    padding: 0;
    width: 22px;
    height: 22px;
    font-size: 15px;
    line-height: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: static;
}

.advanced-replay-btn {
    border: 1px solid var(--line-color);
    background: color-mix(in srgb, var(--surface-bg) 70%, transparent);
    color: var(--text-main);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 0;
    width: 38px;
    height: 22px;
    padding: 0;
}

.advanced-head-actions {
    position: absolute;
    right: 8px;
    top: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.advanced-control-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-soft);
}

.advanced-control-row input[type="range"] {
    width: 180px;
}

.advanced-model-wrap,
.advanced-tf-wrap {
    background: color-mix(in srgb, var(--surface-bg) 75%, transparent);
    border: 1px solid var(--line-color);
    border-radius: 8px;
    overflow: hidden;
}

.advanced-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
}

.advanced-summary-wrap {
    background: color-mix(in srgb, var(--surface-bg) 75%, transparent);
    border: 1px solid var(--line-color);
    border-radius: 8px;
    padding: 8px;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 6px;
    min-height: 0;
}

.advanced-summary-title {
    font-size: 12px;
    color: var(--text-soft);
    font-weight: 700;
}

.advanced-summary-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    overflow: hidden;
    align-content: start;
}

.advanced-raw-wrap {
    min-height: 0;
    border: 1px solid var(--line-color);
    border-radius: 6px;
    background: color-mix(in srgb, var(--bg-base) 90%, transparent);
    overflow: hidden;
}

.advanced-raw-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.advanced-model-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.advanced-tf-wrap {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 6px;
    padding: 6px;
    overflow: hidden;
    box-sizing: border-box;
}

.advanced-tf-wrap canvas,
.advanced-tf-wrap div.advanced-freq-canvas,
.advanced-tf-wrap div.advanced-disp-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border: 1px solid var(--line-color);
    border-radius: 6px;
    background: color-mix(in srgb, var(--bg-base) 85%, transparent);
    box-sizing: border-box;
}

.adv-info-row {
    background: color-mix(in srgb, var(--card-bg) 72%, transparent);
    border: 1px solid var(--line-color);
    border-radius: 6px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.adv-info-row span {
    font-size: 10px;
    color: var(--text-soft);
}

.adv-info-row strong {
    font-size: 11px;
    color: var(--text-main);
}

.batch-band-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    table-layout: auto;
}

.table-enlarge-btn {
    margin-left: 6px;
    width: 18px;
    height: 18px;
    border: 1px solid var(--line-color);
    background: color-mix(in srgb, var(--card-bg) 80%, transparent);
    color: var(--text-main);
    border-radius: 4px;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
}

.batch-band-table th,
.batch-band-table td {
    border-bottom: 1px solid var(--line-color);
    padding: 4px;
    text-align: center;
    color: var(--text-main);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    font-size: clamp(9px, 0.62vw, 11px);
}

.batch-band-table tbody tr td {
    color: inherit !important;
}

.batch-band-table th {
    color: var(--text-soft);
    background: color-mix(in srgb, var(--surface-bg) 60%, transparent);
}

.chart-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    overflow: hidden;
}

.meta-item {
    background: color-mix(in srgb, var(--card-bg) 80%, transparent);
    border: 1px solid var(--line-color);
    border-radius: 8px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.meta-item span {
    color: var(--text-soft);
    font-size: clamp(10px, 0.75vw, 11px);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
}

.meta-item strong {
    color: var(--text-main);
    font-size: clamp(10px, 0.85vw, 12px);
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
}

.net-online {
    color: #37d07f;
    font-weight: 700;
}

.net-offline {
    color: #ff6666;
    font-weight: 700;
}

.power-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    font-weight: 700;
    border: 1px solid transparent;
}

.power-high {
    color: #38d870;
    background: rgba(56, 216, 112, 0.14);
    border-color: rgba(56, 216, 112, 0.35);
}

.power-mid {
    color: #ffd24d;
    background: rgba(255, 210, 77, 0.14);
    border-color: rgba(255, 210, 77, 0.35);
}

.power-warn {
    color: #ffad5c;
    background: rgba(255, 173, 92, 0.14);
    border-color: rgba(255, 173, 92, 0.35);
}

.power-low {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.14);
    border-color: rgba(255, 107, 107, 0.35);
}

.enlarge-btn {
    position: absolute;
    right: 6px;
    top: 6px;
    width: 20px;
    height: 20px;
    border: 1px solid var(--line-color);
    background: color-mix(in srgb, var(--card-bg) 80%, transparent);
    color: var(--text-main);
    border-radius: 5px;
    font-size: 12px;
    line-height: 1;
    z-index: 7;
    cursor: pointer;
}

.wave-zoom-modal {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wave-zoom-overlay {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    /* 与工作台模型对比页面一致的深色透明遮罩 */
}

.wave-zoom-modal[hidden] {
    display: none !important;
}

/* ChartZoom 样式对话框 - 与工作台模型对比页面一致 */
.chart-zoom-dialog {
    width: min(1100px, 94vw);
    height: min(680px, 90vh);
    background: var(--card-bg, #152f4d) !important;
    border: 1px solid var(--line-color);
    border-radius: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 1;
}

/* 头部样式 - 渐变背景 */
.wave-zoom-header {
    background: linear-gradient(135deg, var(--accent, #4ad4ff) 0%, var(--accent-ai, #7f9fff) 100%);
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
}

.wave-zoom-head-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.wave-zoom-title {
    font-weight: 600;
    font-size: 16px;
    margin: 0;
    color: white;
}

.wave-zoom-view-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(8, 26, 44, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 8px;
    padding: 3px;
}

.wave-zoom-view-tab {
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.86);
    border-radius: 6px;
    padding: 5px 10px;
    line-height: 1;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.18s ease;
}

.wave-zoom-view-tab:hover {
    border-color: rgba(255, 255, 255, 0.36);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.wave-zoom-view-tab.is-active {
    background: #ffffff;
    border-color: rgba(255, 255, 255, 0.95);
    color: #0a2b47;
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.28), 0 6px 14px rgba(4, 20, 36, 0.35);
    transform: translateY(-1px);
}

/* 控制按钮组 */
.wave-zoom-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wave-zoom-detail-toggle {
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 6px;
    padding: 5px 10px;
    line-height: 1;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.wave-zoom-detail-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wave-zoom-detail-toggle.is-active {
    background: #ffffff;
    color: #0a2b47;
    font-weight: 700;
    border-color: rgba(255, 255, 255, 0.95);
}

.wave-zoom-btn-group {
    display: flex;
    gap: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.wave-zoom-btn {
    padding: 6px 10px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.wave-zoom-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.wave-zoom-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.wave-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.wave-zoom-level {
    min-width: 50px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    color: white;
}

/* 关闭按钮 */
.wave-zoom-close {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 4px;
    font-size: 20px;
    line-height: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wave-zoom-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 内容区域 */
.wave-zoom-body {
    flex: 1;
    overflow: hidden;
    background: var(--bg-base, #091729);
    border-radius: 0 0 10px 10px;
}

.wave-zoom-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    position: relative;
}

/* When table is shown, let it fill the container */
.wave-zoom-container:has(.wave-zoom-table:not([hidden])) {
    align-items: stretch;
    justify-content: stretch;
}

.wave-zoom-canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
    transition: transform 0.08s ease-out;
}

.wave-zoom-table {
    width: 100%;
    height: 100%;
    overflow: auto;
    color: var(--text-main);
    background: var(--surface-bg);
    border-radius: 6px;
    padding: 10px;
    box-sizing: border-box;
}

/* Modal zoom view - table fills available space with adaptive text */
.wave-zoom-table .batch-band-table {
    table-layout: fixed;
    width: 100%;
    min-height: 100%;
    font-size: clamp(16px, 3.5vw, 32px) !important;
    border-collapse: separate;
    border-spacing: 0;
}

.wave-zoom-table .batch-band-table thead {
    display: table-header-group;
}

.wave-zoom-table .batch-band-table tbody {
    display: table-row-group;
    height: 100%;
}

.wave-zoom-table .batch-band-table tbody tr {
    height: calc(100% / 11);
}

.wave-zoom-table .batch-band-table tbody tr td {
    color: inherit !important;
    vertical-align: middle;
}

.wave-zoom-table .batch-band-table th,
.wave-zoom-table .batch-band-table td {
    white-space: normal;
    word-break: break-all;
    line-height: 1.1 !important;
    padding: 2px 4px !important;
    text-align: center;
    font-size: inherit !important;
}

/* 第一列频带窄一点，后面三列均分剩余空间 */
.wave-zoom-table .batch-band-table th:first-child,
.wave-zoom-table .batch-band-table td:first-child {
    width: 90px;
    min-width: 90px;
    white-space: nowrap;
}

.wave-zoom-table .batch-band-table th:not(:first-child),
.wave-zoom-table .batch-band-table td:not(:first-child) {
    width: calc((100% - 90px) / 3);
}

.zoom-empty {
    color: var(--text-soft);
    font-size: 13px;
    padding: 10px;
}

.wave-zoom-modal[hidden] {
    display: none !important;
}

.wave-zoom-dialog {
    width: min(1100px, 94vw);
    height: min(680px, 90vh);
    background: color-mix(in srgb, var(--card-bg) 90%, transparent);
    border: 1px solid var(--line-color);
    border-radius: 10px;
    padding: 8px;
    position: relative;
}

.wave-zoom-canvas {
    width: 100%;
    height: 100%;
    display: block;
    transition: transform 0.08s ease-out;
}

.zoom-empty {
    color: var(--text-soft);
    font-size: 13px;
    padding: 10px;
}

.canvas-tooltip {
    position: fixed;
    z-index: 1300;
    pointer-events: none;
    background: rgba(6, 18, 32, 0.9);
    color: #e6f2ff;
    border: 1px solid rgba(117, 175, 248, 0.38);
    border-radius: 6px;
    padding: 5px 7px;
    font-size: 11px;
    white-space: nowrap;
    max-width: 80vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 1280px),
(max-height: 860px) {
    .advanced-dialog {
        width: min(1020px, 94vw);
        height: min(700px, 94vh);
        padding: 8px;
        gap: 6px;
    }

    .advanced-head {
        font-size: 13px;
        min-height: 24px;
        gap: 8px;
        padding-right: 80px;
    }

    .advanced-status-line {
        font-size: 10px;
    }

    .advanced-top-row,
    .advanced-tf-wrap {
        gap: 5px;
    }

    .advanced-summary-wrap {
        padding: 6px;
        gap: 5px;
    }

    .advanced-summary-title {
        font-size: 11px;
    }

    .adv-info-row {
        padding: 4px;
        gap: 2px;
    }

    .adv-info-row span {
        font-size: 9px;
    }

    .adv-info-row strong {
        font-size: 10px;
    }

    .advanced-close-btn,
    .advanced-replay-btn {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }

    .advanced-replay-btn {
        width: 34px;
    }
}

@media (max-width: 1040px),
(max-height: 760px) {
    .advanced-dialog {
        width: min(960px, 96vw);
        height: min(640px, 96vh);
        padding: 6px;
        gap: 4px;
    }

    .advanced-head {
        font-size: 12px;
        min-height: 22px;
        padding-right: 74px;
    }

    .advanced-status-line {
        max-width: 42%;
    }

    .advanced-summary-list {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .advanced-summary-wrap {
        padding: 5px;
    }

    .advanced-tf-wrap {
        padding: 4px;
        gap: 4px;
    }

    .adv-info-row span {
        font-size: 8px;
    }

    .adv-info-row strong {
        font-size: 9px;
    }

    .advanced-close-btn,
    .advanced-replay-btn {
        width: 18px;
        height: 18px;
        border-radius: 4px;
        font-size: 10px;
    }

    .advanced-replay-btn {
        width: 30px;
    }

    .wave-zoom-table .batch-band-table {
        font-size: clamp(14px, 3vw, 28px) !important;
    }

    .wave-zoom-table .batch-band-table th,
    .wave-zoom-table .batch-band-table td {
        padding: 2px 4px !important;
        line-height: 1.1 !important;
    }
}

.platform-home-entry {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    margin-right: 14px;
    padding: 0;
}

.platform-home-entry-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #3b95ff, #6d7dff);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.platform-home-entry-text {
    color: #eef7ff;
    font-size: 14px;
    font-weight: 700;
}

.platform-topbar-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.platform-topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: #eef7ff;
}

.platform-topbar-subtitle {
    font-size: 12px;
    font-weight: 500;
    color: #9ec6f0;
}

.platform-sidebar {
    justify-content: flex-start;
}

.platform-sidebar-head,
.platform-sidebar-note,
.platform-home-main,
.platform-home-side,
.platform-kpi-card,
.platform-visual-card,
.platform-entry-card,
.platform-module-shell,
.platform-module-stage {
    background: rgba(13, 32, 54, 0.9);
    border: 1px solid rgba(132, 189, 255, 0.18);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(3, 10, 20, 0.28);
}

.platform-sidebar-head,
.platform-sidebar-note {
    padding: 14px;
}

.platform-sidebar-head-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.platform-sidebar-head-copy {
    min-width: 0;
}

.platform-sidebar-title,
.platform-sidebar-note-title {
    color: #eef7ff;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
}

.platform-sidebar-desc,
.platform-sidebar-note-text {
    color: #9ec3ea;
    font-size: 12px;
    line-height: 1.6;
}

.platform-sidebar-toggle,
.platform-sidebar-home {
    border: 1px solid rgba(120, 170, 245, 0.24);
    background: rgba(15, 41, 72, 0.78);
    color: #e7f3ff;
    cursor: pointer;
}

.platform-sidebar-toggle {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 16px;
    flex: 0 0 34px;
}

.platform-sidebar-home {
    margin-top: 12px;
    width: 100%;
    min-height: 34px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.platform-sidebar-home:hover,
.platform-sidebar-toggle:hover {
    border-color: #67b4ff;
    background: rgba(31, 93, 154, 0.72);
}

body.sidebar-collapsed .platform-sidebar-head,
body.sidebar-collapsed .platform-sidebar-note {
    padding-left: 10px;
    padding-right: 10px;
}

body.sidebar-collapsed .platform-sidebar-title,
body.sidebar-collapsed .platform-sidebar-desc,
body.sidebar-collapsed .platform-sidebar-note,
body.sidebar-collapsed .platform-sidebar-home,
body.sidebar-collapsed .nav-btn-desc,
body.sidebar-collapsed .platform-topbar-subtitle {
    display: none;
}

body.sidebar-collapsed .nav-btn {
    padding: 12px 10px;
}

body.sidebar-collapsed .nav-btn-title {
    font-size: 12px;
}

#platformView {
    gap: 16px;
    padding: 18px;
}

.platform-home-page {
    display: grid;
    gap: 16px;
}

.platform-home-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.platform-home-main,
.platform-home-side,
.platform-kpi-card,
.platform-visual-card,
.platform-entry-card,
.platform-module-shell,
.platform-module-stage {
    padding: 20px;
}

.platform-home-side {
    display: grid;
    gap: 14px;
    align-content: start;
}

.platform-home-stat-card {
    background: rgba(9, 26, 44, 0.78);
    border: 1px solid rgba(120, 170, 245, 0.14);
    border-radius: 12px;
    padding: 16px;
    display: grid;
    gap: 8px;
}

.platform-home-stat-label,
.platform-kpi-label,
.platform-entry-tag {
    color: #7ec0ff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.platform-home-stat-card strong,
.platform-kpi-card strong,
.platform-entry-card strong {
    color: #eff7ff;
    font-size: 18px;
    line-height: 1.35;
}

.platform-home-stat-card span:last-child,
.platform-kpi-card span:last-child,
.platform-entry-card span:last-child {
    color: #9fc4eb;
    font-size: 13px;
    line-height: 1.65;
}

.platform-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(59, 149, 255, 0.14);
    color: #7ec0ff;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.platform-hero-title {
    margin: 0 0 10px;
    font-size: 30px;
    line-height: 1.2;
    color: #eef7ff;
}

.platform-context-line {
    color: #b5d6f6;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.platform-context-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.platform-scope-badge,
.platform-state-badge {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.platform-scope-badge {
    background: rgba(8, 26, 47, 0.76);
    color: #cbe5ff;
    border: 1px solid rgba(120, 170, 245, 0.22);
}

.platform-state-badge {
    background: rgba(43, 128, 255, 0.18);
    color: #f0f7ff;
    border: 1px solid rgba(92, 167, 255, 0.26);
}

.platform-scope-alert {
    display: none;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(150, 24, 24, 0.18);
    border: 1px solid rgba(255, 128, 128, 0.22);
    color: #ffd0d0;
    font-size: 13px;
}

.platform-scope-alert.visible {
    display: block;
}

.platform-project-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.platform-home-kpi-grid,
.platform-home-visual-grid,
.platform-entry-grid {
    display: grid;
    gap: 16px;
}

.platform-home-kpi-grid,
.platform-entry-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.platform-home-visual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.platform-kpi-card,
.platform-entry-card {
    display: grid;
    gap: 10px;
}

.platform-entry-card {
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.platform-entry-card:hover,
.platform-entry-card.active {
    transform: translateY(-2px);
    border-color: rgba(101, 178, 255, 0.4);
    background: rgba(18, 47, 79, 0.95);
}

.platform-card-head {
    display: grid;
    gap: 4px;
    margin-bottom: 14px;
}

.platform-card-title {
    color: #eef7ff;
    font-size: 16px;
    font-weight: 700;
}

.platform-card-subtitle {
    color: #9ec4eb;
    font-size: 12px;
    line-height: 1.6;
}

.platform-visual-canvas {
    width: 100%;
    height: 250px;
    display: block;
}

.platform-module-shell,
.platform-module-stage {
    display: none;
}

.platform-module-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.platform-active-hint {
    color: #9fc4eb;
    font-size: 13px;
}

.platform-stage {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.platform-stage-title {
    color: #eff7ff;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.platform-stage-subtitle {
    color: #9ec4eb;
    font-size: 13px;
    line-height: 1.6;
}

.platform-frame-wrap {
    flex: 1;
    min-height: 560px;
    padding: 0;
}

.platform-frame-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 12px;
    background: #06111d;
}

body.platform-home-mode .platform-home-page {
    display: grid;
}

body.platform-home-mode .platform-module-shell,
body.platform-home-mode .platform-module-stage {
    display: none;
}

body.platform-module-mode .platform-home-page {
    display: none;
}

body.platform-module-mode .platform-module-shell,
body.platform-module-mode .platform-module-stage {
    display: flex;
}

body.platform-module-mode .platform-module-stage {
    padding: 16px;
    min-height: calc(100vh - var(--topbar-height) - 126px);
}

@media (max-width: 1360px) {

    .platform-home-hero,
    .platform-home-visual-grid {
        grid-template-columns: 1fr;
    }

    .platform-home-kpi-grid,
    .platform-entry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {

    .platform-home-kpi-grid,
    .platform-entry-grid,
    .platform-home-visual-grid {
        grid-template-columns: 1fr;
    }

    .platform-module-head {
        align-items: flex-start;
    }
}

/* Table sorting styles */
.sortable-header {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable-header:hover {
    background: color-mix(in srgb, var(--accent) 20%, transparent);
}

.sort-indicator {
    display: inline-block;
    margin-left: 4px;
    font-size: 10px;
    color: var(--text-soft);
    transition: transform 0.2s;
}

.sortable-header.active-sort .sort-indicator {
    color: var(--accent);
}

.sortable-header.desc .sort-indicator {
    transform: rotate(0deg);
}

.sortable-header.asc .sort-indicator {
    transform: rotate(180deg);
}
