/* 影像工作台 — Aurora 设计系统 */
:root {
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #f3f4f8;
  --bg-glow-1: rgb(124 108 245 / .07);
  --bg-glow-2: rgb(45 212 191 / .05);
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --surface-3: #eff1f6;
  --line: #e4e7ee;
  --line-strong: #d2d7e2;
  --text: #191d27;
  --text-2: #474e5d;
  --text-3: #6e7585;
  --text-4: #9aa0ae;
  --accent: #6a5af0;
  --accent-2: #0ea5a5;
  --accent-hover: #5847e8;
  --accent-soft: #efeefc;
  --accent-glow: rgb(106 90 240 / .28);
  --on-accent: #ffffff;
  --focus: #a49af5;
  --grad: linear-gradient(120deg, #6a5af0 0%, #4f7df3 48%, #0ea5a5 100%);
  --grad-soft: linear-gradient(120deg, rgb(106 90 240 / .1), rgb(14 165 165 / .08));
  --ok: #1e8e5a;     --ok-bg: #e6f5ec;
  --run: #2f6fd0;    --run-bg: #e9f1fc;
  --bad: #c64b40;    --bad-bg: #fbecea;
  --warn: #9a7326;   --warn-bg: #f8f1de;
  --stage: #0d0f14;
  --shadow-sm: 0 1px 2px rgb(23 25 35 / .05);
  --shadow-md: 0 6px 18px -6px rgb(23 25 35 / .1);
  --shadow-lg: 0 32px 72px -24px rgb(23 25 35 / .3), 0 2px 8px rgb(23 25 35 / .06);
  --backdrop: rgb(18 20 30 / .42);

  --r-sm: 8px;
  --r: 10px;
  --r-lg: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0c12;
    --bg-glow-1: rgb(124 108 245 / .13);
    --bg-glow-2: rgb(45 212 191 / .09);
    --surface: #12151e;
    --surface-2: #161a25;
    --surface-3: #1d2230;
    --line: #262c3c;
    --line-strong: #333b4f;
    --text: #e9ebf2;
    --text-2: #b3b9c8;
    --text-3: #8b91a3;
    --text-4: #62697c;
    --accent: #9d8ffc;
    --accent-2: #3fd9c7;
    --accent-hover: #b2a7fd;
    --accent-soft: #252147;
    --accent-glow: rgb(139 124 246 / .35);
    --on-accent: #0f0d24;
    --focus: #7a6ce8;
    --grad: linear-gradient(120deg, #8b7cf6 0%, #5b8cf7 48%, #3fd9c7 100%);
    --grad-soft: linear-gradient(120deg, rgb(139 124 246 / .16), rgb(63 217 199 / .1));
    --ok: #5fce95; --ok-bg: #142b20;
    --run: #7db1ec; --run-bg: #15243a;
    --bad: #ee9a90; --bad-bg: #341d1a;
    --warn: #e3bd6f; --warn-bg: #2e2513;
    --stage: #060709;
    --shadow-sm: none;
    --shadow-md: 0 6px 20px -6px rgb(0 0 0 / .5);
    --shadow-lg: 0 32px 72px -20px rgb(0 0 0 / .65), 0 0 0 1px rgb(255 255 255 / .05);
    --backdrop: rgb(2 3 6 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0c12;
  --bg-glow-1: rgb(124 108 245 / .13);
  --bg-glow-2: rgb(45 212 191 / .09);
  --surface: #12151e;
  --surface-2: #161a25;
  --surface-3: #1d2230;
  --line: #262c3c;
  --line-strong: #333b4f;
  --text: #e9ebf2;
  --text-2: #b3b9c8;
  --text-3: #8b91a3;
  --text-4: #62697c;
  --accent: #9d8ffc;
  --accent-2: #3fd9c7;
  --accent-hover: #b2a7fd;
  --accent-soft: #252147;
  --accent-glow: rgb(139 124 246 / .35);
  --on-accent: #0f0d24;
  --focus: #7a6ce8;
  --grad: linear-gradient(120deg, #8b7cf6 0%, #5b8cf7 48%, #3fd9c7 100%);
  --grad-soft: linear-gradient(120deg, rgb(139 124 246 / .16), rgb(63 217 199 / .1));
  --ok: #5fce95; --ok-bg: #142b20;
  --run: #7db1ec; --run-bg: #15243a;
  --bad: #ee9a90; --bad-bg: #341d1a;
  --warn: #e3bd6f; --warn-bg: #2e2513;
  --stage: #060709;
  --shadow-sm: none;
  --shadow-md: 0 6px 20px -6px rgb(0 0 0 / .5);
  --shadow-lg: 0 32px 72px -20px rgb(0 0 0 / .65), 0 0 0 1px rgb(255 255 255 / .05);
  --backdrop: rgb(2 3 6 / .6);
  color-scheme: dark;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.6 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(52rem 36rem at 88% -12%, var(--bg-glow-1), transparent 62%),
    radial-gradient(44rem 32rem at -10% 108%, var(--bg-glow-2), transparent 60%);
}
h1, h2, h3, p, dl, dd, ol { margin: 0; }
h1 { font-size: 25px; line-height: 1.35; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 16px; line-height: 1.4; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
small { font-size: 12px; }
a { color: inherit; text-decoration: none; }
code, pre, .mono { font-family: var(--mono); font-size: 13px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.hidden { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

::selection { background: var(--accent-soft); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-4); }
*::-webkit-scrollbar-track { background: transparent; }

input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea {
  width: 100%; min-width: 0; padding: 10px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); line-height: 1.5; transition: border-color .18s, box-shadow .18s, background .18s;
}
input:hover:not(:focus):not([readonly]), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--text-4); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--text-4); }
input[readonly] { background: var(--surface-2); }
textarea { resize: vertical; }
select { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
select.narrow { max-width: 420px; }
input[type="checkbox"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
input[type="range"] { accent-color: var(--accent); height: 22px; }

.field-label { display: block; margin: 18px 0 8px; font-size: 13px; font-weight: 550; color: var(--text-2); letter-spacing: .01em; }
.field-label small { color: var(--text-3); font-weight: 400; margin-left: 4px; }
.hint { margin-top: 8px; font-size: 12px; line-height: 1.7; color: var(--text-3); }
.hint.center { text-align: center; }
.hint code { font-size: 12px; }
.error-text { font-size: 13px; line-height: 1.6; color: var(--bad); overflow-wrap: anywhere; }
.error-text:empty { display: none; }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.counter { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-row .field-label { margin-bottom: 8px; }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 37px; padding: 7px 17px; border-radius: var(--r-sm); font-size: 14px; font-weight: 550; white-space: nowrap; border: 1px solid transparent; transition: transform .16s, box-shadow .18s, background .18s, border-color .18s, color .18s, filter .18s; }
.button:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.button .i { width: 16px; height: 16px; }
.button.small { min-height: 30px; padding: 4px 11px; font-size: 13px; }
.button.block { width: 100%; min-height: 44px; font-size: 15px; }
.primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 4px 16px -4px var(--accent-glow), inset 0 1px 0 rgb(255 255 255 / .16); text-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.primary:hover:not(:disabled) { filter: brightness(1.08) saturate(1.05); box-shadow: 0 6px 22px -4px var(--accent-glow), inset 0 1px 0 rgb(255 255 255 / .2); }
.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); box-shadow: var(--shadow-sm); }
.secondary:hover:not(:disabled) { background: var(--surface-3); border-color: var(--text-4); }
.ghost { color: var(--text-2); }
.ghost:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: var(--r-sm); color: var(--text-3); transition: background .16s, color .16s, transform .16s; }
.icon-button:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-button:active:not(:disabled) { transform: scale(.92); }
.icon-button.outlined { width: 36px; height: 36px; flex-basis: 36px; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow-sm); }
.icon-button.outlined:hover:not(:disabled) { border-color: var(--text-4); }
.text-button { font-size: 12px; color: var(--text-3); transition: color .15s; }
.text-button:hover { color: var(--accent); }

/* Segmented control & tabs */
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--r); border: 1px solid var(--line); }
.segmented button { min-height: 30px; padding: 4px 14px; border-radius: 7px; font-size: 13px; color: var(--text-2); transition: background .18s, color .18s, box-shadow .18s; }
.segmented button:hover:not(.active) { color: var(--text); }
.segmented button.active { background: var(--surface); color: var(--text); font-weight: 550; box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.segmented.small button { min-height: 28px; padding: 3px 11px; }
.segmented.icons button { display: inline-flex; align-items: center; padding: 3px 8px; }
.segmented.icons .i { width: 16px; height: 16px; }
.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); }
.tab { position: relative; padding: 9px 0 11px; font-size: 14px; color: var(--text-3); transition: color .18s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); font-weight: 550; }
.tab::after { content: ""; position: absolute; left: 50%; right: 50%; bottom: -1px; height: 2.5px; background: var(--grad); border-radius: 2px; opacity: 0; transition: left .22s ease, right .22s ease, opacity .22s; }
.tab.active::after { left: 0; right: 0; opacity: 1; }

/* Chips (radio groups) */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 5px 13px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); font-size: 13px; color: var(--text-2); cursor: pointer; transition: border-color .16s, background .16s, color .16s, box-shadow .16s, transform .16s; }
.chip input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.chip:hover { border-color: var(--text-4); color: var(--text); transform: translateY(-1px); }
.chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 550; box-shadow: 0 2px 10px -3px var(--accent-glow); }
.chip:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.chip:has(input:disabled) { opacity: .4; cursor: not-allowed; }
.chip small { color: var(--text-3); font-weight: 400; font-size: 12px; }
.ratio { display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; opacity: .75; }
.r-16-9 { width: 18px; height: 10px; } .r-9-16 { width: 10px; height: 18px; } .r-4-3 { width: 16px; height: 12px; }
.r-3-4 { width: 12px; height: 16px; } .r-1-1 { width: 14px; height: 14px; } .r-21-9 { width: 21px; height: 9px; }
.r-3-2 { width: 18px; height: 12px; } .r-2-3 { width: 12px; height: 18px; } .r-adaptive { width: 14px; height: 14px; border-style: dashed; }

/* Switch */
.switch { position: relative; display: inline-flex; width: 40px; height: 23px; flex: 0 0 40px; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; width: 100%; height: 100%; }
.switch > span { position: absolute; inset: 0; border-radius: 12px; background: var(--line-strong); transition: background .2s; }
.switch > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .28); transition: transform .22s cubic-bezier(.34, 1.56, .64, 1); }
.switch input:checked + span { background: var(--grad); }
.switch input:checked + span::after { transform: translateX(17px); }
.switch input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 9px; margin-top: 16px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check small { color: var(--text-3); margin-left: 4px; }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; letter-spacing: .02em; }
.brand-mark { width: 28px; height: 28px; border-radius: 8.5px; background: var(--grad); position: relative; flex-shrink: 0; box-shadow: 0 3px 10px -2px var(--accent-glow), inset 0 1px 0 rgb(255 255 255 / .25); }
.brand-mark::before { content: ""; position: absolute; inset: 8px 6px; border: 1.6px solid #fff; border-radius: 2.5px; opacity: .92; }
.brand-mark::after { content: ""; position: absolute; left: 12px; top: 10.5px; border-left: 6px solid #fff; border-top: 3.5px solid transparent; border-bottom: 3.5px solid transparent; }

/* Login */
.login-view { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.login-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 44px 60px; background: #0b0d15; border-right: 1px solid var(--line); overflow: hidden; color: #e9ebf2; isolation: isolate; }
.login-aside::before {
  content: ""; position: absolute; inset: -20%; z-index: -1;
  background:
    radial-gradient(38rem 30rem at 18% 22%, rgb(124 92 246 / .38), transparent 62%),
    radial-gradient(32rem 28rem at 82% 68%, rgb(45 212 191 / .26), transparent 60%),
    radial-gradient(26rem 22rem at 62% 12%, rgb(79 125 243 / .3), transparent 58%);
  animation: aurora 22s ease-in-out infinite alternate;
}
.login-aside::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: radial-gradient(rgb(255 255 255 / .16) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(70% 70% at 50% 45%, #000 20%, transparent 78%);
}
@keyframes aurora {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(9deg) scale(1.12); }
  100% { transform: rotate(-6deg) scale(1.05); }
}
.login-aside .brand { color: #fff; }
.login-statement { position: relative; animation: fade-up .7s .1s ease-out backwards; }
.login-statement h1 { font-size: 38px; font-weight: 650; letter-spacing: .01em; background: linear-gradient(110deg, #fff 30%, #b9acff 65%, #7fe7d8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-statement p { margin-top: 16px; max-width: 26em; color: rgb(233 235 242 / .72); font-size: 15px; line-height: 1.95; }
.login-foot { font-size: 12px; color: rgb(233 235 242 / .45); letter-spacing: .04em; }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }
.login-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--surface); }
.login-form { width: 100%; max-width: 368px; animation: fade-up .6s ease-out backwards; }
.login-form h2 { font-size: 24px; font-weight: 650; margin-bottom: 8px; letter-spacing: .01em; }
.auth-tabs { margin: 14px 0 4px; }
.password-field { position: relative; }
.password-field input { padding-right: 44px !important; }
.password-field button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.login-form .error-text { margin-top: 12px; }
.login-form .button.block { margin-top: 26px; }

/* Shell */
.app-shell { display: flex; min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; display: flex; flex-direction: column; padding: 24px 14px 14px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(14px); border-right: 1px solid var(--line); z-index: 5; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.sidebar-head-actions { display: none; }
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 32px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r); font-size: 14px; color: var(--text-2); text-align: left; transition: background .18s, color .18s; }
.nav-item .i { width: 17px; height: 17px; color: var(--text-3); transition: color .18s, transform .18s; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item:hover .i { color: var(--text-2); transform: scale(1.08); }
.nav-item.active { background: var(--grad-soft); color: var(--accent); font-weight: 550; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.nav-item.active .i { color: var(--accent); }
.nav-count { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); }
.nav-item.active .nav-count { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.sidebar-foot { margin-top: auto; }
.service-state { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 12px; color: var(--text-3); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex-shrink: 0; box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--ok) 18%, transparent); animation: dot-breathe 2.6s ease-in-out infinite; }
@keyframes dot-breathe { 50% { box-shadow: 0 0 0 5.5px color-mix(in srgb, var(--ok) 8%, transparent); } }
.service-state.error .dot { background: var(--bad); box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--bad) 18%, transparent); animation: none; }
.account { display: flex; align-items: center; gap: 8px; padding: 12px 4px 0 8px; border-top: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: #fff; font-size: 13px; font-weight: 600; text-transform: uppercase; box-shadow: 0 2px 8px -2px var(--accent-glow); }
.account-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.35; }
.account-text strong { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-text small { color: var(--text-3); }
.account .icon-button { width: 30px; height: 30px; flex-basis: 30px; }
.account .icon-button .i { width: 16px; height: 16px; }

.workspace { flex: 1; min-width: 0; margin-left: 236px; padding: 38px 48px 40px; }
.page-view { max-width: 1360px; margin: 0 auto; animation: fade-up .4s ease-out backwards; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.page-sub { margin-top: 6px; color: var(--text-3); font-size: 14px; }
.page-actions { display: flex; align-items: center; gap: 10px; }
.banner { margin-bottom: 20px; padding: 11px 15px; border-radius: var(--r); background: var(--warn-bg); color: var(--warn); font-size: 13px; border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent); }

/* Metrics */
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.metric { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; padding: 13px 22px 11px; border-left: 1px solid var(--line); transition: background .2s; }
.metric:first-child { border-left: 0; }
.metric::before { content: ""; position: absolute; inset: 0 0 auto; height: 2.5px; background: var(--grad); opacity: 0; transition: opacity .25s; }
.metric:hover { background: var(--surface-2); }
.metric:hover::before { opacity: 1; }
.metric > span { font-size: 12.5px; color: var(--text-3); letter-spacing: .02em; }
.metric > strong { font-size: 21px; font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.metric > small { flex-basis: 100%; margin-top: 1px; font-size: 11.5px; color: var(--text-3); }

/* Toolbar */
.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; padding-bottom: 6px; }
.toolbar .hint { margin: 0 0 8px; }
.search { position: relative; display: flex; align-items: center; width: 260px; }
.search .i { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--text-4); pointer-events: none; }
.search input { padding: 7px 12px 7px 33px !important; font-size: 13px; background: var(--surface); border-radius: 999px; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 12px 16px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
.number { text-align: right; font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.tasks-table tbody tr { cursor: pointer; transition: background .14s; }
.tasks-table tbody tr:hover { background: var(--surface-2); }
.task-cell { display: flex; align-items: center; gap: 14px; min-width: 260px; max-width: 460px; text-align: left; width: 100%; }
.thumb { position: relative; width: 72px; height: 46px; flex: 0 0 72px; display: grid; place-items: center; overflow: hidden; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text-4); box-shadow: inset 0 0 0 1px var(--line); }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; background: var(--surface-3); }
.thumb .i { width: 18px; height: 18px; }
.thumb .play { position: absolute; right: 4px; bottom: 4px; width: 16px; height: 16px; border-radius: 50%; background: rgb(0 0 0 / .5); backdrop-filter: blur(4px); display: grid; place-items: center; }
.thumb .play::after { content: ""; margin-left: 2px; border-left: 5px solid #fff; border-top: 3px solid transparent; border-bottom: 3px solid transparent; }
.task-title { min-width: 0; }
.task-title strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 550; color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
.task-title small { display: block; margin-top: 2px; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.model-name { color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; }
.spec { margin-top: 2px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.time { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.time small { display: block; color: var(--text-3); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.completed { background: var(--ok-bg); color: var(--ok); }
.badge.in_progress, .badge.submitting { background: var(--run-bg); color: var(--run); }
.badge.in_progress::before, .badge.submitting::before { animation: pulse 1.6s ease-in-out infinite; box-shadow: 0 0 6px currentColor; }
.badge.failed { background: var(--bad-bg); color: var(--bad); }
.badge.submission_unknown, .badge.polling_timeout { background: var(--warn-bg); color: var(--warn); }
@keyframes pulse { 50% { opacity: .3; } }

.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 2px 0; font-size: 13px; color: var(--text-3); }
.pagination > div { display: flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.workspace-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.workspace-foot > span:first-child { display: flex; align-items: center; gap: 8px; }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 300px; padding: 40px; text-align: center; color: var(--text-3); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty > .i { width: 30px; height: 30px; color: var(--text-4); stroke-width: 1.3; }
.empty h2 { font-size: 15px; font-weight: 550; color: var(--text-2); }
.empty p { font-size: 13px; }
.empty .button { margin-top: 8px; }

/* Gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; transition: border-color .2s, box-shadow .2s, transform .2s; }
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-3); display: grid; place-items: center; color: var(--text-4); overflow: hidden; }
.card-media img, .card-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-media img, .card:hover .card-media video { transform: scale(1.04); }
.card-media .i { width: 24px; height: 24px; stroke-width: 1.4; }
.card-media .badge { position: absolute; left: 10px; top: 10px; backdrop-filter: blur(6px); }
.card-media .kind { position: absolute; right: 10px; bottom: 10px; padding: 1px 7px; border-radius: 4px; background: rgb(0 0 0 / .5); backdrop-filter: blur(4px); color: #fff; font-size: 11px; }
.card-body { padding: 12px 14px 14px; }
.card-body .prompt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; line-height: 1.55; color: var(--text); min-height: 2.6em; overflow-wrap: anywhere; }
.card-body small { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--text-3); }
.card-body small span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Panels (settings) */
.panel { padding: 26px 28px 28px; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: box-shadow .2s; }
.panel:hover { box-shadow: var(--shadow-md); }
.panel > h2, .panel-head { margin-bottom: 6px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; }
.panel .table-wrap { margin-top: 14px; border-radius: var(--r); box-shadow: none; }
.copy-field { display: flex; align-items: center; gap: 2px; max-width: 760px; min-height: 44px; padding: 4px 4px 4px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface-2); transition: border-color .18s, box-shadow .18s; }
.copy-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-soft); }
.copy-field code { flex: 1; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.endpoints > div { display: flex; align-items: center; gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--line); transition: background .15s; }
.endpoints > div:last-child { border-bottom: 0; }
.endpoints dt { display: flex; align-items: center; gap: 12px; min-width: 280px; }
.endpoints dd { color: var(--text-3); font-size: 13px; }
.method { display: inline-block; width: 40px; font-family: var(--mono); font-size: 11.5px; font-weight: 700; color: var(--run); }
.method.post { color: var(--ok); }
.model-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 12px; margin-top: 16px; }
.model-cards-group { grid-column: 1 / -1; margin-top: 10px; font-size: 12px; font-weight: 600; letter-spacing: .1em; color: var(--text-4); }
.model-cards-group:first-child { margin-top: 0; }
.model-card { padding: 13px 16px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); transition: border-color .18s, box-shadow .18s, transform .18s; }
.model-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); box-shadow: 0 5px 16px -6px var(--accent-glow); transform: translateY(-1px); }
.model-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.model-card-head code { font-size: 12.5px; font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }
.model-tag { flex-shrink: 0; padding: 1px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-3); font-size: 11px; white-space: nowrap; }
.model-card p { margin-top: 7px; font-size: 12.5px; line-height: 1.65; color: var(--text-2); }
.specs-table td { vertical-align: top; line-height: 1.7; }
.specs-table td:first-child { white-space: nowrap; }
.notes { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.notes summary, .advanced summary { cursor: pointer; font-size: 13px; font-weight: 550; color: var(--text-2); list-style: none; display: inline-flex; align-items: center; gap: 6px; transition: color .15s; }
.notes summary:hover, .advanced summary:hover { color: var(--accent); }
.notes summary::-webkit-details-marker, .advanced summary::-webkit-details-marker { display: none; }
.notes summary::before, .advanced summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .18s; margin-right: 2px; }
.notes[open] summary::before, .advanced[open] summary::before { transform: rotate(45deg); }
.notes p { margin-top: 12px; font-size: 13px; line-height: 1.85; color: var(--text-2); max-width: 900px; }
.notes strong { color: var(--text); font-weight: 550; }
.code { margin-top: 14px; padding: 16px 18px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); font-size: 12.5px; line-height: 1.75; color: var(--text-2); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; }
.account-form { max-width: 380px; }
.account-form .button { margin-top: 20px; }
.account-form .error-text { margin-top: 12px; }

/* Users */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; margin-bottom: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); transition: box-shadow .2s; }
.setting-row:hover { box-shadow: var(--shadow-md); }
.setting-row .hint { margin-top: 2px; }
.users-table { min-width: 860px; }
.users-table td strong { color: var(--text); font-weight: 550; }
.row-actions { display: flex; align-items: center; gap: 2px; }
.row-actions .icon-button { width: 30px; height: 30px; flex-basis: 30px; }
.row-actions .i { width: 16px; height: 16px; }
.concurrency { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.inline-form { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.inline-form input { width: 104px !important; text-align: right; font-variant-numeric: tabular-nums; }
.setting-row:has(.od-grid) { flex-direction: column; align-items: stretch; gap: 14px; }
.od-grid { flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.od-field { flex: 1 1 120px; max-width: 180px; }
.od-field .field-label { margin: 0 0 6px; font-size: 12px; }
.od-grid input { width: 100% !important; }
.od-grid .button { flex-shrink: 0; min-height: 41px; }
.requests-table td { white-space: nowrap; }
.requests-table .path { white-space: normal; font-family: var(--mono); font-size: 12.5px; overflow-wrap: anywhere; color: var(--text); }
.http-ok { color: var(--ok); }
.http-error { color: var(--bad); }

/* Dialogs */
dialog { padding: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); width: 560px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); }
dialog[open] { display: flex; flex-direction: column; animation: rise .22s cubic-bezier(.32, .72, .35, 1); }
dialog > form { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(6px); animation: backdrop-in .22s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.975); } }
@keyframes backdrop-in { from { opacity: 0; } }
.small-dialog { width: 440px; }
.dialog-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px 16px 24px; border-bottom: 1px solid var(--line); }
.dialog-head::before { content: ""; position: absolute; inset: 0 0 auto; height: 2.5px; background: var(--grad); opacity: .85; border-radius: 2px 2px 0 0; }
.dialog-head h2 { font-size: 17px; font-weight: 650; overflow-wrap: anywhere; min-width: 0; }
.dialog-body { padding: 4px 24px 22px; overflow: auto; }
.dialog-body > p:first-child { padding-top: 18px; line-height: 1.85; overflow-wrap: anywhere; }
.dialog-foot { display: flex; align-items: center; gap: 12px; padding: 14px 20px 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.foot-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
.foot-actions.start { margin-left: 0; justify-content: flex-start; }
#confirm-error { margin-top: 10px; }

/* Create studio */
.studio { width: 1080px; height: min(860px, calc(100dvh - 48px)); }
.studio-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.model-picker { flex-shrink: 0; overflow-x: auto; overflow-y: hidden; padding: 14px 20px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); scrollbar-width: thin; }
.model-list { display: flex; align-items: stretch; gap: 8px; }
.model-group { flex-shrink: 0; align-self: center; margin: 0 6px 0 2px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; color: var(--text-4); }
.model-option { flex: 0 0 auto; width: 218px; padding: 9px 13px; border-radius: var(--r); text-align: left; border: 1px solid var(--line); background: var(--surface); transition: background .18s, border-color .18s, box-shadow .18s, transform .18s; }
.model-option:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.model-option strong { display: block; font-size: 13.5px; font-weight: 550; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-option small { display: block; margin-top: 2px; color: var(--text-3); line-height: 1.5; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-option[aria-checked="true"] { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); background: var(--accent-soft); box-shadow: 0 4px 14px -4px var(--accent-glow); }
.model-option[aria-checked="true"] strong { color: var(--accent); }
.studio-main { flex: 1; min-height: 0; overflow: auto; padding: 22px 32px 30px; }
.model-heading { padding-bottom: 4px; }
.model-heading h3 { font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.model-heading .hint { margin-top: 6px; max-width: 680px; }
.field { margin-top: 4px; }
.params { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: 4px; }
.param-row { display: grid; grid-template-columns: minmax(0, 220px) auto; gap: 20px; align-items: end; }
.check.align-end { margin: 0 0 10px; }
.duration { display: flex; align-items: center; gap: 16px; max-width: 520px; }
.duration input[type="range"] { flex: 1; }
.number-input { position: relative; flex: 0 0 96px; }
.number-input input { padding-right: 32px !important; text-align: right; font-variant-numeric: tabular-nums; }
.number-input span { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--text-3); pointer-events: none; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 520px; margin-top: 20px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; transition: border-color .18s, background .18s; }
.switch-row:hover { border-color: var(--line-strong); background: var(--surface-2); }
.switch-row > span:first-child { display: flex; flex-direction: column; }
.switch-row strong { font-weight: 550; font-size: 14px; color: var(--text); }
.switch-row small { color: var(--text-3); }
.switch-row small:empty { display: none; }
#image-size { max-width: 260px; }
.image-size-more { margin-top: 10px; padding: 0 14px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.frame-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.frame-pair .field-label { margin-top: 18px; }
#reference-fields > div > .field-row .field-label, #image-ref-field .field-row .field-label { margin-top: 18px; }
.advanced { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.advanced > div { max-width: 680px; }
.studio-foot { flex-wrap: wrap; }
.cost { font-size: 12px; color: var(--text-3); }
.studio-foot .error-text { flex-basis: 100%; order: -1; }

/* Media picker */
.media-picker { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; }
.media-item, .media-add { position: relative; width: 104px; height: 104px; border-radius: var(--r); overflow: hidden; }
.media-picker.single .media-item, .media-picker.single .media-add { width: 100%; height: 132px; }
.media-item { background: var(--surface-3); border: 1px solid var(--line); }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-item .link-tile { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; padding: 10px; font-size: 11.5px; line-height: 1.4; color: var(--text-2); overflow-wrap: anywhere; }
.media-item .link-tile .i { width: 16px; height: 16px; color: var(--text-3); margin-bottom: auto; }
.media-item .link-tile span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.media-item .index { position: absolute; left: 6px; top: 6px; min-width: 20px; padding: 0 6px; border-radius: 10px; background: rgb(0 0 0 / .55); backdrop-filter: blur(4px); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.media-item .size { position: absolute; left: 6px; bottom: 6px; padding: 0 6px; border-radius: 4px; background: rgb(0 0 0 / .55); backdrop-filter: blur(4px); color: #fff; font-size: 11px; line-height: 18px; }
.media-item .remove { position: absolute; right: 5px; top: 5px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgb(0 0 0 / .55); backdrop-filter: blur(4px); color: #fff; opacity: 0; transition: opacity .16s, transform .16s; }
.media-item:hover .remove, .media-item .remove:focus-visible { opacity: 1; }
.media-item .remove:hover { transform: scale(1.1); }
.media-item .remove .i { width: 14px; height: 14px; }
.media-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1.5px dashed var(--line-strong); background: var(--surface); color: var(--text-3); font-size: 12px; text-align: center; transition: border-color .18s, background .18s, color .18s, transform .18s; }
.media-add:hover, .media-picker.dragging .media-add { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.media-add .i { width: 20px; height: 20px; stroke-width: 1.5; }
.media-add small { font-size: 11px; color: var(--text-4); }
.media-link { display: flex; align-items: center; gap: 6px; flex: 0 0 100%; }
.media-link input { max-width: 460px; }
.media-link input { font-size: 13px; padding: 6px 10px !important; }
@media (hover: none) { .media-item .remove { opacity: 1; } }

/* Detail */
.detail { width: 940px; }
.detail-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.detail-body { overflow: auto; padding: 22px 26px 26px; display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 5fr); gap: 6px 26px; align-items: start; }
.detail-media, .detail-info { min-width: 0; }
.detail-info .prompt-block { padding-top: 2px; }
.stage { margin-bottom: 20px; border-radius: var(--r); overflow: hidden; background: var(--stage); aspect-ratio: 16 / 9; box-shadow: inset 0 0 0 1px var(--line); }
.stage video, .stage img { width: 100%; height: 100%; object-fit: contain; display: block; }
.progress { display: flex; list-style: none; padding: 0; margin-bottom: 20px; counter-reset: step; }
.progress li { position: relative; flex: 1; padding-top: 18px; font-size: 12px; color: var(--text-4); text-align: center; }
.progress li::before { content: ""; position: absolute; top: 5px; left: 50%; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--line-strong); z-index: 1; transition: background .2s; }
.progress li::after { content: ""; position: absolute; top: 9px; left: -50%; right: 50%; height: 1.5px; background: var(--line-strong); }
.progress li:first-child::after { display: none; }
.progress li.done, .progress li.current { color: var(--text-2); }
.progress li.done::before, .progress li.done::after, .progress li.current::after { background: var(--accent); }
.progress li.current::before { background: var(--surface); box-shadow: 0 0 0 2px var(--accent), 0 0 10px var(--accent-glow); }
.progress li.current { color: var(--accent); font-weight: 550; }
.callout { margin-bottom: 18px; padding: 11px 14px; border-radius: var(--r); background: var(--bad-bg); color: var(--bad); font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; border: 1px solid color-mix(in srgb, var(--bad) 22%, transparent); }
.callout.warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 22%, transparent); }
.prompt-block { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.prompt-block .field-label { margin-top: 0; }
#detail-prompt { font-size: 14px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 9px 16px; padding-top: 16px; font-size: 13px; line-height: 1.6; }
.facts dt { color: var(--text-3); }
.facts dd { overflow-wrap: anywhere; color: var(--text); }
.facts dd.mono { font-size: 12.5px; }
.detail-foot { flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100; max-width: calc(100vw - 32px); padding: 11px 20px; border-radius: 999px; background: color-mix(in srgb, var(--text) 92%, transparent); color: var(--bg); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); overflow-wrap: anywhere; backdrop-filter: blur(8px); animation: toast-in .28s cubic-bezier(.32, .72, .35, 1); }
@keyframes toast-in { from { opacity: 0; transform: translateX(-50%) translateY(10px) scale(.96); } }

/* Responsive */
@media (max-width: 1180px) {
  .sidebar { width: 212px; }
  .workspace { margin-left: 212px; padding: 30px 28px 36px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { padding-bottom: 0; }
  .search { flex: 1; width: auto; }
  .studio-body { display: flex; flex-direction: column; }
  .tasks-table .c-elapsed { display: none; }
  .task-cell { min-width: 220px; }
}
@media (max-width: 760px) {
  body { font-size: 14px; }
  h1 { font-size: 21px; }
  .login-view { grid-template-columns: 1fr; }
  .login-aside { justify-content: flex-start; padding: 24px 22px 30px; border-right: 0; border-bottom: 1px solid var(--line); gap: 30px; }
  .login-statement h1 { font-size: 26px; }
  .login-statement p { font-size: 14px; margin-top: 8px; }
  .login-foot { display: none; }
  .login-main { align-items: flex-start; padding: 30px 22px 40px; }

  .app-shell { display: block; }
  .sidebar { position: sticky; top: 0; width: auto; padding: 10px 14px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-head { padding: 0 2px; }
  .sidebar-head-actions { display: flex; gap: 2px; }
  .nav { flex-direction: row; gap: 18px; margin-top: 6px; overflow-x: auto; scrollbar-width: none; }
  .nav-item { width: auto; flex-shrink: 0; padding: 9px 0 10px; min-height: 0; border-radius: 0; background: none !important; box-shadow: none !important; border-bottom: 2px solid transparent; }
  .nav-item .i { display: none; }
  .nav-item.active { border-bottom-color: var(--accent); }
  .nav-count { margin-left: 4px; }
  .sidebar-foot { display: none; }
  .workspace { margin: 0; padding: 22px 16px 32px; }
  .page-head { align-items: flex-start; margin-bottom: 20px; }
  .page-sub { font-size: 13px; }
  .page-actions .button { padding: 7px 12px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 24px; }
  .metric { padding: 14px 16px; }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  .metric > strong { font-size: 22px; }
  .tabs { gap: 18px; overflow-x: auto; scrollbar-width: none; }
  .tab { flex-shrink: 0; }
  .toolbar-right { flex-wrap: wrap; }
  .search { flex-basis: 100%; order: -1; }

  /* Task rows become cards */
  #tasks-table { background: none; border: 0; box-shadow: none; overflow: visible; }
  .tasks-table thead { display: none; }
  .tasks-table, .tasks-table tbody { display: block; }
  .tasks-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 14px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
  .tasks-table td { display: block; padding: 0; border: 0; }
  .tasks-table td:first-child { grid-column: 1 / -1; }
  .task-cell { min-width: 0; max-width: none; }
  .tasks-table td.c-owner, .tasks-table td.c-elapsed { display: none; }
  .tasks-table td.c-model { grid-column: 1; }
  .tasks-table td.c-status { grid-column: 2; grid-row: 2; justify-self: end; }
  .tasks-table td.c-credit { grid-column: 2; grid-row: 3; text-align: right; }
  .tasks-table td.c-credit::after { content: " 积分"; color: var(--text-3); font-size: 12px; }
  .tasks-table td.c-time { grid-column: 1; grid-row: 3; }
  .tasks-table td.c-time small { display: inline; margin-left: 6px; }
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px 11px 12px; }
  .card-body .prompt { font-size: 13px; }

  .panel { padding: 18px 16px 20px; }
  .endpoints > div { flex-direction: column; align-items: flex-start; gap: 4px; }
  .endpoints dt { min-width: 0; }
  .specs-table { min-width: 560px; }
  .setting-row { padding: 14px 16px; }
  .workspace-foot { flex-direction: column; gap: 4px; }

  dialog { max-width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .studio { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .studio .dialog-foot { border-radius: 0; }
  .studio-body { display: flex; flex-direction: column; overflow: auto; }
  .model-picker { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .model-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .model-group { display: none; }
  .model-option { flex-shrink: 0; width: auto; padding: 7px 12px; margin: 0; border-color: var(--line); background: var(--surface); }
  .model-option small { display: none; }
  .model-option strong { font-size: 13px; white-space: nowrap; }
  .studio-main { overflow: visible; padding: 16px 16px 24px; }
  .frame-pair { grid-template-columns: 1fr 1fr; gap: 10px; }
  .media-item, .media-add { width: calc((100% - 20px) / 3); height: auto; aspect-ratio: 1; }
  .media-picker.single .media-item, .media-picker.single .media-add { height: 112px; aspect-ratio: auto; }
  .param-row { grid-template-columns: 1fr; gap: 0; }
  .check.align-end { margin-top: 14px; }
  .detail-body { display: block; padding: 16px; }
  .detail-media { margin-bottom: 4px; }
  .facts { grid-template-columns: 84px minmax(0, 1fr); }
  .dialog-head { padding: 14px 14px 12px 18px; }
  .dialog-foot { padding: 12px 14px; }
  .detail-foot .button { padding: 7px 10px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
