/* 控制台:iOS 风格设计系统。浅色 / 深色跟随系统。毛玻璃只用在悬浮层(导航、卡片、面板),内容文字始终落在足够对比度的底上 */
:root {
  color-scheme: light dark;
  --bg: #f2f2f7;
  --blob-a: rgba(10, 132, 255, .16); --blob-b: rgba(175, 82, 222, .10); --blob-c: rgba(52, 199, 89, .10);
  --glass: rgba(255, 255, 255, .72); --glass-strong: rgba(255, 255, 255, .86); --glass-edge: rgba(255, 255, 255, .6);
  --fill: rgba(120, 120, 128, .12); --fill-2: rgba(120, 120, 128, .18);
  --sep: rgba(60, 60, 67, .14);
  --text: #1c1c1e; --text-2: rgba(60, 60, 67, .62); --text-3: rgba(60, 60, 67, .38);
  --accent: #007aff; --accent-ink: #fff; --accent-tint: rgba(0, 122, 255, .12);
  --ok: #34c759; --ok-tint: rgba(52, 199, 89, .15); --ok-ink: #1d7a37;
  --err: #ff3b30; --err-tint: rgba(255, 59, 48, .13); --err-ink: #c4231a;
  --deny: #ff9500; --deny-tint: rgba(255, 149, 0, .16); --deny-ink: #a55f00;
  --track: rgba(60, 60, 67, .18);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px rgba(0, 0, 0, .06);
  --shadow-float: 0 20px 60px rgba(0, 0, 0, .18);
  --r-card: 22px; --r-ctl: 12px; --r-sheet: 28px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Noto Sans CJK SC", system-ui, sans-serif;
  --font-num: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --blob-a: rgba(10, 132, 255, .22); --blob-b: rgba(191, 90, 242, .16); --blob-c: rgba(48, 209, 88, .10);
    --glass: rgba(44, 44, 46, .62); --glass-strong: rgba(44, 44, 46, .86); --glass-edge: rgba(255, 255, 255, .08);
    --fill: rgba(120, 120, 128, .24); --fill-2: rgba(120, 120, 128, .34);
    --sep: rgba(84, 84, 88, .55);
    --text: #f5f5f7; --text-2: rgba(235, 235, 245, .62); --text-3: rgba(235, 235, 245, .34);
    --accent: #0a84ff; --accent-tint: rgba(10, 132, 255, .2);
    --ok: #30d158; --ok-tint: rgba(48, 209, 88, .18); --ok-ink: #5ee07d;
    --err: #ff453a; --err-tint: rgba(255, 69, 58, .18); --err-ink: #ff8a82;
    --deny: #ff9f0a; --deny-tint: rgba(255, 159, 10, .2); --deny-ink: #ffc766;
    --track: rgba(235, 235, 245, .2);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-float: 0 20px 60px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; font: 15px/1.47 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
/* 背景:几块很淡的大色斑,让毛玻璃有东西可以"磨" */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60vw 50vh at 12% -5%, var(--blob-a), transparent 70%), radial-gradient(50vw 45vh at 95% 10%, var(--blob-b), transparent 70%), radial-gradient(55vw 45vh at 70% 105%, var(--blob-c), transparent 70%); }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-2); } .mono { font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--accent-tint); outline-offset: 1px; box-shadow: 0 0 0 1.5px var(--accent); }

/* ---------- 顶栏与导航 ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px; height: 56px; padding: 0 max(20px, calc((100vw - 1240px) / 2 + 24px));
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); border-bottom: .5px solid var(--sep); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: -.01em; }
.brand svg { color: var(--accent); }
.tabs { display: flex; gap: 2px; margin: 0 auto 0 12px; padding: 2px; border-radius: 10px; background: var(--fill); }
.tabs button { height: 30px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 14px; font-weight: 500; cursor: pointer; transition: background .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease); }
.tabs button:hover { color: var(--text); }
.tabs button[aria-current="page"] { background: var(--glass-strong); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
.tabs button svg { display: none; }
.who { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; }

.page { max-width: 1240px; margin: 0 auto; padding: 8px 24px 96px; }
.view { animation: view-in .45s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }

.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 20px 0 16px; }
h1 { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -.025em; }
.sub { margin-top: 4px; color: var(--text-2); font-size: 15px; }
h2 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; }
h3 { font-size: 15px; font-weight: 600; }

/* ---------- 按钮 / 表单 ---------- */
button { cursor: pointer; }
.btn, button.primary, button.ghost, button.danger { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 16px; border: 0; border-radius: var(--r-ctl); font-size: 15px; font-weight: 500; white-space: nowrap; transition: transform .18s var(--ease), background .2s, opacity .2s; }
button.primary { background: var(--accent); color: var(--accent-ink); }
button.ghost { background: var(--fill); color: var(--accent); }
button.danger { background: var(--err-tint); color: var(--err-ink); }
button.small { height: 30px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
button.block { width: 100%; height: 44px; }
button:active:not(:disabled) { transform: scale(.97); opacity: .85; }
button:disabled { opacity: .45; cursor: default; }
button[aria-busy="true"] { position: relative; color: transparent; } button[aria-busy="true"]::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid currentColor; border-color: var(--text-2) transparent var(--text-2) transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
input, select, textarea { width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: var(--r-ctl); background: var(--fill); color: var(--text); transition: box-shadow .2s var(--ease), background .2s; }
textarea { resize: vertical; } input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { outline: none; background: var(--glass-strong); box-shadow: 0 0 0 2px var(--accent); }
label { display: block; margin-top: 14px; font-size: 13px; font-weight: 500; color: var(--text-2); } label > input, label > select, label > textarea { margin-top: 6px; color: var(--text); font-weight: 400; font-size: 15px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: 15px; font-weight: 400; } label.inline input { width: auto; min-height: 0; accent-color: var(--accent); }
.field-hint { display: block; margin-top: 4px; font-size: 12px; font-weight: 400; color: var(--text-3); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.error { min-height: 1.4em; margin-top: 10px; font-size: 13px; color: var(--err-ink); }
.hint { margin-top: 12px; font-size: 12.5px; color: var(--text-2); }

/* ---------- 卡片 / 列表 ---------- */
.card { background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); border: .5px solid var(--glass-edge); border-radius: var(--r-card); box-shadow: var(--shadow); }
.list { overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 12px 20px; align-items: center; padding: 14px 18px; transition: background .2s; }
.row + .row { border-top: .5px solid var(--sep); }
.row:hover { background: var(--fill); }
.row-title { font-weight: 600; } .row-sub { margin-top: 2px; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.state { padding: 36px 16px; text-align: center; color: var(--text-2); }
.state button { margin-top: 12px; }
.skel { display: block; height: 14px; border-radius: 7px; background: var(--fill); animation: pulse 1.4s ease-in-out infinite; } @keyframes pulse { 50% { opacity: .5; } }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--fill); color: var(--text-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--ok-tint); color: var(--ok-ink); } .badge.bad { background: var(--err-tint); color: var(--err-ink); } .badge.warn { background: var(--deny-tint); color: var(--deny-ink); } .badge.info { background: var(--accent-tint); color: var(--accent); }
.badge.plain::before { display: none; }

/* ---------- 登录 ---------- */
#login { max-width: 400px; margin: 12vh auto 0; padding: 32px; }
#login h1 { font-size: 28px; }

/* ---------- 监控:概览 ---------- */
.status-line { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 17px; font-weight: 500; letter-spacing: -.01em; }
.status-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); transition: background .4s var(--ease); }
.status-line[data-tone="ok"] .status-dot { background: var(--ok); } .status-line[data-tone="warn"] .status-dot { background: var(--deny); } .status-line[data-tone="bad"] .status-dot { background: var(--err); }
.conn { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 10px; border-radius: 15px; background: var(--glass); border: .5px solid var(--glass-edge); font-size: 13px; font-weight: 500; color: var(--text-2); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); box-shadow: var(--shadow); }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.conn[data-state="live"] { color: var(--ok-ink); } .conn[data-state="live"] i { background: var(--ok); animation: beat 2s ease-in-out infinite; }
.conn[data-state="retry"] { color: var(--deny-ink); } .conn[data-state="retry"] i { background: var(--deny); animation: beat 1s ease-in-out infinite; }
.conn[data-state="down"] { color: var(--err-ink); } .conn[data-state="down"] i { background: var(--err); }
@keyframes beat { 50% { transform: scale(.65); opacity: .6; } }
.banner { margin: 4px 0 12px; padding: 12px 16px; border-radius: 16px; background: var(--deny-tint); color: var(--deny-ink); font-size: 14px; font-weight: 500; animation: view-in .35s var(--ease); }
.banner[data-tone="bad"] { background: var(--err-tint); color: var(--err-ink); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 8px; }
.kpi { padding: 16px 18px 14px; min-width: 0; }
.kpi .label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.kpi .value { margin-top: 4px; font-family: var(--font-num); font-size: 32px; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; transition: color .4s var(--ease); }
.kpi .value small { font-size: 15px; font-weight: 500; color: var(--text-2); margin-left: 3px; letter-spacing: 0; }
.kpi .note { margin-top: 2px; font-size: 13px; color: var(--text-2); min-height: 1.4em; }
.kpi .note b { font-weight: 600; } .kpi .note .ok-t { color: var(--ok-ink); } .kpi .note .bad-t { color: var(--err-ink); } .kpi .note .warn-t { color: var(--deny-ink); }
.kpi .value.bad { color: var(--err-ink); } .kpi .value.warn { color: var(--deny-ink); }

/* ---------- 拓扑 ---------- */
.topo-card { margin-top: 14px; padding: 0; overflow: hidden; }
.topo-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; } .legend i { width: 14px; height: 4px; border-radius: 2px; background: var(--track); }
.legend .l-active i { background: var(--accent); } .legend .l-ok i { background: var(--ok); } .legend .l-err i { background: var(--err); } .legend .l-deny i { background: var(--deny); }
.topo { position: relative; margin: 8px 12px 6px; min-height: 380px; touch-action: manipulation; }
.topo svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.edge-track { fill: none; stroke: var(--track); stroke-width: 2; stroke-linecap: round; transition: stroke .5s var(--ease), stroke-width .3s var(--ease), opacity .4s; }
.edge-flow { fill: none; stroke: transparent; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 3 11; opacity: 0; transition: opacity .35s var(--ease), stroke .35s var(--ease); }
.edge[data-s="active"] .edge-flow { opacity: 1; stroke: var(--accent); animation: flow .7s linear infinite; }
.edge[data-s="active"][data-dir="rev"] .edge-flow { animation-direction: reverse; }
.edge[data-s="ok"] .edge-track { stroke: var(--ok); stroke-width: 3; } .edge[data-s="error"] .edge-track { stroke: var(--err); stroke-width: 3; } .edge[data-s="denied"] .edge-track { stroke: var(--deny); stroke-width: 3; }
.edge[data-s="active"] .edge-track { stroke: var(--accent); stroke-width: 2.5; opacity: .35; }
.edge[data-dim="1"] .edge-track { opacity: .4; }
@keyframes flow { to { stroke-dashoffset: -28; } }
.edge-hit { fill: none; stroke: transparent; stroke-width: 18; pointer-events: stroke; cursor: pointer; }
.dot { fill: var(--accent); }

.node { position: absolute; z-index: 2; display: flex; align-items: center; gap: 10px; width: 164px; min-height: 56px; padding: 8px 12px; border: .5px solid var(--glass-edge); border-radius: 18px; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: var(--shadow); text-align: left; transform: translate(-50%, -50%); transition: opacity .35s var(--ease), box-shadow .35s var(--ease), transform .25s var(--ease); animation: node-in .5s var(--ease) both; }
@keyframes node-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.85); } }
.node.leaving { opacity: 0; transform: translate(-50%, -50%) scale(.85); pointer-events: none; }
.node:hover { transform: translate(-50%, -50%) scale(1.03); }
.node .st { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); transition: background .4s; }
.node[data-health="up"] .st { background: var(--ok); } .node[data-health="degraded"] .st { background: var(--deny); } .node[data-health="down"] .st { background: var(--err); }
.node .nm { display: block; font-weight: 600; font-size: 14.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 112px; }
.node .ds { display: block; font-size: 12px; color: var(--text-2); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 112px; }
.node[data-off="1"] { opacity: .55; }
.node[data-kind="client"] .st { border-radius: 3px; }
.node::after { content: ""; position: absolute; inset: -3px; border-radius: 21px; border: 2px solid transparent; pointer-events: none; transition: border-color .45s var(--ease), opacity .45s var(--ease); opacity: 0; }
.node[data-s="active"]::after { border-color: var(--accent); opacity: 1; animation: ring 1.1s ease-in-out infinite; }
.node[data-s="ok"]::after { border-color: var(--ok); opacity: 1; } .node[data-s="error"]::after { border-color: var(--err); opacity: 1; } .node[data-s="denied"]::after { border-color: var(--deny); opacity: 1; }
@keyframes ring { 50% { transform: scale(1.04); opacity: .55; } }
.node.gw { width: 132px; min-height: 132px; flex-direction: column; justify-content: center; text-align: center; gap: 2px; border-radius: 36px; background: var(--glass-strong); }
.node.gw::after { inset: -4px; border-radius: 40px; }
.node.gw .nm { max-width: none; font-size: 15px; } .node.gw .ds { max-width: none; }
.node.gw .rate { font-family: var(--font-num); font-size: 30px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.node .tag { position: absolute; top: -8px; right: 8px; height: 18px; padding: 0 7px; border-radius: 9px; background: var(--deny-tint); color: var(--deny-ink); font-size: 11px; font-weight: 600; line-height: 18px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

.activity { display: flex; align-items: flex-end; gap: 2px; height: 34px; margin: 0 20px 16px; }
.activity i { flex: 1; min-height: 2px; border-radius: 1.5px; background: var(--fill-2); transition: height .35s var(--ease), background .35s; }
.activity i.on { background: var(--accent); } .activity i.bad { background: var(--err); }
.activity-cap { display: flex; justify-content: space-between; margin: -10px 20px 14px; font-size: 11.5px; color: var(--text-3); }

.topo-empty { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 8px 16px; border-radius: 16px; background: var(--glass); color: var(--text-2); font-size: 13px; text-align: center; max-width: 90%; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }

/* ---------- 实时日志 ---------- */
.log-card { margin-top: 14px; padding: 0; }
.log-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px 10px; }
.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); }
.seg button { height: 26px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-size: 13px; font-weight: 500; transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--glass-strong); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.log { list-style: none; padding: 0; margin: 0; max-height: 440px; overflow: auto; overscroll-behavior: contain; }
.log li { display: grid; grid-template-columns: 62px minmax(120px, 190px) minmax(0, 1fr) 52px 64px; gap: 10px; align-items: center; padding: 9px 20px; border-top: .5px solid var(--sep); font-size: 13.5px; cursor: pointer; transition: background .2s; }
.log li:hover { background: var(--fill); }
.log li.fresh { animation: fresh 1.6s var(--ease); }
@keyframes fresh { from { background: var(--accent-tint); } }
.log .t { color: var(--text-3); font-variant-numeric: tabular-nums; } .log .route { font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .log .route em { font-style: normal; color: var(--text-3); padding: 0 5px; }
.log .path { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .log .path b { font-weight: 600; color: var(--text); margin-right: 6px; font-size: 12px; }
.log .ms { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pill { justify-self: start; min-width: 40px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 650; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.pill.ok { background: var(--ok-tint); color: var(--ok-ink); } .pill.warn { background: var(--accent-tint); color: var(--accent); } .pill.error { background: var(--err-tint); color: var(--err-ink); } .pill.denied { background: var(--deny-tint); color: var(--deny-ink); }
.log-empty { padding: 40px 20px 44px; text-align: center; color: var(--text-2); }
.log-empty b { display: block; margin-bottom: 4px; color: var(--text); font-size: 16px; }

/* ---------- 详情面板 ---------- */
.sheet { position: fixed; z-index: 50; top: 72px; right: 16px; bottom: 16px; width: min(420px, calc(100vw - 32px)); display: flex; flex-direction: column; background: var(--glass-strong); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); border: .5px solid var(--glass-edge); border-radius: var(--r-sheet); box-shadow: var(--shadow-float); transform: translateX(0); transition: transform .5s var(--ease), opacity .35s var(--ease); }
.sheet[hidden] { display: flex !important; transform: translateX(calc(100% + 32px)); opacity: 0; pointer-events: none; visibility: hidden; transition: transform .5s var(--ease), opacity .35s var(--ease), visibility 0s .5s; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 8px; }
.sheet-head h2 { font-size: 22px; } .sheet-body { padding: 0 20px 20px; overflow: auto; }
.close { flex: none; width: 30px; height: 30px; border: 0; border-radius: 15px; background: var(--fill); color: var(--text-2); font-size: 18px; line-height: 1; }
.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.metric { padding: 12px 14px; border-radius: 16px; background: var(--fill); } .metric .label { font-size: 12.5px; color: var(--text-2); } .metric .value { margin-top: 2px; font-family: var(--font-num); font-size: 24px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sheet h3 { margin: 18px 0 8px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; } .kv dt { color: var(--text-2); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.recent { list-style: none; padding: 0; margin: 0; border-radius: 16px; background: var(--fill); overflow: hidden; }
.recent li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; padding: 9px 12px; font-size: 13px; } .recent li + li { border-top: .5px solid var(--sep); }
.recent .p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); } .recent .e { grid-column: 1 / -1; color: var(--err-ink); font-size: 12.5px; }
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: opacity .35s var(--ease); } .scrim.on { opacity: 1; pointer-events: auto; }

/* ---------- 对话框(底部弹出的 iOS 面板)---------- */
dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 24px; border: .5px solid var(--glass-edge); border-radius: var(--r-sheet); background: var(--glass-strong); -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px); color: var(--text); box-shadow: var(--shadow-float); overflow: auto; }
dialog[open] { animation: pop .4s var(--ease); } dialog::backdrop { background: rgba(0, 0, 0, .3); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
dialog h2 { margin-bottom: 4px; } dialog.wide { width: min(680px, calc(100vw - 24px)); }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.svc-grant { margin-top: 10px; padding: 12px 14px; border-radius: 16px; background: var(--fill); } .svc-grant.off .row2 { display: none; } .svc-grant .row2 { margin-top: 4px; }
#token-secret { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; } #token-secret p { flex-basis: 100%; }
#token-secret code { flex: 1; word-break: break-all; padding: 8px 10px; border-radius: 10px; background: var(--fill); font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.subs { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; max-height: 55vh; overflow: auto; }
.subs li { padding: 12px 14px; border-radius: 16px; background: var(--fill); } .subs .meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 12.5px; color: var(--text-2); }
.subs dl { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 0; } .subs dt { color: var(--text-2); } .subs dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

#toast { position: fixed; left: 50%; bottom: 96px; z-index: 80; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 22px; background: var(--glass-strong); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); border: .5px solid var(--glass-edge); box-shadow: var(--shadow-float); font-size: 14px; font-weight: 500; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .3s var(--ease), transform .4s var(--ease); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 手机 ---------- */
@media (max-width: 860px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .log li { grid-template-columns: 50px minmax(0, 1fr) 48px; row-gap: 2px; } .log .path { grid-column: 2 / 3; grid-row: 2; } .log .ms { grid-column: 3; grid-row: 2; } .log .t { grid-row: 1 / 3; align-self: start; padding-top: 2px; }
  .log .route { grid-column: 2; } .log .pill { grid-column: 3; grid-row: 1; }
  .row { grid-template-columns: 1fr; }
  .row-actions { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 16px; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); } .who span { display: none; }
  .tabs { position: fixed; z-index: 35; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); margin: 0; padding: 4px; border-radius: 24px; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); border: .5px solid var(--glass-edge); box-shadow: var(--shadow-float); justify-content: space-between; }
  .tabs button { flex: 1; height: 48px; padding: 0 2px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; }
  .tabs button svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .tabs button[aria-current="page"] { color: var(--accent); background: var(--accent-tint); box-shadow: none; }
  .page { padding: 0 16px 120px; } h1 { font-size: 30px; } .kpi .value { font-size: 28px; }
  .topo { min-height: 0; }
  .node { width: 108px; min-height: 50px; padding: 6px 9px; gap: 7px; border-radius: 16px; } .node .nm { font-size: 13px; max-width: 64px; } .node .ds { font-size: 11px; max-width: 64px; }
  .node.gw { width: 104px; min-height: 104px; } .node.gw .rate { font-size: 24px; }
  .sheet { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 78vh; } .sheet[hidden] { transform: translateY(calc(100% + 24px)); }
  .row2 { grid-template-columns: 1fr; }
  #toast { bottom: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
