/* =============================================================
   TK Studio · UI System v3
   暖纸面产品感 (Figma/Arc-inspired) · 4 变体 · 深色支持
   ============================================================= */

/* -------- BASE TOKENS -------- */
:root {
  /* defaults overwritten by [data-variant] / [data-theme] */
  --paper:        #FAF6EE;
  --paper-2:      #F2EDE2;
  --surface:      #FFFFFF;
  --surface-2:    #FBF8F2;
  --sunk:         #F2EDE2;

  --ink:          #2A2520;
  --ink-2:        #514941;
  --ink-3:        #7A6F62;
  --ink-4:        #A89D8E;
  --ink-5:        #D4CBBC;

  --line:         #ECE5D4;
  --line-2:       #F2EDE2;
  --line-strong:  #D8CFBE;

  --accent:       #DC5A3A;   /* 主强调 · 行动 / hot */
  --accent-2:     #C24A2D;
  --accent-bg:    #FBE1D8;
  --accent-ink:   #8E2E16;

  --live:         #2563EB;
  --live-bg:      #E0EAFE;
  --live-ink:     #1E40AF;

  --ok:           #157A4C;
  --ok-bg:        #D7EFE0;
  --ok-ink:       #0B5234;

  --warn:         #B47215;
  --warn-bg:      #F5E6C4;
  --warn-ink:     #7A4D08;

  --halt:         #B23F35;
  --halt-bg:      #F5DAD5;
  --halt-ink:     #7C2419;

  /* tokens · radii / spacing / shadows */
  --r-xs: 5px;
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  --s-0: 2px;  --s-1: 4px;  --s-2: 8px;  --s-3: 12px;
  --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px;
  --s-8: 40px; --s-9: 56px;

  --sh-1: 0 1px 1px rgba(60,40,20,0.04), 0 1px 2px rgba(60,40,20,0.04);
  --sh-2: 0 2px 4px rgba(60,40,20,0.05), 0 6px 16px rgba(60,40,20,0.07);
  --sh-3: 0 8px 24px rgba(60,40,20,0.10), 0 20px 60px rgba(60,40,20,0.12);
  --sh-inset: inset 0 0.5px 0 rgba(255,255,255,0.6);

  /* fonts · 默认 Apple 原生(与 app 默认一致 · 防字体闪)*/
  --font-ui:      -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: "New York", "Big Caslon", "Iowan Old Style", Georgia, "Source Han Serif SC", serif;
  --font-mono:    "SF Mono", ui-monospace, Menlo, "JetBrains Mono", Consolas, monospace;

  --t-fast: 120ms cubic-bezier(.4,0,.2,1);
  --t:      220ms cubic-bezier(.32,.72,0,1);
  --t-slow: 360ms cubic-bezier(.32,.72,0,1);
}

/* ============== VARIANT · WARM (default) — Figma/Arc cream + coral ============== */
html[data-variant="warm"] {
  --paper:#FAF6EE; --paper-2:#F2EDE2; --surface:#FFFFFF; --surface-2:#FBF8F2; --sunk:#F2EDE2;
  --ink:#2A2520; --ink-2:#514941; --ink-3:#7A6F62; --ink-4:#A89D8E; --ink-5:#D4CBBC;
  --line:#ECE5D4; --line-2:#F4EFE4; --line-strong:#D8CFBE;
  --accent:#DC5A3A; --accent-2:#C24A2D; --accent-bg:#FBE1D8; --accent-ink:#8E2E16;
}
html[data-variant="warm"][data-theme="dark"] {
  --paper:#1A1714; --paper-2:#221E18; --surface:#26221C; --surface-2:#2A251E; --sunk:#1F1B16;
  --ink:#F0EAE0; --ink-2:#CDC3B6; --ink-3:#8E8579; --ink-4:#5E5749; --ink-5:#3D372E;
  --line:#332D24; --line-2:#2A2520; --line-strong:#4A4234;
  --accent:#F0734D; --accent-2:#DC5A3A; --accent-bg:#3A1D11; --accent-ink:#F5B8A2;
  --live:#5B8EFB; --live-bg:#15234D; --live-ink:#A8BFFB;
  --ok:#4AAB7B; --ok-bg:#0F2F1F; --ok-ink:#A2D6B9;
  --warn:#D9A04C; --warn-bg:#332313; --warn-ink:#F3D69E;
  --halt:#D6695E; --halt-bg:#3A1B16; --halt-ink:#F0B5AD;
  --sh-1: 0 1px 1px rgba(0,0,0,0.5); --sh-2: 0 4px 16px rgba(0,0,0,0.4); --sh-3: 0 12px 40px rgba(0,0,0,0.6);
}

/* ============== VARIANT · COOL — Linear-style gray + electric ============== */
html[data-variant="cool"] {
  --paper:#FAFBFC; --paper-2:#F1F3F6; --surface:#FFFFFF; --surface-2:#F7F8FA; --sunk:#EFF1F4;
  --ink:#16181D; --ink-2:#3D424B; --ink-3:#6B7280; --ink-4:#9CA3AF; --ink-5:#D1D5DB;
  --line:#E4E6EB; --line-2:#EDEFF3; --line-strong:#CED2D9;
  --accent:#5E5CE6; --accent-2:#4744C7; --accent-bg:#E8E8FB; --accent-ink:#3D3BA6;
  --live:#0EA5E9; --live-bg:#DEF1FB; --live-ink:#0369A1;
  --ok:#10B981; --ok-bg:#D5F2E5; --ok-ink:#065F46;
  --warn:#F59E0B; --warn-bg:#FCEFD0; --warn-ink:#92400E;
  --halt:#EF4444; --halt-bg:#FDDDDD; --halt-ink:#991B1B;
}
html[data-variant="cool"][data-theme="dark"] {
  --paper:#0D0F13; --paper-2:#141821; --surface:#181C26; --surface-2:#1D2230; --sunk:#10131A;
  --ink:#EDF0F6; --ink-2:#C8CDD8; --ink-3:#8A93A4; --ink-4:#5B6473; --ink-5:#39414E;
  --line:#252B38; --line-2:#1D2230; --line-strong:#384256;
  --accent:#7C7AFF; --accent-2:#5E5CE6; --accent-bg:#1E1E5A; --accent-ink:#B9B8FF;
  --live:#38BDF8; --live-bg:#0C2E47; --live-ink:#B5E2FB;
  --ok:#34D399; --ok-bg:#0A2E22; --ok-ink:#A5E8CE;
  --warn:#FBBF24; --warn-bg:#3A2A0E; --warn-ink:#F7D88A;
  --halt:#F87171; --halt-bg:#3A1818; --halt-ink:#F5B3B3;
  --sh-1: 0 1px 1px rgba(0,0,0,0.5); --sh-2: 0 4px 16px rgba(0,0,0,0.4); --sh-3: 0 12px 40px rgba(0,0,0,0.6);
}

/* ============== VARIANT · CREAM — Notion cozy, chocolate brown + forest ============== */
html[data-variant="cream"] {
  --paper:#F8F1E1; --paper-2:#EFE6D0; --surface:#FBF6E8; --surface-2:#F4EBD3; --sunk:#EBE0C5;
  --ink:#3D2D18; --ink-2:#5C462C; --ink-3:#8A7252; --ink-4:#B3A082; --ink-5:#DBCDB1;
  --line:#E2D5B4; --line-2:#ECDFC0; --line-strong:#C9B98F;
  --accent:#A6481E; --accent-2:#7E3413; --accent-bg:#F3DACA; --accent-ink:#6B2B0F;
  --live:#1F6FB5; --live-bg:#D6E4F2; --live-ink:#114672;
  --ok:#2D6E4E; --ok-bg:#D5E6D8; --ok-ink:#1B4831;
  --warn:#996300; --warn-bg:#F3DFAE; --warn-ink:#664000;
  --halt:#A33B2A; --halt-bg:#F0CFC6; --halt-ink:#6E1F12;
}
html[data-variant="cream"][data-theme="dark"] {
  --paper:#1E1812; --paper-2:#26201A; --surface:#2D2620; --sunk:#221C16;
  --ink:#F4EAD3; --ink-2:#D3C5A6; --ink-3:#9D8E74; --ink-4:#665C49; --ink-5:#403828;
  --line:#352D22; --line-2:#2A241D; --line-strong:#4D4334;
  --accent:#DC8553; --accent-2:#A6481E; --accent-bg:#3D1E10; --accent-ink:#F0BC97;
  --live:#5B95D5; --live-bg:#15273E; --live-ink:#A8C4E5;
  --ok:#5BAD7E; --ok-bg:#11301F; --ok-ink:#A5D5B8;
  --warn:#D9A04C; --warn-bg:#332313; --warn-ink:#F3D69E;
  --halt:#D6695E; --halt-bg:#3A1B16; --halt-ink:#F0B5AD;
  --sh-1: 0 1px 1px rgba(0,0,0,0.5); --sh-2: 0 4px 16px rgba(0,0,0,0.4); --sh-3: 0 12px 40px rgba(0,0,0,0.6);
}

/* ============== VARIANT · EDGE — high contrast + acid lime ============== */
html[data-variant="edge"] {
  --paper:#F5F5F4; --paper-2:#E7E5E1; --surface:#FFFFFF; --surface-2:#FAFAF9; --sunk:#EDECE8;
  --ink:#0A0907; --ink-2:#2E2A26; --ink-3:#6B665F; --ink-4:#999388; --ink-5:#C9C3B7;
  --line:#DEDBD4; --line-2:#E8E5DE; --line-strong:#BAB6AD;
  --accent:#C1FF52; --accent-2:#A3E033; --accent-bg:#E8FFB8; --accent-ink:#3A6B0C;
  --live:#0066FF; --live-bg:#D8E3FF; --live-ink:#0044AA;
  --ok:#00875A; --ok-bg:#CCEFE2; --ok-ink:#005C3D;
  --warn:#D97706; --warn-bg:#FDE8C8; --warn-ink:#7C4203;
  --halt:#DC2626; --halt-bg:#FBD5D5; --halt-ink:#7C1818;
  --r-xs: 4px; --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px;
}
html[data-variant="edge"][data-theme="dark"] {
  --paper:#0A0907; --paper-2:#161410; --surface:#1A1814; --sunk:#0F0E0B;
  --ink:#F2EFE8; --ink-2:#CFC8B9; --ink-3:#928A7B; --ink-4:#5D564B; --ink-5:#3A352D;
  --line:#2E2A22; --line-2:#22201A; --line-strong:#48422F;
  --accent:#D8FF6E; --accent-2:#C1FF52; --accent-bg:#2D3D10; --accent-ink:#E8FFB8;
  --live:#4D8FFF; --live-bg:#0F1F4A; --live-ink:#A6C2FF;
  --ok:#40C588; --ok-bg:#0A2E21; --ok-ink:#A8E0C6;
  --warn:#FBBF24; --warn-bg:#3A2A0E; --warn-ink:#F7D88A;
  --halt:#F87171; --halt-bg:#3A1B16; --halt-ink:#F5B3B3;
  --sh-1: 0 1px 1px rgba(0,0,0,0.6); --sh-2: 0 4px 16px rgba(0,0,0,0.5); --sh-3: 0 12px 40px rgba(0,0,0,0.7);
}

/* -------- Density modes -------- */
html[data-density="compact"] {
  --s-3: 8px; --s-4: 12px; --s-5: 14px; --s-6: 18px; --s-7: 22px;
  --cell-pad-y: 6px; --cell-pad-x: 10px;
  --row-h: 32px;
}
html[data-density="compact"] .page { padding: 14px 20px 60px; }
html[data-density="compact"] .stat-grid { gap: 8px; }
html[data-density="compact"] .stat-c { padding: 12px 14px; }
html[data-density="compact"] .stat-c .v { font-size: 22px; }
html[data-density="compact"] .card-h { padding: 10px 14px; }
html[data-density="compact"] .card-b { padding: 12px 14px; }
html[data-density="compact"] .topbar { padding: 8px 20px; }
html[data-density="compact"] .hero { padding: 14px 18px; }
html[data-density="compact"] .hero .greeting { font-size: 22px; }
html[data-density="compact"] .hero-row { gap: 10px; margin-bottom: 14px; }
html[data-density="compact"] .hero-actions { margin-top: 8px; gap: 6px; }
html[data-density="compact"] .hero-actions .btn { padding: 5px 10px; font-size: 12px; }
html[data-density="regular"] {
  --cell-pad-y: 9px; --cell-pad-x: 14px;
  --row-h: 40px;
}
html[data-density="cozy"] {
  --s-3: 14px; --s-4: 20px; --s-5: 24px; --s-6: 32px;
  --cell-pad-y: 14px; --cell-pad-x: 18px;
  --row-h: 52px;
}

/* -------- Radius scale slot -------- */
html[data-radius="sharp"]   { --r-xs: 3px; --r-sm: 4px; --r: 6px;  --r-lg: 8px;  --r-xl: 12px; }
html[data-radius="soft"]    { --r-xs: 5px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 22px; }
html[data-radius="pillowy"] { --r-xs: 8px; --r-sm: 12px;--r: 18px; --r-lg: 24px; --r-xl: 32px; }

/* =========================================================
   BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  overflow: hidden;
  transition: background var(--t-slow), color var(--t-slow);
}
::selection { background: var(--accent); color: var(--surface); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.serif { font-family: var(--font-display); }

/* =========================================================
   APP SHELL
   ========================================================= */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  background: var(--paper);
}

@media (max-width: 1280px) {
  .app { grid-template-columns: 220px 1fr; }
}

/* ---------- Sidebar ---------- */
.sidebar {
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  padding: 14px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  transition: background var(--t-slow), border-color var(--t-slow);
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--ink-5); border-radius: 2px; }

.sb-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 10px;
}
.sb-brand .logo {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-style: italic;
  font-size: 18px; font-weight: 400;
}
.sb-brand .name {
  font-weight: 600; font-size: 14px;
  letter-spacing: -0.01em; line-height: 1.1;
}
.sb-brand .name small {
  display: block;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); font-weight: 400;
  margin-top: 2px; letter-spacing: 0.04em;
}
.sb-brand .switch {
  margin-left: auto;
  width: 22px; height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xs);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  cursor: pointer;
}
.sb-brand .switch:hover { color: var(--ink); }

.sb-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink-3);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.sb-search:hover { border-color: var(--line-strong); background: var(--surface-2); }
.sb-search .grow { flex: 1; }
.sb-search .kbd {
  font-family: var(--font-mono); font-size: 10px;
  background: var(--paper-2);
  padding: 1px 5px; border-radius: 3px;
  border: 1px solid var(--line);
  color: var(--ink-3);
}

.sb-group { display: flex; flex-direction: column; gap: 1px; }
.sb-group-h {
  font-family: var(--font-mono); font-size: 9.5px;
  color: var(--ink-4);
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 8px 10px 4px;
}
.sb-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  position: relative;
  transition: background var(--t-fast), color var(--t-fast);
}
.sb-item:hover { background: var(--surface); color: var(--ink); }
.sb-item.cur {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-1);
}
.sb-item .ic { width: 16px; height: 16px; color: var(--ink-3); flex-shrink: 0; }
.sb-item.cur .ic { color: var(--accent); }
.sb-item .badge {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 10px;
  font-weight: 500;
  background: var(--paper-2); color: var(--ink-3);
  padding: 1px 6px; border-radius: var(--r-pill);
  letter-spacing: 0;
}
.sb-item.cur .badge { background: var(--accent-bg); color: var(--accent-ink); }
.sb-item .badge.live {
  background: var(--live-bg); color: var(--live-ink);
  display: flex; align-items: center; gap: 4px;
}
.sb-item .badge.live::before {
  content: ""; width: 5px; height: 5px;
  background: var(--live); border-radius: 50%;
  animation: pulse 1.4s ease-in-out infinite;
}
.sb-item .nx {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--ink-4);
  border: 1px solid var(--line);
  padding: 0 4px; border-radius: 3px;
  min-width: 14px; text-align: center;
}
.sb-item.cur .nx { color: var(--accent); border-color: var(--accent); }

.sb-foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 8px;
}
.sb-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 11px;
  flex-shrink: 0;
}
.sb-foot .who { font-size: 12px; font-weight: 500; line-height: 1.2; }
.sb-foot .who small { display: block; color: var(--ink-3); font-size: 10px; margin-top: 2px; }
.sb-foot .btn-ico {
  margin-left: auto;
  width: 24px; height: 24px;
  background: transparent;
  border: none;
  border-radius: var(--r-xs);
  color: var(--ink-3);
  cursor: pointer;
}
.sb-foot .btn-ico:hover { background: var(--surface); color: var(--ink); }

/* =========================================================
   MAIN AREA
   ========================================================= */
.main {
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  flex-shrink: 0;
  transition: background var(--t-slow), border-color var(--t-slow);
}
.crumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.crumb .sep { color: var(--ink-4); }
.crumb b { font-weight: 500; color: var(--ink); }

.tb-title {
  display: flex; flex-direction: column;
  margin-right: auto;
  margin-left: 6px;
}
.tb-title h1 {
  font-size: 18px; font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0; line-height: 1.2;
}
.tb-title small {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3); margin-top: 2px;
  letter-spacing: 0.04em;
}

.tb-actions { display: flex; align-items: center; gap: 8px; }

/* page area scroll */
.page {
  flex: 1; overflow-y: auto;
  background: var(--paper);
  padding: 24px 32px 80px;
  transition: background var(--t-slow);
}
.page::-webkit-scrollbar { width: 8px; }
.page::-webkit-scrollbar-thumb { background: var(--ink-5); border-radius: 4px; }

/* page sections */
.section + .section { margin-top: 28px; }
.section-h {
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 14px;
}
.section-h h2 {
  font-size: 14px; font-weight: 600; margin: 0;
  letter-spacing: -0.005em;
}
.section-h .sub {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-3); letter-spacing: 0.04em;
}
.section-h .actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* mainline track (showing on prompts/products/benchmarks/studio) */
.mainline {
  display: flex; align-items: center; gap: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px 14px;
  margin-bottom: 24px;
  box-shadow: var(--sh-1);
}
.ml-stop {
  flex: 1; display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.ml-node {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  background: var(--paper-2); color: var(--ink-4);
  flex-shrink: 0;
  border: 1.5px solid transparent;
}
.ml-stop.done .ml-node { background: var(--ok-bg); color: var(--ok-ink); }
.ml-stop.cur .ml-node  { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.ml-body { line-height: 1.15; min-width: 0; }
.ml-name { font-size: 12px; font-weight: 600; }
.ml-sub  { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); margin-top: 1px; letter-spacing: 0.02em; }
.ml-stop.cur .ml-name { color: var(--accent); }
.ml-rail {
  flex: 1; height: 1px;
  background: linear-gradient(to right, var(--ink-5) 50%, transparent 50%);
  background-size: 5px 1px;
}
.ml-stop.done + .ml-stop .ml-rail,
.ml-stop.done .ml-rail { background: var(--ok); background-image: none; }

/* =========================================================
   PRIMITIVES
   ========================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  cursor: pointer; line-height: 1;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(0.5px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn .kbd {
  font-family: var(--font-mono); font-size: 10px;
  padding: 1px 5px; border-radius: 3px;
  background: rgba(255,255,255,0.15);
  margin-left: 4px;
  opacity: 0.85;
}
.btn-primary {
  background: var(--ink); color: var(--paper);
}
.btn-primary:hover { background: var(--ink-2); }
.btn-accent {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 0 rgba(0,0,0,0.05);
}
html[data-variant="edge"] .btn-accent { color: var(--ink); }
.btn-accent:hover { background: var(--accent-2); }
.btn-ghost {
  background: var(--surface); color: var(--ink-2);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--ink-4); }
.btn-quiet {
  background: transparent; color: var(--ink-3);
}
.btn-quiet:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger {
  background: var(--surface); color: var(--halt-ink);
  border-color: var(--halt-bg);
}
.btn-danger:hover { background: var(--halt-bg); border-color: var(--halt); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 16px; font-size: 14px; }
.btn-ico { padding: 6px; width: 28px; height: 28px; justify-content: center; }

.icon { width: 14px; height: 14px; flex-shrink: 0; }
.icon-lg { width: 18px; height: 18px; }
.icon-sm { width: 12px; height: 12px; }

/* form */
.input, .select-x {
  font: inherit; font-size: 13px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none;
}
.input:focus, .select-x:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.input::placeholder { color: var(--ink-4); }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: var(--r-sm);
  min-width: 240px;
}
.search-box .ic { color: var(--ink-4); }
.search-box input {
  border: none; background: transparent; outline: none;
  font: inherit; font-size: 13px; flex: 1; color: var(--ink);
}
.search-box input::placeholder { color: var(--ink-4); }

.seg {
  display: inline-flex;
  background: var(--paper-2);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 1px;
}
.seg button {
  font: inherit; font-size: 12px; font-weight: 500;
  padding: 5px 12px;
  border: none; background: transparent;
  color: var(--ink-3); border-radius: 6px;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.seg button:hover { color: var(--ink); }
.seg button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-1);
}

/* pill */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  letter-spacing: 0.04em;
  line-height: 1.4;
  white-space: nowrap;
}
.pill::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: currentColor; opacity: 0.85;
}
.pill-idle  { background: var(--paper-2); color: var(--ink-3); }
.pill-queue { background: var(--warn-bg); color: var(--warn-ink); }
.pill-live  { background: var(--live-bg); color: var(--live-ink); }
.pill-live::before { animation: pulse 1.4s ease-in-out infinite; }
.pill-ok    { background: var(--ok-bg);   color: var(--ok-ink); }
.pill-err   { background: var(--halt-bg); color: var(--halt-ink); }
.pill-hot   { background: var(--accent-bg); color: var(--accent-ink); }
@keyframes pulse {
  0%, 100% { opacity: 0.85; box-shadow: 0 0 0 0 currentColor; }
  50%      { opacity: 0.35; box-shadow: 0 0 0 4px transparent; }
}

/* tag (pattern + audience + custom) */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500;
  padding: 2px 7px;
  border-radius: var(--r-xs);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  line-height: 1.4;
  white-space: nowrap;
}
.tag .dot { width: 6px; height: 6px; border-radius: 1.5px; background: var(--ink-4); }
.tag-pat-jy .dot { background: #C2185B; }
.tag-pat-bx .dot { background: #2962FF; }
.tag-pat-asmr .dot { background: #1F8A5B; }
.tag-pat-jq .dot { background: #B7791F; }
.tag-pat-tz .dot { background: #6E3FAB; }

.tag-aud {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  background: var(--paper-2);
  border-color: transparent;
}
.tag-aud .dot { display: none; }

/* card */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--sh-1);
  transition: background var(--t-slow), border-color var(--t-slow);
}
.card-h {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.card-h h3 {
  font-size: 13.5px; font-weight: 600; margin: 0;
  letter-spacing: -0.005em;
}
.card-h .meta {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.card-h .grow { flex: 1; }
.card-b { padding: 16px; }

/* stat card */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat-c {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px 18px;
  box-shadow: var(--sh-1);
  display: flex; flex-direction: column; gap: 6px;
  transition: all var(--t);
}
.stat-c:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.stat-c .label {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex; justify-content: space-between; align-items: center;
}
.stat-c .label .ic-bg {
  width: 24px; height: 24px;
  border-radius: var(--r-xs);
  background: var(--paper-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
}
.stat-c .v {
  font-size: 28px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
  margin-top: 2px;
}
.stat-c .v .u { font-size: 13px; color: var(--ink-3); margin-left: 3px; font-weight: 400; }
.stat-c .v.serif {
  font-family: var(--font-display); font-style: italic;
  font-size: 44px; font-weight: 400;
  letter-spacing: -0.02em;
}
.stat-c .delta {
  font-size: 11px; font-family: var(--font-mono);
  display: flex; align-items: center; gap: 4px;
}
.stat-c .delta.up { color: var(--ok); }
.stat-c .delta.dn { color: var(--halt); }
.stat-c .foot {
  font-size: 11px; color: var(--ink-3);
}

/* spark */
.spark { display: flex; align-items: end; gap: 2px; height: 28px; margin-top: 4px; }
.spark i {
  flex: 1;
  background: var(--accent);
  border-radius: 1px;
  min-height: 2px;
  opacity: 0.85;
}
.spark.live i { background: var(--live); }
.spark.ok i { background: var(--ok); }
.spark i:last-child { background: var(--ink); opacity: 1; }

/* table */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  font-family: var(--font-mono); font-size: 10px;
  font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: left;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky; top: 0;
}
.tbl tbody td {
  padding: var(--cell-pad-y, 10px) var(--cell-pad-x, 14px);
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.sel { background: var(--accent-bg); }
.tbl .num-cell { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tbl .num-cell.big { font-size: 14.5px; font-weight: 500; }

/* mini bar */
.minibar { display: inline-block; height: 4px; width: 90px; background: var(--line); border-radius: 2px; vertical-align: middle; overflow: hidden; }
.minibar i { display: block; height: 100%; background: var(--ink); border-radius: 2px; }
.minibar.hot i { background: var(--accent); }
.minibar.live i { background: var(--live); }
.minibar.ok i { background: var(--ok); }

/* shot dots (job progress thumbs) */
.shots { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.shot {
  width: 42px;
  aspect-ratio: 9 / 16;
  border-radius: var(--r-xs);
  background: var(--paper-2);
  border: 1.5px solid var(--line);
  position: relative;
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  cursor: pointer;
}
.shot:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.shot .shot-n {
  position: absolute; top: 3px; left: 3px;
  font-family: var(--font-mono); font-size: 9px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  z-index: 3;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.shot.pending {
  background:
    repeating-linear-gradient(135deg, var(--paper-2) 0 4px, var(--surface-2) 4px 5px);
}
.shot.pending .shot-n {
  background: var(--paper-2); color: var(--ink-4);
}
.shot.ok    { border-color: var(--ok); }
.shot.live  { border-color: var(--live); }
.shot.err   { border-color: var(--halt); }
.shot.live::after {
  content: ""; position: absolute; inset: -3px;
  border: 1.5px solid var(--live); border-radius: calc(var(--r-xs) + 2px);
  animation: pulse 1.4s ease-in-out infinite;
}
.shot .shot-thumb {
  position: absolute; inset: 0;
  z-index: 1;
}
.shot .shot-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; z-index: 2;
}
.shot.ok .shot-bar { background: var(--ok); }
.shot.live .shot-bar { background: var(--live); }
.shot.err .shot-bar { background: var(--halt); }
.shot.err .shot-x {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  color: var(--halt);
  background: rgba(255,255,255,0.7);
}
html[data-theme="dark"] .shot.err .shot-x { background: rgba(0,0,0,0.5); color: #fff; }
/* hide thumb's center initial inside small shot tiles — the shot number is shown via .shot-n */
.shot .thumb-init { display: none; }

/* stepper */
.stepper {
  display: flex; gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
}
.step {
  flex: 1; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px;
  border-right: 1px solid var(--line-2);
  position: relative;
  transition: background var(--t);
}
.step:last-child { border-right: none; }
.step .idx {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--ink-3);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step .info { line-height: 1.2; min-width: 0; }
.step .info .t { font-size: 12.5px; font-weight: 600; }
.step .info .s { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); margin-top: 1px; }
.step.done { background: var(--ok-bg); }
.step.done .idx { background: var(--ok); color: #fff; }
.step.done .info .t { color: var(--ok-ink); }
.step.done .info .s { color: var(--ok-ink); opacity: 0.7; }
.step.cur { background: var(--ink); }
.step.cur .idx { background: var(--paper); color: var(--ink); }
.step.cur .info .t { color: var(--paper); }
.step.cur .info .s { color: var(--paper); opacity: 0.5; }
.step.err { background: var(--halt-bg); }
.step.err .idx { background: var(--halt); color: #fff; }
.step.err .info .t { color: var(--halt-ink); }

/* video thumb */
.vthumb {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: all var(--t-fast);
  cursor: pointer;
}
.vthumb:hover { box-shadow: var(--sh-2); transform: translateY(-1px); border-color: var(--line-strong); }
.vthumb.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.vthumb .body { padding: 10px 12px 12px; }
.vthumb .nm {
  font-size: 12px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}
.vthumb .meta {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-4);
  display: flex; justify-content: space-between;
  margin-bottom: 6px;
}
.vthumb .tagrow {
  display: flex; gap: 3px; flex-wrap: wrap;
  min-height: 19px;
}
.vthumb .tagrow .tag { font-size: 10px; padding: 1px 5px; }

/* =========================================================
   THUMB · 哈希着色的占位缩略图
   ========================================================= */
.thumb {
  position: relative;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--c1, #888);
  isolation: isolate;
  user-select: none;
}
.thumb-bg {
  position: absolute; inset: 0;
  background: linear-gradient(var(--angle, 135deg), var(--c1, #FF6B6B), var(--c2, #4ECDC4));
  z-index: 0;
}
.thumb-bg::after {
  /* film grain overlay */
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,0.06) 1px, transparent 1px);
  background-size: 6px 6px, 11px 11px;
  background-position: 0 0, 3px 3px;
  mix-blend-mode: overlay;
  opacity: 0.6;
}

/* layered shape decorations (variants by data-shape) */
.thumb-shape { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.thumb-shape[data-shape="0"]::before {
  content: ""; position: absolute;
  width: 65%; aspect-ratio: 1;
  background: var(--c3, rgba(255,255,255,0.25));
  border-radius: 50%;
  left: 18%; top: 18%;
  mix-blend-mode: soft-light;
  opacity: 0.95;
}
.thumb-shape[data-shape="0"]::after {
  content: ""; position: absolute;
  width: 30%; aspect-ratio: 1;
  background: rgba(255,255,255,0.16);
  border-radius: 50%;
  right: 12%; bottom: 12%;
}
.thumb-shape[data-shape="1"]::before {
  content: ""; position: absolute;
  width: 110%; aspect-ratio: 1;
  border: 18% solid var(--c3, rgba(255,255,255,0.25));
  border-radius: 50%;
  left: -25%; top: -25%;
  box-sizing: border-box;
  mix-blend-mode: soft-light;
}
.thumb-shape[data-shape="2"] {
  background-image: repeating-linear-gradient(
    45deg,
    transparent 0 14%,
    var(--c3, rgba(255,255,255,0.18)) 14% 16%
  );
  mix-blend-mode: soft-light;
}
.thumb-shape[data-shape="3"]::before {
  content: ""; position: absolute;
  width: 70%; aspect-ratio: 1;
  background: var(--c3, rgba(255,255,255,0.22));
  border-radius: 50%;
  left: 5%; bottom: -35%;
  mix-blend-mode: soft-light;
}
.thumb-shape[data-shape="3"]::after {
  content: ""; position: absolute;
  width: 50%; aspect-ratio: 1;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
  right: -10%; top: -15%;
}
.thumb-shape[data-shape="4"]::before {
  content: ""; position: absolute;
  width: 55%; aspect-ratio: 1;
  background: var(--c3, rgba(255,255,255,0.28));
  border-radius: 30% 70% 70% 30% / 60% 40% 60% 40%;
  left: 22%; top: 25%;
  mix-blend-mode: soft-light;
  transform: rotate(var(--angle, 0deg));
}
.thumb-shape[data-shape="5"] {
  background:
    linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.25) 100%),
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35) 0%, transparent 40%);
}
.thumb-shape[data-shape="6"]::before {
  content: ""; position: absolute; inset: 15%;
  background: var(--c3, rgba(255,255,255,0.20));
  border-radius: 50%;
  filter: blur(28px);
}
.thumb-shape[data-shape="6"]::after {
  content: ""; position: absolute;
  width: 40%; aspect-ratio: 1; left: 30%; top: 30%;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50%;
}

/* big initials letter */
.thumb-init {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-ui);
  color: rgba(255,255,255,0.95);
  font-weight: 700;
  letter-spacing: -0.04em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.1);
  z-index: 2;
  mix-blend-mode: screen;
  opacity: 0.92;
}

/* badges + meta */
.thumb-dur, .thumb-badge, .thumb-frame {
  position: absolute;
  font-family: var(--font-mono); font-size: 10px;
  z-index: 3;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.thumb-dur {
  bottom: 6px; right: 6px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  padding: 2px 6px;
  border-radius: var(--r-xs);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.thumb-frame {
  top: 6px; left: 6px;
  background: rgba(0,0,0,0.5);
  color: rgba(255,255,255,0.95);
  padding: 1px 6px;
  border-radius: var(--r-xs);
}
.thumb-badge {
  top: 6px; right: 6px;
  background: var(--accent);
  color: #fff;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  font-size: 9.5px;
  letter-spacing: 0.06em;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
html[data-variant="edge"] .thumb-badge { color: var(--ink); }

.thumb-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.thumb-play .pc {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  padding-left: 3px;
}
.vthumb:hover .thumb-play,
.thumb:hover .thumb-play { opacity: 1; }

/* size variants */
.thumb-xs { font-size: 16px; }
.thumb-xs .thumb-init { font-size: 18px; }
.thumb-sm .thumb-init { font-size: 24px; }
.thumb-md .thumb-init { font-size: 36px; }
.thumb-lg .thumb-init { font-size: 56px; }

/* category strip at bottom (for product) */
.thumb-strip {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 6px 8px;
  z-index: 3;
  font-family: var(--font-mono); font-size: 9.5px;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.4) 100%);
  display: flex; justify-content: space-between; align-items: end;
}

/* modal */
.modal-back {
  position: absolute; inset: 0;
  background: rgba(20,15,10,0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn var(--t);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  width: min(600px, 92%);
  max-height: 80vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: slideUp var(--t);
}
@keyframes slideUp { from { transform: translateY(12px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-h {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px;
}
.modal-h h3 { font-size: 15px; font-weight: 600; margin: 0; }
.modal-h .close {
  margin-left: auto;
  background: transparent; border: none;
  width: 26px; height: 26px;
  border-radius: var(--r-xs);
  color: var(--ink-3); font-size: 18px; line-height: 1;
  cursor: pointer;
}
.modal-h .close:hover { background: var(--paper-2); color: var(--ink); }
.modal-b { padding: 20px; overflow-y: auto; flex: 1; }
.modal-f {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end;
  background: var(--surface-2);
}

/* command palette */
.cmdk {
  width: min(540px, 92%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 70vh;
}
.cmdk-input {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.cmdk-input input {
  border: none; background: transparent; outline: none;
  font: inherit; font-size: 15px; color: var(--ink); flex: 1;
}
.cmdk-input input::placeholder { color: var(--ink-4); }
.cmdk-input .esc {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3);
  background: var(--paper-2);
  padding: 2px 6px; border-radius: var(--r-xs);
}
.cmdk-body { overflow-y: auto; padding: 6px; }
.cmdk-group {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-4); letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 12px 4px;
}
.cmdk-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--r-sm);
}
.cmdk-row:hover, .cmdk-row.on { background: var(--paper-2); }
.cmdk-row.on { background: var(--accent-bg); }
.cmdk-row.on b { color: var(--accent-ink); }
.cmdk-row .ico { width: 18px; height: 18px; color: var(--ink-3); flex-shrink: 0; }
.cmdk-row .grow { flex: 1; min-width: 0; }
.cmdk-row .meta { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); }
.cmdk-row .kbd {
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-3);
  background: var(--paper-2); padding: 1px 5px; border-radius: 3px;
}

/* benchmark detail layout */
.bench-row {
  display: grid; grid-template-columns: 56px 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
  align-items: center;
  transition: background var(--t-fast);
  position: relative;
}
.bench-row .bthumb {
  width: 56px;
  aspect-ratio: 9/16;
}
.bench-row:hover { background: var(--surface-2); }
.bench-row.on { background: var(--accent-bg); }
.bench-row.on::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent);
}
.bench-row .rank {
  font-family: var(--font-display); font-style: italic;
  font-size: 28px; color: var(--ink-3); line-height: 1;
  text-align: center;
}
.bench-row.on .rank { color: var(--accent); }
.bench-row .ttl {
  font-size: 13px; font-weight: 500;
  line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.bench-row .meta {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 10px; color: var(--ink-4);
}
.bench-row .views {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13.5px; font-weight: 500;
  color: var(--ink); text-align: right;
  line-height: 1.2;
}
.bench-row .views .u {
  font-size: 9.5px;
  color: var(--ink-4); font-weight: 400;
  display: block;
  margin-top: 1px;
  letter-spacing: 0.04em;
}

/* shot list (in benchmark detail) */
.shot-list .row {
  display: grid;
  grid-template-columns: 64px 84px 1fr auto;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line-2);
  align-items: start;
  font-size: 12.5px;
}
.shot-list .row:last-child { border-bottom: none; }
.shot-list .row .sthumb {
  width: 64px;
  aspect-ratio: 9/16;
  position: relative;
}
.shot-list .row .tm {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-2);
  padding-top: 2px;
}
.shot-list .row .desc { color: var(--ink-2); line-height: 1.5; padding-top: 2px; }
.shot-list .row .desc .hk { color: var(--ink); font-weight: 500; }

/* compose pane */
.compose {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.compose .col { padding: 16px 18px; min-height: 300px; }
.compose .col + .col { border-left: 1px solid var(--line); background: var(--surface-2); }
.compose .col .lab {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center;
}
.frag {
  padding: 9px 10px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 12px; line-height: 1.5;
  margin-bottom: 6px;
  display: flex; gap: 8px; align-items: start;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.frag:hover { border-color: var(--line-strong); }
.frag.on { background: var(--accent-bg); border-color: var(--accent); }
.frag .badge {
  font-family: var(--font-mono); font-size: 9.5px;
  padding: 1px 5px; background: var(--paper-2); color: var(--ink-3);
  border-radius: 3px; flex-shrink: 0; letter-spacing: 0.04em;
  font-weight: 500;
}
.frag.on .badge { background: var(--accent); color: #fff; }
.compose-pre {
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.7;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: var(--r-sm);
  max-height: 280px; overflow-y: auto;
  white-space: pre-wrap;
}
.compose-pre b { color: var(--accent); background: var(--accent-bg); padding: 0 4px; border-radius: 3px; font-weight: 500; }

/* product card */
.prod-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-1);
  transition: all var(--t-fast);
  cursor: pointer;
}
.prod-card:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.prod-card .thumb-wrap {
  aspect-ratio: 1;
  position: relative;
}
.prod-card .thumb-wrap .thumb {
  position: absolute; inset: 0;
  border-radius: 0;
}
.prod-card .body { padding: 12px 14px; }
.prod-card .name { font-size: 13px; font-weight: 600; letter-spacing: -0.005em; margin-bottom: 4px; }
.prod-card .sub { font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-3); margin-bottom: 8px; }
.prod-card .stats {
  display: flex; gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line-2);
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3);
}
.prod-card .stats b { color: var(--ink); font-weight: 500; }

/* activity feed */
.feed { display: flex; flex-direction: column; gap: 2px; }
.feed-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  align-items: center;
  font-size: 12.5px;
}
.feed-item:hover { background: var(--surface-2); }
.feed-item .dot-c {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--paper-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
}
.feed-item .dot-c.ok { background: var(--ok-bg); color: var(--ok-ink); }
.feed-item .dot-c.live { background: var(--live-bg); color: var(--live-ink); }
.feed-item .dot-c.hot { background: var(--accent-bg); color: var(--accent-ink); }
.feed-item .dot-c.err { background: var(--halt-bg); color: var(--halt-ink); }
.feed-item .when {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-4);
}

/* mini chart placeholder */
.chart {
  position: relative; height: 200px;
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  border: 1px solid var(--line-2);
}
.chart svg { width: 100%; height: 100%; overflow: visible; display: block; }

/* job card (studio) */
.job {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-1);
  transition: box-shadow var(--t);
}
.job:hover { box-shadow: var(--sh-2); }
.job-h {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
}
.job-h .jid {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--ink-4); padding: 2px 6px;
  background: var(--paper-2); border-radius: var(--r-xs);
  letter-spacing: 0.04em;
}
.job-h .nm { font-weight: 600; font-size: 14px; }
.job-h .prod-ref {
  font-family: var(--font-mono); font-size: 10.5px;
  color: var(--ink-3); padding: 2px 7px;
  background: var(--surface-2); border-radius: var(--r-xs);
  border: 1px solid var(--line);
}
.job-h .grow { flex: 1; }
.job-h .progress {
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
}
.job-h .progress b { color: var(--ink); font-weight: 600; }
.job-body {
  padding: 16px 18px;
  background: var(--surface-2);
  border-top: 1px solid var(--line-2);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.job-body .lab {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-4); letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 6px;
}
.job-foot {
  padding: 10px 18px;
  border-top: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--ink-3);
  background: var(--surface);
}
.job-foot .err { color: var(--halt-ink); }
.job-foot .ok-t { color: var(--ok-ink); font-weight: 500; }
.job-foot .grow { flex: 1; }

/* progress bar */
.pbar {
  height: 4px; background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin: 6px 0;
}
.pbar i {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width var(--t);
}
.pbar.live i { background: var(--live); }
.pbar.ok i { background: var(--ok); }

/* tag chips */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--paper-2); color: var(--ink-2);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--t-fast);
}
.chip:hover { background: var(--surface); border-color: var(--line-strong); }
.chip.on {
  background: var(--ink); color: var(--paper);
  border-color: var(--ink);
}

/* empty state */
.empty {
  text-align: center;
  padding: 64px 24px;
  color: var(--ink-3);
  font-size: 13px;
}
.empty .big {
  font-family: var(--font-display); font-style: italic;
  font-size: 56px; color: var(--ink-4);
  margin-bottom: 12px; line-height: 1;
}

/* utility */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }

/* spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* labels */
.label-mono {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--ink-3); letter-spacing: 0.08em;
  text-transform: uppercase; font-weight: 500;
}

/* dashboard hero */
.hero-row {
  display: grid; grid-template-columns: 2fr 1fr; gap: 16px;
  margin-bottom: 24px;
}
.hero {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: var(--sh-1);
  position: relative;
  overflow: hidden;
}
.hero .greeting {
  font-size: 30px; font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  line-height: 1.2;
}
.hero .greeting em { color: var(--accent); font-style: normal; font-weight: 600; }
.hero .sub {
  font-size: 13px; color: var(--ink-3);
  max-width: 520px;
  line-height: 1.5;
}
.hero-actions {
  margin-top: 16px;
  display: flex; gap: 8px; flex-wrap: wrap;
}

/* responsive — laptop 1280 */
@media (max-width: 1280px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-row { grid-template-columns: 1fr; }
  .page { padding: 18px 22px 60px; }
  .topbar { padding: 10px 22px; }
  .sb-brand .switch { display: none; }
}
@media (max-width: 1100px) {
  .compose { grid-template-columns: 1fr; }
  .compose .col + .col { border-left: none; border-top: 1px solid var(--line); }
}

/* keyframes */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.fade { animation: fade-in var(--t); }

/* =========================================================
   Tweaks 面板(预览用 · 移植自 tweaks-panel.jsx 精简版)
   ========================================================= */
.tw-fab{ position:fixed; right:18px; bottom:18px; z-index:200;
  width:42px; height:42px; border-radius:50%; border:1px solid var(--line-strong);
  background:var(--surface); color:var(--ink-2); cursor:pointer;
  box-shadow:var(--sh-2); display:flex; align-items:center; justify-content:center; font-size:18px; }
.tw-fab:hover{ color:var(--ink); }
.tw-panel{ position:fixed; right:18px; bottom:70px; z-index:200;
  width:280px; max-height:78vh; overflow-y:auto;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  box-shadow:var(--sh-3); padding:14px; display:none; }
.tw-panel.open{ display:block; }
.tw-sec{ font-family:var(--font-mono); font-size:9.5px; letter-spacing:.12em; text-transform:uppercase;
  color:var(--ink-4); margin:12px 0 6px; }
.tw-sec:first-child{ margin-top:0; }
.tw-grid{ display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.tw-opt{ appearance:none; border:1px solid var(--line-strong); background:var(--surface-2);
  color:inherit; padding:7px 8px; border-radius:var(--r-sm); font:inherit; font-size:11px;
  text-align:left; cursor:pointer; line-height:1.3; }
.tw-opt.on{ border-color:var(--ink); background:var(--surface); box-shadow:var(--sh-1); }
.tw-opt b{ font-weight:600; }
.tw-opt .d{ opacity:.6; font-size:10px; display:block; margin-top:2px; }
.tw-row{ display:flex; gap:4px; }
.tw-row .tw-opt{ flex:1; text-align:center; }
.tw-sw{ width:18px; height:18px; border-radius:5px; display:inline-block; vertical-align:-3px; margin-right:5px; border:1px solid rgba(0,0,0,.1); }
.tw-acc{ display:flex; gap:6px; }
.tw-acc button{ width:28px; height:28px; border-radius:var(--r-sm); border:2px solid transparent; cursor:pointer; }
.tw-acc button.on{ border-color:var(--ink); }
.page-stub{ text-align:center; padding:80px 24px; color:var(--ink-3); }
.page-stub .big{ font-family:var(--font-display); font-style:italic; font-size:52px; color:var(--ink-4); margin-bottom:10px; }
