/* ==========================================================================
   南林　校园网络质量监测中心
   设计系统：浅色为主，支持深色；系统字体栈；无外部依赖
   ========================================================================== */

:root {
    --bg: #f4f6fb;
    --bg-grad-1: #eef3ff;
    --bg-grad-2: #f6fbff;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --ink: #0d1b2a;
    --ink-2: #31435c;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --line: #e5eaf3;
    --line-strong: #d5dde9;

    --brand: #2563eb;
    --brand-600: #1d4ed8;
    --brand-2: #06b6d4;
    --brand-soft: #eff5ff;
    --brand-ink: #ffffff;

    --ok: #10b981;
    --good: #22c55e;
    --warn: #f59e0b;
    --bad: #ef4444;
    --ok-soft: #ecfdf5;
    --warn-soft: #fffbeb;
    --bad-soft: #fef2f2;

    --shadow-xs: 0 1px 2px rgba(13, 27, 42, .05);
    --shadow-sm: 0 2px 6px rgba(13, 27, 42, .05);
    --shadow-md: 0 16px 40px -20px rgba(13, 27, 42, .25);
    --shadow-lg: 0 30px 60px -30px rgba(13, 27, 42, .35);

    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius: 18px;
    --radius-lg: 24px;

    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Consolas, monospace;

    --header-h: 68px;
}

[data-theme="dark"] {
    --bg: #070d18;
    --bg-grad-1: #0a1526;
    --bg-grad-2: #071019;
    --surface: #0f1a2c;
    --surface-2: #0c1626;
    --surface-3: #142238;
    --ink: #e8eefb;
    --ink-2: #c3cfe3;
    --muted: #8fa1bd;
    --muted-2: #6b7d9b;
    --line: #1d2a42;
    --line-strong: #2a3a57;

    --brand: #4f8cff;
    --brand-600: #3b7bf5;
    --brand-2: #22d3ee;
    --brand-soft: #12233f;
    --brand-ink: #ffffff;

    --ok-soft: #0c2a22;
    --warn-soft: #2b2110;
    --bad-soft: #2c1416;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .35);
    --shadow-md: 0 18px 40px -22px rgba(0, 0, 0, .75);
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.02em; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-600); }
img, svg, canvas { display: block; max-width: 100%; }
.ico { display: inline-block; width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.15em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code, .mono { font-family: var(--mono); font-size: .88em; }

::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
    border-radius: 6px;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -100px;
    padding: 10px 18px;
    background: var(--brand);
    color: #fff;
    border-radius: 0 0 12px 12px;
    z-index: 200;
    transition: top .15s;
}
.skip-link:focus { top: 0; color: #fff; }

.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.page-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(900px 520px at 8% -8%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 65%),
        radial-gradient(800px 500px at 96% 0%, color-mix(in srgb, var(--brand-2) 10%, transparent), transparent 60%),
        linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2) 40%, var(--bg));
    pointer-events: none;
}

/* --------------------------------------------------------------- header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--line);
    border-bottom-color: color-mix(in srgb, var(--line) 80%, transparent);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { display: inline-flex; width: 38px; height: 38px; flex-shrink: 0; }
.brand-mark.sm { width: 32px; height: 32px; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.brand-text small { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 8px; }

.nav-link {
    position: relative;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--ink-2);
    transition: background .15s, color .15s;
    white-space: nowrap;
}
.nav-link:hover { background: var(--surface-3); color: var(--ink); }
.nav-link.is-active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink-2);
    transition: background .15s, border-color .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn .ico { width: 18px; height: 18px; }

.theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: block; }

/* -------------------------------------------------------------- buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: transform .12s, box-shadow .18s, background .18s, border-color .18s;
}
.btn .ico { width: 17px; height: 17px; }
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: var(--brand-ink);
    box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--brand) 70%, transparent);
}
.btn-primary:hover { color: #fff; box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--brand) 80%, transparent); }

.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); }

.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); color: var(--brand-600); }

.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ----------------------------------------------------------------- hero */
.hero { padding: 44px 0 10px; }

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
    gap: 36px;
    align-items: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .01em;
}
.eyebrow .dot-live {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); }
    70% { box-shadow: 0 0 0 8px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
    margin: 18px 0 14px;
    font-size: clamp(32px, 4.4vw, 46px);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.12;
}
.hero h1 .accent {
    background: linear-gradient(120deg, var(--brand), var(--brand-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-lead { font-size: 16px; color: var(--muted); max-width: 34em; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin-top: 26px;
    color: var(--muted);
    font-size: 13px;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta .ico { width: 15px; height: 15px; color: var(--brand); }

/* ----------------------------------------------------------- live panel */
.live-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 26px 26px 22px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.live-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--brand-2), transparent);
}

.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-title { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.live-title .ico { width: 17px; height: 17px; color: var(--brand); }

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--surface-3);
    color: var(--muted);
}
.status-chip::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
}
.status-chip.is-ok { background: var(--ok-soft); color: #047857; }
.status-chip.is-warn { background: var(--warn-soft); color: #b45309; }
.status-chip.is-bad { background: var(--bad-soft); color: #b91c1c; }
.status-chip.is-running { background: var(--brand-soft); color: var(--brand); }
.status-chip.is-running::before { animation: pulse 1.2s infinite; }

.live-value {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 18px 0 2px;
}
.live-number {
    font-size: clamp(50px, 7vw, 64px);
    font-weight: 800;
    letter-spacing: -.04em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}
.live-unit { font-size: 18px; font-weight: 600; color: var(--muted); }

.live-caption { font-size: 13px; color: var(--muted); min-height: 20px; }

.mini-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 20px 0 16px;
}
.mini-stat {
    padding: 10px 8px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    text-align: center;
}
.mini-stat b {
    display: block;
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
}
.mini-stat span { font-size: 11px; color: var(--muted); }

.live-chart { height: 108px; margin: 0 -6px; }
.live-chart canvas { display: block; width: 100%; height: 100%; }

.live-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
    padding-top: 0;
    font-size: 12.5px;
    color: var(--muted);
}
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
    width: 38px; height: 22px; border-radius: 999px;
    background: var(--line-strong);
    position: relative;
    transition: background .2s;
}
.switch-track::after {
    content: "";
    position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
    transition: transform .2s;
}
.switch input:checked + .switch-track { background: var(--brand); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }

/* --------------------------------------------------------------- layout */
.section { padding: 34px 0 8px; }
.section-tight { padding: 22px 0 4px; }

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.section-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.section-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.section-actions { display: flex; align-items: center; gap: 8px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.card-pad { padding: 22px; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}
.card-head h3 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ico { width: 16px; height: 16px; color: var(--brand); }
.card-head .hint { font-size: 12px; color: var(--muted); }
.card-body { padding: 20px 22px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.grid-main.align-start { align-items: start; }

/* ------------------------------------------------------------- kpi card */
.kpi {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    flex-shrink: 0;
}
.kpi-icon .ico { width: 20px; height: 20px; }
.kpi-icon.ok { background: var(--ok-soft); color: #047857; }
.kpi-icon.warn { background: var(--warn-soft); color: #b45309; }
.kpi-icon.bad { background: var(--bad-soft); color: #b91c1c; }
.kpi-body { min-width: 0; }
.kpi-label { font-size: 12.5px; color: var(--muted); }
.kpi-value {
    font-size: 25px;
    font-weight: 750;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
}
.kpi-sub { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.kpi-value small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; }

/* --------------------------------------------------------------- charts */
.chart-wrap { position: relative; width: 100%; height: 260px; }
.chart-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 13px;
    background: repeating-linear-gradient(0deg, transparent, transparent 39px, color-mix(in srgb, var(--line) 55%, transparent) 39px, color-mix(in srgb, var(--line) 55%, transparent) 40px);
    border-radius: 8px;
}
.chart-empty[hidden] { display: none; }
.chart-wrap.sm { height: 200px; }
.chart-wrap.lg { height: 320px; }
.chart-wrap canvas { width: 100% !important; height: 100% !important; }

/* --------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
    text-align: left;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    white-space: nowrap;
}
.data-table td {
    padding: 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.data-table .strong { font-weight: 600; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--surface-3);
    color: var(--muted);
    white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: #047857; }
.badge.good { background: var(--ok-soft); color: #15803d; }
.badge.warn { background: var(--warn-soft); color: #b45309; }
.badge.bad { background: var(--bad-soft); color: #b91c1c; }

/* --------------------------------------------------------------- forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.input, .select, textarea.input {
    width: 100%;
    padding: 10px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, textarea.input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row .field { margin-bottom: 0; flex: 1 1 150px; }

.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; padding: 32px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 24px; }

/* ---------------------------------------------------------------- misc */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 11px; gap: 2px; }
.segmented button {
    border: 0;
    background: transparent;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.segmented button.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-xs); }

.notice {
    display: flex;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-2);
}
.notice .ico { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: var(--brand); }
.notice.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, var(--line)); }
.notice.ok .ico { color: #047857; }
.notice.bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.notice.bad .ico { color: #b91c1c; }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 32%, var(--line)); }
.notice.warn .ico { color: #b45309; }

.empty {
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 46px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
}
.empty .ico { width: 30px; height: 30px; color: var(--muted-2); }

.skeleton {
    background: linear-gradient(90deg, var(--surface-3) 25%, color-mix(in srgb, var(--surface-3) 55%, var(--surface)) 37%, var(--surface-3) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 8px;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.hero-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 12.5px;
    color: var(--muted);
}
.pill b { color: var(--ink); font-weight: 650; }

/* --------------------------------------------------------------- footer */
.site-footer {
    margin-top: 56px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.footer-top {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
    gap: 32px;
    padding: 42px 24px 30px;
}
.footer-brand { display: flex; align-items: flex-start; gap: 12px; }
.footer-brand strong { font-size: 14px; }
.footer-brand p { font-size: 12px; color: var(--muted); margin-top: 4px; max-width: 26em; }
.footer-brand .footer-desc { color: var(--muted-2); font-size: 11.5px; }
.footer-col h4 {
    margin: 0 0 12px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted-2);
}
.footer-col > a {
    display: block;
    padding: 5px 0;
    font-size: 13px;
    color: var(--ink-2);
}
.footer-col > a:hover { color: var(--brand); }
.footer-link {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 5px 0;
    color: var(--ink-2);
}
.footer-link .ico { margin-top: 2px; color: var(--muted); flex-shrink: 0; }
.footer-link strong { display: block; font-size: 13px; font-weight: 600; }
.footer-link small { display: block; font-size: 11.5px; color: var(--muted); }
.footer-link:hover strong { color: var(--brand); }
.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    padding: 18px 24px 28px;
    border-top: 1px solid var(--line);
}
.footer-legal {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 11.5px;
    color: var(--muted-2);
}
.footer-legal a { color: var(--muted); }
.footer-legal a:hover { color: var(--brand); }

/* ------------------------------------------------------------ utilities */
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.wrap-gap { flex-wrap: wrap; }
.right { text-align: right; }
.center { text-align: center; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------- 排行 */
.rank-list { display: flex; flex-direction: column; gap: 14px; }
.rank-item { display: flex; align-items: center; gap: 12px; }
.rank-no {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px; height: 24px;
    border-radius: 8px;
    background: var(--surface-3);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.rank-no.top { background: var(--brand-soft); color: var(--brand); }
.rank-main { flex: 1; min-width: 0; }
.rank-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rank-top strong { font-size: 13.5px; font-weight: 600; }
.rank-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.rank-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

/* --------------------------------------------------------------- CTA */
.cta-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    flex-wrap: wrap;
    padding: 30px 34px;
    border-radius: var(--radius-lg);
    border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line));
    background:
        radial-gradient(600px 220px at 100% 0%, color-mix(in srgb, var(--brand-2) 18%, transparent), transparent 70%),
        linear-gradient(135deg, var(--brand-soft), var(--surface));
    box-shadow: var(--shadow-md);
}
.cta-band h2 { font-size: 22px; letter-spacing: -.02em; }
.cta-band p { color: var(--muted); font-size: 13.5px; margin-top: 6px; }

/* --------------------------------------------------------------- 下载页 */
.download-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
    flex-wrap: wrap;
}
.download-icon {
    display: grid;
    place-items: center;
    width: 48px; height: 48px;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--brand);
    flex-shrink: 0;
}
.download-icon .ico { width: 22px; height: 22px; }
.download-info { flex: 1; min-width: 200px; }
.download-name { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 15px; flex-wrap: wrap; }
.download-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }

.checksum { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.checksum summary { cursor: pointer; padding: 4px 0; user-select: none; }
.checksum code { display: block; margin-top: 8px; padding: 10px 12px; border-radius: 9px; background: var(--surface-3); word-break: break-all; color: var(--ink-2); }

.changelog { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.changelog h4 { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 8px; }
.changelog h4 .ico { width: 14px; height: 14px; color: var(--brand); }
.changelog ul { display: flex; flex-direction: column; gap: 6px; }
.changelog li { position: relative; padding-left: 14px; font-size: 12.5px; color: var(--ink-2); }
.changelog li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }

.steps { display: flex; flex-direction: column; gap: 18px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps p { margin-top: 2px; }
.step-no {
    display: grid;
    place-items: center;
    width: 26px; height: 26px;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.help-list { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.help-list li { padding-left: 16px; position: relative; }
.help-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--brand); }
.help-list code { background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }

/* --------------------------------------------------------------- 分布图 */
.dist-legend { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; font-size: 12.5px; }
.dist-legend-item { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.dist-legend-item b { margin-left: auto; color: var(--ink); font-variant-numeric: tabular-nums; }
.dist-total { font-size: 11.5px; color: var(--muted-2); text-align: right; margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); flex-shrink: 0; }
.dot.ok { background: var(--ok); }
.dot.good { background: #22c55e; }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }

/* --------------------------------------------------------------- toast */
.toast-region {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 11px 16px;
    border-radius: 11px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 13px;
    box-shadow: var(--shadow-lg);
    animation: toast-in .2s ease-out;
    max-width: 340px;
}
.toast.err { background: #b91c1c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------- 挂机与贡献 */
.live-toggles { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.contrib-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: 11px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--muted);
    flex-wrap: wrap;
}
.contrib-text b { color: var(--ink); font-variant-numeric: tabular-nums; }
.contrib-text { min-width: 0; }

/* ------------------------------------------------------------- 推广位 */
.ad-band {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 22px;
    margin-top: 10px;
    border: 1px dashed color-mix(in srgb, var(--brand) 30%, var(--line));
    border-radius: 16px;
    background:
        radial-gradient(400px 120px at 100% 0%, color-mix(in srgb, var(--brand-2) 14%, transparent), transparent 70%),
        linear-gradient(135deg, var(--brand-soft), var(--surface));
}
.ad-tag {
    position: absolute;
    top: -9px;
    left: 16px;
    padding: 2px 9px;
    border-radius: 99px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 10.5px;
    color: var(--muted);
    letter-spacing: .04em;
}
.ad-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--brand);
    flex-shrink: 0;
}
.ad-icon .ico { width: 21px; height: 21px; }
.ad-copy { flex: 1; min-width: 200px; }
.ad-copy strong { font-size: 14.5px; }
.ad-copy .ad-sub { margin-left: 6px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.ad-copy p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.ad-cta { flex-shrink: 0; }

.ad-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px dashed color-mix(in srgb, var(--brand) 30%, var(--line));
    background: linear-gradient(160deg, var(--brand-soft), var(--surface));
}
.ad-card .ad-tag { top: -9px; left: 16px; }
.ad-card-head { display: flex; gap: 12px; align-items: center; margin-top: 4px; }
.ad-card-head strong { font-size: 14.5px; }
.ad-desc { font-size: 12.5px; color: var(--muted); }

/* ------------------------------------------------------------- 功能卡 */
.feature-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-xs);
    transition: transform .15s, box-shadow .2s, border-color .2s;
}
.feature-card:hover {
    color: var(--ink);
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
    box-shadow: var(--shadow-md);
}
.feature-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
    flex-shrink: 0;
}
.feature-icon .ico { width: 20px; height: 20px; }
.feature-card h3 { font-size: 15px; margin-bottom: 4px; }
.feature-card p { font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.feature-arrow { width: 17px; height: 17px; color: var(--muted-2); margin-left: auto; flex-shrink: 0; }

/* ------------------------------------------------------------- 友链条 */
.links-strip {
    display: flex;
    align-items: center;
    gap: 8px 18px;
    flex-wrap: wrap;
    padding: 16px 20px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 12.5px;
}
.links-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-2); font-weight: 600; }
.links-label .ico { width: 14px; height: 14px; }
.links-strip a { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.links-strip a:hover { color: var(--brand); }
.links-strip .ico.sm { width: 12px; height: 12px; opacity: .6; }
.links-note { margin-left: auto; color: var(--muted-2); font-size: 11.5px; }

/* --------------------------------------------------------------- 弹窗 */
body.modal-open { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 18px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 14, 26, .62); backdrop-filter: blur(4px); }
.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: toast-in .2s ease-out;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); }
.share-canvas { width: 100%; height: auto; border-radius: 12px; display: block; }

/* --------------------------------------------------------------- 周报 */
.conclusion-list { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: var(--ink-2); }
.conclusion-list li { position: relative; padding-left: 18px; line-height: 1.65; }
.conclusion-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand);
}
.text-ok { color: #047857; }
.text-bad { color: #b91c1c; }

/* --------------------------------------------------------------- 诊断 */
.diag-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.diag-number {
    font-size: clamp(48px, 8vw, 62px);
    font-weight: 800;
    letter-spacing: -.045em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.diag-number span { font-size: 18px; font-weight: 600; color: var(--muted); margin-left: 5px; }
.diag-side { display: flex; gap: 26px; text-align: right; }
.diag-side b { display: block; font-size: 17px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.phase-list { display: flex; flex-direction: column; gap: 13px; }
.phase-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) 76px; gap: 12px; align-items: center; font-size: 12.5px; }
.phase-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.phase-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .5s ease; }
.phase-row b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.diag-history li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.diag-history li:last-child { border-bottom: 0; }
.verdict-line { display: block; }
.verdict-line + .verdict-line { margin-top: 5px; }

/* --------------------------------------------------------------- 快照 */
.snapshot { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.snapshot-item { padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.snapshot-item span { display: block; font-size: 11.5px; color: var(--muted); }
.snapshot-item b { display: block; margin-top: 2px; font-size: 16px; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- 工单 */
.ticket-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.ticket-grid span { display: block; font-size: 11.5px; color: var(--muted); }
.ticket-grid b { font-size: 14px; }
.ticket-message {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    font-size: 14px;
    line-height: 1.75;
    white-space: pre-wrap;
}
.ticket-step { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.ticket-step > span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--line-strong);
    margin-top: 4px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.ticket-step.done > span { background: var(--brand); }
.ticket-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 14px;
    bottom: -2px;
    width: 2px;
    background: var(--line);
}
.ticket-step.done::before { background: var(--brand); }
.check-row { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.check-row input { margin-top: 3px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

/* --------------------------------------------------------------- 告警 */
.alert-list { display: flex; flex-direction: column; gap: 12px; }
.alert-list li { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.alert-list li:last-child { border-bottom: 0; }
.alert-list p { margin-top: 4px; font-size: 12.5px; color: var(--ink-2); line-height: 1.6; }
.inline-form { display: flex; align-items: center; gap: 6px; }
.select-sm { padding: 6px 26px 6px 9px; font-size: 12px; border-radius: 8px; }
.ico.sm { width: 14px; height: 14px; }

/* --------------------------------------------------------- 校区切换 */
.campus-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.campus-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    flex-wrap: wrap;
    padding-top: 6px;
    padding-bottom: 6px;
}
.campus-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-right: 4px;
}
.campus-label .ico { width: 14px; height: 14px; }
.campus-chip {
    padding: 5px 13px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 500;
    transition: background .15s, color .15s, border-color .15s;
}
.campus-chip:hover { border-color: var(--campus, var(--brand)); color: var(--campus, var(--brand)); }
.campus-chip.is-active {
    background: var(--campus, var(--brand));
    border-color: var(--campus, var(--brand));
    color: #fff;
}
.campus-hint { margin-left: auto; font-size: 11.5px; color: var(--muted-2); }

/* --------------------------------------------------------- 校区总览 */
.campus-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.campus-card {
    position: relative;
    display: block;
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}
.campus-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--campus, var(--brand));
}
.campus-card:hover { color: var(--ink); border-color: var(--campus, var(--brand)); }
.campus-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.campus-card-head strong { font-size: 15px; }
.campus-card-head span { font-size: 11.5px; color: var(--muted); }
.campus-card-metrics { display: flex; align-items: baseline; gap: 8px; margin: 10px 0 6px; }
.campus-card-metrics b { font-size: 26px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.campus-card-metrics small { font-size: 12px; color: var(--muted); }
.campus-card-foot { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.campus-card-foot b { color: var(--ink); }

/* --------------------------------------------------------- 网络拓扑 */
.topo-panel { margin-bottom: 18px; }
.topo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.topo-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 650; }
.topo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--campus, var(--brand)); }
.topo-meta { display: flex; gap: 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.topo-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.topo-canvas { position: relative; width: 100%; overflow: hidden; }
.topo-svg { width: 100%; height: auto; display: block; }
.topo-node-label { font-size: 12px; fill: var(--ink-2); font-family: var(--font); }
.topo-core-label { font-size: 13px; font-weight: 700; fill: var(--ink); font-family: var(--font); }
.topo-link { stroke: var(--line-strong); stroke-width: 1.4; fill: none; }
.topo-link.bad { stroke: color-mix(in srgb, var(--bad) 45%, var(--line)); stroke-dasharray: 4 3; }
.topo-detail { margin-top: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); min-height: 44px; }
.topo-detail b { color: var(--ink); }
.topo-mobile { display: flex; flex-direction: column; gap: 14px; padding: 10px 0; }
.topo-mobile-core { align-self: center; color: #fff; padding: 9px 22px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.topo-mobile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.topo-mobile-node { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.topo-mobile-node b { font-size: 13px; }
.topo-mobile-node small { margin-left: auto; color: var(--muted); font-size: 11.5px; }
.topo-mobile-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* --------------------------------------------------------- 网络探测 */
.probe-status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.probe-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.probe-status.ok { color: #047857; }
.probe-status.warn { color: #b45309; }
.probe-status.bad { color: #b91c1c; }
.event-list { display: flex; flex-direction: column; gap: 10px; }
.event-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 12.5px; }
.event-item .badge { flex-shrink: 0; }
.event-item p { color: var(--muted); margin-top: 2px; }

/* NJFUer 工具栏会向 body 注入 3px 品牌线；本站不需要 */
#njf-brand-line { display: none !important; }

/* --------------------------------------------------------- 统一身份 */
.account-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 600;
    transition: border-color .15s, color .15s;
}
.account-link:hover { color: var(--brand); border-color: var(--brand); }
.account-link .ico { width: 15px; height: 15px; }
.account-avatar-sm {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}
.account-name { max-width: 88px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-btn { position: relative; }
.notif-count { position: absolute; top: -2px; right: -2px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 9px; line-height: 15px; text-align: center; font-weight: 700; }
.notif-list { display: flex; flex-direction: column; gap: 8px; }
.notif-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.notif-item.unread { border-color: #b8d9f5; background: #f5fbff; }
.notif-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--brand); flex-shrink: 0; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13.5px; font-weight: 650; }
.notif-body p { font-size: 12.5px; color: var(--muted); margin: 3px 0 4px; }
.notif-link { display: inline-block; margin-left: 10px; font-size: 11.5px; font-weight: 600; color: var(--brand); }

.my-dorm-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid #c7e8e2; border-radius: 14px; background: linear-gradient(135deg, #effcf8, #f2f7ff); color: var(--ink); }
.my-dorm-banner:hover { border-color: var(--brand); }
.my-dorm-banner-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #fff; color: var(--brand); box-shadow: var(--shadow-xs); flex-shrink: 0; }
.my-dorm-banner-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.my-dorm-banner-text strong { font-size: 13.5px; }
.my-dorm-banner-text small { font-size: 11.5px; color: var(--muted); }
.my-dorm-banner-link { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.my-dorm-banner-link .ico { width: 14px; height: 14px; }

.auth-wrap { display: grid; grid-template-columns: 1.08fr .92fr; gap: 36px; align-items: center; max-width: 1040px; margin: 0 auto; }
.auth-landing { min-height: 0; padding: 16px 0 36px; }
.auth-setup { margin-bottom: 14px; padding: 14px 15px; border: 1px solid #f0d9a8; border-radius: 12px; background: #fff9eb; color: #7a5a16; font-size: 12px; line-height: 1.7; }
.auth-setup strong { display: block; font-size: 13px; margin-bottom: 4px; color: #6b4a0b; }
.auth-setup p { margin: 4px 0 0; word-break: break-all; }
.auth-setup code { font-size: 10.5px; background: rgba(0,0,0,.05); padding: 1px 4px; border-radius: 4px; }
.auth-hero h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.12; letter-spacing: -.04em; margin: 16px 0 14px; }
.auth-hero p { color: var(--muted); font-size: 15px; max-width: 34em; }
.auth-benefits { list-style: none; padding: 0; margin: 22px 0 18px; display: grid; gap: 10px; }
.auth-benefits li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-2); }
.auth-benefits .ico { color: var(--ok); width: 16px; height: 16px; }
.auth-note { font-size: 11.5px; color: var(--muted-2); line-height: 1.7; }
.auth-card { max-width: 400px; width: 100%; justify-self: end; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, #0c3d31, #0f9e97); color: #fff; font-weight: 800; }
.auth-brand strong { display: block; font-size: 14px; }
.auth-brand small { display: block; color: var(--muted); font-size: 10.5px; }
.auth-btn { width: 100%; justify-content: center; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--muted-2); font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.account-wrap { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.account-head { display: flex; align-items: center; gap: 16px; padding: 20px 22px; }
.account-avatar { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #06b6d4); color: #fff; font-size: 24px; font-weight: 800; flex-shrink: 0; }
.account-meta { flex: 1; min-width: 0; }
.account-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.account-name-row h1 { font-size: 24px; letter-spacing: -.02em; }
.account-meta p { margin-top: 5px; }
.account-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.account-actions .btn { height: 34px; padding-top: 0; padding-bottom: 0; white-space: nowrap; }
.account-wrap .grid-2 { align-items: start; }
.account-wrap .empty { padding: 28px 16px; }
.bind-panel { margin-top: 4px; padding: 16px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); }
.bind-panel-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; }
.bind-panel-head strong { font-size: 13.5px; }
.bind-panel-head span { font-size: 11px; color: var(--muted); }
.bind-form .form-row { gap: 10px; align-items: flex-start; }
.bind-form .field { margin-bottom: 8px; flex: 1 1 0; min-width: 0; }
.bind-form .field label { font-size: 12px; margin-bottom: 5px; }
.bind-form .hint { margin: 0 0 12px; font-size: 11px; }
.bind-form .btn-block { width: 100%; }
.account-grid { align-items: start; }
.my-dorm-title { font-size: 30px; font-weight: 750; letter-spacing: -.03em; margin: 2px 0 10px; }
.my-dorm-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.my-dorm-metrics div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.my-dorm-metrics b { display: block; font-size: 18px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.my-dorm-metrics span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.binding-list { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.binding-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.my-tickets { display: flex; flex-direction: column; gap: 6px; }
.my-ticket { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); }
.my-ticket:hover { border-color: var(--brand); }
.my-ticket strong { font-size: 12.5px; }
.my-ticket p { margin-top: 2px; }
.device-list { display: flex; flex-direction: column; gap: 8px; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.device-row strong { font-size: 13px; }
.device-row p { margin-top: 2px; }
.device-code-box { margin-top: 16px; padding: 16px; border: 1px dashed #b8d9f5; border-radius: 12px; background: #f5fbff; text-align: center; }
.device-code-box span { display: block; font-size: 10.5px; color: var(--muted); }
.device-code-box b { display: block; font-size: 34px; letter-spacing: .16em; font-variant-numeric: tabular-nums; color: var(--brand); margin: 4px 0; }
.device-code-box small { font-size: 10.5px; color: var(--muted); }
.step-list { margin: 10px 0 0; padding-left: 20px; color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.privacy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 10px; }
.privacy-grid div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.privacy-grid span { display: block; font-size: 10.5px; color: var(--muted); }
.privacy-grid b { display: block; font-size: 13px; margin-top: 2px; word-break: break-all; }
.resident-list { display: flex; flex-wrap: wrap; gap: 8px; }
.resident { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 12px; }
.resident-avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #06b6d4); color: #fff; font-size: 10px; font-weight: 700; }
.service-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.service-card { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--ink); }
.service-card:hover { border-color: var(--brand); }
.service-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface); color: var(--brand); margin-bottom: 5px; }
.service-card strong { font-size: 13px; }
.service-card small { font-size: 10.5px; color: var(--muted); }
.service-action { font-size: 10.5px; color: var(--brand); font-weight: 600; margin-top: 6px; }

@media (max-width: 900px) {
    .auth-wrap { grid-template-columns: 1fr; gap: 24px; }
    .auth-card { justify-self: start; max-width: none; }
    .account-name { display: none; }
    .account-head { align-items: flex-start; flex-wrap: wrap; }
    .account-actions { width: 100%; }
    .service-grid { grid-template-columns: repeat(2, 1fr); }
    .privacy-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------- responsive */
@media (max-width: 1080px) {
    .grid-main { grid-template-columns: minmax(0, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
    .hero { padding-top: 30px; }
    .brand-text small { display: none; }
    .site-nav { margin-left: 0; overflow-x: auto; scrollbar-width: none; }
    .site-nav::-webkit-scrollbar { display: none; }
    .header-cta span { display: none; }
    .header-cta { padding: 9px 11px; }
}

@media (max-width: 760px) {
    :root { --header-h: 116px; }
    .wrap { padding: 0 16px; }
    body { font-size: 14.5px; }
    .site-header { height: auto; }
    .header-inner {
        flex-wrap: wrap;
        gap: 8px 12px;
        padding-top: 10px;
        padding-bottom: 8px;
    }
    .brand { order: 1; }
    .header-actions { order: 2; }
    .site-nav {
        order: 3;
        flex: 1 0 100%;
        width: 100%;
        margin: 0;
        padding-bottom: 2px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .nav-link { padding: 6px 11px; font-size: 13px; }
    .nav-link.nav-hide-sm { display: none; }
    .section-actions { width: 100%; gap: 8px; }
    .section-actions .segmented { flex: 1 1 auto; }
    .section-actions .segmented button { padding: 6px 8px; font-size: 12px; }
    .cell-opt { display: none; }
    .table-wide .data-table { min-width: 720px; }
    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .live-card { padding: 20px 18px 18px; }
    .section-head h2 { font-size: 19px; }
    .chart-wrap { height: 220px; }
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .footer-top { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 30px 16px 22px; }
    .footer-bottom { padding: 14px 16px 26px; align-items: flex-start; flex-direction: column; gap: 8px; }
    .footer-legal { gap: 4px 12px; }
    .ticket-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ad-band { padding: 16px; gap: 12px; }
    .ad-copy .ad-sub { display: none; }
    .ad-cta { margin-left: auto; }
    .phase-row { grid-template-columns: 78px minmax(0, 1fr) 62px; gap: 8px; font-size: 12px; }
    .links-note { margin-left: 0; width: 100%; }
    .data-table th, .data-table td { padding: 10px 9px; }
}

@media (max-width: 360px) {
    .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .hero h1 { font-size: 30px; }
    .live-number { font-size: 48px; }
    .btn { padding: 9px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
    html { scroll-behavior: auto; }
}

@media print {
    .site-header, .site-footer, .hero-actions, .theme-toggle { display: none !important; }
    body { background: #fff; }
}
