/* =====================================================================================
   STARGATE · interface language — shared component styles
   Carbon (dark) is the workspace; Porcelain (.light) is the reading theme (使用指南).
   Grammar: hairlines and type carry hierarchy; colour only ever means state;
   the diagonal hatch always means "unknown" and is never drawn as free capacity.
   Motion is opt-in (.sb.motion on the root). Every comp renders its settled end state.
   Application adapters are in shell.css and workbench.css.
   Sections: 01 tokens · 02 reset · 03 base · 04 type · 05 shell (top bar, account,
   sync, notices) · 06 frame · 07 controls · 08 readouts · 09 gpu ·
   10 status · 11 timeline · 12 jobs & transfer · 13 surfaces · 14 command blocks ·
   15 terminal · 16 overlays · 17 loading/unknown/stale · 18 rows · 19 phone ·
   20 light theme · 21 responsive · 22 motion
   ===================================================================================== */

/* ── 01 tokens ─────────────────────────────────────────────────────────────────────── */
.sb{
  --sans:"Geist","Noto Sans SC","PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
  --display:"Archivo","Noto Sans SC","PingFang SC",sans-serif;
  --mono:"Geist Mono",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  /* Carbon surfaces and ink. ink-4 is for non-text marks or type ≥ 24px only (3.5:1). */
  --bg:#0A0B0D;--bg-1:#111215;--bg-2:#16171B;--bg-3:#1E2024;--bg-4:#26282D;
  --line:#212328;--line-2:#2D2F35;--line-3:#3B3E45;
  --ink:#F2F2EF;--ink-2:#A6A8AE;--ink-3:#878990;--ink-4:#66686F;
  /* state — the only colours in the product */
  --run:#3DD68C;--queue:#F2B13C;--prep:#5BB8F5;--err:#FF6161;
  --run-bg:rgba(61,214,140,.09);--queue-bg:rgba(242,177,60,.09);--prep-bg:rgba(91,184,245,.09);--err-bg:rgba(255,97,97,.08);
  --hatch:rgba(255,255,255,.17);
  --fill-mine:rgba(242,242,239,.16);--fill-other:rgba(242,242,239,.07);
  --primary:#F2F2EF;--primary-hover:#FFFFFF;--on-primary:#0A0B0D;--on-danger:#0A0B0D;

  --scrim:rgba(4,5,6,.62);
  --shadow:0 30px 80px rgba(0,0,0,.55),0 0 0 1px rgba(255,255,255,.04);
  --shadow-pop:0 12px 32px rgba(0,0,0,.5),0 0 0 1px rgba(255,255,255,.03);
  --seg-on:#2A2C31;
  --code-bg:rgba(242,242,239,.08);
  --ring:var(--ink); /* focus ring colour of the page theme (survives re-scoped inks) */
  /* page grid: the top bar, notices and .wrap share one left/right line */
  --gutter:48px;--content:1280px;
  --edge:max(var(--gutter),calc((100% - var(--content)) / 2));
  /* type scale — nine text sizes + four numeral sizes. Phone (.m) remaps five of them. */
  --fs-title:40px;    /* page title (CJK 500) */
  --fs-row:16px;      /* row titles (job, post, dataset), lead */
  --fs-body:14px;     /* body, buttons, inputs */
  --fs-meta:13px;     /* secondary lines, status words, tables, small buttons */
  --fs-small:12px;    /* labels, captions, legends — the smallest CJK size */
  --fs-micro:11px;    /* Geist Mono metadata only: ids, hashes, times, kbd */
  /* control heights */
  --h-md:40px;
  /* shell motion uses 160–550ms, ease-out and spring curves. */
  --t-quick:140ms;    /* hover, colour, small text swaps */
  /* measured value, symmetric */
  font-family:var(--sans);color:var(--ink);background:var(--bg);
  font-size:var(--fs-body);line-height:1.6;letter-spacing:.005em;
  -webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;
  font-feature-settings:"ss01" 1;
}
.sb.light{
  --bg:#F3F3F0;--bg-1:#FFFFFF;--bg-2:#ECECE8;--bg-3:#E3E3DE;--bg-4:#D8D8D2;
  --line:#DEDED8;--line-2:#CDCDC6;--line-3:#B9B9B2;
  --ink:#0B0C0E;--ink-2:#45474D;--ink-3:#63656C;--ink-4:#888984;
  --run:#0A7A46;--queue:#985800;--prep:#0A62B8;--err:#C01D2C;
  --run-bg:rgba(10,122,70,.07);--queue-bg:rgba(152,88,0,.07);--prep-bg:rgba(10,98,184,.07);--err-bg:rgba(192,29,44,.06);
  --hatch:rgba(11,12,14,.2);
  --fill-mine:rgba(11,12,14,.13);--fill-other:rgba(11,12,14,.06);
  --primary:#0B0C0E;--primary-hover:#2A2B30;--on-primary:#FFFFFF;--on-danger:#FFFFFF;
  --scrim:rgba(20,20,18,.32);
  --shadow:0 30px 80px rgba(20,20,18,.18),0 0 0 1px rgba(0,0,0,.05);
  --shadow-pop:0 12px 32px rgba(20,20,18,.14),0 0 0 1px rgba(0,0,0,.05);
  --seg-on:#FFFFFF;
  --code-bg:rgba(11,12,14,.07);
  --ring:var(--ink);
}

/* ── 02 reset — zero specificity, so every single-class component rule wins ─────────── */
:where(.sb) *,:where(.sb) *::before,:where(.sb) *::after{box-sizing:border-box}
:where(.sb) :where(h1,h2,h3,h4,h5,h6,p,ol,ul,dl,dd,figure,blockquote,pre){margin:0}
:where(.sb) :where(ol,ul){padding:0;list-style:none}
:where(.sb) a{color:inherit;text-decoration:none}
:where(.sb) :where(button,input,select,textarea){font:inherit;color:inherit;letter-spacing:inherit}
:where(.sb) button{cursor:pointer;background:none;border:0;padding:0}
:where(.sb) :where(button,[role="button"]):disabled{cursor:not-allowed}
:where(.sb) svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* ── 03 base helpers ───────────────────────────────────────────────────────────────── */
:where(.sb) code,.mono{font-family:var(--mono);font-size:.92em;letter-spacing:0}
.muted{color:var(--ink-2)}
.hatch{background-image:repeating-linear-gradient(135deg,var(--hatch) 0 1px,transparent 1px 6px)}
.root{min-height:100vh;position:relative}
.sb ::selection{background:rgba(242,242,239,.24)}
.sb.light ::selection{background:rgba(11,12,14,.16)}
.sb :focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.sb .input:focus,.sb .input:focus-visible{outline:none;border-color:var(--ink-2)}
.sb [tabindex="-1"]:focus{outline:none}
/* skip link: the first Tab stop on every page */

/* utilities — use these instead of var() inside inline style attributes (the canvas may drop them) */
.ink-3{color:var(--ink-3)}
.ghost{color:var(--ink-4)}
.disp{font-family:var(--display);font-stretch:112%;font-weight:300}
.br{border-right:1px solid var(--line)}
.legend .slot.mine{background:var(--ink)}.legend .slot.used{background:var(--ink-3)}

/* ── 04 type — named scale (.fs-*) plus the legacy helpers mapped onto it ───────────── */
.label{font-size:var(--fs-small);color:var(--ink-3);letter-spacing:.04em;line-height:1.45}
.h1{font-size:var(--fs-title);font-weight:500;line-height:1.15;letter-spacing:-.01em;margin-top:18px}
/* no one-character last lines; short UI copy breaks at punctuation, never mid-word
   (long prose keeps normal CJK breaking so lines stay full) */
:where(.sb) p{text-wrap:pretty}
.notice,.job-desc{word-break:keep-all;overflow-wrap:anywhere;text-wrap:pretty}
