/* 自定义滚动条 - 深色风格 */
    ::-webkit-scrollbar { width: 4px; height: 4px; }
    ::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); }
    ::-webkit-scrollbar-thumb { background: rgba(0, 212, 255, 0.3); border-radius: 2px; }
    ::-webkit-scrollbar-thumb:hover { background: rgba(0, 212, 255, 0.5); }
    
    /* 隐藏旧导航 */
    #content > nav, #content > .navbar { display: none !important; }
    body, .wrapper, #content { margin: 0 !important; padding: 0 !important; }
    .wrapper { height: 100vh !important; }
    #content { height: 100vh !important; overflow: hidden !important; }
    #screen-root {
        background:
            radial-gradient(circle at 16% 8%, rgba(0, 212, 255, 0.12), transparent 28%),
            radial-gradient(circle at 84% 12%, rgba(0, 255, 136, 0.08), transparent 24%),
            linear-gradient(135deg, #0a1628 0%, #132042 52%, #0a1628 100%);
        color: #ffffff;
    }

    /* 侧边栏折叠 */
    #sidebar {
        transition: width 0.3s ease, transform 0.3s ease;
        background: linear-gradient(180deg, rgba(7, 18, 35, 0.95), rgba(8, 20, 40, 0.9));
        border-right: 1px solid rgba(0, 212, 255, 0.12);
        box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02), 12px 0 28px rgba(2, 8, 23, 0.24);
    }
    #sidebar.collapsed { width: 72px; }
    #sidebar.collapsed .sidebar-text { display: none; }
    #sidebar.collapsed .submenu { display: none !important; }
    #sidebar.collapsed .nav-group-title { display: none; }
    #sidebar.collapsed .sidebar-nav-link,
    #sidebar.collapsed .sidebar-nav-button,
    #sidebar.collapsed .sidebar-tool-link,
    #sidebar.collapsed .sidebar-login-link {
        justify-content: center;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    #sidebar.collapsed .sidebar-nav-icon,
    #sidebar.collapsed .sidebar-tool-icon,
    #sidebar.collapsed .sidebar-login-link .material-icons-outlined {
        margin-right: 0;
    }
    #sidebar.collapsed .sidebar-logo-row {
        justify-content: center;
    }
    #sidebar.collapsed .sidebar-user-card {
        justify-content: center;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    /* 侧边栏子菜单动画 */
    .submenu {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    .submenu.open { max-height: 500px; }
    .rotate-icon { transition: transform 0.3s ease; }
    .sidebar-shell {
        position: relative;
        overflow: hidden;
    }
    .sidebar-shell::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at top left, rgba(0, 212, 255, 0.08), transparent 24%);
        pointer-events: none;
    }
    .sidebar-header {
        border-bottom: 1px solid rgba(0, 212, 255, 0.12);
        background: rgba(255, 255, 255, 0.02);
    }
    .sidebar-logo-mark {
        box-shadow: 0 10px 20px rgba(14, 165, 233, 0.22);
    }
    .sidebar-logo-title {
        color: #e2e8f0;
    }
    .sidebar-logo-subtitle {
        font-size: 11px;
        line-height: 1.1;
        color: rgba(148, 163, 184, 0.72);
    }
    .sidebar-toggle-btn {
        color: #94a3b8;
        border: 1px solid rgba(255, 255, 255, 0.05);
        background: rgba(255, 255, 255, 0.03);
        transition: all 0.2s ease;
    }
    .sidebar-toggle-btn:hover {
        color: #22d3ee;
        border-color: rgba(34, 211, 238, 0.2);
        background: rgba(34, 211, 238, 0.08);
    }
    .sidebar-section-title {
        font-size: 11px;
        font-weight: 700;
        color: rgba(148, 163, 184, 0.68);
        letter-spacing: 0.18em;
        text-transform: uppercase;
    }
    .sidebar-nav-link,
    .sidebar-nav-button {
        min-height: 44px;
        border: 1px solid transparent;
        color: #cbd5e1;
        background: transparent;
        transition: all 0.2s ease;
    }
    .sidebar-nav-link:hover,
    .sidebar-nav-button:hover {
        color: #f8fafc;
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.05);
        transform: translateX(2px);
    }
    .sidebar-nav-link.active {
        color: #67e8f9;
        background: linear-gradient(90deg, rgba(34, 211, 238, 0.16), rgba(59, 130, 246, 0.08));
        border-color: rgba(34, 211, 238, 0.16);
        box-shadow: inset 2px 0 0 #22d3ee, 0 10px 24px rgba(6, 182, 212, 0.12);
    }
    .sidebar-nav-icon {
        width: 22px;
        margin-right: 10px;
        flex-shrink: 0;
        text-align: center;
    }
    .sidebar-submenu {
        margin-top: 6px;
        margin-left: 14px;
        padding-left: 12px;
        border-left: 1px dashed rgba(148, 163, 184, 0.16);
    }
    .sidebar-submenu-link {
        position: relative;
        display: block;
        padding: 8px 10px;
        border-radius: 10px;
        font-size: 13px;
        color: #94a3b8;
        transition: all 0.2s ease;
    }
    .sidebar-submenu-link::before {
        content: '';
        position: absolute;
        left: -17px;
        top: 50%;
        width: 6px;
        height: 6px;
        border-radius: 9999px;
        background: rgba(148, 163, 184, 0.3);
        transform: translateY(-50%);
        transition: all 0.2s ease;
    }
    .sidebar-submenu-link:hover {
        color: #67e8f9;
        background: rgba(34, 211, 238, 0.08);
    }
    .sidebar-submenu-link:hover::before {
        background: rgba(34, 211, 238, 0.8);
        box-shadow: 0 0 10px rgba(34, 211, 238, 0.45);
    }
    .sidebar-tools {
        border-top: 1px solid rgba(0, 212, 255, 0.1);
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    }
    .sidebar-user-card {
        border: 1px solid rgba(255, 255, 255, 0.05);
        background: rgba(255, 255, 255, 0.03);
        border-radius: 14px;
        padding: 9px 10px;
        transition: all 0.2s ease;
    }
    .sidebar-user-card:hover {
        border-color: rgba(34, 211, 238, 0.16);
        background: rgba(34, 211, 238, 0.05);
    }
    .sidebar-tool-link,
    .sidebar-login-link {
        border: 1px solid transparent;
        border-radius: 10px;
        transition: all 0.2s ease;
    }
    .sidebar-tool-link:hover,
    .sidebar-login-link:hover {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.05);
        transform: translateY(-1px);
    }
    .sidebar-tool-icon {
        width: 16px;
        margin-right: 6px;
        text-align: center;
        flex-shrink: 0;
    }
    .sidebar-tools .sidebar-user-name {
        font-size: 13px;
        line-height: 1.2;
    }
    .sidebar-tools .sidebar-user-meta {
        font-size: 12px;
        line-height: 1.2;
    }
    .sidebar-tools .sidebar-tool-link,
    .sidebar-tools .sidebar-login-link {
        font-size: 12px;
        line-height: 1.2;
    }
    .sidebar-tools .sidebar-tool-link {
        padding: 8px 10px;
    }
    .sidebar-tools .sidebar-login-link {
        padding: 8px 10px;
    }
    .sidebar-tools .sidebar-tool-link .sidebar-text,
    .sidebar-tools .sidebar-login-link .sidebar-text,
    .sidebar-tools .sidebar-login-link span:not(.material-icons-outlined) {
        font-size: 12px;
        white-space: nowrap;
    }
    .sidebar-style-menu {
        background: rgba(15, 23, 42, 0.94);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(34, 211, 238, 0.14);
        box-shadow: 0 18px 32px rgba(2, 8, 23, 0.34);
    }
    .dashboard-style-option {
        color: #cbd5e1;
        text-decoration: none;
        transition: color 0.16s ease, background 0.16s ease;
    }
    .dashboard-style-option:hover,
    .dashboard-style-option.active-theme-option {
        color: #00d4ff;
        background: rgba(0, 212, 255, 0.1);
    }
    .dashboard-style-option.active-theme-option {
        font-weight: 600;
    }
    .panel-toolbar {
        padding: 10px 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-shrink: 0;
    }
    .dashboard-select {
        background: rgba(19, 32, 66, 0.95);
        border-width: 1px;
        border-style: solid;
        border-radius: 0.375rem;
        color: #cbd5e1;
        font-size: 0.875rem;
        padding: 0.25rem 0.5rem;
        outline: none;
    }
    .dashboard-select-primary {
        border-color: rgba(0, 212, 255, 0.3);
    }
    .dashboard-select-primary:focus {
        border-color: #00d4ff;
    }
    .dashboard-select-warm {
        border-color: rgba(249, 115, 22, 0.3);
    }
    .dashboard-select-warm:focus {
        border-color: #fb923c;
    }
    .dashboard-select-amber {
        border-color: rgba(245, 158, 11, 0.3);
    }
    .dashboard-select-amber:focus {
        border-color: #fbbf24;
    }
    .dashboard-select-compact {
        max-width: 80px;
        padding-left: 0.375rem;
        padding-right: 0.375rem;
    }
    .list-placeholder,
    .list-placeholder-sm {
        text-align: center;
        color: #64748b;
        padding: 1rem 0;
    }
    .list-placeholder {
        font-size: 1rem;
    }
    .list-placeholder-sm {
        font-size: 0.875rem;
    }
    .list-placeholder .material-icons-outlined,
    .list-placeholder-sm .material-icons-outlined {
        display: block;
        margin-bottom: 0.25rem;
    }
    .list-placeholder .material-icons-outlined {
        font-size: 1.875rem;
    }
    .list-placeholder-sm .material-icons-outlined {
        font-size: 1.5rem;
    }

    /* 卡片与描边 */
    .glow-border {
        border: 1px solid rgba(0, 212, 255, 0.16);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 8px 24px rgba(3, 10, 24, 0.28);
    }
    /* 数字动画 */
    .num-value {
        font-family: 'Orbitron', monospace;
        text-shadow: 0 0 8px rgba(255, 255, 255, 0.08);
    }

    .dashboard-welcome-modal {
        background: rgba(2, 8, 23, 0.68);
        color: #f8fafc;
    }
    .dashboard-welcome-panel {
        background: #132042;
        border: 1px solid rgba(0, 212, 255, 0.3);
        color: #f8fafc;
    }
    .dashboard-welcome-icon {
        color: #00d4ff;
    }
    .dashboard-welcome-title {
        color: #ffffff;
    }
    .dashboard-welcome-copy {
        color: #dbeafe;
    }
    .dashboard-welcome-secondary {
        border: 1px solid rgba(148, 163, 184, 0.75);
        color: #e2e8f0;
        background: transparent;
        text-decoration: none;
    }
    .dashboard-welcome-secondary:hover {
        color: #ffffff;
        border-color: #cbd5e1;
        background: rgba(255, 255, 255, 0.06);
    }
    .dashboard-welcome-primary {
        border: 1px solid rgba(0, 212, 255, 0.75);
        background: #00d4ff;
        color: #061626;
    }
    .dashboard-welcome-primary:hover {
        background: #38e0ff;
        color: #061626;
    }

    .dashboard-card {
        position: relative;
        border: 1px solid rgba(148, 163, 184, 0.14);
        background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.46));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 22px rgba(2, 8, 23, 0.24);
        transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .dashboard-card::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at top right, rgba(0, 212, 255, 0.12), transparent 42%);
        pointer-events: none;
    }
    .dashboard-card:hover {
        transform: translateY(-2px);
        border-color: rgba(0, 212, 255, 0.22);
        box-shadow: 0 14px 30px rgba(2, 8, 23, 0.34);
    }
    .panel-card {
        border: 1px solid rgba(148, 163, 184, 0.14);
        background: linear-gradient(180deg, rgba(15, 23, 42, 0.66), rgba(15, 23, 42, 0.42));
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 14px 32px rgba(2, 8, 23, 0.24);
    }
    .panel-card-warm {
        border-color: rgba(251, 146, 60, 0.22);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 14px 32px rgba(120, 53, 15, 0.16);
    }
    .panel-card-amber {
        border-color: rgba(251, 191, 36, 0.22);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 14px 32px rgba(120, 53, 15, 0.16);
    }
    .metric-tag {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 2px 8px;
        border-radius: 9999px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.06);
        color: #cbd5e1;
        font-size: 12px;
        line-height: 18px;
        white-space: nowrap;
    }
    .status-pill {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 6px 12px;
        border-radius: 9999px;
        background: rgba(16, 185, 129, 0.08);
        border: 1px solid rgba(16, 185, 129, 0.18);
        color: #86efac;
    }
    .page-kicker {
        font-size: 14px;
        letter-spacing: 0.15em;
        color: rgba(148, 163, 184, 0.9);
        font-weight: 500;
        text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    }
    .layer-checkbox {
        border: 1px solid transparent;
        transition: all 0.2s ease;
    }
    .layer-checkbox:hover {
        border-color: rgba(255, 255, 255, 0.08);
        transform: translateY(-1px);
    }
    .weather-tab,
    .extreme-tab {
        transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    }
    .status-item {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 8px 10px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }
    .map-overlay-badge {
        background: rgba(10, 22, 40, 0.78);
        backdrop-filter: blur(8px);
        border: 1px solid rgba(148, 163, 184, 0.18);
        box-shadow: 0 10px 24px rgba(2, 8, 23, 0.22);
    }

    /* 综合态势地图样式 */
    #situation-map {
        background: #0a1628;
    }
    #situation-map-container::after {
        content: '';
        position: absolute;
        inset: 0;
        pointer-events: none;
        background:
            linear-gradient(180deg, rgba(10, 22, 40, 0.08), transparent 25%, transparent 75%, rgba(10, 22, 40, 0.2)),
            radial-gradient(circle at top left, rgba(0, 212, 255, 0.08), transparent 28%);
    }
    #situation-map .ol-zoom {
        top: 8px;
        right: 8px;
        left: auto;
    }
    #situation-map .ol-zoom button {
        background: rgba(0, 212, 255, 0.2);
        color: #00d4ff;
        border: 1px solid rgba(0, 212, 255, 0.3);
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
    #situation-map .ol-zoom button:hover {
        background: rgba(0, 212, 255, 0.3);
    }
    #situation-map .ol-attribution {
        display: none;
    }

    /* Compact desktop mode: keep the dashboard usable on small laptop widths. */
    @media (min-width: 768px) and (max-width: 1440px) {
        #screen-root {
            min-width: 0;
        }

        #sidebar {
            width: 12.5rem;
        }

        .sidebar-header {
            height: 3.5rem;
            padding-left: 0.75rem;
            padding-right: 0.75rem;
        }

        .sidebar-logo-mark {
            width: 2rem;
            height: 2rem;
            border-radius: 0.625rem;
            margin-right: 0.5rem;
        }

        .sidebar-nav-link,
        .sidebar-nav-button {
            min-height: 38px;
            padding: 0.45rem 0.625rem !important;
            border-radius: 0.625rem !important;
        }

        .sidebar-nav-icon {
            margin-right: 0.45rem;
        }

        .sidebar-submenu {
            margin-left: 10px;
            padding-left: 10px;
        }

        .sidebar-submenu-link {
            padding: 6px 8px;
            font-size: 12px;
            border-radius: 8px;
        }

        .sidebar-section-title {
            font-size: 10px;
        }

        .sidebar-tools {
            padding: 0.5rem;
        }

        .sidebar-tools .sidebar-tool-link,
        .sidebar-tools .sidebar-login-link {
            padding: 6px 8px;
        }

        #screen-root > main > header {
            height: 48px;
            padding-left: 0.75rem;
            padding-right: 0.75rem;
        }

        #screen-root > main > header .page-kicker {
            display: none;
        }

        #screen-root > main > header .text-2xl {
            font-size: 1.125rem;
            line-height: 1.5rem;
        }

        #screen-root > main > header #current-time {
            font-size: 1.25rem;
            line-height: 1.5rem;
        }

        #screen-root > main > header #current-date {
            font-size: 0.6875rem;
            line-height: 1rem;
        }

        #screen-root > main > header .status-pill {
            padding: 4px 9px;
            gap: 6px;
            font-size: 12px;
        }

        #screen-root > main > .flex-1.p-3 {
            padding: 0.5rem !important;
            gap: 0.5rem !important;
        }

        #screen-root > main > .flex-1.p-3 > .grid.grid-cols-4,
        #screen-root > main > .flex-1.p-3 > .grid.grid-cols-12 {
            gap: 0.625rem !important;
        }

        .dashboard-card {
            padding: 0.625rem 0.75rem !important;
            border-radius: 0.625rem !important;
        }

        .dashboard-card .w-10.h-10 {
            width: 2rem;
            height: 2rem;
            border-radius: 0.625rem;
        }

        .dashboard-card .text-2xl {
            font-size: 1.25rem;
            line-height: 1.5rem;
        }

        .dashboard-card .text-sm {
            font-size: 0.75rem;
            line-height: 1rem;
        }

        .metric-tag {
            gap: 3px;
            padding: 1px 6px;
            font-size: 11px;
            line-height: 16px;
        }

        .panel-card {
            border-radius: 0.625rem !important;
        }

        .panel-toolbar {
            gap: 0.375rem;
            padding: 7px 8px;
            flex-wrap: wrap;
        }

        .panel-toolbar h3,
        #screen-root .panel-card h3 {
            min-width: 0;
            font-size: 0.875rem !important;
            line-height: 1.25rem !important;
        }

        .dashboard-select {
            max-width: 112px;
            padding: 0.125rem 0.375rem;
            font-size: 0.75rem;
        }

        .dashboard-select-compact {
            max-width: 68px;
        }

        .weather-tab,
        .extreme-tab {
            padding-top: 0.375rem !important;
            padding-bottom: 0.375rem !important;
            font-size: 0.75rem !important;
            line-height: 1rem !important;
        }

        .weather-tab .material-icons-outlined,
        .extreme-tab .material-icons-outlined {
            font-size: 0.875rem !important;
        }

        #weather-list,
        #fire-province-list,
        #extreme-stats-list {
            padding: 0.5rem !important;
            gap: 0.375rem !important;
        }

        #weather-list > :not([hidden]) ~ :not([hidden]),
        #fire-province-list > :not([hidden]) ~ :not([hidden]),
        #extreme-stats-list > :not([hidden]) ~ :not([hidden]) {
            margin-top: 0.375rem !important;
        }

        .status-item {
            gap: 0.375rem;
            padding: 5px 7px;
            border-radius: 8px;
        }

        .layer-checkbox {
            gap: 0.25rem !important;
            padding: 3px 6px !important;
            font-size: 0.75rem !important;
            line-height: 1rem !important;
        }

        .map-overlay-badge {
            padding: 0.375rem 0.5rem !important;
            font-size: 0.75rem !important;
        }

        #screen-root > main > .flex-1.p-3 > .flex.items-center.justify-between {
            padding-top: 0.25rem !important;
            font-size: 0.75rem !important;
        }
    }

    @media (min-width: 1181px) and (max-width: 1280px) {
        #sidebar {
            width: 11rem;
        }

        .sidebar-logo-subtitle,
        #screen-root > main > header .status-pill span:last-child {
            display: none;
        }
    }

    @media (min-width: 768px) and (max-width: 1180px) {
        #sidebar {
            width: 72px !important;
        }

        #sidebar .sidebar-text,
        #sidebar .submenu,
        #sidebar .nav-group-title {
            display: none !important;
        }

        #sidebar .sidebar-header,
        #sidebar .sidebar-logo-row,
        #sidebar .sidebar-nav-link,
        #sidebar .sidebar-nav-button,
        #sidebar .sidebar-tool-link,
        #sidebar .sidebar-login-link,
        #sidebar .sidebar-user-card {
            justify-content: center;
        }

        #sidebar .sidebar-header {
            padding-left: 0.5rem;
            padding-right: 0.5rem;
        }

        #sidebar .sidebar-toggle-btn {
            display: none;
        }

        #sidebar .sidebar-nav-link,
        #sidebar .sidebar-nav-button,
        #sidebar .sidebar-tool-link,
        #sidebar .sidebar-login-link {
            padding-left: 0.5rem !important;
            padding-right: 0.5rem !important;
        }

        #sidebar .sidebar-nav-icon,
        #sidebar .sidebar-tool-icon,
        #sidebar .sidebar-login-link .material-icons-outlined {
            margin-right: 0;
        }

        #sidebar .sidebar-tools .grid {
            grid-template-columns: 1fr;
        }

        #screen-root > main > header .status-pill,
        #screen-root > main > header > div:last-child > div:nth-child(2) {
            display: none;
        }

        #screen-root > main > .flex-1.p-3 > .grid.grid-cols-12 {
            grid-template-columns: minmax(190px, 2.8fr) minmax(360px, 6.4fr) minmax(190px, 2.8fr);
            gap: 0.5rem !important;
        }
    }

    @media (min-width: 768px) and (max-height: 760px) {
        #screen-root > main > header {
            height: 46px;
        }

        #screen-root > main > .flex-1.p-3 {
            padding: 0.5rem !important;
            gap: 0.5rem !important;
        }

        .dashboard-card {
            padding-top: 0.5rem !important;
            padding-bottom: 0.5rem !important;
        }

        .panel-toolbar {
            padding-top: 6px;
            padding-bottom: 6px;
        }

        .list-placeholder,
        .list-placeholder-sm {
            padding: 0.5rem 0;
        }
    }
