/* colab-pool 控制台 —— 扁平风格
 * 层级靠底色区分：页面 bg → 卡片 panel → 卡片内填充 fill → 悬停/激活 fill-2；
 * 描边只用于表格行分隔与键盘焦点，阴影只用于浮层（对话框、日志抽屉、提示）。
 * 尺度：字号 12/13/14/16/20/28，间距 4/8/12/16/20/24/32，卡片统一内边距 20px。
 */

/* design-kit 字体加载（palette.md §10：Noto Serif SC 300/600 + Fraunces Variable 本地加载） */
@font-face {
  font-family: "Fraunces Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/fraunces-latin-ext-full-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/fraunces-latin-full-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Noto Serif SC";
  font-style: normal;
  font-display: swap;
  font-weight: 300;
  src: url("/static/fonts/noto-serif-sc-latin-300-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Noto Serif SC";
  font-style: normal;
  font-display: swap;
  font-weight: 300;
  src: url("/static/fonts/noto-serif-sc-chinese-simplified-300-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif SC";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/static/fonts/noto-serif-sc-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Noto Serif SC";
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url("/static/fonts/noto-serif-sc-chinese-simplified-600-normal.woff2") format("woff2");
}

:root {
  --dw-serif: "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "Songti SC", "STSong", serif;
  --dw-display: "Fraunces Variable", "Fraunces", "Noto Serif SC", Georgia, serif;
  --dw-sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --dw-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --font-ui: var(--dw-sans);
  --font-serif: var(--dw-serif);
  --font-display: var(--dw-display);
  --font-mono: var(--dw-mono);

  --fs-xs: 12px;
  --fs-s: 13px;
  --fs-m: 14px;
  --fs-l: 16px;
  --fs-xl: 20px;
  --fs-xxl: 28px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  --pad: 20px;            /* 卡片、面板、对话框统一内边距 */
  --gap: 16px;            /* 卡片之间的间距 */
  --page-x: 32px;         /* 顶栏与内容区的左右留白 */
  --content-max: 1480px;
  --rail-w: 236px;
  --topbar-h: 72px;       /* 顶栏与侧栏品牌区等高，两者在同一水平带内对齐 */
  --h-ctl: 36px;
  --h-ctl-sm: 30px;
  --h-tag: 24px;

  --r-xs: 6px;
  --r-s: 10px;
  --r: 14px;
  --r-l: 20px;
  --r-xl: 28px;
  --r-full: 999px;

  /* design-kit 的 CSS 动效变量（palette.md §13）：只给颜色、底色的过渡；形状与状态走 motion.js 的弹簧 */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 120ms;
  --base: 180ms;
  --slow: 280ms;
  --exit: 140ms;
}
@media (prefers-reduced-motion: reduce) {
  :root { --fast: 0ms; --base: 0ms; --slow: 0ms; --exit: 0ms; }
}

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --rail: #0b0c0f;
  --bg: #0f1115;
  --panel: #16181e;
  --stage: #1c1f27;
  --track: #242832;
  --fill: #1e222a;
  --fill-2: #282d37;
  --side: rgba(255, 236, 196, .038);
  --line: rgba(255, 236, 196, .075);
  --text: #eceae4;
  --text-2: #b6b1a7;
  --muted: #878279;
  --faint: #6c675f;

  --accent: #f5a524;
  --accent-2: #ffb941;
  --accent-ink: #191104;
  --accent-soft: rgba(245, 165, 36, .14);
  --ok: #3dd6a0;
  --ok-soft: rgba(61, 214, 160, .13);
  --warn: #f2c14e;
  --warn-soft: rgba(242, 193, 78, .13);
  --err: #ff6b6b;
  --err-soft: rgba(255, 107, 107, .13);
  --info: #6ea8ff;
  --info-soft: rgba(110, 168, 255, .13);

  --console-bg: #090a0c;
  --console-text: #c9ced6;
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, .42), 0 0 0 0.5px rgba(255, 236, 196, .08);
  --overlay-shadow: 0 22px 48px -20px rgba(0, 0, 0, .65), 0 8px 18px -10px rgba(0, 0, 0, .35);
  --backdrop: rgba(5, 6, 8, .62);
}

[data-theme="light"] {
  color-scheme: light;
  --rail: #ebe8e1;
  --bg: #f4f2ed;
  --panel: #fbf9f5;
  --stage: #f2ede7;
  --track: #dfd9d0;
  --fill: #f0ece4;
  --fill-2: #e6e1d7;
  --side: rgba(42, 28, 12, .038);
  --line: rgba(42, 28, 12, .09);
  --text: #1c1915;
  --text-2: #4e4942;
  --muted: #6e675f;
  --faint: #877f76;

  --accent: #b86200;
  --accent-2: #cc6f00;
  --accent-ink: #fbf9f5;
  --accent-soft: rgba(184, 98, 0, .1);
  --ok: #0f8a5f;
  --ok-soft: rgba(15, 138, 95, .1);
  --warn: #a86b00;
  --warn-soft: rgba(168, 107, 0, .11);
  --err: #cf3f3f;
  --err-soft: rgba(207, 63, 63, .09);
  --info: #2f6fd6;
  --info-soft: rgba(47, 111, 214, .09);

  --console-bg: #16181c;
  --console-text: #c9ced6;
  --shadow-sm: 0 1px 3px 0 rgba(42, 28, 12, .14), 0 0 0 0.5px rgba(42, 28, 12, .06);
  --overlay-shadow: 0 22px 48px -20px rgba(42, 28, 12, .24), 0 8px 18px -10px rgba(42, 28, 12, .12);
  --backdrop: rgba(35, 28, 15, .32);
}

/* ── 基础 ─────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { scrollbar-gutter: stable; }
body {
  font: var(--fs-m)/1.55 var(--dw-sans);
  letter-spacing: .02em;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
code, kbd, .mono { font-family: var(--dw-mono); font-size: .92em; letter-spacing: 0; }
.num { font-family: var(--dw-display); font-variant-numeric: tabular-nums; letter-spacing: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ic {
  width: 16px; height: 16px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic.sm { width: 14px; height: 14px; }
.ic.lg { width: 20px; height: 20px; }

/* ── 独立全屏登录页（扁平无描边无渐变，色块分层） ─────────────────────── */

body[data-surface="auth"] .rail,
body[data-surface="auth"] .topbar {
  display: none !important;
}
body[data-surface="auth"] .shell {
  display: block;
  min-height: 100vh;
  background: var(--bg);
}
body[data-surface="auth"] .view {
  max-width: none;
  min-height: 100vh;
  padding: 0;
}
/* 登录舞台：左侧一块等距视角的「算力格阵」（品牌 2×2 方块的放大），右侧一张安静的毛玻璃表单卡 */
.auth-stage {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 412px);
  align-items: center; gap: 48px;
  padding: 48px clamp(24px, 6vw, 88px);
}
.auth-stage::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(50% 60% at 47% 52%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--bg);
}

/* 格阵 */
.auth-field {
  position: absolute; z-index: -1; left: 47%; top: 52%;
  width: 0; height: 0; perspective: 1400px; pointer-events: none;
}
.auth-grid {
  --cell: clamp(26px, 2.9vw, 42px); --gap: clamp(8px, .8vw, 12px);
  position: absolute; left: 0; top: 0;
  display: grid; grid-template-columns: repeat(14, var(--cell)); gap: var(--gap);
  transform: translate(-50%, -50%) rotateX(56deg) rotateZ(-40deg);
  transform-style: preserve-3d;
  -webkit-mask-image: radial-gradient(closest-side, #000 52%, transparent 100%);
  mask-image: radial-gradient(closest-side, #000 52%, transparent 100%);
}
.auth-cell {
  width: var(--cell); height: var(--cell); border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
  background: color-mix(in srgb, var(--accent) 5%, var(--panel));
  animation: auth-wave 7.2s var(--ease-out) infinite;
  animation-delay: calc(var(--w) * 110ms);
}
.auth-cell.lit {
  background: color-mix(in srgb, var(--accent) 78%, var(--panel));
  box-shadow: 0 0 26px -2px color-mix(in srgb, var(--accent) 55%, transparent);
  animation-name: auth-wave-lit;
}
.auth-cell.lit.half {
  background: color-mix(in srgb, var(--accent) 30%, var(--panel));
  box-shadow: 0 0 18px -6px color-mix(in srgb, var(--accent) 35%, transparent);
}
@keyframes auth-wave {
  0%, 14%, 100% { transform: translateZ(0); background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
  6% { transform: translateZ(14px); background: color-mix(in srgb, var(--accent) 34%, var(--panel)); }
}
@keyframes auth-wave-lit {
  0%, 14%, 100% { transform: translateZ(4px); }
  6% { transform: translateZ(18px); }
}
@media (prefers-reduced-motion: reduce) { .auth-cell { animation: none; } }

/* 左侧文案 */
.auth-intro {
  align-self: stretch; min-height: min(640px, calc(100vh - 96px));
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
}
.auth-brand { display: flex; align-items: center; gap: var(--sp-3); }
.auth-brand svg { width: 28px; height: 28px; }
.auth-brand .bm-a { fill: var(--accent); }
.auth-brand .bm-b { fill: var(--accent); opacity: .32; }
.auth-brand-name { font-size: var(--fs-l); font-weight: 650; letter-spacing: .04em; }
.auth-brand-tag {
  height: var(--h-tag); padding: 0 10px; display: inline-flex; align-items: center;
  border-radius: var(--r-full); font-size: var(--fs-xs);
  background: var(--accent-soft); color: var(--accent);
}
.auth-hero { max-width: 26em; }
.auth-hero h1 {
  margin: 0;
  font: 600 clamp(34px, 4.2vw, 54px)/1.18 var(--dw-serif);
  letter-spacing: .04em;
  text-shadow: 0 2px 30px color-mix(in srgb, var(--bg) 80%, transparent);
}
.auth-hero p {
  margin: 20px 0 0; max-width: 24em;
  font-size: var(--fs-l); line-height: 1.75; color: var(--text-2);
}
.auth-specs { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; list-style: none; }
.auth-specs li { font: 500 var(--fs-l)/1 var(--dw-display); letter-spacing: .02em; color: var(--muted); }

/* 表单卡 */
.auth-card {
  position: relative;
  display: flex; flex-direction: column; gap: 20px;
  padding: 36px;
  border-radius: var(--r-xl);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: var(--overlay-shadow);
}
.auth-card-head h2 { margin: 0; font: 600 26px/1.3 var(--dw-serif); letter-spacing: .04em; }
.auth-card-head p { margin: 8px 0 0; font-size: var(--fs-s); line-height: 1.6; color: var(--muted); }
.auth-fields { display: flex; flex-direction: column; gap: 14px; }
.auth-card .field > span { font-size: var(--fs-s); color: var(--text-2); }
.auth-card .input { height: 44px; padding: 0 14px; border-radius: var(--r); font-size: var(--fs-m); }
.auth-card .field .hint { font-size: var(--fs-xs); color: var(--faint); }
.auth-card .field .hint.ok { color: var(--ok); }
.auth-card .field.bad .input { box-shadow: inset 0 0 0 1.5px var(--err); }
.auth-card .field.bad .hint { color: var(--err); }
.auth-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-2);
  align-items: center;
}
.auth-code-row .input {
  letter-spacing: .12em;
}
.auth-code-btn {
  height: 44px !important;
  min-width: 118px;
  padding: 0 16px !important;
  border-radius: var(--r) !important;
  font-size: var(--fs-s) !important;
  font-weight: 550;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.modal-subsec {
  margin-top: var(--sp-2);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.modal-subsec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
}
.modal-subsec-head b {
  font-size: var(--fs-s);
  font-weight: 600;
  color: var(--text);
}
.auth-submit { width: 100%; height: 46px; border-radius: var(--r-full); font-size: var(--fs-m); font-weight: 600; }
.auth-foot { margin: 0; text-align: center; font-size: var(--fs-s); color: var(--muted); }
.auth-foot code { color: var(--text-2); }
.auth-link {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--accent); font: inherit;
}
.auth-link:hover { text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 900px) {
  .auth-stage { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 28px 20px 40px; align-items: start; }
  .auth-intro { min-height: 0; gap: 24px; }
  .auth-hero p, .auth-specs { display: none; }
  .auth-field { left: 78%; top: 110px; opacity: .5; }
  .auth-grid { --cell: 24px; --gap: 7px; }
  .auth-card { padding: 28px 22px; }
}

/* ── 框架：侧栏 + 顶栏 + 内容 ─────────────────────────────────────────── */

.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: var(--sp-2);
  padding: 0 var(--sp-3) var(--sp-4);
  background: var(--rail);
}
.rail-top {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.brand {
  display: flex; align-items: center; gap: var(--sp-3); flex: none;
  height: var(--topbar-h); padding: 0 var(--sp-3);
  text-decoration: none;
}
.brand-mark { width: 28px; height: 28px; flex: none; }
.brand-mark .bm-a { fill: var(--accent); }
.brand-mark .bm-b { fill: var(--accent); opacity: .32; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-family: var(--dw-serif); font-size: 15px; font-weight: 600; letter-spacing: .04em; }
.brand-sub { font-size: var(--fs-xs); color: var(--muted); letter-spacing: .04em; }

.nav { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav-mark {
  position: absolute; top: 0; left: 0; z-index: 0; pointer-events: none;
  border-radius: var(--r-s); background: var(--fill);
}
.nav a {
  display: flex; align-items: center; gap: var(--sp-3);
  height: var(--h-ctl); padding: 0 var(--sp-3);
  position: relative; z-index: 1;
  border-radius: var(--r-s);
  color: var(--text-2); text-decoration: none;
  white-space: nowrap;
  transition: background var(--base) var(--ease), color var(--base) var(--ease);
}
@media (hover: hover) {
  .nav a:hover { background: var(--side); color: var(--text); }
  .nav a.active:hover { background: transparent; }
}
.nav a.active { color: var(--text); font-weight: 600; }
.nav a.active .ic { color: var(--accent); }
.nav-badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-grid; place-items: center; border-radius: 10px;
  font: 600 11px/1 var(--font-mono);
  background: var(--accent); color: var(--accent-ink);
}

.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-2); }
.gauge { padding: var(--sp-4); border-radius: var(--r-l); background: var(--panel); }
.gauge > .row-between { align-items: center; gap: var(--sp-2); }
.gauge-name { font-size: var(--fs-s); font-weight: 600; line-height: 20px; }
.gauge-label { font-size: var(--fs-xs); line-height: 18px; color: var(--muted); }
.gauge-value { margin: var(--sp-3) 0 var(--sp-2); font-size: var(--fs-xl); font-weight: 600; line-height: 1.2; }
.gauge-name + .gauge-label { margin-top: 0; }
.gauge-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-1); margin: var(--sp-3) calc(var(--sp-2) * -1) calc(var(--sp-2) * -1); }
.gauge-actions .btn { padding: 0 var(--sp-2); }
.gauge-value small { margin-left: var(--sp-1); font-size: var(--fs-xs); font-weight: 500; color: var(--muted); }
.gauge-bar { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; background: var(--fill-2); }
.gauge-bar span { display: block; height: 100%; background: var(--accent); }
.gauge-bar span:nth-child(2n) { background: var(--accent-2); opacity: .55; }
.gauge-legend { display: flex; flex-direction: column; gap: var(--sp-1); margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--text-2); }
.gauge-legend div { display: flex; justify-content: space-between; gap: var(--sp-2); }
.gauge-legend .num { color: var(--muted); }

.main-col { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  width: 100%; max-width: var(--content-max);
  height: var(--topbar-h);
  padding: 0 var(--page-x);
  background: var(--bg);
}
.topbar-title { min-width: 0; }
.topbar h1 {
  margin: 0;
  font-family: var(--dw-serif);
  font-size: 24px;
  font-weight: 300;
  line-height: 32px;
  letter-spacing: .06em;
}
.topbar p {
  margin: 0; font-size: var(--fs-s); line-height: 20px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar p:empty { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 2px; flex: none; }
.sync { display: inline-flex; align-items: center; gap: var(--sp-2); margin-right: var(--sp-3); font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }

.view { position: relative; width: 100%; max-width: var(--content-max); padding: var(--sp-2) var(--page-x) 64px; outline: none; }
.view-gone { position: absolute; pointer-events: none; }
.view-gone, .view-gone * { animation: none !important; }
.boot { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-8) 0; color: var(--muted); }

/* ── 用户工作台与管理后台专属扁平组件（纯底色区分，无描边无渐变） ────── */

/* 6 节点硬件并发槽位矩阵（扁平色块） */
.rack-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}
.rack-unit {
  padding: var(--pad);
  border-radius: var(--r-l);
  background: var(--panel);
}
.rack-unit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.rack-unit-head > div:first-child { display: flex; align-items: baseline; gap: var(--sp-2); min-width: 0; }
.rack-unit-name { font: 650 var(--fs-l)/24px var(--font-mono); }
.rack-unit-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); color: var(--muted); }
.rack-bays {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-2);
}
.rack-bay {
  padding: var(--sp-3);
  border-radius: var(--r);
  background: var(--fill);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 64px;
}
.rack-bay.active {
  background: var(--accent-soft);
}
.rack-bay-id {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: 600 var(--fs-xs)/18px var(--font-mono);
}
.rack-bay.active .rack-bay-id { color: var(--accent); }
.rack-bay-owner {
  font-size: var(--fs-xs);
  color: var(--text-2);
}
.rack-bay-meta {
  font: var(--fs-xs)/16px var(--font-mono);
  color: var(--muted);
  margin-top: auto;
}

/* ── 控件 ─────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--h-ctl); padding: 0 var(--sp-4);
  border: 0; border-radius: var(--r-full);
  background: var(--fill); color: var(--text);
  font-size: var(--fs-s); font-weight: 550; letter-spacing: .02em; white-space: nowrap; text-decoration: none;
  cursor: pointer;
  transition: background var(--base) var(--ease), color var(--base) var(--ease);
}
.btn > .ic { color: var(--muted); transition: color var(--base) var(--ease); }
.btn.primary > .ic, .btn.danger > .ic { color: currentColor; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .35; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.tonal { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.btn.tonal > .ic { color: currentColor; }
.btn.saved { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
.btn.saved > .ic { color: currentColor; }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.danger { background: var(--err-soft); color: var(--err); }
.btn.danger.solid { background: var(--err); color: #fff; }
.btn.sm { height: var(--h-ctl-sm); padding: 0 var(--sp-3); gap: 6px; font-size: var(--fs-xs); }
.btn.icon-only { width: var(--h-ctl); padding: 0; border-radius: 50%; color: var(--muted); }
.btn.icon-only > .ic { color: currentColor; }
.btn.sm.icon-only { width: var(--h-ctl-sm); }
@media (hover: hover) {
  .btn:hover:not(:disabled) { background: var(--fill-2); }
  .btn:hover:not(:disabled) > .ic { color: var(--text); }
  .btn.primary:hover:not(:disabled) { background: var(--accent-2); }
  .btn.primary:hover:not(:disabled) > .ic { color: currentColor; }
  .btn.tonal:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 22%, transparent); }
  .btn.tonal:hover:not(:disabled) > .ic { color: currentColor; }
  .btn.ghost:hover:not(:disabled) { background: var(--fill); color: var(--text); }
  .btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--err) 22%, transparent); }
  .btn.danger:hover:not(:disabled) > .ic { color: currentColor; }
  .btn.danger.solid:hover:not(:disabled) { background: color-mix(in srgb, var(--err) 88%, #000); }
}
.btn .spin { animation: spin .8s linear infinite; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.btn-row.end { justify-content: flex-end; }

.link { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--accent); font-size: var(--fs-s); text-decoration: none; }
.link:hover { text-decoration: underline; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field-label { font-size: var(--fs-xs); font-weight: 500; letter-spacing: .04em; color: var(--muted); line-height: 18px; }
.field small, .help { font-size: var(--fs-xs); line-height: 18px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-width: 0; height: var(--h-ctl); padding: 0 14px;
  border: 0; border-radius: var(--r);
  background: var(--fill); color: var(--text);
  transition: background var(--base) var(--ease), box-shadow var(--fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { height: auto; padding: var(--sp-3) 14px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 16px, calc(100% - 13px) 16px;
  background-size: 5px 5px; background-repeat: no-repeat;
}
@media (hover: hover) {
  .input:hover:not(:focus), .select:hover:not(:focus) { background-color: var(--fill-2); }
}
.input:focus, .select:focus, .textarea:focus { outline: none; background-color: var(--panel); box-shadow: inset 0 0 0 1.5px var(--accent); }
.input:disabled, .select:disabled { opacity: .35; cursor: not-allowed; }
.input.mono, .textarea.mono { font-family: var(--dw-mono); font-size: var(--fs-s); letter-spacing: 0; }
.select.inline { width: auto; min-width: 180px; }
.input.sm-input { width: 180px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.ctl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-4); height: var(--h-ctl); }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-top: auto; padding-top: var(--sp-3); box-shadow: 0 -1px 0 var(--line); }
.builder-cost {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--dw-display);
  font-size: 22px;
  font-weight: 500;
  color: var(--accent);
}
.builder-cost small {
  font-family: var(--dw-sans);
  font-size: var(--fs-xs);
  font-weight: 450;
  color: var(--muted);
}

/* 工作台左右分栏布局：左栏「新建工作站」紧凑两列网格，右栏「运行中」实例列表/空状态上下严格对齐 */
.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: stretch;
  gap: var(--gap);
}
.workbench-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.workbench-col > .card,
.workbench-col > .empty {
  flex: 1;
}
.slot-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* 11 下拉选单 · 浮层展开 (design-kit Menu / useUnfold：圆角 16、内边距 6、项高 36 圆角 10，悬停浅井色块弹簧滑动) */
.m-select {
  position: relative;
  width: 100%;
  min-width: 0;
}
.m-select[data-open="true"] {
  z-index: 30;
}
.m-select-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  width: 100%;
  height: var(--h-ctl);
  padding: 0 12px 0 14px;
  border: 0;
  border-radius: var(--r);
  background: var(--fill);
  color: var(--text);
  font-size: var(--fs-m);
  text-align: left;
  cursor: pointer;
  transition: background var(--base) var(--ease), box-shadow var(--fast) var(--ease);
}
@media (hover: hover) {
  .m-select-btn:hover {
    background: var(--fill-2);
  }
}
.m-select[data-open="true"] .m-select-btn,
.m-select-btn:focus-visible {
  outline: none;
  background: var(--panel);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.m-select-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-select-caret {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: transform var(--base) var(--ease), color var(--base) var(--ease);
}
.m-select[data-open="true"] .m-select-caret {
  transform: rotate(180deg);
  color: var(--accent);
}
.m-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 16px;
  background: var(--fill);
  box-shadow: var(--overlay-shadow);
  transform-origin: 50% 0;
  scrollbar-width: thin;
  scrollbar-color: var(--fill-2) transparent;
}
:root[data-theme="light"] .m-select-menu {
  background: var(--panel);
}
.m-select-mark {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 0;
  border-radius: 10px;
  background: var(--fill-2);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--fast) var(--ease);
}
.m-select-menu[data-pointing="true"] .m-select-mark {
  opacity: 1;
}
.m-select-opt {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: color var(--fast) var(--ease);
}
.m-select-opt:hover,
.m-select-opt:focus-visible {
  outline: none;
  color: var(--text);
}
.m-select-opt[aria-selected="true"] {
  color: var(--accent);
  font-weight: 600;
}
.m-select-opt-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-select-opt-meta {
  font-family: var(--dw-mono);
  font-size: 11.5px;
  font-weight: 450;
  color: var(--muted);
  white-space: nowrap;
}
.m-select-opt .ic {
  color: var(--accent);
}

.check { display: flex; align-items: flex-start; gap: var(--sp-3); cursor: pointer; }
.check input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--accent); }
.check b { display: block; font-weight: 550; line-height: 20px; }
.check small { font-size: var(--fs-xs); color: var(--muted); }

.switch { position: relative; display: inline-flex; align-items: center; gap: var(--sp-2); flex: none; cursor: pointer; user-select: none; font-size: var(--fs-s); color: var(--text-2); }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch .track { --a: 3px; --b: 17px; position: relative; width: 36px; height: 20px; border-radius: 10px; background: var(--fill-2); transition: background var(--base) var(--ease); }
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: var(--a); width: calc(var(--b) - var(--a)); height: 14px; border-radius: 7px;
  background: var(--muted); transition: background var(--base) var(--ease);
}
.switch input:checked + .track { --a: 19px; --b: 33px; background: var(--accent); }
.switch input:checked + .track::after { background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }

/* ── 卡片与区块 ───────────────────────────────────────────────────────── */

.card { background: var(--panel); border-radius: var(--r-l); }

.section { margin-top: var(--sp-8); }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: var(--h-ctl-sm); margin-bottom: var(--sp-3); }
.section-head h2 {
  display: flex; align-items: center; gap: var(--sp-2); margin: 0;
  font-family: var(--dw-serif); font-size: 16px; font-weight: 600; letter-spacing: .06em; color: var(--text);
}
.section-head .hint { font-size: var(--fs-xs); color: var(--muted); }

.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-1); text-align: center;
  padding: 28px var(--pad); border-radius: var(--r-l);
  background: var(--panel); color: var(--muted); font-size: var(--fs-s); letter-spacing: .04em;
}
.empty b { color: var(--text-2); font-size: var(--fs-m); font-weight: 600; }

.callout {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border: 0; border-radius: var(--r);
  background: var(--fill); color: var(--text-2); font-size: var(--fs-s);
}
.callout > .ic { margin-top: 2px; }
.callout b { color: var(--text); }
.callout pre { margin: var(--sp-1) 0 0; white-space: pre-wrap; word-break: break-word; font: var(--fs-xs)/1.55 var(--font-mono); color: var(--text-2); }
.callout.ok { background: var(--ok-soft); }
.callout.ok > .ic { color: var(--ok); }
.callout.warn { background: var(--warn-soft); }
.callout.warn > .ic { color: var(--warn); }
.callout.err { background: var(--err-soft); }
.callout.err > .ic { color: var(--err); }
.callout.accent { background: var(--accent-soft); }
.callout.accent > .ic { color: var(--accent); }

/* 状态徽章（圆角胶囊）与数据标签（小圆角块），均为纯色填充 */
.badge {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: var(--h-tag); padding: 0 var(--sp-2); border-radius: 12px;
  font-size: var(--fs-xs); font-weight: 550; white-space: nowrap;
  background: var(--fill); color: var(--text-2);
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: var(--h-tag); padding: 0 var(--sp-2); border-radius: var(--r-s);
  font: var(--fs-xs)/1 var(--font-mono); color: var(--text-2); background: var(--fill);
}
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chips, .svc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.arrow { color: var(--faint); font-size: var(--fs-xs); }

.led { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.led.ok { background: var(--ok); }
.led.warn { background: var(--warn); }
.led.err { background: var(--err); }
.led.busy { background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
.led.dim { background: var(--faint); }

/* 统一的键值网格：标签 12px 在上、值在下；槽位与账号卡片共用，列与列严格对齐 */
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-4); margin: 0; }
.kv > div { min-width: 0; }
.kv dt { font-size: var(--fs-xs); line-height: 18px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv dd { margin: 2px 0 0; font-size: var(--fs-m); line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kv dd.st { display: flex; align-items: center; gap: var(--sp-2); }
.kv dd.big { font-size: var(--fs-xl); line-height: 28px; font-weight: 600; }
.kv dd.accent { color: var(--accent); }

/* ── KPI ──────────────────────────────────────────────────────────────── */

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.kpi { padding: var(--pad); }
.kpi-label { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); line-height: 18px; color: var(--muted); }
.kpi-value { margin-top: var(--sp-2); font-size: var(--fs-xxl); font-weight: 600; line-height: 36px; letter-spacing: -.02em; }
.kpi-value small { margin-left: 6px; font-size: var(--fs-s); font-weight: 500; letter-spacing: 0; color: var(--muted); }
.kpi-sub { margin-top: var(--sp-1); min-height: 20px; font-size: var(--fs-s); line-height: 20px; color: var(--text-2); }
.kpi.hero .kpi-value { color: var(--accent); }

/* ── 卡片网格：两列，与四列 KPI 的边缘对齐 ───────────────────────────── */

.slot-grid, .acc-grid, .prof-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.slot, .acc, .prof, .set-card { display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--pad); min-width: 0; }
.slot-head, .acc-head, .prof-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.slot-foot, .acc-foot, .prof-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-top: auto; }
.slot-foot .grow, .prof-foot .grow { flex: 1; }

.slot-title { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.slot-title h3, .acc-name h3, .prof-head h3 { margin: 0; font: 650 var(--fs-l)/24px var(--font-mono); }
.slot-title h3 { text-transform: uppercase; letter-spacing: .02em; }
.slot-host { margin-top: 2px; font: var(--fs-xs)/18px var(--font-mono); color: var(--muted); }

.ssh-creds {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.85fr);
  gap: 8px;
}
.cmd {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  height: var(--h-ctl); padding: 0 4px 0 12px;
  border-radius: var(--r); background: var(--fill);
  font: var(--fs-s)/1 var(--dw-mono);
}
.cmd .prompt { color: var(--accent); user-select: none; display: inline-flex; align-items: center; flex: none; }
.cmd code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-s); color: var(--text); }
.cmd code.pw-mask { letter-spacing: .12em; color: var(--text-2); }
.cmd-actions { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.cmd .btn { width: 28px; height: 28px; color: var(--muted); }
@media (hover: hover) {
  .cmd .btn:hover { background: var(--fill-2); color: var(--text); }
}


.job-inline { width: 100%; align-items: center; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.job-inline:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }

/* ── 表格：仅保留行间细线 ─────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.table th {
  padding: var(--sp-4) var(--pad) var(--sp-2);
  text-align: left; font-size: var(--fs-xs); font-weight: 550; color: var(--muted); white-space: nowrap;
}
.table td { padding: var(--sp-3) var(--pad); border-top: 1px solid var(--line); vertical-align: middle; }
.table th.r, .table td.r { text-align: right; }
.table td.cell-switch { width: 1%; white-space: nowrap; }
.table td.cell-switch .m-switch { display: block; }
.table .sub { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--muted); }
.table b.mono { font-size: var(--fs-s); }
tr.is-disabled td { color: var(--muted); }
.user-table th,
.user-table td {
  padding-left: 14px;
  padding-right: 14px;
  white-space: nowrap;
}
.user-table th:first-child,
.user-table td:first-child {
  padding-left: var(--pad);
  white-space: normal;
}
.user-table th:last-child,
.user-table td:last-child {
  padding-right: var(--pad);
}
.user-table td:first-child .sub {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-row.nowrap { flex-wrap: nowrap; gap: 4px; }
.btn-slot-sm { display: inline-block; width: var(--h-ctl-sm); height: var(--h-ctl-sm); flex: none; }
.user-cell-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.user-cell-name { font-size: var(--fs-s); font-weight: 600; color: var(--text); }
tr.is-disabled .user-cell-name { color: var(--muted); }
.uid-copy {
  padding: 2px 8px;
  border: 0;
  border-radius: var(--r-xs);
  background: var(--fill);
  color: var(--text-2);
  font: var(--fs-xs)/18px var(--dw-mono);
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
@media (hover: hover) {
  .uid-copy:hover { background: var(--fill-2); color: var(--text); }
}
.m-switch:disabled { opacity: .35; cursor: not-allowed; }
.set-card .table th:first-child, .set-card .table td:first-child { padding-left: 0; }
.set-card .table th:last-child, .set-card .table td:last-child { padding-right: 0; }
.set-card .table th { padding-top: 0; }

/* ── 列表工具栏（搜索、状态胶囊）与无描边分页栏（design-kit 浅井分层） ── */

.list-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.search-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.search-wrap > .ic {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--muted);
  pointer-events: none;
}
.search-input {
  height: var(--h-ctl-sm);
  width: 204px;
  padding: 0 28px 0 30px;
  border: 0;
  border-radius: var(--r-s);
  background: var(--fill);
  color: var(--text);
  font: var(--fs-xs)/1 var(--dw-sans);
  transition: background var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
[data-theme="light"] .search-input {
  background: var(--fill-2);
}
.search-input::placeholder { color: var(--muted); }
@media (hover: hover) {
  .search-input:hover:not(:focus) { background: var(--fill-2); }
  [data-theme="light"] .search-input:hover:not(:focus) { background: var(--track); }
}
.search-input:focus,
[data-theme="light"] .search-input:focus {
  outline: none;
  background: var(--panel);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.search-clear {
  position: absolute;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.search-clear:hover {
  background: var(--fill-2);
  color: var(--text);
}
[data-theme="light"] .search-clear:hover {
  background: var(--track);
}
.search-clear .ic { width: 12px; height: 12px; }

.filter-pills {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: var(--h-ctl-sm);
  padding: 3px;
  border-radius: var(--r-s);
  background: var(--fill);
}
[data-theme="light"] .filter-pills {
  background: var(--fill-2);
}
.filter-pill {
  height: 100%;
  padding: 0 10px;
  border: 0;
  border-radius: calc(var(--r-s) - 2px);
  background: transparent;
  color: var(--muted);
  font: 500 var(--fs-xs)/1 var(--dw-sans);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
.filter-pill:hover:not(.active) {
  color: var(--text-2);
}
.filter-pill.active {
  background: var(--fill-2);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] .filter-pill.active {
  background: var(--panel);
}

.pager,
.list-more-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 10px var(--pad);
  border-top: 1px solid var(--line);
  font-size: var(--fs-xs);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.list-more-bar {
  border-radius: 0 0 var(--r-l) var(--r-l);
}
.pager-info {
  color: var(--muted);
  white-space: nowrap;
}
.pager-btns {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.pager-btn {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--r-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-2);
  font: 500 var(--fs-xs)/1 var(--dw-mono);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.pager-btn .ic { width: 14px; height: 14px; }
.pager-btn:hover:not(:disabled):not(.active) {
  background: var(--fill);
  color: var(--text);
}
.pager-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
  cursor: default;
}
.pager-btn:disabled {
  opacity: .32;
  cursor: not-allowed;
}
.pager-gap {
  padding: 0 4px;
  color: var(--faint);
  user-select: none;
}

.table-empty-cell {
  padding: 28px var(--pad) !important;
  text-align: center;
  color: var(--muted);
}

.code-users-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  margin-left: 4px;
  border: 0;
  border-radius: var(--r-xs);
  background: var(--fill);
  color: var(--text-2);
  font: var(--fs-xs)/18px var(--dw-sans);
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.code-users-link:hover {
  background: var(--fill-2);
  color: var(--text);
}

/* ── 账号 ─────────────────────────────────────────────────────────────── */

.acc.is-disabled { opacity: .72; }
.acc-name { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.acc-email { margin-top: 2px; font-size: var(--fs-s); line-height: 20px; color: var(--text-2); }
.acc-desc { font-size: var(--fs-xs); line-height: 18px; color: var(--muted); }
.sessions { display: flex; flex-direction: column; gap: 6px; }
.session {
  display: flex; align-items: center; gap: var(--sp-3);
  min-height: var(--h-ctl); padding: 3px 3px 3px var(--sp-3);
  border-radius: var(--r); background: var(--fill); font-size: var(--fs-s);
}
.session code { font-weight: 600; }
.session .meta { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); color: var(--muted); }
.session .chip { background: var(--panel); }
.path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--fs-xs)/18px var(--font-mono); color: var(--muted); }
.path .ic { margin-right: 6px; vertical-align: -3px; }

/* ── Profiles ─────────────────────────────────────────────────────────── */

.prof-head h3 { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.prof-desc { margin: var(--sp-1) 0 0; font-size: var(--fs-s); color: var(--text-2); }
.spec { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: baseline; gap: var(--sp-3) var(--sp-4); margin: 0; font-size: var(--fs-s); }
.spec dt { font-size: var(--fs-xs); color: var(--muted); }
.spec dd { min-width: 0; margin: 0; }

/* ── 任务列表：固定列宽，使用时长、消耗积分、状态徽章与时间跨行严格对齐 ── */

.jobs { display: flex; flex-direction: column; }
.job-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 104px 112px 84px 96px;
  align-items: center;
  gap: var(--sp-4);
  width: 100%;
  padding: 14px var(--pad);
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--fast) var(--ease);
}
.job-row:first-child { border-top: 0; border-radius: var(--r-l) var(--r-l) 0 0; }
.job-row:last-child { border-radius: 0 0 var(--r-l) var(--r-l); }
.job-row:only-child { border-radius: var(--r-l); }
.job-row:hover { background: var(--fill); }
.job-row .badge { justify-self: start; }
.job-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.job-last { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--fs-xs)/18px var(--font-mono); color: var(--muted); }
.job-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  white-space: nowrap;
}
.job-metric-label {
  font-size: 11px;
  line-height: 15px;
  color: var(--muted);
}
.job-metric-val {
  font-family: var(--dw-display);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.job-metric-val.accent {
  color: var(--accent);
}
.job-metric-val small {
  margin-left: 3px;
  font-family: var(--dw-sans);
  font-size: 11px;
  font-weight: 450;
  color: var(--muted);
}
.job-time { text-align: right; white-space: nowrap; font-size: var(--fs-xs); line-height: 18px; color: var(--muted); }
.st-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.st-icon .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.st-icon.ok { background: var(--ok-soft); color: var(--ok); }
.st-icon.err { background: var(--err-soft); color: var(--err); }
.st-icon.busy { background: var(--accent-soft); color: var(--accent); }
.st-icon.wait { background: var(--warn-soft); color: var(--warn); }

/* ── 设置（遵循 design-kit 组件规格：不写多余副标题与次级说明，单选流珠 / 液态分段 / 拉伸开关 / 可拖动数字） ── */

.settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: var(--gap);
}
.settings-col {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-width: 0;
}
.settings-col > .set-card:only-child {
  flex: 1;
}
.settings .wide { grid-column: 1 / -1; }
.set-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 24px;
  min-width: 0;
}
.set-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  height: 30px;
}
.set-head-tool {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.set-head-label {
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}
.set-card h3 {
  margin: 0;
  font-family: var(--dw-serif);
  font-size: 17px;
  font-weight: 600;
  line-height: 24px;
  letter-spacing: .06em;
  color: var(--text);
}
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.row-between h3 { margin: 0; }
.row-between p { margin: var(--sp-1) 0 0; font-size: var(--fs-s); }

/* 弹窗内的兼容选项块 */
.radio-cards { display: grid; gap: var(--sp-2); }
.radio-card {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-s);
  background: var(--fill); cursor: pointer; transition: background var(--base) var(--ease);
}
@media (hover: hover) {
  .radio-card:hover { background: var(--fill-2); }
}
.radio-card input { flex: none; margin: 3px 0 0; accent-color: var(--accent); }
.radio-card b { display: block; font-weight: 600; line-height: 20px; }
.radio-card small { font-size: var(--fs-s); color: var(--muted); }
.radio-card:has(input:checked) { background: var(--accent-soft); }
.radio-card:has(input:checked) b { color: var(--accent); }

/* 20 单选 · 圆点流过去 (design-kit Radio.tsx)：外扩 10px 悬停内边距，使 18px 圆环与卡片标题严格左对齐 */
.m-radio {
  position: relative;
  margin: 0 -10px;
  width: calc(100% + 20px);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.m-radio-row {
  height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  letter-spacing: .02em;
  text-align: left;
  cursor: pointer;
  transition: color var(--base) var(--ease);
}
.m-radio-row[aria-checked="true"] {
  color: var(--text);
  font-weight: 600;
}
.m-radio-ring {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--track);
}
.m-radio-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-radio-bead,
.m-radio-eye {
  position: absolute;
  pointer-events: none;
}
.m-radio-bead {
  border-radius: 9px;
  background: var(--accent);
}
.m-radio-eye {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-ink);
}

/* 07 开关 · 拉伸的滑钮 (design-kit Toggle.tsx：单独一行 40 × 24，行高 44，行间细线，左右与标题严格对齐) */
.m-toggles {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.m-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: 44px;
  padding: 0;
  font-size: 13.5px;
  letter-spacing: .02em;
  color: var(--text);
}
.m-toggle-row + .m-toggle-row {
  box-shadow: 0 -1px 0 var(--line);
}
.m-switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--track);
  cursor: pointer;
  touch-action: none;
  transition: background var(--base) var(--ease);
}
.m-switch[aria-checked="true"] {
  background: var(--accent);
}
.m-switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #fbf8f4;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

/* 09 分段切换 · 液态滑块 (design-kit Segmented.tsx：底槽用浅井 fill，滑块用抬升色块 + 贴纸阴影，避免多行重复高亮抢视觉焦点) */
.m-seg {
  position: relative;
  flex: none;
  background: var(--fill);
  cursor: pointer;
  touch-action: none;
  user-select: none;
}
.m-seg[data-width="fill"] {
  width: 100%;
}
.m-seg-block {
  position: absolute;
  top: 2px;
  bottom: 2px;
  background: var(--fill-2);
  box-shadow: var(--shadow-sm);
}
.m-seg-row {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.m-seg-opt {
  position: absolute;
  top: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: nowrap;
}
.m-seg-paper .m-seg-opt {
  color: var(--text);
  font-weight: 600;
}
.m-seg-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* 22 可拖动的数字 & 计费行列表 (design-kit NumberField.tsx + Odometer：列宽与标题左右边缘严格对齐) */
.m-rate-list {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.m-rate-row {
  flex: 1;
  display: grid;
  grid-template-columns: 76px 76px minmax(0, 1fr) 92px 108px;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0;
  font-size: 13.5px;
}
.m-rate-row + .m-rate-row {
  box-shadow: 0 -1px 0 var(--line);
}
.m-rate-gpu {
  font-family: var(--dw-mono);
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0;
  color: var(--text);
}
.m-rate-cu {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 3px;
  font-family: var(--dw-display);
  font-size: 13.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.m-rate-eff {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  font-family: var(--dw-display);
  font-size: 13.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.m-rate-cu small,
.m-rate-eff small {
  font-family: var(--dw-sans);
  font-size: 11px;
  color: var(--faint);
}

.m-num {
  position: relative;
  flex: none;
  width: 116px;
  height: 30px;
  border-radius: 8px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: ew-resize;
}
.m-num[data-editing="true"] {
  cursor: text;
}
.m-num-ground {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  border-radius: 8px;
  background: var(--fill);
  transition: background var(--fast) var(--ease);
}
.m-num-arrow {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  display: grid;
  place-items: center;
  color: var(--muted);
  opacity: 0;
  pointer-events: none;
}
.m-num-arrow .ic {
  width: 12px;
  height: 12px;
  stroke-width: 2.3;
}
.m-num-left { left: 5px; }
.m-num-right { right: 5px; }
.m-num-show {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--dw-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  pointer-events: none;
}
.m-num-unit {
  font-family: var(--dw-sans);
  font-size: 11.5px;
  font-weight: 450;
  letter-spacing: .02em;
  color: var(--muted);
}
.m-num-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: 500 14px/1 var(--dw-display);
  text-align: center;
  opacity: 0;
  pointer-events: none;
}
.m-num[data-editing="true"] .m-num-input {
  opacity: 1;
  pointer-events: auto;
}
.m-num[data-editing="true"] .m-num-show {
  opacity: 0;
}

.set-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); }
.set-row b { display: block; font-weight: 600; line-height: 20px; }
.set-row small { font-size: var(--fs-s); color: var(--muted); }

/* ── 23 第三方同级登录（Google + Oblivionis）、积分钱包与兑换码 ───────── */

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  font-size: var(--fs-xs); color: var(--faint); letter-spacing: .04em;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.auth-providers {
  display: flex; flex-direction: column; gap: 10px;
}
.btn-oauth {
  width: 100%; height: 44px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--fill);
  color: var(--text);
  font: 550 var(--fs-s)/1 var(--dw-sans);
  letter-spacing: .01em;
  cursor: pointer;
  transition: background var(--base) var(--ease);
}
@media (hover: hover) {
  .btn-oauth:hover:not(:disabled) {
    background: var(--fill-2);
  }
}
.btn-oauth:disabled { opacity: .35; cursor: not-allowed; }
.btn-oauth svg { width: 18px; height: 18px; flex: none; }

.auth-back-btn {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 6px; margin-bottom: -6px;
  border: 0; border-radius: var(--r-full);
  background: var(--fill); color: var(--text-2);
  font: 500 var(--fs-xs)/1.4 var(--dw-sans);
  cursor: pointer;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.auth-back-btn:hover { color: var(--text); background: color-mix(in srgb, var(--accent) 14%, var(--fill)); }

/* ── 侧栏左下角极简身份小卡（design-kit：无描边、底色分层、无多余标签） ── */

.rail-user {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: var(--r-l);
  background: var(--panel);
}
.rail-user-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-width: 0;
}
.rail-user-link {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; border-radius: var(--r-s);
}
.rail-user-text { min-width: 0; display: flex; flex-direction: column; }
.rail-user-name {
  font-size: var(--fs-s); font-weight: 600; line-height: 19px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rail-user-handle {
  font: var(--fs-xs)/16px var(--dw-mono); color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rail-user-bar {
  height: 4px; border-radius: 2px; overflow: hidden;
  background: var(--track);
}
.rail-user-bar span { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.rail-user-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: var(--fs-xs); line-height: 16px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rail-user-meta .accent { color: var(--accent); font-weight: 550; }

.user-ident {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; overflow: hidden;
  background: var(--accent-soft); color: var(--accent);
  font: 650 13px/1 var(--dw-display);
}
.user-avatar.lg {
  width: 48px; height: 48px;
  font-size: 18px;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.provider-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.provider-tag {
  height: 20px; padding: 0 8px;
  display: inline-flex; align-items: center; gap: 4px;
  border-radius: var(--r-full);
  background: var(--fill); color: var(--muted);
  font-size: 11px; font-weight: 550; letter-spacing: .02em;
}

/* ── 个人信息页 (#/profile · design-kit 扁平浅井体系) ─────────────────── */

.profile-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.profile-ident {
  display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1;
}
.profile-ident-text { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.profile-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 32px; }
.profile-name-row h3 {
  margin: 0;
  font-family: var(--dw-serif); font-size: 19px; font-weight: 600; line-height: 26px; letter-spacing: .04em;
}
.profile-handle,
.profile-uid {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  font: var(--fs-xs)/18px var(--dw-mono);
  color: var(--muted);
}
.profile-uid {
  cursor: pointer;
  transition: color var(--fast) var(--ease);
}
@media (hover: hover) {
  .profile-uid:hover { color: var(--text-2); }
}

.rename-inline {
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
}
.rename-input {
  height: 32px; width: min(220px, 52vw); padding: 0 10px;
  border: 0; border-radius: var(--r-s);
  background: var(--fill); color: var(--text);
  font-family: var(--dw-serif); font-size: 17px; font-weight: 600;
}
.rename-input:focus { outline: none; background: var(--fill-2); }

.prof-list {
  display: flex;
  flex-direction: column;
  margin-bottom: -6px;
}
.prof-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 50px;
  padding: 6px 0;
  border-top: 1px solid var(--line);
}
.prof-item-key {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: var(--fs-s);
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}
.prof-item-key > svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.prof-item-key > .ic {
  color: var(--muted);
}
.prof-item-val {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-s);
  color: var(--text-2);
}
.prof-item-val.mono {
  font-family: var(--dw-mono);
  font-size: 13px;
}
.prof-item-val.muted {
  color: var(--muted);
}
.prof-item-val.masked {
  letter-spacing: .12em;
}
@media (max-width: 520px) {
  .prof-item {
    grid-template-columns: 104px minmax(0, 1fr) auto;
    gap: 10px;
  }
}

.modal-body.form-stack {
  gap: 14px;
}
.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrap .input {
  padding-right: 40px;
}
.pw-eye {
  position: absolute;
  right: 4px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
@media (hover: hover) {
  .pw-eye:hover {
    color: var(--text);
    background: var(--fill-2);
  }
}
.field-hint {
  font-size: var(--fs-xs);
  line-height: 18px;
  color: var(--muted);
}
.field-hint.ok {
  color: var(--ok);
}

.ssh-key-item {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  min-height: 50px; padding: 6px 0;
  border-top: 1px solid var(--line);
}
.ssh-key-type {
  flex: none; height: 22px; padding: 0 8px;
  display: inline-flex; align-items: center;
  border-radius: var(--r-xs); background: var(--fill);
  font: 600 10.5px/1 var(--dw-mono); color: var(--accent);
}
.ssh-key-meta {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px;
}
.ssh-key-comment {
  font-size: var(--fs-s); font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ssh-key-fp {
  font: 11px/15px var(--dw-mono); color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ssh-key-empty {
  display: flex; align-items: center;
  min-height: 46px; padding: 6px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-xs);
}

.wallet-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px;
}
.wallet-stat {
  padding: 14px 16px; border-radius: var(--r);
  background: var(--fill);
  display: flex; flex-direction: column; gap: 4px;
}
.wallet-stat > span { font-size: var(--fs-xs); color: var(--muted); }
.wallet-stat > b { font: 600 22px/1.2 var(--dw-display); font-variant-numeric: tabular-nums; color: var(--text); }
.wallet-stat > b.accent { color: var(--accent); }
.wallet-stat > b small { margin-left: 3px; font: 500 12px/1 var(--dw-sans); color: var(--muted); }

.redeem-bar {
  display: flex; gap: 8px; align-items: center;
}
.redeem-bar .input { flex: 1; text-transform: uppercase; letter-spacing: .06em; }

.ledger-list {
  display: flex; flex-direction: column;
  flex: 1; min-height: 0;
  max-height: 360px; overflow-y: auto;
  border-radius: var(--r);
  background: var(--fill);
  scrollbar-width: thin;
  scrollbar-color: var(--fill-2) transparent;
}
.ledger-empty {
  flex: 1;
  display: grid; place-items: center;
  min-height: 120px;
  padding: 24px 16px; border-radius: var(--r);
  background: var(--fill); color: var(--muted);
  text-align: center; font-size: var(--fs-s);
}
.ledger-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 16px; font-size: var(--fs-s);
}
.ledger-row + .ledger-row { border-top: 1px solid var(--line); }
.ledger-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ledger-title { font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ledger-meta { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.ledger-amt { text-align: right; flex: none; font-variant-numeric: tabular-nums; }
.ledger-delta { font: 600 14px/1.2 var(--dw-display); display: block; }
.ledger-delta.pos { color: var(--ok); }
.ledger-delta.neg { color: var(--text); }
.ledger-bal { font-size: 11px; color: var(--muted); }
.ledger-more {
  width: 100%;
  min-height: 38px;
  padding: 8px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--text-2);
  font: 500 var(--fs-xs)/1.2 var(--dw-sans);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.ledger-more:hover:not(:disabled) {
  background: var(--fill-2);
  color: var(--text);
}
.ledger-more:disabled {
  opacity: .5;
  cursor: default;
}

.provider-bind-box {
  display: flex; flex-direction: column; gap: 8px;
}
.provider-bind-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 8px 10px 8px 14px;
  border-radius: var(--r); background: var(--fill);
}
.provider-bind-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.provider-bind-info svg { width: 18px; height: 18px; flex: none; }
.provider-bind-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.provider-bind-text b { font-size: var(--fs-s); font-weight: 600; }
.provider-bind-text small {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 640px) {
  .wallet-stats { grid-template-columns: 1fr; }
}
.infolist { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: baseline; gap: var(--sp-3) var(--sp-4); margin: 0; font-size: var(--fs-s); }
.infolist dt { font-size: var(--fs-xs); color: var(--muted); }
.infolist dd { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); min-width: 0; margin: 0; font: var(--fs-xs)/20px var(--font-mono); word-break: break-all; }

pre.code {
  margin: 0; padding: var(--sp-4); overflow: auto;
  border-radius: var(--r); background: var(--console-bg); color: var(--console-text);
  font: var(--fs-xs)/1.65 var(--font-mono); tab-size: 4;
}
pre.code.tall { max-height: 62vh; }

/* ── 日志抽屉（浮层，保留一层柔和阴影） ───────────────────────────────── */

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; flex-direction: column; width: min(540px, 100vw);
  background: var(--panel); box-shadow: var(--overlay-shadow);
  transform: translateX(104%); visibility: hidden;
}
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--pad) var(--pad) var(--sp-2); }
.drawer-head h2 { margin: 0; font-size: var(--fs-l); font-weight: 650; line-height: 24px; }
.drawer-head .btn { margin: -6px -8px 0 0; }
.drawer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--sp-4); margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--muted); }
.drawer-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.drawer-body { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3) var(--pad); }
.drawer-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 0 var(--pad) var(--pad); font-size: var(--fs-xs); color: var(--muted); }
#dj-alerts { display: flex; flex-direction: column; gap: var(--sp-3); }
#dj-alerts:empty { display: none; }

.console {
  position: relative; flex: 1; min-height: 0; overflow: auto;
  padding: var(--sp-3) 0; border-radius: var(--r);
  background: var(--console-bg); color: var(--console-text);
  font: var(--fs-xs)/1.7 var(--font-mono);
}
.console .ln { display: grid; grid-template-columns: 72px minmax(0, 1fr); padding: 0 var(--sp-4); }
.console .ln:hover { background: rgba(255, 255, 255, .03); }
.console .ts { color: #4d545e; user-select: none; }
.console .tx { white-space: pre-wrap; word-break: break-word; }
.console .ln.step .tx { color: #ffcf73; }
.console .ln.head .tx { color: #fff; font-weight: 600; }
.console .ln.ok .tx { color: #4fe0ab; }
.console .ln.err .tx { color: #ff8585; }
.console .ln.warn .tx { color: #f6d27a; }
.console .ln.remote .tx { color: #8b939e; }
.console .waiting { padding: var(--sp-1) var(--sp-4); }
.console .cursor { display: inline-block; width: 7px; height: 13px; vertical-align: -2px; background: #ffcf73; animation: blink 1s steps(1) infinite; }
.console-jump { position: absolute; right: calc(var(--pad) + var(--sp-4)); bottom: calc(var(--sp-3) + var(--sp-4)); }
.result-card { display: flex; flex-direction: column; gap: var(--sp-2); }

/* ── 对话框（浮层，保留一层柔和阴影） ─────────────────────────────────── */

.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  padding: 0; border: 0; overflow: visible;
  background: transparent; color: var(--text);
}
.modal.size-lg { width: min(900px, calc(100vw - 32px)); }
.modal.size-sm { width: min(440px, calc(100vw - 32px)); }
.modal::backdrop { background: var(--backdrop); opacity: 0; transition: opacity var(--base) var(--ease); }
.modal.shown::backdrop { opacity: 1; }
.modal.closing::backdrop { opacity: 0; transition-duration: var(--exit); }
.modal.closing { pointer-events: none; }
.modal-card { transform-origin: 50% 50%; }
.modal-card {
  display: flex; flex-direction: column; max-height: calc(100vh - 48px);
  border-radius: var(--r-l); background: var(--panel); box-shadow: var(--overlay-shadow);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--pad) var(--pad) 0; }
.modal-head h2 { margin: 0; font-size: var(--fs-l); font-weight: 650; line-height: 24px; }
.modal-head p { margin: var(--sp-1) 0 0; font-size: var(--fs-s); color: var(--muted); }
.modal-head .btn { margin: -6px -8px 0 0; }
.modal-content { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.modal-body { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: var(--sp-5); padding: var(--pad); }
.modal-body.logout-body { gap: var(--sp-4); }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 0 var(--pad) var(--pad); }
.modal-foot .note { min-width: 0; font-size: var(--fs-xs); color: var(--muted); }
.confirm-msg { margin: 0; font-size: var(--fs-m); line-height: 1.6; color: var(--text-2); }
.logout-account {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--fill);
  min-width: 0;
}
.logout-account-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.logout-account-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.logout-account-name b {
  font-size: var(--fs-m);
  font-weight: 600;
  line-height: 20px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logout-account-meta {
  font: var(--fs-xs)/18px var(--dw-mono);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.form-error { white-space: pre-wrap; font-size: var(--fs-s); color: var(--err); }

/* 21 图块 · 选框跟过去 (design-kit Tiles.tsx：两列紧凑网格，与下方两列表单列宽严格对齐；四边弹簧选框外扩 2px 同心跟随) */
.m-gpu-tiles {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.m-gpu-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--fill);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background var(--base) var(--ease);
}
@media (hover: hover) {
  .m-gpu-tile:hover {
    background: var(--fill-2);
  }
}
.m-gpu-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  width: 100%;
}
.m-gpu-name {
  font-family: var(--dw-mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
  transition: color var(--base) var(--ease);
}
.m-gpu-tile[aria-checked="true"] .m-gpu-name {
  color: var(--accent);
}
.m-gpu-rate {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--dw-display);
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  transition: color var(--base) var(--ease);
}
.m-gpu-tile[aria-checked="true"] .m-gpu-rate {
  color: var(--accent);
}
.m-gpu-rate small {
  font-family: var(--dw-sans);
  font-size: 11px;
  font-weight: 450;
  color: var(--muted);
}
.m-gpu-spec {
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-gpu-ring {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 14px;
  background: rgba(245, 165, 36, .045);
  box-shadow: 0 0 0 2px var(--accent);
  pointer-events: none;
}

/* 弹窗兼容选项块 */
.pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.pick {
  position: relative; display: flex; flex-direction: column; gap: var(--sp-1);
  padding: var(--sp-3) 36px var(--sp-3) var(--sp-4); border-radius: var(--r-s);
  background: var(--fill); cursor: pointer; transition: background var(--base) var(--ease);
}
.pick::after {
  content: ""; position: absolute; top: 18px; right: var(--sp-4);
  width: 10px; height: 10px; border-radius: 50%; background: var(--faint); opacity: .6;
}
@media (hover: hover) {
  .pick:hover { background: var(--fill-2); }
}
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick b { display: flex; align-items: center; gap: var(--sp-2); font: 600 var(--fs-m)/24px var(--dw-mono); }
.pick small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--fs-xs); line-height: 18px; color: var(--muted); }
.pick:has(input:checked) { background: var(--accent-soft); }
.pick:has(input:checked) b { color: var(--accent); }
.pick:has(input:checked)::after { background: var(--accent); opacity: 1; }
.pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.urlbox {
  max-height: 76px; overflow: auto; padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r); background: var(--fill);
  font: var(--fs-xs)/1.5 var(--font-mono); color: var(--text-2); word-break: break-all;
}

.editor {
  width: 100%; min-height: 56vh; resize: vertical; overflow: auto;
  padding: var(--sp-4); border: 0; border-radius: var(--r);
  background: var(--console-bg); color: #dde1e6;
  font: var(--fs-s)/1.6 var(--font-mono); tab-size: 2; white-space: pre;
}
.editor:focus { outline: none; box-shadow: 0 0 0 2px var(--accent); }

/* ── Toast（浮层） ────────────────────────────────────────────────────── */

/* design-kit 14 提示条：窗口顶部只有一条，从状态色小点长出；新消息原地变宽换字，不堆叠 */
.toasts { position: fixed; left: 0; right: 0; top: 18px; height: 0; z-index: 60; pointer-events: none; }
.toast-shell {
  --tone: var(--info);
  position: absolute; left: 50%; top: 0; width: 10px; height: 10px; overflow: hidden;
  border-radius: 5px; background: var(--tone); opacity: 0;
  box-shadow:
    0 14px 30px -16px rgb(0 0 0 / calc(.7 * var(--toast-k, 0))),
    0 0 0 1px rgb(255 236 196 / calc(.07 * var(--toast-k, 0)));
}
[data-theme="light"] .toast-shell {
  box-shadow:
    0 14px 30px -16px rgb(42 28 12 / calc(.28 * var(--toast-k, 0))),
    0 0 0 1px rgb(42 28 12 / calc(.06 * var(--toast-k, 0)));
}
.toast-shell[data-tone="ok"] { --tone: var(--ok); }
.toast-shell[data-tone="err"] { --tone: var(--err); }
.toast-shell[data-tone="warn"] { --tone: var(--warn); }
.toast-dot {
  position: absolute; top: min(50%, 20px); width: 8px; height: 8px; margin-top: -4px;
  border-radius: 4px; background: var(--tone);
}
.toast-msg {
  position: absolute; left: 0; top: 0; box-sizing: border-box;
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: min(520px, calc(100vw - 32px)); min-height: 40px;
  padding: 10px 18px 10px 32px;
  font-size: 13px; line-height: 20px; letter-spacing: .02em; color: var(--text);
}
.toast-msg:has(.toast-act) { padding-top: 6px; padding-bottom: 6px; padding-right: 6px; }
.toast-act {
  flex: none; height: 28px; padding: 0 12px; border: 0; border-radius: 14px;
  background: color-mix(in srgb, var(--tone) 16%, transparent); color: var(--tone);
  font: inherit; font-size: 12.5px; letter-spacing: .06em; cursor: pointer;
}
.toast-act:hover { background: color-mix(in srgb, var(--tone) 24%, transparent); }

/* ── 动效引擎所需 ─────────────────────────────────────────────────────── */

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.odo { display: inline-flex; align-items: flex-start; vertical-align: baseline; line-height: 1.18; white-space: nowrap; }
.odo::before { content: '\200b'; }
.odo-digit {
  position: relative; display: inline-block; flex: none;
  width: 1ch; height: calc(1.18em + 0.4em); margin: -0.2em 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 0.2em, #000 calc(100% - 0.2em), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 0.2em, #000 calc(100% - 0.2em), transparent 100%);
}
.odo-strip { position: absolute; top: 0; left: -0.2em; right: -0.2em; white-space: pre; text-align: center; line-height: 1.6em; }
.odo-char { display: inline-block; flex: none; overflow: hidden; white-space: pre; }
.nav-badge.odo, .nav-badge .odo { line-height: 1; }

/* ── 工具类 ───────────────────────────────────────────────────────────── */

.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.mt-xs { margin-top: var(--sp-1) !important; }
.mt-s { margin-top: var(--sp-2); }
.mb-s { margin-bottom: var(--sp-3); }

.skel {
  display: inline-block; min-width: 60px; height: 1em; border-radius: 4px; vertical-align: middle;
  background: linear-gradient(90deg, var(--fill), var(--fill-2), var(--fill)); background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.skel.w-s { min-width: 36px; }
.spinner { display: inline-block; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--fill-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

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

/* ── 响应式 ───────────────────────────────────────────────────────────── */

@media (max-width: 1180px) {
  .kpis, .rack-matrix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workbench, .slot-grid, .acc-grid, .prof-grid, .settings { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  :root { --page-x: 16px; --pad: 16px; }
  .rack-matrix, .m-gpu-tiles { grid-template-columns: minmax(0, 1fr); }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sp-1); padding: var(--sp-2) var(--sp-2); }
  .brand { height: 44px; }
  .brand-sub, .rail-foot { display: none; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .topbar { position: static; flex-wrap: wrap; height: auto; padding: var(--sp-4) var(--page-x); }
  .view { padding-top: 0; }
  .sync { display: none; }
  .grid-2, .pick-grid, .rack-bays { grid-template-columns: minmax(0, 1fr); }
  .form-foot .btn { width: 100%; }
  .job-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .job-row .job-time { display: none; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-actions .btn.primary span { display: none; }
}
