:root {
    color-scheme: light;
    --page: #f9f6fa;
    --card: rgba(255,255,255,.94);
    --ink: #32263d;
    --secondary: #63556e;
    --muted: #71647c;
    --line: #eadfeb;
    --rose: #9c285d;
    --accent: #b73872;
    --soft: #fae9f1;
    --green: #20624d;
    --green-bg: #e8f5ed;
    --warn: #865015;
    --warn-bg: #fff2db;
    --red: #a02e48;
    --red-bg: #fceaf0;
    --blue: #6650a2;
    --blue-bg: #f0ebf9;
    --shadow: 0 2px 6px #54325506, 0 14px 34px #714e7810;
    --font: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display:none !important; }
html { min-width: 320px; }
body { margin: 0; font: 16px/1.55 var(--font); color: var(--ink); background: var(--page); }
button, input, select, textarea { font: inherit; }
button, select { cursor:pointer; }
button { color:inherit; }
:focus-visible { outline: 3px solid #ac3e7ccc; outline-offset: 3px; }
button:disabled { opacity: .6; cursor:progress; }
a { color: var(--rose); }
h1,h2,h3,p { margin:0; }
h2 { font-size: 20px; font-weight: 720; letter-spacing:.01em; line-height:1.4; }
.loading { display:grid; place-items:center; align-content:center; gap:12px; min-height:100dvh; color:var(--secondary); }
.login-screen { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(380px,1fr); min-height:100dvh; }
.login-picture {
    background: linear-gradient(90deg,#f8dfe722,#28182816), url("/assets/spring-yachiyo.webp") 67% 50% / cover no-repeat;
    min-height:100dvh;
}
.login-panel { display:grid; place-items:center; padding:40px; background:linear-gradient(140deg,#fff,#fff7fb 62%,#f2edf9); }
.login-card { width:min(100%,390px); }
.brand { display:flex; gap:11px; align-items:center; white-space:nowrap; }
.brand img { border-radius:13px; box-shadow:0 4px 12px #9c285d24; object-fit: cover; }
.brand strong { display:block; font-size:18px; font-weight:760; letter-spacing:.045em; line-height:1.3; }
.brand span { display:block; color:var(--muted); font-size:13px; margin-top:2px; }
.login-card h1 { margin-top:45px; font-size:36px; letter-spacing:-.03em; }
.login-card p { color:var(--secondary); margin-top:9px; }
.login-card form { display:grid; gap:17px; margin-top:28px; }
label { display:grid; gap:7px; font-weight:610; }
input:not([type=checkbox]),select,textarea {
    width:100%; color:var(--ink); border:1px solid var(--line); padding:10px 12px;
    border-radius:10px; background:#fff; min-width:0;
}
input::placeholder, textarea::placeholder { color:#81758a; }
input:not([type=checkbox]):hover, select:hover, textarea:hover { border-color:#cbb6ce; }
select { appearance:none; padding-right:32px; background:
    linear-gradient(45deg,transparent 49%,#766384 50%, #766384 64%, transparent 65%) right 17px center/6px 6px no-repeat,
    linear-gradient(135deg,transparent 36%,#766384 37%,#766384 50%,transparent 51%) right 12px center/6px 6px no-repeat,#fff; }
.button { display:inline-flex; justify-content:center; align-items:center; gap:6px; padding:9px 14px; min-height:39px; border:1px solid transparent; border-radius:10px; white-space:nowrap; font-weight:650; line-height:1.35; }
.button.primary { color:white; background:linear-gradient(115deg,#a32d63,#ad366e); box-shadow:0 4px 10px #a12c6425; }
.button.primary:hover { background:#80204d; }
.button.quiet { border-color:var(--line); background:#fff9fd; }
.button.quiet:hover { background:#f7ecf4; }
.button.text { border:0; background:none; color:var(--rose); padding-inline:5px; }
.button.text:hover { text-decoration:underline; }
.login-submit { margin-top:4px; min-height:46px; }
.login-card .login-origin { margin-top:28px; font-size:13px; color:var(--muted); }
.form-error { color:var(--red) !important; font-weight:560; }
.shell { display:grid; grid-template-columns:217px minmax(0,1fr); min-height:100dvh; }
.sidebar {
    display:flex; flex-direction:column; height:100dvh; position:sticky; top:0; background:linear-gradient(170deg,#fffafe,#fcf8fc 70%,#f4eaf3);
    border-right:1px solid var(--line); padding:25px 16px 16px; z-index:2;
}
.sidebar .brand { padding-inline:8px; }
.navigation { display:grid; gap:6px; margin-top:39px; }
.navigation button, .logout {
    display:flex; align-items:center; gap:11px; min-height:43px; text-align:left; padding:10px 11px; border:0; background:none; border-radius:10px; font-weight:610;
}
.navigation button:hover,.logout:hover { background:#f5eaf5; }
.navigation button[aria-current="page"] { background:#f8e6f0; color:#8c2356; }
.nav-icon { width:16px; height:16px; position:relative; display:inline-block; flex:none; color:inherit; }
.icon-grid { border:1.6px solid currentColor; border-radius:4px; background:linear-gradient(currentColor,currentColor) center/1.4px 100% no-repeat,linear-gradient(currentColor,currentColor) center/100% 1.4px no-repeat; }
.icon-host { border:1.6px solid currentColor; border-radius:3px; background:linear-gradient(currentColor,currentColor) center/100% 1.4px no-repeat; }
.icon-host::after { content:""; position:absolute; width:2px;height:2px;left:3px;top:3px;border-radius:50%;background:currentColor;box-shadow:0 6px 0 currentColor; }
.icon-pulse { border-left:1.6px solid currentColor; border-bottom:1.6px solid currentColor; border-radius:1px; }
.icon-pulse::after { content:""; position:absolute; top:5px; left:3px; width:10px; height:5px; border-top:1.6px solid currentColor; border-right:1.6px solid currentColor; transform:skewY(-25deg); }
.icon-door { border:1.6px solid currentColor; border-right:0; height:14px; width:10px; border-radius:3px 0 0 3px; margin-right:6px; }
.icon-door::after { content:""; position:absolute; top:5px; left:4px; width:11px; height:1.5px; background:currentColor; }
.sidebar-bottom { margin-top:auto; display:grid; gap:12px; }
.sources { background:#fffaff; border:1px solid var(--line); border-radius:12px; padding:11px; display:grid; gap:6px; font-size:13px; }
.sources p { color:var(--muted); margin-bottom:2px; }
.sources > div { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.source-state { color:var(--muted); white-space:nowrap; }
.source-state.is-up { color:var(--green); }
.source-state.is-down { color:var(--red); }
.content { width:min(100%,1590px); padding:23px clamp(18px,2.7vw,42px) 45px; justify-self:center; }
.topbar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:18px; }
.trail { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:14px; }
.trail strong { color:var(--ink); font-weight:660; }
.top-actions,.chart-actions,.host-filters { display:flex; gap:9px; align-items:center; }
.hero {
    min-height:174px; border:1px solid #eee0ed; border-radius:20px; position:relative; overflow:hidden; display:flex; align-items:center;
    background:linear-gradient(90deg,#fbf0f8 0%,#fbf0f8ee 28%,#fbf0f850 62%,#f9eff415 86%),url("/assets/spring-lake.webp") 55% 59% / cover no-repeat;
    box-shadow:var(--shadow);
}
.hero-content { padding:21px 29px 25px; }
.hero-date { color:#774365; font-size:13px; font-weight:670; letter-spacing:.065em; margin-bottom:5px; }
.hero h1 { font-size:clamp(30px,3vw,45px); font-weight:780; line-height:1.2; letter-spacing:.006em; }
.hero p { color:#523c5a; font-weight:590; margin-top:10px; }
.last-updated { margin:0 14px 12px auto; align-self:flex-end; padding:4px 8px; border-radius:8px; background:#fff9; color:#523c5a; font-size:12px; white-space:nowrap; }
.metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:13px; margin:16px 0; }
.metric { background:var(--card); box-shadow:var(--shadow); border:1px solid var(--line); border-radius:15px; padding:15px 16px; min-width:0; }
.metric .metric-title { display:flex; align-items:center; gap:8px; color:var(--secondary); font-weight:610; font-size:14px; }
.metric-icon { width:25px; height:25px; display:grid; place-items:center; border-radius:8px; background:var(--soft); color:var(--rose); font-size:15px; font-weight:700; }
.metric .big { font-size:27px; font-weight:770; line-height:1.22; letter-spacing:-.035em; margin-top:6px; font-variant-numeric:tabular-nums; }
.metric small { color:var(--muted); font-size:13px; display:block; }
.workspace-panels { display:grid; grid-template-columns:minmax(0,1.54fr) minmax(0,1fr); gap:15px; align-items:start; }
.workspace-panels.single { grid-template-columns:minmax(0,1fr); }
.panel { background:var(--card); box-shadow:var(--shadow); border:1px solid var(--line); border-radius:17px; min-width:0; }
.panel-header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; padding:16px 17px 12px; }
.panel-header p { color:var(--muted); font-size:13px; margin-top:3px; }
.chart-actions { flex-wrap:wrap; justify-content:flex-end; }
.chart-actions select { width:135px; padding-block:6px; font-size:13px; }
.segments { display:flex; background:#f8f1f7; border:1px solid var(--line); border-radius:9px; padding:2px; white-space:nowrap; }
.segments button { background:none; border:0; padding:4px 8px; border-radius:7px; color:var(--muted); font-size:13px; font-weight:600; }
.segments button[aria-pressed=true] { background:white; color:var(--rose); box-shadow:0 1px 4px #7b467a15; }
.chart-legend { display:flex; gap:8px; padding:0 16px 6px; flex-wrap:wrap; }
.legend-item { border:1px solid var(--line); padding:4px 8px; border-radius:7px; background:#fbf7fb; display:flex; gap:6px; align-items:center; font-size:13px; color:var(--secondary); }
.legend-item[aria-pressed=false] { opacity:.55; background:white; }
.legend-dot,.dot { display:inline-block; width:8px;height:8px;border-radius:50%;background:currentColor; flex:none; }
.legend-cpu .legend-dot { color:#ad376f; }
.legend-memory .legend-dot { color:#7253b0; }
.legend-disk .legend-dot { color:#267765; }
.chart-wrap { margin:0 15px 14px; position:relative; height:219px; }
.chart-wrap canvas { width:100%;height:100%; display:block; }
.chart-empty { inset:0; position:absolute; display:grid; place-items:center; color:var(--muted); background:#fff7; text-align:center; padding:14px; pointer-events:none; }
.chart-tip { position:absolute; right:5px; top:6px; padding:7px 10px; background:#fffcff; border:1px solid var(--line); border-radius:8px; box-shadow:var(--shadow); font-size:13px; pointer-events:none; }
.probes-list { padding:0 12px 11px; display:grid; gap:2px; }
.probe-row { display:flex; align-items:center; min-width:0; gap:6px; border:0; padding:9px 6px; border-top:1px solid #f1e8f1; background:none; text-align:left; width:100%; }
.probe-row:hover { background:#fbf3f8; border-radius:7px; }
.probe-main { min-width:0; display:grid; gap:2px; margin-right:auto; }
.probe-name { font-size:14px; font-weight:640; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.probe-target { font-size:12px; color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.heartbeats { display:flex; align-items:center; gap:3px; min-height:21px; padding-inline:3px; }
.heartbeat { display:inline-block; width:4px; height:15px; border-radius:2px; background:#a9cbbb; }
.heartbeat.down { background:#d96887; }
.heartbeat.pending { background:#e3ae59; }
.heartbeat.maintenance { background:#a594c9; }
.heartbeat.unknown { background:#d9d1dd; }
.pill { display:inline-flex; align-items:center; gap:5px; border-radius:99px; padding:3px 8px; font-size:12px; font-weight:650; color:var(--blue); background:var(--blue-bg); white-space:nowrap; }
.pill.up { color:var(--green); background:var(--green-bg); }
.pill.degraded,.pill.pending { color:var(--warn); background:var(--warn-bg); }
.pill.down { color:var(--red); background:var(--red-bg); }
.probe-latency { font-variant-numeric:tabular-nums; min-width:51px; text-align:right; color:var(--muted); font-size:12px; white-space:nowrap; }
.hosts-panel { margin-top:16px; }
.host-filters input { min-width:145px; max-width:190px; font-size:14px; padding-block:7px; }
.host-filters select { min-width:115px; font-size:14px; padding-block:7px; }
.table-scroller { overflow-x:auto; padding-inline:16px; padding-bottom:7px; }
table { border-collapse:collapse; width:100%; min-width:630px; text-align:left; font-variant-numeric:tabular-nums; }
th { color:var(--muted); font-weight:600; font-size:13px; background:#faf5fa; }
th,td { padding:8px 10px; border-bottom:1px solid #f0e8f0; white-space:nowrap; }
th:first-child {border-radius:8px 0 0 8px;} th:last-child {border-radius:0 8px 8px 0;}
tbody tr:last-child td { border-bottom:0; }
.host-button { border:0; padding:1px 0; text-align:left; background:none; display:grid; color:var(--ink); }
.host-button:hover strong { color:var(--rose); text-decoration:underline; }
.host-button strong { font-size:14px; }
.host-button span { font-size:12px; color:var(--muted); }
.resource-value { min-width:73px; display:grid; gap:4px; font-size:13px; }
.resource-value progress { display:block; width:64px;height:4px; appearance:none; accent-color:#aa467c; border:0; }
progress::-webkit-progress-bar { background:#efe5ed;border-radius:6px; }
progress::-webkit-progress-value { background:#b85b8d;border-radius:6px; }
progress::-moz-progress-bar { background:#b85b8d;border-radius:6px; }
.table-tone { color:var(--muted); font-size:13px; }
.notice { background:#fff4df; color:#704817; border:1px solid #f0deb8; padding:10px 13px; border-radius:10px; margin-bottom:12px; }
.empty { color:var(--muted); text-align:center; padding:24px 14px; }
.dialog { width:min(560px,calc(100vw - 28px)); max-height:calc(100dvh - 32px); background:#fffcff; color:var(--ink); border:1px solid var(--line); border-radius:18px; padding:20px; box-shadow:0 24px 80px #39264245; }
.dialog::backdrop { background:#38223b66; }
.dialog-head { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px; }
.close { border:1px solid var(--line); background:#fff; border-radius:9px; width:34px; height:34px; font-size:22px; line-height:1; }
.dialog form,.dialog section { display:grid; gap:14px; }
.dialog-detail { color:var(--secondary); }
.dialog-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:5px; }
.form-check { display:flex; align-items:center; gap:8px; }
.form-check input { width:17px; height:17px; accent-color:var(--accent); }
textarea { resize:vertical; font:13px/1.5 ui-monospace,monospace; overflow-wrap:anywhere; }
.detail-list { display:grid; gap:8px; margin:16px 0; }
.detail-row { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:8px; border-bottom:1px solid var(--line); padding:0 0 8px; }
.detail-row span:first-child { color:var(--secondary); }
.detail-stats { display:flex; flex-wrap:wrap; gap:12px; font-size:14px; }
.toast { position:fixed; z-index:4; right:22px; bottom:20px; background:#442b48; color:#fff; padding:11px 16px; border-radius:10px; box-shadow:var(--shadow); }
@media (max-width:1140px) {
    .shell { grid-template-columns:178px minmax(0,1fr); }
    .sidebar { padding-inline:12px; }
    .panel-header { flex-wrap:wrap; }
    .chart-actions { justify-content:flex-start; }
    .probe-latency { display:none; }
}
@media (max-width:900px) {
    .shell { display:block; }
    .sidebar { height:auto; padding:12px 17px; display:flex; flex-direction:row; align-items:center; gap:14px; flex-wrap:wrap; border-right:0; border-bottom:1px solid var(--line); }
    .sidebar .brand { padding:0; }
    .navigation { display:flex; margin:0; }
    .navigation button { min-height:36px; padding:7px 9px; }
    .sidebar-bottom { margin:0 0 0 auto; display:block; }
    .sources { display:none; }
    .logout { min-height:36px; padding:7px 9px; font-size:13px; }
    .content { padding-top:15px; }
}
@media (max-width:670px) {
    .login-screen { display:block; background:linear-gradient(140deg,#fff,#fff7fb); }
    .login-picture { min-height:0; height:25dvh; background-position:70% 32%; }
    .login-panel { padding:30px 22px 45px; }
    .login-card h1 { margin-top:26px; font-size:29px; }
    .workspace-panels { grid-template-columns:minmax(0,1fr); }
    .metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .top-actions .quiet { padding-inline:9px; }
    .hero { min-height:149px; }
    .hero-content { padding:18px 14px; }
    .hero p { font-size:14px; }
    .last-updated { display:none; }
    .sidebar { gap:8px; }
    .sidebar .brand img { width:33px;height:33px; }
    .sidebar .brand strong { font-size:15px; }
    .sidebar .brand span,.navigation .nav-icon,.logout .nav-icon { display:none; }
    .navigation { order:3; flex-basis:100%; }
    .navigation button { flex:1; justify-content:center; font-size:14px; }
    .probe-latency { display:block; }
}
@media (prefers-reduced-motion:no-preference) {
    button { transition:background .12s,border-color .12s; }
}
.chart-probes { display:flex; gap:6px; align-items:center; flex-wrap:wrap; margin:0 15px 12px; font-size:12px; color:var(--muted); }
.chart-probes button { border:1px solid var(--line); background:#fffbff; border-radius:7px; padding:3px 7px; }
.chart-probes button:hover { background:var(--soft); }
.detail-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:14px; }
.probe-history { display:flex; flex-wrap:wrap; gap:4px; margin-top:10px; }
.probe-history .heartbeat { width:6px;height:20px; }
@media (max-width:670px) {
    .hosts-panel .table-scroller { overflow:visible; padding:0 12px 13px; }
    .hosts-panel table { display:block; min-width:0; }
    .hosts-panel thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
    .hosts-panel tbody { display:grid; gap:8px; }
    .hosts-panel tr { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border:1px solid var(--line); border-radius:11px; padding:4px 6px; }
    .hosts-panel td { display:flex; align-items:flex-start; padding:5px 7px; border:0; min-width:0; }
    .hosts-panel td:first-child { grid-column:span 2; }
    .hosts-panel td:nth-child(2) { justify-content:flex-end; }
    .hosts-panel td:last-child { grid-column:1 / -1; font-size:12px; }
    .hosts-panel td:last-child::before { content:"探测"; margin-right:8px; }
    .hosts-panel .resource-value { min-width:0; }
    .hosts-panel td:nth-child(3) .resource-value::before { content:"CPU"; color:var(--muted); }
    .hosts-panel td:nth-child(4) .resource-value::before { content:"内存"; color:var(--muted); }
    .hosts-panel td:nth-child(5) .resource-value::before { content:"磁盘"; color:var(--muted); }
}
.chart-toolbar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; padding:0 16px 8px; }
.chart-toolbar .chart-legend { padding:0; }
.legend-sent .legend-dot { color:#a63268; }
.legend-received .legend-dot { color:#267765; }
.traffic-summary { margin:0 15px 10px; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; }
.traffic-stat { border:1px solid var(--line); background:#fbf6fb; padding:7px 9px; border-radius:9px; }
.traffic-stat span { display:block; font-size:12px; color:var(--muted); }
.traffic-stat strong { display:block; font-size:14px; font-variant-numeric:tabular-nums; }
.traffic-note { grid-column:1 / -1; color:var(--muted); font-size:12px; }
.host-network { font-variant-numeric:tabular-nums; font-size:13px; color:var(--secondary); }
.network-label { display:none; }
@media (max-width:670px) {
    .hosts-panel td.host-network { display:grid; min-width:0; }
    .hosts-panel td.host-network .network-label { display:block; font-size:12px; color:var(--muted); }
    .hosts-panel td:last-child { grid-column:auto; display:grid; white-space:normal; }
    .hosts-panel td:last-child::before { margin:0; }
}
.session-actions { display:grid; gap:4px; }
.icon-account { border:1.6px solid currentColor; border-radius:4px; }
.icon-account::before { content:""; position:absolute; border-radius:50%; width:4px;height:4px; background:currentColor; left:4px;top:2px; }
.icon-account::after { content:""; position:absolute; border-radius:4px 4px 1px 1px; width:8px;height:4px; background:currentColor; left:2px;bottom:2px; }
.login-card .login-note { padding:10px; border-radius:9px; background:#e8f5ed; color:var(--green); }
@media (max-width:900px) { .session-actions { display:flex; flex-wrap:wrap; } }
