/* WorkBuddy Relay —— 台账风格的浅色界面
   纸白底 / 细线分隔 / 信号橙点缀 / 数字用等宽字体 */

:root {
  --paper: #ffffff;
  --bg: #f4f6f9;
  --bg-deep: #eef1f6;
  --ink: #0f1726;
  --ink-2: #3a4453;
  --muted: #6f7a8b;
  --faint: #9aa4b4;
  --line: #e7ebf1;
  --line-2: #d3dae5;
  --signal: #e8543f;
  --signal-soft: #fdeeea;
  --teal: #0f8f7e;
  --teal-soft: #e7f5f2;
  --blue: #2668e8;
  --violet: #5b5bd6;
  --amber: #c97806;
  --navy: #16233c;
  --ok: #128f6c;
  --warn: #b06a00;
  --err: #c0362c;
  --radius: 5px;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

/* hidden 属性要能压住 .field{display:flex} 这类作者样式，否则条件显示失效 */
[hidden] { display: none !important; }
html, body { overflow-x: hidden; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.hidden { display: none !important; }

/* ---------- 公共外壳 ---------- */
.shell { display: flex; min-height: 100vh; }

.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  width: 178px;
  flex: 0 0 178px;
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 14px 10px 10px;
  gap: 4px;
}

.rail-top { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 8px; margin-bottom: 14px; }
.rail-toggle { border: 1px solid var(--line-2); background: #fff; color: var(--muted); width: 24px; height: 24px;
  border-radius: 5px; cursor: pointer; font-size: 13px; line-height: 1; display: grid; place-items: center; }
.rail-toggle:hover { color: var(--ink); border-color: var(--faint); }
.rail .mark {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: var(--ink);
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  border-radius: 7px;
  margin: 0;
}

.rail a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink-2);
  border-radius: 6px;
  line-height: 1.2;
  position: relative;
  white-space: nowrap;
}
.rail a .ico { display: block; width: 17px; height: 17px; flex: 0 0 17px; opacity: .7; }
.rail a .ico svg { width: 17px; height: 17px; display: block; }
.rail a.on .ico { opacity: 1; }
.rail a:hover { background: #eef2f8; color: var(--ink); }
.rail a.on { color: var(--blue); background: #e9f0fe; font-weight: 600; }
.rail a.on::before {
  content: ""; position: absolute; left: -10px; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--blue);
}
.rail .spacer { flex: 1; }
.rail .who { font-size: 11px; color: var(--faint); padding: 4px 10px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { flex: 1; min-width: 0; margin-left: 178px; }
body.rail-collapsed .main { margin-left: 64px; }

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-size: 15px; font-weight: 600; }
.topbar .sub { font-size: 12.5px; color: var(--muted); }
.topbar .sub::before { content: '·'; margin-right: 8px; color: var(--faint); }
.topbar .grow { flex: 1; }

.content { padding: 22px 30px 64px; width: 100%; }
/* 大屏铺满：表格类页面不设宽度上限，超宽屏靠列宽自适应 */
@media (min-width: 1800px) { .content { padding: 24px 46px 72px; } }

/* ---------- 工具条 / 标签 / 侧栏分组 ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: #fff; }
.toolbar input[type="search"] { height: 32px; width: 220px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 5px; background: #fbfcfe; }
.toolbar select { height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 5px; background: #fbfcfe; }
.toolbar .grow { flex: 1; }
.toolbar .count { font-size: 12px; color: var(--muted); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px;
  background: #eaf1fe; color: #1c4fae; font-size: 12px; font-family: var(--mono); white-space: nowrap;
  font-variant-numeric: tabular-nums; }
.pill.warn { background: #fdf3e6; color: #8a5a00; }
.pill.off { background: #f2f3f6; color: var(--muted); }

.rail-group { font-size: 11px; color: var(--faint); padding: 14px 10px 5px; letter-spacing: .02em; }
.rail-status { padding: 10px 10px 2px; font-size: 11px; color: var(--muted);
  border-top: 1px solid var(--line); margin-top: 10px; display: flex; align-items: center; gap: 6px; }

/* ---------- 通用元件 ---------- */
/* 按钮：一律有边框 + 底色 + 阴影，点得出来是按钮，不是一段文字 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 13px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  font-size: 13px; font-weight: 500; font-family: inherit; line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 38, .06);
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s, transform .06s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { border-color: #c3ccdb; background: #f8fafd; box-shadow: 0 2px 5px rgba(15, 23, 38, .09); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 1px rgba(15, 23, 38, .07); }
.btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.btn.primary { background: var(--blue); border-color: #1b53c0; color: #fff; box-shadow: 0 1px 2px rgba(28, 88, 200, .28); }
.btn.primary:hover { background: #1d58c9; border-color: #1d58c9; box-shadow: 0 2px 6px rgba(28, 88, 200, .32); }

.btn.signal { background: var(--signal); border-color: var(--signal); color: #fff; }
/* ghost 只是「次要按钮」：淡边框 + 白底，不再是裸文字 */
.btn.ghost { background: #fdfefe; border-color: #ccd6e5; color: #3d4b60; box-shadow: 0 1px 1px rgba(15, 23, 38, .05); }
.btn.ghost:hover { background: #f1f5fb; border-color: #a9b8cc; color: var(--ink); }
.btn.sm { height: 27px; padding: 0 10px; font-size: 12.5px; border-radius: 5px; gap: 4px; }
.btn.sm.ghost { box-shadow: 0 1px 1px rgba(15, 23, 38, .04); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn:disabled:hover { background: #fff; border-color: var(--line-2); }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: 11.5px; color: var(--muted); }
input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  background: #fbfcfe;
  border-radius: 5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 80px; padding: 8px 10px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px rgba(16,21,33,.06); }
input:user-invalid { border-color: var(--err); }

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(15, 23, 38, .04);
  overflow: hidden;
}
.panel-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.panel-hd h3 { font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }
.panel-hd .grow { flex: 1; }
.panel-bd { padding: 16px; }
.panel-bd.flush { padding: 0; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.grid th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12px;
  padding: 9px 16px; border-bottom: 1px solid var(--line); background: #fafbfd;
  white-space: nowrap;
}
table.grid td { padding: 10px 16px; border-bottom: 1px solid #eef1f6; vertical-align: middle; font-size: 13px; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid tr:hover td { background: #f8fafd; }
table.grid tr.group-row td { background: #f7f9fc; padding: 7px 16px; font-size: 12px; color: var(--ink-2); border-bottom: 1px solid var(--line); }
table.grid tr.group-row:hover td { background: #f7f9fc; }
table.grid tr.group-row .dot { margin-right: 6px; }
table.grid td.r, table.grid th.r { text-align: right; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px; border-radius: 4px;
  font-size: 11.5px; line-height: 19px;
  border: 1px solid var(--line-2); color: var(--ink-2); background: #fff;
}
.tag.ok { color: #0c7a5b; border-color: #c6e8da; background: #effaf5; }
.tag.err { color: #b3362c; border-color: #f2cecb; background: #fdf4f3; }
.tag.warn { color: #9a6400; border-color: #f0dfc0; background: #fdf8ec; }
.tag.off { color: var(--faint); }
.tag.bad { color: #b3261e; border-color: #f3ccc8; background: #fdf1f0; }

.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; background: var(--faint); }
.dot.on { background: var(--ok); }
.dot.hot { background: var(--signal); }
.dot.idle { background: var(--amber); }

.empty { padding: 44px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 4px; }

/* ---------- 指标带 ---------- */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 7px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 38, .04);
  overflow: hidden;
}
.metrics > div { padding: 16px 20px; border-right: 1px solid var(--line); }
.metrics > div:last-child { border-right: 0; }
.metrics .k { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.metrics .v { font-size: 26px; line-height: 1.1; font-family: var(--mono); letter-spacing: -0.03em; font-weight: 500; }
.metrics .v small { font-size: 13px; margin-left: 4px; color: var(--muted); font-family: var(--sans); margin-left: 3px; }
.metrics .d { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---------- 图表 ---------- */
.bars { display: flex; align-items: stretch; gap: 4px; height: 108px; justify-content: space-between; }
.bars .b { flex: 1 1 0; max-width: 54px; min-width: 0; background: #f1f3f7; position: relative; border-radius: 1px; display: flex; align-items: flex-end; }
.bars .b i { width: 100%; background: var(--navy); display: block; border-radius: 1px 1px 0 0; }
.bars .b:hover i { background: var(--signal); }
.spark-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 6px; }

.progress { height: 6px; background: var(--bg-deep); border-radius: 2px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--teal); }

/* ---------- 分段控件 ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.seg-b { border: 0; background: var(--paper); padding: 7px 16px; font-size: 13px; cursor: pointer; color: var(--muted); font-family: inherit; }
.seg-b + .seg-b { border-left: 1px solid var(--line-2); }
.seg-b:hover { color: var(--ink); }
.seg-b.on { background: var(--ink); color: #fff; }
.seg-b.on:hover { color: #fff; }

/* ---------- 分段控件 ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.seg-b { border: 0; background: var(--paper); padding: 7px 16px; font-size: 13px; cursor: pointer; color: var(--muted); font-family: inherit; }
.seg-b + .seg-b { border-left: 1px solid var(--line-2); }
.seg-b:hover { color: var(--ink); }
.seg-b.on { background: var(--ink); color: #fff; }
.seg-b.on:hover { color: #fff; }

/* ---------- 分段控件 ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.seg-b { border: 0; background: var(--paper); padding: 7px 16px; font-size: 13px; cursor: pointer; color: var(--muted); font-family: inherit; }
.seg-b + .seg-b { border-left: 1px solid var(--line-2); }
.seg-b:hover { color: var(--ink); }
.seg-b.on { background: var(--ink); color: #fff; }
.seg-b.on:hover { color: #fff; }

/* ---------- 分段控件 ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.seg-b { border: 0; background: var(--paper); padding: 7px 16px; font-size: 13px; cursor: pointer; color: var(--muted); font-family: inherit; }
.seg-b + .seg-b { border-left: 1px solid var(--line-2); }
.seg-b:hover { color: var(--ink); }
.seg-b.on { background: var(--ink); color: #fff; }
.seg-b.on:hover { color: #fff; }

/* ---------- 分段控件 ---------- */
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.seg-b { border: 0; background: var(--paper); padding: 7px 16px; font-size: 13px; cursor: pointer; color: var(--muted); font-family: inherit; }
.seg-b + .seg-b { border-left: 1px solid var(--line-2); }
.seg-b:hover { color: var(--ink); }
.seg-b.on { background: var(--ink); color: #fff; }
.seg-b.on:hover { color: #fff; }

/* ---------- 弹层 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(16,21,33,.32);
  display: grid; place-items: center; padding: 20px; z-index: 80;
}
.modal {
  width: min(560px, 100%);
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  box-shadow: 0 18px 48px rgba(16,21,33,.16);
  max-height: 90vh;
  overflow: auto;
}
.modal-hd { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
.modal-hd h3 { font-size: 15px; flex: 1; }
.modal-bd { padding: 20px; }
.modal-ft { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.x { cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; background: none; border: 0; }
.x:hover { color: var(--ink); }

.toast-host { position: fixed; top: 28px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 200; }
.toast {
  background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 3px;
  font-size: 13px; max-width: 380px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  animation: toast-in .18s ease-out;
}
.toast.err { background: #8f2a22; }
.toast.ok { background: #0d6b52; }
@keyframes toast-in { from { transform: translateY(6px); opacity: 0; } }

/* ---------- 认证页 ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) clamp(420px, 40vw, 560px); }
.auth-side {
  background: var(--navy); color: #e8edf6;
  padding: 44px clamp(40px, 7vw, 160px) 40px;
  display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-side .brand-row { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: -.01em; color: #fff; }
.auth-side .pitch { margin-top: auto; margin-bottom: auto; padding: 40px 0; max-width: 620px; }
.auth-side h1 { font-weight: 600; font-size: clamp(30px, 2.7vw, 46px); line-height: 1.16; letter-spacing: -0.025em; max-width: 13em; }
.auth-side .lede { color: #9fb0c8; margin-top: 18px; max-width: 27em; font-size: 14.5px; line-height: 1.75; }
.auth-side .meta { font-size: 12px; color: #7f90aa; font-family: var(--mono); max-width: 620px; }
.auth-side .glyphs { position: absolute; right: -40px; bottom: -40px; opacity: .18; }
.auth-form { background: var(--paper); padding: 48px clamp(36px, 4vw, 64px); display: flex; flex-direction: column; justify-content: center; align-items: stretch; }
.auth-form > * { width: 100%; max-width: 400px; margin-left: auto; margin-right: auto; }
.auth-form h2 { font-size: 27px; margin-bottom: 6px; letter-spacing: -.025em; }
.auth-form .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 30px; }
.auth-form .btn { width: 100%; height: 46px; margin-top: 6px; font-size: 14.5px; }
.auth-form .alt { margin-top: 18px; font-size: 12.5px; color: var(--muted); text-align: center; }
.auth-form .alt a { color: var(--ink); border-bottom: 1px solid var(--line-2); }

/* ---------- 居中登录卡片 ---------- */
/* margin:auto 而不是 align/justify-center：视口比内容矮时能正常滚动，不会把顶部 logo 裁掉 */
.auth-center { min-height: 100vh; display: flex; background: var(--bg); padding: 44px 20px; }
.auth-center .auth-card-wrap { width: min(420px, 100%); flex: 0 0 auto; margin: auto; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 600; margin-bottom: 24px; font-size: 15px; letter-spacing: -.01em; }
.auth-brand .mk { width: 26px; height: 26px; background: var(--ink); color: #fff; border-radius: 3px; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; }
.auth-card { background: var(--paper); border: 1px solid var(--line); border-radius: 4px; padding: 30px 30px 26px; box-shadow: 0 1px 3px rgba(16,21,33,.05); }
.auth-card h2 { font-size: 24px; letter-spacing: -.02em; text-align: center; }
.auth-card .sub { color: var(--muted); font-size: 13.5px; margin: 6px 0 24px; text-align: center; }
.auth-card .btn { width: 100%; height: 44px; margin-top: 4px; }
.auth-card .alt { margin-top: 18px; font-size: 12.5px; color: var(--muted); text-align: center; }
.auth-card .alt a { color: var(--ink); border-bottom: 1px solid var(--line-2); }
.auth-foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--muted); display: flex; gap: 8px; justify-content: center; }
.auth-foot .sep { color: var(--faint); }
.auth-foot a { border-bottom: 1px solid var(--line); }

/* 网关页的复制行 */
.kv { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { width: 132px; flex: 0 0 132px; font-size: 12.5px; color: var(--muted); }
.kv .v { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.kv .btn { flex: 0 0 auto; }

/* ---------- 首页 ---------- */
.landing { background: var(--paper); }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 28px; }

.site-nav {
  height: 68px; display: flex; align-items: center; gap: 24px;
  border-bottom: 1px solid var(--line);
}
.site-nav .brand { font-weight: 650; letter-spacing: -0.01em; font-size: 16px; display: flex; align-items: center; gap: 9px; }
.site-nav .brand span.mk {
  width: 24px; height: 24px; background: var(--ink); color: #fff; border-radius: 2px;
  font-family: var(--mono); font-size: 11px; display: grid; place-items: center;
}
.site-nav nav { display: flex; gap: 20px; font-size: 13.5px; color: var(--ink-2); }
.site-nav .grow { flex: 1; }
.site-nav a.link:hover { color: var(--ink); }

.hero { padding: 66px 0 40px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; }
.hero h1 { font-size: 43px; line-height: 1.16; letter-spacing: -0.02em; font-weight: 600; }
.hero .lede { margin-top: 18px; font-size: 16px; color: var(--ink-2); max-width: 30em; }
.hero .cta { margin-top: 26px; display: flex; gap: 10px; align-items: center; }
.hero .cta .btn { height: 40px; padding: 0 18px; }
.hero .note { margin-top: 14px; font-size: 12.5px; color: var(--muted); }

.routeboard { position: relative; }
.routeboard svg { width: 100%; height: auto; display: block; }
.rb-node-label { font-size: 9.5px; fill: var(--muted); font-family: var(--sans); }
.rb-core { font-size: 11px; fill: #fff; font-family: var(--mono); }

.band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fbfcfd; }
.band .row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.band .cell { padding: 22px 24px; border-right: 1px solid var(--line); }
.band .cell:last-child { border-right: 0; }
.band .n { font-family: var(--mono); font-size: 24px; letter-spacing: -0.03em; }
.band .l { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.section { padding: 62px 0; }
.section-hd { display: flex; align-items: baseline; gap: 16px; margin-bottom: 28px; }
.section-hd h2 { font-size: 27px; letter-spacing: -0.02em; }
.section-hd p { color: var(--muted); font-size: 13.5px; }

.prov-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.prov {
  padding: 18px 20px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; gap: 12px; align-items: flex-start; background: var(--paper);
}
.prov .swatch { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: 0 0 8px; }
.prov .prov-logo { width: 34px; height: 34px; border-radius: 8px; object-fit: contain;
  background: #fff; border: 1px solid var(--line); flex: none; margin-top: 0; }
.prov .nm { font-weight: 600; font-size: 14px; }
.prov .vd { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.prov .mo { font-size: 11.5px; color: var(--ink-2); margin-top: 8px; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); }
.step { padding: 26px 24px; border-right: 1px solid var(--line); }
.step:last-child { border-right: 0; }
.step .idx { font-family: var(--mono); font-size: 12px; color: var(--signal); }
.step h3 { font-size: 16px; margin: 8px 0 6px; }
.step p { font-size: 13px; color: var(--ink-2); }

.codebox {
  background: var(--navy); color: #dbe4f3; border-radius: 4px; padding: 18px 20px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.8; overflow-x: auto;
}
.codebox .c { color: #7f90aa; }
.codebox .k { color: #ffb4a5; }
.codebox .s { color: #9fe0cf; }

.site-foot { border-top: 1px solid var(--line); padding: 26px 0 40px; font-size: 12.5px; color: var(--muted); display: flex; gap: 18px; }

/* 宽屏：把两块面板按比例摊开，别缩在一边 */
@media (min-width: 1500px) {
  .content { padding: 34px 48px 80px; }
  .metrics .v { font-size: 32px; }
  .panel-hd { padding: 16px 22px; }
  .panel-bd { padding: 22px; }
  .panel-bd.flush { padding: 0; }
  table.grid th, table.grid td { padding-left: 18px; padding-right: 18px; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; }
  .hero h1 { font-size: 34px; }
  .prov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .band .row { grid-template-columns: repeat(2, 1fr); }
  .band .cell:nth-child(2) { border-right: 0; }
  .auth-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-side { padding: 26px 24px 22px; justify-content: flex-start; }
  .auth-side .pitch { margin: 16px 0 0; padding: 0; max-width: none; }
  .auth-side h1 { font-size: 24px; line-height: 1.25; max-width: none; }
  .auth-side h1 br { display: none; }
  .auth-side .lede, .auth-side .meta, .auth-side .glyphs { display: none; }
  .auth-form { padding: 34px 22px 48px; justify-content: center; min-height: 60vh; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics > div:nth-child(2) { border-right: 0; }
  .metrics > div:nth-child(1), .metrics > div:nth-child(2) { border-bottom: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; }
  .step { border-right: 0; border-bottom: 1px solid var(--line); }
  .content { padding: 18px 14px 48px; }
  table.grid { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 账号行的三个积分数字 */
.credit-cells { display: flex; gap: 16px; white-space: nowrap; align-items: baseline; }
.credit-cells span { font-size: 11.5px; color: var(--muted); }
.credit-cells b { font-family: var(--mono); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); margin-left: 2px; }
.credit-cells b.warn { color: #a86b00; }
.credit-cells b.spent { color: #b3362c; }


/* 侧栏收起（手动或窄屏自动） */
body.rail-collapsed .rail { width: 64px; flex: 0 0 64px; padding: 14px 8px 10px; }
@media (max-width: 900px) { .main { margin-left: 64px; } }
body.rail-collapsed .rail a { justify-content: center; padding: 9px 0; }
body.rail-collapsed .rail a .lbl,
body.rail-collapsed .rail-group,
body.rail-collapsed .rail-status .lbl,
body.rail-collapsed .who { display: none; }
body.rail-collapsed .rail-top { flex-direction: column; gap: 8px; align-items: center; padding: 0; }
body.rail-collapsed .rail-status { justify-content: center; padding: 10px 0 2px; }
body.rail-collapsed .rail a.on::before { left: -8px; }

@media (max-width: 900px) {
  .rail { width: 64px; flex: 0 0 64px; padding: 14px 8px 10px; }
  .rail a { justify-content: center; padding: 9px 0; }
  .rail a .lbl, .rail-group, .rail-status .lbl, .who { display: none; }
  .rail-top { flex-direction: column; gap: 8px; align-items: center; padding: 0; }
  .rail-status { justify-content: center; padding: 10px 0 2px; }
  .rail a.on::before { left: -8px; }
  .rail-toggle { display: none; }
}


/* 侧栏底部的小入口 */
.rail-mini { display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 12px;
  color: var(--muted); border-radius: 6px; }
.rail-mini:hover { background: #eef2f8; color: var(--ink); }
.rail-mini .ico { width: 15px; height: 15px; flex: 0 0 15px; }
.rail-mini .ico svg { width: 15px; height: 15px; display: block; }
body.rail-collapsed .rail-mini { justify-content: center; padding: 8px 0; }
body.rail-collapsed .rail-mini .lbl { display: none; }


/* 站点图标 */
.mk-img { width: 24px; height: 24px; border-radius: 5px; display: block; object-fit: cover; }
.rail .mark { background: transparent !important; padding: 0; overflow: hidden; }
.rail .mark img { width: 30px; height: 30px; display: block; border-radius: 7px; object-fit: cover; }
.rail-title { font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: 1px;
  white-space: nowrap; overflow: hidden; }
body.rail-collapsed .rail-title { display: none; }
body.rail-collapsed .rail .mark { margin: 0 auto; }


/* 设置页：两列表单，宽度与其它面板一致 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 0 24px; width: 100%; max-width: 1560px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field { margin-bottom: 14px; }
.form-grid .field.check { display: flex; align-items: center; gap: 8px; padding-top: 22px; }
.form-grid .field.check label { font-size: 13px; }
.readonly { height: 36px; display: flex; align-items: center; font-size: 13px; color: var(--ink-2); }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } .form-grid .field.check { padding-top: 0; } }


/* 模型目录：按上游折叠 */
.model-group { border-top: 1px solid var(--line); }
.model-group-hd:hover { background: #f2f5fa; }
.model-group:first-child { border-top: 0; }
.model-group-hd { display: flex; align-items: center; gap: 10px; padding: 9px 16px; background: #f7f9fc; }
.model-group-hd strong { font-weight: 600; font-size: 13px; }
.caret { width: 24px; height: 24px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2);
  border-radius: 5px; cursor: pointer; display: grid; place-items: center; font-size: 15px; font-weight: 600;
  line-height: 1; padding: 0 0 2px; transition: transform .15s ease, color .15s, border-color .15s; }
.caret:hover { color: var(--ink); border-color: var(--faint); }
.caret.open { transform: rotate(90deg); color: var(--ink); }


/* 请求热力图 */
.heat-wrap { position: relative; padding-top: 18px; }
.heat-months { position: relative; height: 14px; }
.heat-month { position: absolute; top: 0; font-size: 11px; color: var(--muted); }
.heat { display: flex; gap: 4px; overflow-x: auto; padding: 2px 0 2px; }
.heat-col { display: flex; flex-direction: column; gap: 4px; }
.heat-cell { width: 16px; height: 16px; border-radius: 4px; background: #eef1f6; display: block; }
.heat-cell.l0 { background: #eef1f6; }
.heat-cell.l1 { background: #cfe0fd; }
.heat-cell.l2 { background: #9dc0fb; }
.heat-cell.l3 { background: #5b8ff0; }
.heat-cell.l4 { background: #2f6df6; }
.heat-cell.lx { background: transparent; }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 8px; }
.heat-legend .heat-cell { width: 12px; height: 12px; }


/* 模型目录表格：固定布局防长促销标签把表格撑出容器 */
#mTable table.grid, .model-group table.grid { table-layout: fixed; width: 100%; }
#mTable td, .model-group td { overflow: hidden; text-overflow: ellipsis; }
#mTable .tag, .model-group .tag { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }


/* 危险操作按钮 */
.btn.danger { background: #d0453c; color: #fff; border-color: #d0453c; }
.btn.danger:hover { background: #b93a31; }


/* 内嵌滑条验证码（拖到最右） */
.slide { position: relative; height: 42px; background: #eef1f6; border: 1px solid var(--line-2);
  border-radius: 4px; overflow: hidden; }
.slide-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(180deg, #6dbb5a, #4e9e3f); }
.slide.ok { background: #5cb85c; border-color: #4e9e3f; }
.slide-btn { position: absolute; left: 0; top: 0; width: 44px; height: 42px; background: #fff;
  border-right: 1px solid var(--line-2); display: grid; place-items: center;
  cursor: grab; user-select: none; touch-action: none; z-index: 2; }
.slide-btn.dragging { cursor: grabbing; }
.slide-puzzle { display: block; width: 24px; height: 24px; border-radius: 5px;
  background: #fff url('/static/logo.png') center/cover no-repeat; }
.slide-check { color: #fff; font-size: 16px; font-weight: 700; }
.slide-hint { position: absolute; left: 0; right: 0; top: 0; line-height: 42px;
  text-align: center; font-size: 13px; color: var(--muted); pointer-events: none; }
.slide-ok { position: absolute; left: 12px; top: 0; line-height: 42px; font-size: 13px;
  color: #fff; font-weight: 600; }

.tag .prov-logo { width: 13px; height: 13px; border-radius: 3px; }
.prov-logo { width: 18px; height: 18px; border-radius: 4px; object-fit: contain;
  flex: none; background: #fff; border: 1px solid var(--line-2);
  vertical-align: middle; margin-top: -3px; margin-bottom: -1px; }

/* 上游多账号策略（chip 胶囊） */
.pr-row { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.pr-row:last-child { border-bottom: 0; }
.pr-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.pr-head strong { font-size: 14px; }
.pr-line { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.pr-line:last-child { margin-bottom: 0; }
.pr-label { font-size: 12px; color: var(--muted); min-width: 60px; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; cursor: pointer;
  transition: all .12s ease; }
.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.tag.think { background: #eef4ff; color: #2f5fd0; border-color: #d6e3fb; }

/* 管理员内容按归属分区 */
.owner-sect { margin-bottom: 18px; }
.owner-sect:last-child { margin-bottom: 0; }
.owner-sect-hd { display: flex; align-items: baseline; gap: 10px; padding: 10px 16px;
  background: var(--paper-2, #f7f8fa); border-bottom: 1px solid var(--line); }
.owner-sect-hd b { font-size: 13px; }

/* 概览指标卡可点（悬停微亮 + 手型） */
.metric-link { cursor: pointer; transition: background .12s ease; border-radius: 6px; }
.metric-link:hover { background: rgba(15, 23, 38, .035); }

/* 模型列表：紧凑行距 + 操作列右固定，避免按钮被裁切 */
.model-list table.grid td { padding: 7px 10px; vertical-align: middle; }
.model-list table.grid thead th { padding: 8px 10px; }
.model-list .m-name .mono { font-family: var(--mono); font-size: 12.5px; line-height: 1.3; }
.model-list table.grid tr:hover td { background: rgba(15, 23, 38, .022); }

/* ---------- 模型表：列宽分配（宽屏铺满后防止名称列吃掉所有空间） ---------- */
/* 模型表：名称列定宽（320px，由表头给），超长省略；窄列不换行 */
#mTable .m-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#mTable td:nth-child(3), #mTable th:nth-child(3),
#mTable td:nth-child(4), #mTable th:nth-child(4),
#mTable td:nth-child(5), #mTable th:nth-child(5) { white-space: nowrap; }

/* ---------- 上线体检提示条 ---------- */
.sec-tips { display: grid; gap: 8px; margin-bottom: 16px; }
.sec-tip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 6px;
  background: #fff8e6; border: 1px solid #f5dfa6; color: #6b4a00; font-size: 13px; }
.sec-tip.high { background: #fef1f1; border-color: #f3c4c4; color: #8c1f1f; }
.sec-tip.low { background: #f4f7fb; border-color: #dde5f0; color: #35495f; }
.sec-tip .dot-warn { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.sec-tip .btn { flex: 0 0 auto; }

/* 表格里的操作按钮：相邻按钮之间留出间距，不再挤成一串文字 */
table.grid td .btn + .btn { margin-left: 6px; }
table.grid td .btn { vertical-align: middle; }

/* ---------- 路由组的模型 chips（参考 magpie 的模型选择） ---------- */
.g-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px; border: 1px solid var(--line-2);
  border-radius: 6px; min-height: 40px; align-content: flex-start; }
/* 一个上游一个框，框头是上游名 */
#gModelChips { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow: auto; }
.g-chip-group { border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; background: #fff; }
.g-chip-group-hd { display: flex; align-items: center; gap: 8px; padding: 8px 11px;
  background: #f8fafd; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.g-chip-group-hd .prov-logo { width: 15px; height: 15px; }
.g-chip-group .g-chips { border: 0; border-radius: 0; }
.g-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  border: 1px dashed var(--line-2); background: #fff; color: var(--ink-2); font-size: 12.5px;
  font-family: inherit; cursor: pointer; transition: all .12s; white-space: nowrap; }
.g-chip:hover { border-color: var(--faint); color: var(--ink); background: #f8fafd; }
.g-chip.on { border: 1px solid var(--ink); background: #f4f7fc; color: var(--ink); font-weight: 500; }
.g-chip .g-chip-free { color: #12805c; font-weight: 600; }
.g-chip .g-chip-rate { color: var(--muted); }
.g-chip .g-chip-ctx { padding: 1px 5px; border-radius: 3px; background: #eef1f6; color: var(--muted); font-size: 11px; }

/* ---------- 路由组的模型列表（有序，参考 magpie） ---------- */
.g-model-list { border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.g-mrow { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line);
  font-size: 12.5px; background: #fff; }
.g-mrow:last-child { border-bottom: 0; }
.g-mrow:hover { background: #fafcff; }
.g-mrow .g-midx { width: 18px; text-align: right; color: var(--faint); font-size: 11.5px; font-family: var(--mono); }
.g-mrow .g-mname { flex: 0 1 auto; font-weight: 500; }
.g-mrow .g-mprov { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-mrow .g-mctx { flex: 0 0 auto; }
.g-mrow .g-mact { flex: 0 0 auto; display: flex; gap: 4px; }
.g-mrow .g-mact .btn { padding: 0 7px; height: 24px; font-size: 12px; }

/* ---------- 密钥弹窗的模型 chips（与组弹窗同款） ---------- */
.kMfChip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border-radius: 999px;
  border: 1px dashed var(--line-2); background: #fff; color: var(--ink-2); font-size: 12.5px;
  cursor: pointer; transition: all .12s; white-space: nowrap; user-select: none; }
.kMfChip:hover { border-color: var(--faint); color: var(--ink); background: #f8fafd; }
.kMfChip.on { border: 1px solid var(--ink); background: #f4f7fc; color: var(--ink); font-weight: 500; }
.kMfChip input { display: none; }
