/* 129 CMS — dark glass console
   WebDesignSkills: glass-dark-ui / dark-glass-clean-layout / dark-blue-contrasting-clean */

:root {
    --bg-0: #020617;
    --bg-1: #07101e;
    --glass-fill: rgba(12, 20, 36, 0.52);
    --glass-fill-strong: rgba(8, 14, 28, 0.82);
    --line: rgba(148, 163, 184, 0.16);
    --text: #e8eef8;
    --muted: #8ea0b8;
    --accent: #5b9dff;
    --ok: #4ade9b;
    --warn: #f5c15c;
    --radius: 18px;
    --shadow: 0 20px 48px rgba(2, 6, 23, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
    font-family: "IBM Plex Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg-0);
    color: var(--text);
    letter-spacing: 0.01em;
}
a { color: var(--accent); }

.atmosphere {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background:
        radial-gradient(900px 480px at 8% -8%, rgba(91, 157, 255, 0.16), transparent 58%),
        radial-gradient(640px 420px at 92% 8%, rgba(99, 102, 241, 0.1), transparent 52%),
        linear-gradient(180deg, #020617 0%, #07101e 55%, #020617 100%);
}
.atmosphere .fold {
    position: absolute;
    top: -10%;
    width: 22%;
    height: 120%;
    background: linear-gradient(180deg, transparent 0%, rgba(91, 157, 255, 0.07) 55%, rgba(91, 157, 255, 0.16) 100%);
    filter: blur(28px);
    mix-blend-mode: screen;
    animation: fold-drift 22s ease-in-out infinite;
}
.atmosphere .f1 { left: 8%; animation-delay: 0s; }
.atmosphere .f2 { left: 38%; width: 18%; animation-delay: -7s; animation-duration: 28s; }
.atmosphere .f3 { left: 68%; width: 26%; animation-delay: -13s; }
.atmosphere .bloom {
    position: absolute;
    right: -8%;
    bottom: -18%;
    width: 48%;
    height: 48%;
    background: radial-gradient(circle, rgba(91, 157, 255, 0.18), transparent 68%);
    filter: blur(8px);
}
@keyframes fold-drift {
    0%, 100% { transform: translateX(0); opacity: .85; }
    50% { transform: translateX(28px); opacity: 1; }
}

.glass-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
    background-color: var(--glass-fill);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}
@supports not ((backdrop-filter: blur(1px))) {
    .glass-panel { background-color: var(--glass-fill-strong); }
}

.border-gradient { position: relative; }
.border-gradient::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    background: linear-gradient(
        145deg,
        rgba(148, 163, 184, 0.34) 0%,
        rgba(91, 157, 255, 0.42) 46%,
        rgba(148, 163, 184, 0.16) 100%
    );
    pointer-events: none;
}

.micro {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

.login-wrap {
    position: relative;
    z-index: 1;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-card {
    width: 400px;
    padding: 32px 32px 28px;
}
.login-card h1 {
    margin: 10px 0 8px;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.03em;
}
.login-card p { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.login-card label,
.field label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin: 14px 0 6px;
    letter-spacing: 0.04em;
}
.login-card input,
.toolbar input,
.map-bar input {
    width: 100%;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(2, 6, 23, 0.55);
    color: var(--text);
    padding: 0 12px;
    outline: none;
    font: inherit;
}
.login-card input:focus,
.toolbar input:focus,
.map-bar input:focus {
    border-color: rgba(91, 157, 255, 0.55);
    box-shadow: 0 0 0 3px rgba(91, 157, 255, 0.12);
}

.btn {
    height: 40px;
    border: 1px solid rgba(91, 157, 255, 0.35);
    border-radius: 999px;
    background: rgba(91, 157, 255, 0.16);
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    padding: 0 16px;
    font-family: inherit;
    letter-spacing: 0.02em;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.btn:hover { background: rgba(91, 157, 255, 0.28); border-color: rgba(91, 157, 255, 0.7); }
.btn:active { transform: translateY(1px); }
.btn:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
}

.loading-mask {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 6, 23, 0.48);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.loading-mask.hidden { display: none !important; }
.loading-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    font-size: 14px;
    color: var(--text);
}
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(91, 157, 255, 0.22);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.btn.ghost {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--line);
    color: var(--text);
}
.btn.block { width: 100%; margin-top: 20px; }
.err { color: #ff8b8b; font-size: 12px; min-height: 18px; margin-top: 8px; }

.app {
    position: relative;
    z-index: 1;
    display: flex;
    height: calc(100% - 20px);
    margin: 10px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 22px;
    overflow: hidden;
    background: rgba(2, 6, 23, 0.28);
}
.rail-mark {
    position: absolute;
    z-index: 6;
    width: 8px;
    height: 8px;
    border: 1px solid rgba(226, 232, 240, 0.45);
    pointer-events: none;
}
.rail-mark.tl { top: 8px; left: 8px; border-right: 0; border-bottom: 0; }
.rail-mark.tr { top: 8px; right: 8px; border-left: 0; border-bottom: 0; }
.rail-mark.bl { bottom: 8px; left: 8px; border-right: 0; border-top: 0; }
.rail-mark.br { bottom: 8px; right: 8px; border-left: 0; border-top: 0; }

.mobile-bar { display: none; }

.side {
    width: 228px;
    margin: 14px 0 14px 14px;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    flex-shrink: 0;
}
.brand {
    font-weight: 600;
    font-size: 15px;
    padding: 6px 10px 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.02em;
}
.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(91, 157, 255, 0.8);
}
.side-label { padding: 14px 10px 8px; }
.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--text);
    border: 0;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    margin-bottom: 4px;
    font: inherit;
    font-size: 14px;
}
.nav-no {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 0.08em;
    min-width: 1.6em;
}
.nav-btn.active, .nav-btn:hover { background: rgba(255, 255, 255, 0.06); }
.nav-btn.active { color: #fff; }
.nav-btn.active .nav-no { color: var(--accent); }
.side .who {
    margin-top: auto;
    font-size: 13px;
    color: var(--muted);
    padding: 10px;
}
.side .who #whoName { color: var(--text); margin: 4px 0 12px; }
.side .who .btn { width: 100%; }

.main {
    flex: 1;
    overflow: auto;
    padding: 22px 26px 40px;
}
.top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}
.top h2 {
    margin: 6px 0 6px;
    font-size: 28px;
    font-weight: 500;
    letter-spacing: -0.03em;
}
.muted { color: var(--muted); font-size: 13px; }

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}
.card {
    position: relative;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015));
    background-color: var(--glass-fill);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px 16px 14px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.card .k { font-size: 12px; color: var(--muted); letter-spacing: 0.04em; }
.card .v {
    font-size: 32px;
    font-weight: 500;
    margin-top: 10px;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}
.card .s { font-size: 12px; color: var(--ok); margin-top: 6px; }

.board-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.board {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0;
    overflow: hidden;
}
.board-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--line);
}
.board-head h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 500;
}
.board.cc4pro { border-top: 2px solid #5b9dff; }
.board.cc4 { border-top: 2px solid #4ade9b; }
.board.cc4l { border-top: 2px solid #7dd3fc; }
.board.other { border-top: 2px solid #94a3b8; }
.stat-table,
.ram-table {
    width: 100%;
    margin: 0;
}
.stat-table td {
    padding: 9px 16px;
    border-bottom: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
}
.stat-table td:last-child,
.ram-table td:last-child,
.ram-table th:last-child {
    text-align: right;
}
.stat-table tr.today td:first-child { color: var(--ok); }
.stat-table tr.today td:last-child {
    color: #fff;
    font-weight: 600;
    font-size: 18px;
}
.stat-table .delta {
    margin-left: 8px;
    font-size: 11px;
    font-weight: 500;
}
.stat-table .delta.up { color: var(--ok); }
.stat-table .delta.down { color: #ff8b8b; }
.stat-table .delta.flat { color: var(--muted); }
.ram-label {
    padding: 8px 16px 4px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.ram-table th,
.ram-table td {
    padding: 7px 10px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.ram-table th:first-child,
.ram-table td:first-child { padding-left: 16px; }
.ram-table th:last-child,
.ram-table td:last-child { padding-right: 16px; }
.board .table-wrap {
    border: 0;
    border-radius: 0;
    overflow: auto;
}

.chart-wrap {
    height: 320px;
    padding: 16px 14px 10px;
    border: 1px solid var(--line);
}
.chart-wrap canvas { width: 100% !important; height: 100% !important; }

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th {
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
tr:hover td { background: rgba(91, 157, 255, 0.06); }
.table-wrap.glass-panel { border: 0; }

.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input { height: 40px; min-width: 220px; width: auto; }
.pager { margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.map-page { padding: 0 !important; overflow: hidden; position: relative; flex: 1; min-height: 0; }
#map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #050814;
    touch-action: pan-x pan-y;
}
.leaflet-container { background: #050814; }
.leaflet-layer.map-tiles-dark .leaflet-tile {
    filter: invert(1) hue-rotate(180deg) brightness(0.88) contrast(1.05) saturate(0.35);
}
.leaflet-control-zoom a {
    background: rgba(12, 20, 36, 0.88) !important;
    color: #e8eef8 !important;
    border-color: rgba(148, 163, 184, 0.18) !important;
}
.leaflet-control-zoom a:hover { background: rgba(91, 157, 255, 0.22) !important; }
.leaflet-control-attribution {
    background: rgba(8, 14, 28, 0.72) !important;
    color: #8ea0b8 !important;
}
.leaflet-control-attribution a { color: #5b9dff !important; }
.map-bar {
    position: absolute;
    z-index: 500;
    top: 16px;
    left: 58px;
    right: 332px;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px 10px 8px 14px;
    max-width: 560px;
}
.map-bar .micro { flex-shrink: 0; }
.map-bar input {
    flex: 1;
    max-width: none;
    height: 36px;
    background: transparent;
    border: 0;
}
.map-bar input:focus { box-shadow: none; }
.map-side {
    position: absolute;
    z-index: 500;
    top: 16px;
    right: 16px;
    width: 300px;
    max-height: calc(100vh - 52px);
    overflow: auto;
    padding: 14px;
}
.map-bar .map-list-btn { display: none; }
.map-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    background: transparent;
    border: 0;
    color: inherit;
    padding: 0 0 10px;
    cursor: default;
    font: inherit;
}
.map-side-head h3 { margin: 0; font-size: 14px; font-weight: 500; }
.handle-bar { display: none; }
#countryList { overflow: auto; }
.country-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    font-size: 13px;
}
.country-item:hover { color: #fff; }
.popup-line { font-size: 12px; color: #1e293b; line-height: 1.55; }
.leaflet-popup-content { margin: 10px 12px; font-size: 13px; }

.hidden { display: none !important; }
.note { font-size: 12px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.section { margin-bottom: 26px; }
.section h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}
#view-sync .card { padding: 20px; }
#view-sync .btn { margin-top: 14px; }

@media (max-width: 1100px) {
    .cards { grid-template-columns: 1fr 1fr; }
    .board-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
    .app {
        flex-direction: column;
        margin: 0;
        height: 100%;
        height: 100dvh;
        border-radius: 0;
        border: 0;
    }
    .rail-mark { display: none; }
    .side { display: none; }
    .mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin: 8px 8px 0;
        padding: 8px;
        border-radius: 14px;
        flex-shrink: 0;
    }
    .mobile-bar .brand { display: none; }
    .mobile-nav {
        display: flex;
        gap: 4px;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .mobile-nav .nav-btn,
    .mobile-nav .btn {
        width: auto;
        margin: 0;
        padding: 8px 12px;
        font-size: 13px;
        flex-shrink: 0;
        min-height: 40px;
    }
    html, body, .app { height: 100%; height: 100dvh; }
    body.map-open { overflow: hidden; overscroll-behavior: none; }
    .main { padding: 14px 12px 28px; min-height: 0; }
    .top h2 { font-size: 22px; }
    .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .board-grid { grid-template-columns: 1fr; gap: 10px; }
    .card .v { font-size: 26px; }
    .toolbar input { min-width: 0; width: 100%; }
    .chart-wrap { height: 240px; }
    .btn, .nav-btn, .country-item { touch-action: manipulation; }

    .app.map-open {
        position: relative;
    }
    .app.map-open .mobile-bar {
        position: absolute;
        z-index: 1300;
        top: env(safe-area-inset-top, 0px);
        left: 8px;
        right: 8px;
        margin: 8px 0 0;
        background-color: var(--glass-fill-strong);
    }
    .app.map-open .map-page {
        position: absolute;
        inset: 0;
        z-index: 1;
    }
    .map-bar {
        top: calc(72px + env(safe-area-inset-top, 0px));
        left: 8px;
        right: 8px;
        max-width: none;
        padding: 6px 8px;
        gap: 6px;
        background-color: var(--glass-fill-strong);
        z-index: 1100;
    }
    .map-bar .micro { display: none; }
    .map-bar input {
        height: 40px;
        font-size: 16px;
        min-width: 0;
    }
    .map-bar .btn { height: 40px; padding: 0 12px; flex-shrink: 0; }
    .map-bar .map-list-btn { display: inline-flex; align-items: center; }
    .leaflet-control-zoom {
        margin: 0 10px 92px 0 !important;
    }
    .leaflet-control-attribution {
        max-width: 52%;
        font-size: 10px !important;
        margin: 0 0 68px 8px !important;
    }
    .leaflet-popup {
        max-width: min(280px, calc(100vw - 48px)) !important;
    }
    .map-side {
        top: auto;
        right: 8px;
        left: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        width: auto;
        height: min(52vh, 420px);
        max-height: min(52vh, 420px);
        padding: 8px 12px 10px;
        transform: translateY(calc(100% - 52px));
        transition: transform .22s ease;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        background-color: var(--glass-fill-strong);
        z-index: 1200;
    }
    .map-side.open {
        transform: translateY(0);
    }
    .map-side-head {
        position: relative;
        cursor: pointer;
        padding: 10px 0 8px;
        flex-shrink: 0;
        min-height: 44px;
    }
    .handle-bar {
        display: block;
        position: absolute;
        left: 50%;
        top: 6px;
        width: 36px;
        height: 4px;
        margin-left: -18px;
        border-radius: 99px;
        background: rgba(148, 163, 184, 0.45);
    }
    .map-side-head h3 { padding-top: 4px; }
    #countryList {
        flex: 1;
        min-height: 0;
        -webkit-overflow-scrolling: touch;
    }
    .country-item {
        padding: 12px 2px;
        min-height: 44px;
        align-items: center;
        font-size: 15px;
    }
}
