:root{
  --canvas:#0d0f13;
  --sidebar:#121419;
  --surface:#171a21;
  --surface-soft:#1d212b;
  --surface-hover:#222733;
  --line:#262c37;
  --line-strong:#39404e;
  --text:#e9ebf0;
  --muted:#9aa3b2;
  --subtle:#69718280;
  --subtle:#6b7382;
  --accent:#5b8cff;
  --accent-hover:#7aa3ff;
  --accent-soft:rgba(91,140,255,.14);
  --ok:#3fdc97;
  --ok-soft:rgba(63,220,151,.13);
  --warn:#f5c542;
  --warn-soft:rgba(245,197,66,.12);
  --bad:#ff6b6b;
  --bad-soft:rgba(255,107,107,.12);
  --purple:#b48ef7;
  --shadow:0 18px 48px rgba(0,0,0,.55);
  --font:"Segoe UI Variable Text","Segoe UI","Microsoft YaHei UI",system-ui,sans-serif;
  --mono:"Cascadia Mono","Consolas",monospace;
}

.diagnostic-detail { margin-top: 18px; padding: 20px; }
.artifact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.artifact-card { text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: inherit; padding: 14px; cursor: pointer; }
.artifact-card:hover { border-color: var(--accent); background: var(--surface-hover); }
.artifact-card strong, .artifact-card span, .artifact-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.artifact-card span { margin-top: 7px; color: var(--muted); }
.artifact-card small { margin-top: 5px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

*{box-sizing:border-box}
html,body{margin:0;min-height:100%;max-width:100%;background:var(--canvas);color:var(--text);font-family:var(--font);font-size:14px;line-height:1.5;letter-spacing:0;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
body{overflow-x:hidden}
button,input,select{font:inherit;letter-spacing:0;color:inherit}
button{-webkit-tap-highlight-color:transparent}
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid rgba(91,140,255,.5);outline-offset:2px}
.hidden{display:none!important}
::selection{background:rgba(91,140,255,.35)}

/* 线性图标体系：所有图标继承文字颜色 */
.i{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;display:block}
.i-inline{width:15px;height:15px;display:inline-block;vertical-align:-2px;margin-right:6px}

.layout{display:grid;grid-template-columns:224px minmax(0,1fr);min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;background:var(--sidebar);border-right:1px solid var(--line);padding:20px 12px 14px;display:flex;flex-direction:column;z-index:20}
.brand{display:flex;align-items:center;gap:10px;padding:0 8px 23px;font-size:15px;font-weight:700}
.brand small{display:block;margin-top:1px;color:var(--muted);font-size:11px;font-weight:500}
.brand-mark,.product-mark{display:grid;place-items:center;background:linear-gradient(145deg,#2b3242,#1c212c);color:#fff;font-weight:750;border:1px solid var(--line-strong)}
.brand-mark{width:32px;height:32px;border-radius:8px}
.brand-mark .i,.product-mark .i{width:17px;height:17px;stroke:#fff}
.nav{display:flex;flex-direction:column;gap:3px}
.nav-label{padding:0 10px 5px;color:var(--subtle);font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.08em}
.nav-btn{position:relative;min-height:40px;border:0;border-radius:7px;background:transparent;color:var(--muted);text-align:left;padding:8px 10px;display:flex;align-items:center;gap:10px;cursor:pointer;transition:background-color .14s ease,color .14s ease,transform .1s ease}
.nav-btn:hover{background:var(--surface-hover);color:var(--text)}
.nav-btn:active{transform:translateY(1px)}
.nav-btn.active{background:var(--accent-soft);color:var(--accent-hover);font-weight:680}
.nav-btn.active::before{content:"";position:absolute;left:-12px;top:9px;bottom:9px;width:3px;border-radius:0 3px 3px 0;background:var(--accent)}
.nav-icon{display:inline-grid;place-items:center;width:18px;height:18px;flex:none}
.sidebar-foot{margin-top:auto;border-top:1px solid var(--line);padding:14px 8px 2px;color:var(--muted);font-size:11px;display:flex;align-items:center;gap:8px;min-width:0}
.sidebar-foot span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.status-dot{width:7px;height:7px;border-radius:50%;background:var(--subtle);flex:none}
.status-dot.ok{background:var(--ok);box-shadow:0 0 0 3px var(--ok-soft)}

.main{width:100%;max-width:1600px;min-width:0;margin:0 auto;padding:28px clamp(22px,3vw,46px) 48px}
.topbar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:22px}
.page-heading{min-width:0}
.topbar h1{margin:0;font-size:22px;line-height:1.25;font-weight:720}
.topbar p{margin:5px 0 0;color:var(--muted);font-size:12px}
.topbar-actions{display:flex;align-items:center;gap:8px;flex:none}
.health{display:inline-flex;align-items:center;gap:7px;margin-right:4px;color:var(--muted);font-size:12px;white-space:nowrap}
.health i{width:7px;height:7px;border-radius:50%;background:var(--subtle)}
.health.ok{color:var(--ok)}
.health.ok i{background:var(--ok);box-shadow:0 0 0 3px var(--ok-soft)}
.health.bad{color:var(--bad)}
.health.bad i{background:var(--bad);box-shadow:0 0 0 3px var(--bad-soft)}

.btn,.icon-btn{height:36px;border:1px solid var(--line-strong);border-radius:7px;background:var(--surface);color:var(--text);padding:0 13px;cursor:pointer;transition:border-color .14s ease,background-color .14s ease,color .14s ease,transform .1s ease}
.btn:hover,.icon-btn:hover{border-color:#4a5364;background:var(--surface-hover)}
.btn:active,.icon-btn:active{transform:translateY(1px)}
.btn:disabled,.icon-btn:disabled{opacity:.48;cursor:default;transform:none}
.icon-btn{width:36px;padding:0;font-size:18px;display:grid;place-items:center}
.icon-btn .i{width:16px;height:16px}
.btn.primary{border-color:var(--accent);background:var(--accent);color:#fff}
.btn.primary:hover{border-color:var(--accent-hover);background:var(--accent-hover)}
.btn.quiet{background:transparent}
.btn.danger-solid{border-color:var(--bad);background:var(--bad);color:#1a0d0d}
.wide{width:100%}
.text-btn{min-height:32px;border:0;background:none;color:var(--accent-hover);font-size:12px;padding:4px 0;cursor:pointer;white-space:nowrap}
.text-btn:hover{color:#9db9ff}

/* 状态横幅：一切正常 / 需要留意 */
.hero{display:flex;gap:16px;align-items:flex-start;margin-bottom:14px;padding:20px 22px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.hero-mark{flex:none;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;font-size:19px;font-weight:750;background:var(--ok-soft);color:var(--ok)}
.hero-mark .i{width:20px;height:20px;stroke-width:2.2}
.hero.hero-bad{border-color:rgba(255,107,107,.4);background:linear-gradient(180deg,rgba(255,107,107,.10),rgba(255,107,107,.02) 70%),var(--surface)}
.hero.hero-bad .hero-mark{background:var(--bad-soft);color:var(--bad)}
.hero.hero-warn{border-color:rgba(245,197,66,.35);background:linear-gradient(180deg,rgba(245,197,66,.08),rgba(245,197,66,.01) 70%),var(--surface)}
.hero.hero-warn .hero-mark{background:var(--warn-soft);color:var(--warn)}
.hero-body{min-width:0}
.hero h2{margin:0;font-size:17px;font-weight:720}
.hero p{margin:3px 0 0;color:var(--muted);font-size:12.5px}
.hero-problems{margin-top:10px;display:grid;gap:7px}
.hero-problem{display:flex;align-items:baseline;gap:8px;font-size:12.5px;flex-wrap:wrap}
.hero-problem i{flex:none;width:7px;height:7px;border-radius:50%;align-self:center}
.hero-problem.bad i{background:var(--bad)}
.hero-problem.warn i{background:var(--warn)}
.hero-problem .hero-hint{color:var(--subtle);font-size:11.5px}

/* 指标卡：左标签、彩色大数值、实时曲线 */
.metric-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin-bottom:14px;border:1px solid var(--line);border-radius:10px;background:var(--surface);overflow:hidden}
.metric{min-width:0;padding:16px 20px 13px;text-align:left}
.metric+.metric{border-left:1px solid var(--line)}
button.metric{border:0;border-radius:0;background:transparent;color:inherit;font:inherit;cursor:pointer;transition:background-color .14s ease}
button.metric:hover{background:var(--surface-hover)}
button.metric:active{background:#1c212b}
.metric span{display:block;color:var(--muted);font-size:12px}
.metric strong{display:block;margin:6px 0 2px;font-size:26px;line-height:1.15;font-weight:750;font-variant-numeric:tabular-nums;color:var(--text)}
.metric strong.v-green{color:var(--ok)}
.metric strong.v-blue{color:var(--accent-hover)}
.metric strong.v-purple{color:var(--purple)}
.metric strong.v-amber{color:var(--warn)}
.metric strong.status-good{color:var(--ok);font-size:22px}
.metric strong.status-bad{color:var(--bad);font-size:22px}
.metric strong.status-warn{color:var(--warn);font-size:22px}
.metric small{display:block;margin-top:2px;color:var(--subtle);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.spark{height:30px;margin-top:4px}
.spark svg{display:block;width:100%;height:100%}
.spark polyline{fill:none;stroke:var(--accent);stroke-width:1.6;stroke-linejoin:round;stroke-linecap:round}
.spark polygon{fill:var(--accent);opacity:.13;stroke:none}
.spark.spark-up polyline{stroke:var(--ok)}
.spark.spark-up polygon{fill:var(--ok)}
.spark.spark-down polyline{stroke:var(--bad)}
.spark.spark-down polygon{fill:var(--bad)}
.spark.spark-purple polyline{stroke:var(--purple)}
.spark.spark-purple polygon{fill:var(--purple)}
.spark.spark-amber polyline{stroke:var(--warn)}
.spark.spark-amber polygon{fill:var(--warn)}
.spark-empty{height:100%;border-bottom:1px solid var(--line)}

.overview-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(290px,.75fr);gap:14px}
.relay-grid{grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr)}
.surface{min-width:0;margin-bottom:14px;padding:18px;border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.surface.flush,.surface.flush-table{padding:0;overflow:hidden}
.surface.form-surface{padding:20px}
.section-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:15px}
.section-head.padded{padding:17px 18px 14px;margin:0}
.section-head h2{margin:0;font-size:14px;font-weight:700}
.section-head p{margin:3px 0 0;color:var(--muted);font-size:12px}
.section-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.section-meta,.toolbar-meta{color:var(--muted);font-size:12px;white-space:nowrap}
.check-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 20px}
.check{display:grid;grid-template-columns:8px minmax(0,1fr) auto;align-items:center;gap:9px;min-width:0;padding:10px 0;border-bottom:1px solid var(--line)}
.check:nth-last-child(-n+2){border-bottom:0}
.check-dot{width:8px;height:8px;border-radius:50%;background:var(--ok)}
.check.warn .check-dot{background:var(--warn)}
.check.bad .check-dot{background:var(--bad)}
.check span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.check small{color:var(--muted);font-size:11px;text-align:right}
.check.warn small{color:var(--warn)}
.check.bad small{color:var(--bad)}
.facts{margin:0}
.facts div{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:8px 0;border-bottom:1px solid var(--line)}
.facts div:last-child{border-bottom:0}
.facts dt{color:var(--muted)}
.facts dd{min-width:0;margin:0;font-weight:650;text-align:right;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.compact-facts{margin-top:8px}
.compact-facts div{padding:7px 0}

.toolbar{display:flex;align-items:center;gap:10px;min-height:38px;margin-bottom:12px;flex-wrap:wrap}
.more-row{display:flex;justify-content:center;padding:12px;border-top:1px solid var(--line)}
.more-row:empty{display:none}
.toolbar-meta{margin-left:auto}
.search{display:flex;align-items:center;gap:7px;width:min(360px,100%);height:38px;padding:0 11px;border:1px solid var(--line-strong);border-radius:7px;background:var(--surface)}
.search span{color:var(--subtle);font-size:17px;display:grid;place-items:center}
.search span .i{width:16px;height:16px}
.search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--text)}
.search input::placeholder{color:#5d6575}
.select,.input{height:38px;border:1px solid var(--line-strong);border-radius:7px;outline:0;background:var(--surface-soft);color:var(--text);padding:0 10px}
.select:focus,.input:focus,.search:focus-within{border-color:#5b8cff;box-shadow:0 0 0 3px var(--accent-soft)}
.segmented{display:inline-flex;padding:2px;border:1px solid var(--line-strong);border-radius:7px;background:var(--surface)}
.segmented button{height:31px;border:0;border-radius:5px;background:transparent;color:var(--muted);padding:0 13px;cursor:pointer}
.segmented button:hover{color:var(--text)}
.segmented button.active{background:#2b3140;color:var(--text);font-weight:650}
.check-inline{display:inline-flex;align-items:center;gap:7px;color:var(--muted);font-size:12px;cursor:pointer;user-select:none}
.check-inline input{width:15px;height:15px;accent-color:var(--accent)}

.table-wrap{width:100%;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain}
.data{width:100%;border-collapse:collapse;font-size:12.5px}
.data th,.data td{text-align:left;vertical-align:middle;padding:11px 13px;border-bottom:1px solid var(--line)}
.data th{height:40px;background:var(--surface-soft);color:#8b93a4;font-size:11px;font-weight:650;white-space:nowrap}
.data tbody tr:last-child td{border-bottom:0}
.data tbody tr:hover td{background:#1b202a}
.data strong{font-weight:650}
.subline{display:block;max-width:300px;margin-top:2px;color:var(--subtle);font-size:10.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mono{font-family:var(--mono);font-size:11px}
.muted{color:var(--muted)}
.nowrap{white-space:nowrap}
.empty{height:108px!important;text-align:center!important;color:var(--muted)}
.empty-hint{display:block;margin-top:4px;color:var(--subtle);font-size:11.5px}
.pill{display:inline-flex;align-items:center;padding:2px 8px;border-radius:5px;background:#242a36;color:#a7b0c0;font-size:10.5px;font-weight:650;white-space:nowrap;border:1px solid transparent}
.pill.online,.pill.ok{background:var(--ok-soft);color:var(--ok);border-color:rgba(63,220,151,.25)}
.pill.offline,.pill.bad{background:var(--bad-soft);color:var(--bad);border-color:rgba(255,107,107,.25)}
.pill.pending,.pill.never,.pill.warn{background:var(--warn-soft);color:var(--warn);border-color:rgba(245,197,66,.25)}
.pill.ipv6{background:var(--accent-soft);color:var(--accent-hover);border-color:rgba(91,140,255,.25)}
.qv{font-weight:700}
.qv.online{color:var(--ok)}
.qv.warn{color:var(--warn)}
.qv.bad{color:var(--bad)}
td.actions{width:1%;white-space:nowrap}
.dev-cell{display:flex;align-items:center;gap:10px;min-width:0}
.dev-cell>.i{flex:none;color:var(--muted)}
.dev-cell strong{display:block}
tr.dev-offline .dev-cell>.i{color:var(--subtle)}
.actions-bar{display:flex;justify-content:flex-end;gap:6px}
.table-btn{min-height:32px;border:0;border-radius:5px;background:none;color:var(--muted);font-size:12px;padding:4px 8px;cursor:pointer}
.table-btn:hover{background:var(--surface-hover);color:var(--text)}
.table-btn.danger{color:var(--bad)}
.table-btn.danger:hover{background:var(--bad-soft)}
tr.dev-offline td{opacity:.62}
tr.dev-offline td .pill.offline{opacity:1}

.menu{position:fixed;z-index:80;min-width:172px;padding:5px;border:1px solid var(--line-strong);border-radius:9px;background:#1c202a;box-shadow:var(--shadow)}
.menu button{display:flex;width:100%;align-items:center;gap:8px;min-height:34px;border:0;border-radius:6px;background:none;color:var(--text);font-size:12.5px;padding:6px 10px;cursor:pointer;text-align:left;white-space:nowrap}
.menu button:hover{background:var(--surface-hover)}
.menu button.danger{color:var(--bad)}
.menu button.danger:hover{background:var(--bad-soft)}
.menu .menu-sep{height:1px;margin:4px 6px;background:var(--line)}

.session-main td{padding-top:14px;border-bottom:0}
.session-main td:first-child{border-left:3px solid var(--accent)}
.session-detail td{padding:0 13px 15px;border-bottom:1px solid var(--line);background:var(--surface-soft)}
.session-detail td:first-child{border-left:3px solid var(--accent)}
.session-detail:hover td{background:var(--surface-soft)!important}
.link-grid{display:grid;grid-template-columns:repeat(3,minmax(180px,1fr));border:1px solid var(--line);border-radius:8px;background:var(--surface);overflow:hidden}
.link-grid>div{min-width:0;padding:10px 12px;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.link-grid>div:nth-child(3n){border-right:0}
.link-grid>div:nth-last-child(-n+3){border-bottom:0}
.link-grid>div>span{display:block;margin-bottom:4px;color:var(--muted);font-size:10.5px}
.link-grid>div>strong{display:block;font-size:12px;font-variant-numeric:tabular-nums}
.link-grid small{display:block;margin-top:3px;color:var(--subtle);font-family:var(--mono);font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.link-grid small.plain{font-family:var(--font);color:var(--muted)}
.link-grid b{color:var(--accent-hover);font-weight:600}
.device-chips{display:flex;flex-wrap:wrap;gap:5px}
.device-chips>span{display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border-radius:5px;background:#20252f;color:var(--muted);font-size:11px;border:1px solid var(--line)}
.mini-dot{width:6px;height:6px;border-radius:50%;background:var(--subtle)}
.mini-dot.online{background:var(--ok)}

.inline-form{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap;margin-top:16px}
.inline-form label{display:flex;flex-direction:column;gap:5px;color:var(--muted);font-size:12px}
.steps{display:grid;gap:10px;margin:4px 0 4px}
.step{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border:1px solid var(--line);border-radius:9px;background:var(--surface-soft)}
.step-no{flex:none;width:26px;height:26px;border-radius:50%;background:var(--accent-soft);color:var(--accent-hover);display:grid;place-items:center;font-weight:750;font-size:13px}
.step strong{font-size:13px}
.step p{margin:2px 0 0;color:var(--muted);font-size:12px}
.overview-facts{margin-top:14px}
.input{min-width:230px}
.input.compact{width:150px;min-width:120px}
.secret-box{display:grid;grid-template-columns:minmax(190px,260px) minmax(0,1fr) auto;align-items:center;gap:14px;margin-top:16px;padding:13px;border:1px solid rgba(91,140,255,.4);border-radius:8px;background:rgba(91,140,255,.08)}
.secret-box strong,.secret-box span{display:block}
.secret-box span{margin-top:2px;color:var(--muted);font-size:11px}
.secret-box code{padding:8px;border:1px solid var(--line);border-radius:6px;background:var(--surface-soft);font-family:var(--mono);font-size:11px;word-break:break-all}

.notice{display:none;margin-bottom:12px;padding:10px 12px;border-radius:8px;font-size:12px}
.notice.show{display:block}
.notice.error{border:1px solid rgba(255,107,107,.4);background:var(--bad-soft);color:#ff9c9c}
.notice.warn{border:1px solid rgba(245,197,66,.4);background:var(--warn-soft);color:#f0d38a}
.loading-bar{height:2px;margin:-8px 0 10px;overflow:hidden;background:#1c2230}
.loading-bar span{display:block;width:35%;height:100%;background:var(--accent);animation:loading 1s ease-in-out infinite}
.skeleton-block:empty{min-height:100px;border-radius:6px;background:linear-gradient(90deg,#1b1f28 25%,#232834 40%,#1b1f28 65%);background-size:300% 100%;animation:skeleton 1.2s ease infinite}

.auth-view{min-height:100vh;padding:28px;display:grid;place-items:center;background:radial-gradient(1200px 600px at 30% -10%,rgba(91,140,255,.08),transparent),var(--canvas)}
.auth-panel{width:min(410px,100%);padding:31px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:var(--shadow)}
.product-mark{width:40px;height:40px;margin-bottom:22px;border-radius:9px}
.eyebrow{margin:0 0 5px;color:var(--subtle);font-size:10px;font-weight:700}
.auth-panel h1{margin:0;font-size:21px}
.auth-copy{margin:7px 0 23px;color:var(--muted)}
.auth-form{display:flex;flex-direction:column;gap:8px}
.auth-form label{font-size:12px;font-weight:650}
.auth-form .input{width:100%;margin-bottom:4px}
.auth-foot{margin:16px 0 0;color:var(--subtle);font-size:11px;text-align:center}
.toast{position:fixed;right:22px;bottom:22px;z-index:100;max-width:min(360px,calc(100vw - 28px));padding:10px 14px;border-radius:8px;background:#e9ebf0;color:#171a21;font-weight:600;box-shadow:var(--shadow);opacity:0;transform:translateY(8px);pointer-events:none;transition:opacity .18s ease,transform .18s ease}
.toast.show{opacity:1;transform:none}
.modal-backdrop{position:fixed;inset:0;z-index:90;padding:20px;display:grid;place-items:center;background:rgba(4,6,10,.6);backdrop-filter:blur(3px);animation:fade-in .15s ease}
.modal{width:min(430px,100%);padding:22px;display:grid;grid-template-columns:34px 1fr;gap:13px;border:1px solid var(--line-strong);border-radius:12px;background:#1b1f28;box-shadow:var(--shadow);animation:modal-in .18s ease}
.modal-icon{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--bad-soft);color:var(--bad);font-weight:750}
.modal-icon .i{width:15px;height:15px;stroke-width:2.2}
.modal-icon.ok{background:var(--ok-soft);color:var(--ok)}
.modal h2{margin:2px 0 6px;font-size:15px}
.modal p{margin:0;color:var(--muted);font-size:12px;white-space:pre-line}
.modal-actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:8px;margin-top:8px}
.modal-form{grid-template-columns:1fr}
.modal-form .modal-actions{margin-top:14px}
.modal-wide{width:min(520px,100%)}
.modal-field{display:grid;gap:6px;color:var(--muted);font-size:12px;margin-top:12px}
.modal-field .input{width:100%}
.secret-reveal{grid-column:1/-1;margin-top:4px;padding:10px;border:1px solid var(--line);border-radius:6px;background:var(--surface-soft);font-family:var(--mono);font-size:12px;word-break:break-all}
.relay-metrics .metric strong{font-size:22px}
.relay-error{margin:14px 0 0}
.operation-note{padding:10px 0;border-bottom:1px solid var(--line)}
.keys-create{padding:14px 18px;border-bottom:1px solid var(--line)}
.keys-create .inline-form{margin-top:0}

/* 账号详情抽屉：点开一个用户，看到他在平台上的全部行为 */
.drawer-backdrop{position:fixed;inset:0;z-index:85;background:rgba(4,6,10,.5);animation:fade-in .15s ease}
.drawer{position:absolute;top:0;right:0;bottom:0;width:min(560px,94vw);display:flex;flex-direction:column;background:#171a21;border-left:1px solid var(--line-strong);box-shadow:var(--shadow);animation:drawer-in .18s ease}
@keyframes drawer-in{from{transform:translateX(30px);opacity:0}}
.drawer-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:20px 22px 14px;border-bottom:1px solid var(--line)}
.drawer-head h2{margin:0;font-size:17px}
.drawer-head p{margin:3px 0 0;color:var(--muted);font-size:12px}
.drawer-body{overflow-y:auto;padding:16px 22px 28px}
.drawer-section{margin-bottom:20px}
.drawer-section h3{margin:0 0 10px;font-size:12px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.06em}
.drawer-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--line);font-size:12.5px}
.drawer-row:last-child{border-bottom:0}
.drawer-row .mono{color:var(--subtle)}
.operation-note strong{font-size:12px}
.operation-note p{margin:4px 0 0;color:var(--muted);font-size:12px}
.technical-details{margin-top:12px;padding-top:2px}
.technical-details summary{min-height:36px;display:flex;align-items:center;color:var(--accent-hover);font-size:12px;cursor:pointer;list-style:none}
.technical-details summary::after{content:"⌄";margin-left:auto;color:var(--subtle)}
.technical-details[open] summary::after{content:"⌃"}
.technical-details summary::-webkit-details-marker{display:none}

/* 链路态势：平台此刻的链路形状、拥塞算法与选择依据。
   数据来自近 5 分钟内上报过遥测的连接；没有数据时整块说明原因，而不是显示一排 0。 */
.link-posture .section-head{margin-bottom:12px}
.link-posture-body{display:grid;gap:14px}
.link-posture-empty{display:grid;gap:4px;padding:14px;border:1px dashed var(--line-strong);border-radius:8px;background:var(--surface-soft)}
.link-posture-empty strong{font-size:13px}
.link-posture-empty span{color:var(--muted);font-size:12px}
.link-split{display:grid;gap:8px}
.link-split-bar{display:flex;height:10px;border:1px solid var(--line);border-radius:6px;background:#20252f;overflow:hidden}
.link-split-bar>span{height:100%}
.link-split-legend{display:flex;flex-wrap:wrap;gap:6px 16px;color:var(--muted);font-size:11.5px}
.link-split-legend b{color:var(--text);font-variant-numeric:tabular-nums}
.link-split-legend i{display:inline-block;width:8px;height:8px;margin-right:6px;border-radius:2px}
.seg-direct{background:var(--ok)}
.seg-relay{background:var(--warn)}
.seg-unknown{background:#5c6474}
.link-facts div{padding:7px 0}
.link-facts dd{font-size:13px}
.link-dist-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 22px}
.link-dist-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin-bottom:2px}
.link-dist-head strong{font-size:12.5px}
.link-dist-head small{color:var(--subtle);font-size:10.5px}
.link-dist-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 10px;align-items:center;padding:6px 0;font-size:12px}
.link-dist-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.link-dist-count{color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums}
.link-dist-bar{grid-column:1/-1;height:4px;border-radius:2px;background:#20252f;overflow:hidden}
.link-dist-bar>span{display:block;height:100%;border-radius:2px;background:var(--accent)}
.link-dist p{margin:0}
.link-banner{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin:0}
.link-banner strong{font-size:12.5px}
.link-banner>span{color:var(--muted)}
.link-trend{display:grid;gap:2px;padding-top:12px;border-top:1px solid var(--line)}

/* 链路历史曲线：连接详情里按需加载的一段真实时间序列 */
.link-grid>div.link-history-wrap{grid-column:1/-1;border-right:0;border-bottom:0}
.link-history{margin:0}
.link-history>summary{display:flex;align-items:center;gap:8px;min-height:40px;padding:9px 12px;border-top:1px solid var(--line);color:var(--accent-hover);font-size:12px;cursor:pointer;list-style:none}
.link-history>summary:hover{background:var(--surface-hover)}
.link-history>summary::-webkit-details-marker{display:none}
.link-history>summary::after{content:"⌄";margin-left:auto;color:var(--subtle)}
.link-history[open]>summary::after{content:"⌃"}
.link-history-body{display:grid;gap:2px;padding:4px 12px 14px}
.link-history-row{display:grid;grid-template-columns:84px minmax(0,1fr) 210px;align-items:center;gap:6px 12px;padding:6px 0}
.lh-label{color:var(--muted);font-size:11.5px}
.lh-values{min-width:0;text-align:right;white-space:nowrap}
.lh-values b{display:block;font-size:12.5px;font-weight:650;font-variant-numeric:tabular-nums}
.lh-values small{display:block;color:var(--subtle);font-size:10.5px;overflow:hidden;text-overflow:ellipsis}
.spark.spark-tight{height:34px;margin:0}
.spark.spark-tight .spark-empty{border-bottom-style:dashed}
.link-note{margin:0;color:var(--muted);font-size:11.5px}
.link-note-hint{display:block;margin-top:3px;color:var(--subtle);font-size:11px}
.link-history-body .text-btn{min-height:auto}
.link-unknown{color:var(--muted)}

/* 连接记录里的链路明细：展开一行看该链路最后一次上报的全部字段 */
.report-detail td{padding:0 13px 15px;border-bottom:1px solid var(--line);background:var(--surface-soft)}
.report-detail:hover td{background:var(--surface-soft)!important}
.report-detail .facts{max-width:760px;margin-top:4px}
.report-detail .facts div{padding:6px 0}
.report-link-cell .table-btn{padding:4px 0;min-height:26px}

@media(max-width:960px){
  .link-dist-grid{grid-template-columns:1fr}
}

@media(max-width:720px){
  .link-history-row{grid-template-columns:minmax(0,1fr);gap:2px}
  .link-history-row .lh-values{display:flex;align-items:baseline;gap:10px;text-align:left;max-width:100%}
  .lh-values b,.lh-values small{display:inline}
  .responsive-table tr.report-detail{border-top:0;border-radius:0 0 9px 9px;margin-top:-10px;background:var(--surface-soft)}
  .responsive-table tr:has(+.report-detail){border-radius:9px 9px 0 0}
  .responsive-table tr.report-detail td{display:block;padding:0 12px 12px;border:0;text-align:left}
  .responsive-table tr.report-detail td::before{display:none}
  .responsive-table tr.report-detail .facts{max-width:100%}
}

@keyframes loading{0%{transform:translateX(-110%)}100%{transform:translateX(390%)}}
@keyframes skeleton{0%{background-position:100% 0}100%{background-position:0 0}}
@keyframes fade-in{from{opacity:0}}
@keyframes modal-in{from{opacity:0;transform:translateY(6px) scale(.99)}}

@media(max-width:960px){
  .layout{display:block}
  .sidebar{position:sticky;height:auto;padding:10px 12px;border-right:0;border-bottom:1px solid var(--line)}
  .brand{padding:0 4px 9px}
  .brand small{display:none}
  .brand-mark{width:29px;height:29px}
  .nav{width:100%;display:flex;flex-direction:row;gap:4px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}
  .nav::-webkit-scrollbar{display:none}
  .nav-group{display:contents}
  .nav-label{display:none}
  .nav-btn{flex:0 0 auto;justify-content:center;min-height:36px;padding:7px 12px;white-space:nowrap}
  .nav-btn.active::before{left:10px;right:10px;top:auto;bottom:-1px;width:auto;height:2px;border-radius:2px 2px 0 0}
  .nav-icon{display:none}
  .sidebar-foot{display:none}
  .main{padding:20px 16px 38px}
  .overview-grid,.relay-grid{grid-template-columns:1fr}
  .table-wrap{max-width:100%}
}

@media(max-width:720px){
  .topbar{align-items:flex-start;margin-bottom:18px}
  .topbar p{display:none}
  .health span{display:none}
  .btn.quiet{padding:0 10px}
  .metric-strip{grid-template-columns:repeat(2,minmax(0,1fr))}
  .metric:nth-child(3){border-left:0;border-top:1px solid var(--line)}
  .metric:nth-child(4){border-top:1px solid var(--line)}
  .metric{padding:15px}
  .metric strong{font-size:24px}
  .metric strong.status-good,.metric strong.status-bad,.metric strong.status-warn,.relay-metrics .metric strong{font-size:20px}
  .check-list{grid-template-columns:1fr}
  .check:nth-last-child(2){border-bottom:1px solid var(--line)}
  .toolbar{align-items:stretch;flex-wrap:wrap}
  .search{width:100%}
  .toolbar-meta{width:100%;margin-left:0}
  .audit-toolbar .segmented{flex:1}
  .inline-form{align-items:stretch}
  .inline-form label,.inline-form .input,.inline-form .btn{width:100%;min-width:0}
  .secret-box{grid-template-columns:1fr}
  .secret-box .btn{justify-self:start}
  .surface.flush{border:0;background:transparent;overflow:visible}
  .responsive-table,.responsive-table tbody,.responsive-table tr,.responsive-table td{display:block;width:100%}
  .responsive-table thead{display:none}
  .responsive-table tbody{display:grid;gap:10px}
  .responsive-table tr{padding:9px 12px;border:1px solid var(--line);border-radius:9px;background:var(--surface)}
  .responsive-table td{min-height:34px;padding:7px 0;display:grid;grid-template-columns:minmax(92px,32%) minmax(0,1fr);align-items:center;gap:12px;border-bottom:1px solid var(--line);text-align:right}
  .responsive-table td::before{content:attr(data-label);color:var(--muted);font-size:11px;text-align:left}
  .responsive-table td:last-child{border-bottom:0}
  .responsive-table td.actions{display:flex;justify-content:flex-end;padding-top:9px}
  .responsive-table td.actions::before{display:none}
  .responsive-table .subline{max-width:100%;margin-left:auto}
  .responsive-table .device-chips{justify-content:flex-end}
  .responsive-table .empty{display:block;height:auto!important;padding:32px 12px;text-align:center!important}
  .responsive-table .empty::before{display:none}
  .session-table,.session-table tbody,.session-table tr,.session-table td{display:block;width:100%}
  .session-table thead{display:none}
  .session-table tbody{display:block;padding:10px;background:var(--canvas)}
  .session-main{margin-top:10px;padding:9px 12px;border:1px solid var(--line);border-bottom:0;border-radius:9px 9px 0 0;background:var(--surface)}
  .session-main:first-child{margin-top:0}
  .session-main td{min-height:34px;padding:7px 0;display:grid;grid-template-columns:minmax(92px,32%) minmax(0,1fr);align-items:center;gap:12px;border:0;border-bottom:1px solid var(--line);text-align:right}
  .session-main td:first-child{border-left:0}
  .session-main td::before{content:attr(data-label);color:var(--muted);font-size:11px;text-align:left}
  .session-main td.actions{display:flex;justify-content:flex-end;border-bottom:0}
  .session-main td.actions::before{display:none}
  .session-main .subline{max-width:100%;margin-left:auto}
  .session-detail{border:1px solid var(--line);border-top:0;border-radius:0 0 9px 9px;background:var(--surface)}
  .session-detail td{padding:0 12px 12px;border:0;background:transparent}
  .session-detail td:first-child{border-left:0}
  .session-detail:hover td{background:transparent!important}
  .session-main:has(+.session-main),.session-main:last-child{border-bottom:1px solid var(--line);border-radius:9px}
  .link-grid{grid-template-columns:1fr}
  .link-grid>div,.link-grid>div:nth-child(3n),.link-grid>div:nth-last-child(-n+3){border-right:0;border-bottom:1px solid var(--line)}
  .link-grid>div:last-child{border-bottom:0}
  .link-grid small{white-space:normal;overflow-wrap:anywhere}
  .overview-table,.overview-table tbody,.overview-table tr,.overview-table td{display:block;width:100%}
  .overview-table thead{display:none}
  .overview-table tbody{display:grid;gap:0}
  .overview-table tr{padding:9px 13px;border-top:1px solid var(--line)}
  .overview-table td{min-height:32px;padding:6px 0;display:grid;grid-template-columns:minmax(90px,31%) minmax(0,1fr);align-items:center;gap:12px;border:0;text-align:right}
  .overview-table td::before{content:attr(data-label);color:var(--muted);font-size:11px;text-align:left}
  .overview-table .subline{max-width:100%;margin-left:auto}
  .overview-table .empty{display:block;height:auto!important;padding:28px 12px;text-align:center!important}
  .overview-table .empty::before{display:none}
  .facts div{align-items:flex-start}
  .hero{flex-direction:column;gap:10px}
}

@media(max-width:420px){
  .main{padding:16px 12px 32px}
  .topbar h1{font-size:20px}
  .metric{padding:13px}
  .metric small{white-space:normal;min-height:33px}
  .section-head{gap:8px}
  .section-head p{font-size:11px}
  .section-meta{white-space:normal;text-align:right}
  .modal{padding:18px}
  .toast{right:14px;bottom:14px}
}

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