:root,
[data-theme="abyss"] {
  --bg: #040a12;
  --bg-deep: #01050a;
  --panel: rgba(8, 20, 33, .78);
  --panel-2: rgba(12, 28, 45, .72);
  --panel-solid: #081522;
  --line: rgba(96, 165, 250, .16);
  --line-strong: rgba(96, 165, 250, .4);
  --text: #eaf5ff;
  --muted: #8fb0c4;
  --faint: #5b7488;
  --accent: #60a5fa;
  --accent-2: #34d399;
  --accent-3: #a78bfa;
  --accent-soft: rgba(96, 165, 250, .12);
  --accent-2-soft: rgba(52, 211, 153, .1);
  --shadow: 0 24px 70px rgba(0, 0, 0, .42);
  --glow: 0 0 32px rgba(96, 165, 250, .16);
  --radius: 20px;
  --radius-sm: 12px;
  --font: Inter, "SF Pro Display", -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}

[data-theme="aurora"] {
  --bg: #070b16;
  --bg-deep: #03050b;
  --panel: rgba(20, 18, 40, .64);
  --panel-2: rgba(28, 25, 52, .62);
  --panel-solid: #121127;
  --line: rgba(167, 139, 250, .18);
  --line-strong: rgba(167, 139, 250, .46);
  --text: #f0edff;
  --muted: #a9a2c9;
  --faint: #746d95;
  --accent: #a78bfa;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --accent-soft: rgba(167, 139, 250, .13);
  --accent-2-soft: rgba(34, 211, 238, .1);
  --shadow: 0 24px 80px rgba(3, 0, 20, .5);
  --glow: 0 0 40px rgba(167, 139, 250, .2);
}

[data-theme="terminal"] {
  --bg: #050805;
  --bg-deep: #010301;
  --panel: rgba(8, 16, 10, .84);
  --panel-2: rgba(10, 22, 13, .78);
  --panel-solid: #071108;
  --line: rgba(163, 230, 53, .16);
  --line-strong: rgba(163, 230, 53, .42);
  --text: #dcffd8;
  --muted: #8fb88a;
  --faint: #5b7b58;
  --accent: #a3e635;
  --accent-2: #fbbf24;
  --accent-3: #22d3ee;
  --accent-soft: rgba(163, 230, 53, .1);
  --accent-2-soft: rgba(251, 191, 36, .1);
  --shadow: 0 18px 60px rgba(0, 0, 0, .5);
  --glow: 0 0 30px rgba(163, 230, 53, .16);
  --font: "JetBrains Mono", Consolas, "Microsoft YaHei", monospace;
  --mono: "JetBrains Mono", Consolas, monospace;
}

[data-theme="platinum"] {
  --bg: #f2efe8;
  --bg-deep: #e7e2d8;
  --panel: rgba(255, 255, 255, .82);
  --panel-2: rgba(255, 255, 255, .68);
  --panel-solid: #fffdf8;
  --line: rgba(28, 25, 23, .1);
  --line-strong: rgba(37, 99, 235, .34);
  --text: #1c1917;
  --muted: #6b645d;
  --faint: #9a9188;
  --accent: #2563eb;
  --accent-2: #0f766e;
  --accent-3: #b45309;
  --accent-soft: rgba(37, 99, 235, .08);
  --accent-2-soft: rgba(15, 118, 110, .08);
  --shadow: 0 22px 60px rgba(78, 65, 48, .14);
  --glow: 0 0 30px rgba(37, 99, 235, .1);
}

[data-theme="nebula"] {
  --bg: #0a0514;
  --bg-deep: #040109;
  --panel: rgba(27, 10, 43, .68);
  --panel-2: rgba(37, 14, 58, .62);
  --panel-solid: #170825;
  --line: rgba(244, 114, 182, .18);
  --line-strong: rgba(244, 114, 182, .44);
  --text: #fbeaff;
  --muted: #c6a5d6;
  --faint: #8d6b9e;
  --accent: #f472b6;
  --accent-2: #818cf8;
  --accent-3: #22d3ee;
  --accent-soft: rgba(244, 114, 182, .12);
  --accent-2-soft: rgba(129, 140, 248, .11);
  --shadow: 0 26px 80px rgba(10, 0, 20, .55);
  --glow: 0 0 42px rgba(244, 114, 182, .18);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background: var(--bg);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 12% 8%, var(--accent-soft), transparent 32%),
    radial-gradient(circle at 88% 12%, var(--accent-2-soft), transparent 30%),
    linear-gradient(160deg, var(--bg-deep), var(--bg));
  pointer-events: none;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.5), transparent 75%);
  opacity: .35;
  pointer-events: none;
}
[data-theme="aurora"] body::before {
  background:
    radial-gradient(ellipse at 15% 0%, rgba(167,139,250,.22), transparent 45%),
    radial-gradient(ellipse at 85% 20%, rgba(34,211,238,.12), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(244,114,182,.1), transparent 45%),
    linear-gradient(160deg, var(--bg-deep), var(--bg));
}
[data-theme="terminal"] body::after {
  background-size: 100% 4px, 44px 44px, 44px 44px;
  opacity: .18;
}
[data-theme="terminal"] h1, [data-theme="terminal"] h2, [data-theme="terminal"] h3 { font-family: var(--mono); letter-spacing: -.02em; }
[data-theme="platinum"] body::after { opacity: .5; }
[data-theme="nebula"] body::before {
  background:
    radial-gradient(ellipse at 10% 10%, rgba(244,114,182,.24), transparent 42%),
    radial-gradient(ellipse at 90% 25%, rgba(129,140,248,.2), transparent 42%),
    radial-gradient(ellipse at 45% 100%, rgba(34,211,238,.12), transparent 45%),
    linear-gradient(160deg, var(--bg-deep), var(--bg));
  animation: nebulaShift 18s ease-in-out infinite alternate;
}
@keyframes nebulaShift { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(18deg); } }

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: inherit; }
.hidden { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 262px;
  height: 100vh;
  flex: none;
  padding: 22px 16px 18px;
  border-right: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(22px) saturate(1.2);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px 24px; }
.brand-logo { width: 40px; height: 40px; border-radius: 12px; box-shadow: none; }
.brand-text b { display: block; font-size: 15px; letter-spacing: .2px; }
.brand-text span { display: block; margin-top: 3px; color: var(--faint); font-size: 9px; letter-spacing: 1.6px; }
.nav-label { padding: 0 10px 8px; color: var(--faint); font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; }
.mode-nav { display: flex; flex-direction: column; gap: 8px; }
.mode-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px 11px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  transition: .22s ease;
}
.mode-btn:hover { background: var(--accent-soft); color: var(--text); transform: translateX(2px); }
.mode-btn.active {
  border-color: var(--line-strong);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}
.mode-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--accent); }
.mode-btn.active .mode-icon { border-color: var(--line-strong); color: var(--accent); box-shadow: none; }
.mode-icon svg { width: 19px; height: 19px; }
.mode-text { min-width: 0; flex: 1; }
.mode-text b { display: block; font-size: 13px; font-weight: 600; }
.mode-text small { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; }
.mode-arrow { opacity: 0; transform: translateX(-4px); transition: .2s; font-size: 13px; }
.mode-btn.active .mode-arrow, .mode-btn:hover .mode-arrow { opacity: 1; transform: translateX(0); }

.basket { display: flex; flex-direction: column; min-height: 120px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.basket .section-head { padding: 0 8px; color: var(--muted); font-size: 11px; letter-spacing: .6px; }
.pill { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; }
.basket-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 8px; padding: 0 4px; max-height: 180px; overflow-y: auto; }
.basket-item { position: relative; width: 52px; height: 52px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel-2); cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.basket-item:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.basket-item.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 2px 8px rgba(0,0,0,.35); }
.basket-item.selected::after { content: "参考"; position: absolute; left: 2px; bottom: 2px; padding: 1px 3px; border-radius: 3px; background: var(--accent); color: #04101d; font-size: 7px; font-weight: 800; letter-spacing: .2px; }
.basket-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.basket-item button { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 16px; height: 16px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.66); color: #fff; }
.basket-item button svg { width: 9px; height: 9px; }
.basket-item .basket-toggle { left: 2px; right: auto; border: 1px solid rgba(255,255,255,.55); color: transparent; }
.basket-item .basket-toggle.on { border-color: var(--accent); background: var(--accent); color: #04101d; }
.basket-item .ref-index { position: absolute; right: 3px; bottom: 2px; color: #fff; font-size: 8px; font-weight: 700; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
.basket-empty { padding: 8px 4px; color: var(--faint); font-size: 11px; line-height: 1.7; }
.hint { margin: 0; color: var(--faint); font-size: 10px; line-height: 1.7; }
.basket .hint { padding: 0 8px; }

.sidebar-foot { display: flex; flex-direction: column; gap: 7px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.ghost-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font-size: 12px; text-align: left; transition: .2s;
}
a.ghost-btn { text-decoration: none; }
.ghost-btn:hover { border-color: var(--line); background: var(--accent-soft); color: var(--text); }
.ghost-btn svg { width: 15px; height: 15px; }
.ghost-btn.compact { width: 34px; height: 34px; padding: 0; justify-content: center; border-color: var(--line); }
.key-btn {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; margin-top: 2px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--muted); font-size: 11px; text-align: left;
}
.key-btn:hover { border-color: var(--line-strong); color: var(--text); }
.key-btn.ready { color: var(--accent-2); border-color: rgba(52,211,153,.32); }
.dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #ff6b7d; }
.key-btn.ready .dot, .connection.ready .dot { background: var(--accent-2); }

.main { width: min(100%, 1480px); flex: 1; min-width: 0; margin: 0 auto; padding: 28px 34px 64px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: 2.1px; }
.title-block h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); line-height: 1.1; letter-spacing: -1.2px; }
.title-block p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.connection { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); font-size: 10px; cursor: pointer; font-family: inherit; }
.connection:hover { border-color: var(--line-strong); color: var(--text); }

.panel { animation: panelIn .45s ease both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 18px; align-items: start; }
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(155deg, var(--panel), var(--panel-2));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.1);
}
.composer { padding: 24px; }
.composer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.composer-head h2 { margin: 0; font-size: 20px; letter-spacing: -.5px; }
.select-wrap { display: flex; flex-direction: column; gap: 5px; min-width: 230px; }
.select-wrap > span { color: var(--faint); font-size: 9px; letter-spacing: 1.3px; }
select {
  height: 38px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel-2); color: var(--text); outline: none; font-size: 11px;
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 16px, calc(100% - 11px) 16px;
  background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
}
select:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--accent-soft); }

.prompt-wrap { position: relative; }
textarea {
  display: block; width: 100%; min-height: 118px; resize: vertical; padding: 15px 16px 38px;
  border: 1px solid var(--line); border-radius: 14px; outline: none;
  background: rgba(0,0,0,.14); color: var(--text); font-size: 13px; line-height: 1.75;
  transition: .2s;
}
[data-theme="platinum"] textarea { background: rgba(255,255,255,.65); }
textarea:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea::placeholder { color: var(--faint); }
.prompt-editor {
  display: block; width: 100%; min-height: 118px; max-height: 320px; overflow-y: auto;
  padding: 15px 16px 38px; border: 1px solid var(--line); border-radius: 14px; outline: none;
  background: rgba(0,0,0,.14); color: var(--text); font-size: 13px; line-height: 1.75;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word;
  transition: .2s;
}
[data-theme="platinum"] .prompt-editor { background: rgba(255,255,255,.65); }
.prompt-editor:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.prompt-editor:empty::before { content: attr(data-placeholder); color: var(--faint); pointer-events: none; }
.prompt-mention {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  margin: 0 3px; padding: 1px; border: 1px solid var(--line-strong); border-radius: 7px;
  background: var(--panel-2); box-shadow: 0 0 12px var(--accent-soft); cursor: default; user-select: none;
}
.prompt-mention img { display: block; width: 34px; height: 34px; object-fit: cover; border-radius: 5px; }
.prompt-tools { position: absolute; right: 10px; bottom: 9px; display: flex; gap: 5px; }
.mini-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 27px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); color: var(--muted); font-size: 10px;
}
.mini-btn:hover { border-color: var(--line-strong); color: var(--text); }
.mini-btn svg { width: 12px; height: 12px; }

.ref-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; min-height: 44px; }
.ref-strip { display: flex; flex-wrap: wrap; gap: 7px; }
.ref-thumb { position: relative; width: 58px; height: 64px; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel-2); cursor: pointer; }
.ref-thumb img { width: 100%; height: 44px; object-fit: cover; display: block; }
.ref-name { display: block; height: 19px; padding: 2px 4px 0; overflow: hidden; color: var(--muted); font-size: 8px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.ref-thumb button { position: absolute; top: 2px; right: 2px; display: grid; place-items: center; width: 15px; height: 15px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; }
.ref-thumb button svg { width: 8px; height: 8px; }
.ref-thumb .ref-index { position: absolute; left: 3px; top: 3px; display: grid; place-items: center; width: 14px; height: 14px; border-radius: 4px; background: rgba(0,0,0,.7); color: #fff; font-size: 8px; font-weight: 700; }
.add-ref {
  display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px;
  border: 1px dashed var(--line-strong); border-radius: 9px; background: transparent; color: var(--muted); font-size: 10px; white-space: nowrap;
}
.add-ref:hover { color: var(--text); background: var(--accent-soft); }
.add-ref svg { width: 13px; height: 13px; }
.add-ref.small { height: 30px; margin-top: 7px; }

.param-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.video-params { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.video-params .param:last-child .segmented button { min-width: 38px; padding: 0 8px; }
.param > label { display: block; margin-bottom: 6px; color: var(--faint); font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; }
.segmented { display: flex; flex-wrap: wrap; gap: 5px; }
.segmented button {
  min-width: 44px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 10px; transition: .18s;
}
.segmented button:hover { border-color: var(--line-strong); color: var(--text); }
.segmented button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); box-shadow: 0 0 16px var(--accent-soft); }

.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.status { min-width: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.status.error { color: #ff8798; }
.status.ok { color: var(--accent-2); }
.queue-info { margin-left: auto; color: var(--faint); font-size: 10px; white-space: nowrap; }
.generate {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04101d;
  font-size: 12px; font-weight: 800; letter-spacing: .2px;
  box-shadow: 0 12px 30px var(--accent-soft), inset 0 1px 0 rgba(255,255,255,.24);
  transition: .2s;
}
.generate:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 16px 36px var(--accent-soft); }
.generate:disabled { transform: none; filter: none; }
.generate svg { width: 16px; height: 16px; }
.generate kbd { padding: 2px 5px; border-radius: 4px; background: rgba(0,0,0,.14); font: 9px var(--mono); }
.generate .price { padding: 3px 7px; border-radius: 6px; background: rgba(0,0,0,.16); font: 10px var(--mono); letter-spacing: -.2px; }
.generate.loading span::after { content: "…"; }

.side-card { padding: 20px; position: sticky; top: 24px; }
.side-title { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; font-size: 12px; font-weight: 700; }
.side-title svg { width: 14px; height: 14px; color: var(--accent); }
.tips { margin: 0; padding: 0 0 0 16px; color: var(--muted); font-size: 10px; line-height: 1.8; }
.tips li { margin-bottom: 9px; padding-left: 2px; }
.tips b { color: var(--text); font-weight: 600; }
.mini-stat { display: flex; align-items: baseline; gap: 5px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10px; }
.mini-stat b { color: var(--accent); font-size: 22px; }
.model-caps { display: grid; gap: 7px; }
.cap-model { margin-bottom: 2px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; }
.cap-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.08); color: var(--muted); font-size: 10px; }
.cap-row b { color: var(--text); font-weight: 600; }

.ref-blocks { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-top: 15px; }
.ref-block { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.08); }
.ref-block-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; color: var(--muted); font-size: 10px; }
.ref-block-head small { color: var(--faint); font-size: 8px; }
.media-ref { display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.media-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); color: var(--muted); font-size: 9px; }
.media-chip span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-chip button { display: grid; place-items: center; width: 15px; height: 15px; padding: 0; border: 0; border-radius: 50%; background: rgba(0,0,0,.2); color: inherit; }
.media-chip button svg { width: 8px; height: 8px; }
.media-chip svg { width: 12px; height: 12px; color: var(--accent); }

.mention-menu { position: absolute; left: 0; top: 0; z-index: 35; width: 280px; max-width: calc(100% - 16px); max-height: 230px; overflow-y: auto; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--panel-solid); box-shadow: var(--shadow); }
.mention-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left; }
.mention-item:hover { background: var(--accent-soft); }
.mention-item img { width: 32px; height: 32px; flex: none; object-fit: cover; border-radius: 6px; }
.mention-item b { display: block; font-size: 10px; }
.mention-item span { display: block; margin-top: 2px; color: var(--faint); font-size: 8px; }
.mention-preview { display: flex; flex-wrap: wrap; gap: 6px; min-height: 0; }
.mention-preview:empty { display: none; }
.mention-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 7px 4px 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); color: var(--muted); font-size: 9px; }
.mention-chip img { width: 28px; height: 28px; object-fit: cover; border-radius: 5px; }
.mention-chip b { color: var(--accent); font-size: 9px; }
.mention-chip small { color: var(--faint); font-size: 8px; }
.name-preview { display: grid; place-items: center; min-height: 100px; margin-bottom: 12px; border: 1px dashed var(--line); border-radius: 10px; background: rgba(0,0,0,.12); }
.name-preview img { max-width: 100%; max-height: 160px; border-radius: 8px; }
.modal-actions { display: flex; gap: 7px; }
.segmented button.locked { opacity: .72; border-style: dashed; }

.results-section { margin-top: 28px; }
.results-head { margin-bottom: 12px; }
.results-head h3, .tasks-section h3 { margin: 0; font-size: 17px; letter-spacing: -.3px; }
.result-actions { display: flex; gap: 6px; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.result-card {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel); box-shadow: 0 10px 28px rgba(0,0,0,.18);
  animation: cardIn .35s ease both;
}
@keyframes cardIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.result-card:hover { border-color: var(--line-strong); box-shadow: 0 18px 40px rgba(0,0,0,.24); }
.result-media { position: relative; aspect-ratio: var(--thumb-ratio, 4 / 3); overflow: hidden; background: var(--bg-deep); cursor: zoom-in; }
.result-media img, .result-media video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.result-card:hover .result-media img, .result-card:hover .result-media video { transform: scale(1.035); }
.result-overlay { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 9px; background: linear-gradient(transparent 45%, rgba(0,0,0,.72)); opacity: 0; transition: .2s; }
.result-card:hover .result-overlay { opacity: 1; }
.result-actions-inline { display: flex; gap: 5px; }
.icon-btn {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid rgba(255,255,255,.2); border-radius: 8px; background: rgba(0,0,0,.46); color: #fff; backdrop-filter: blur(8px);
}
.icon-btn:hover { background: rgba(20,30,42,.88); border-color: rgba(255,255,255,.4); }
.icon-btn svg { width: 14px; height: 14px; }
.result-check { display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 1px solid rgba(255,255,255,.5); border-radius: 6px; background: rgba(0,0,0,.35); color: transparent; }
.result-check.on { border-color: var(--accent); background: var(--accent); color: #04101d; }
.result-check svg { width: 12px; height: 12px; }
.result-meta { padding: 10px 11px 11px; }
.result-meta b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.result-meta span { display: block; margin-top: 4px; color: var(--faint); font-size: 9px; }
.result-actions-bottom { display: flex; gap: 5px; margin-top: 9px; }
.result-actions-bottom .mini-btn { flex: 1; justify-content: center; }
.result-actions-bottom .use-btn { border-color: var(--line-strong); color: var(--accent); }
.result-card.video .result-media { aspect-ratio: 16 / 9; }
.result-card.portrait .result-media { aspect-ratio: 9 / 16; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 180px; padding: 20px; border: 1px dashed var(--line); border-radius: 14px; color: var(--faint); text-align: center; }
.empty svg { width: 30px; height: 30px; opacity: .45; }
.empty b { color: var(--muted); font-size: 12px; }
.empty span { font-size: 10px; }

.tasks-section { margin-top: 26px; }
.task-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.task-card { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.task-spinner { width: 22px; height: 22px; flex: none; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.task-main { min-width: 0; flex: 1; }
.task-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.task-main span { display: block; margin-top: 3px; color: var(--faint); font-size: 9px; }
.task-progress { height: 4px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: var(--line); }
.task-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .35s ease; }
.task-percent { display: block; margin-top: 4px; color: var(--accent); font-size: 9px; text-align: right; }
.task-error { margin-top: 7px; padding: 7px 8px; border: 1px solid rgba(255,107,125,.22); border-radius: 7px; background: rgba(255,107,125,.07); color: #ff9aa8; font-size: 9px; line-height: 1.55; word-break: break-word; }
.task-retry { margin-top: 7px; }
.task-card.done .task-spinner { border: 0; background: var(--accent-2-soft); color: var(--accent-2); animation: none; }
.task-card.done .task-spinner::after { content: "✓"; font-size: 12px; }
.task-card.failed .task-spinner { border: 0; background: rgba(255,107,125,.12); color: #ff8798; animation: none; }
.task-card.failed .task-spinner::after { content: "!"; font-size: 13px; font-weight: 800; }

.history-drawer {
  position: fixed; top: 0; right: 0; z-index: 60; width: min(390px, 100vw); height: 100vh;
  padding: 22px 18px; overflow-y: auto; border-left: 1px solid var(--line);
  background: var(--panel-solid); box-shadow: -30px 0 80px rgba(0,0,0,.4);
  animation: drawerIn .28s ease both;
}
@keyframes drawerIn { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.drawer-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.4); backdrop-filter: blur(2px); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.drawer-head h2 { margin: 0; font-size: 20px; }
.drawer-tabs { display: flex; gap: 5px; margin: 16px 0; }
.drawer-tabs button { height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--muted); font-size: 10px; }
.drawer-tabs button.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.history-list { display: flex; flex-direction: column; gap: 7px; }
.history-item { display: flex; align-items: center; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.history-thumb { width: 46px; height: 46px; flex: none; overflow: hidden; border-radius: 7px; background: var(--bg-deep); }
.history-thumb img, .history-thumb video { width: 100%; height: 100%; object-fit: cover; }
.history-main { min-width: 0; flex: 1; }
.history-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.history-main span { display: block; margin-top: 3px; color: var(--faint); font-size: 8px; }
.history-empty { padding: 26px 8px; color: var(--faint); font-size: 10px; text-align: center; }

.hover-preview { position: fixed; right: 24px; top: 88px; z-index: 80; width: min(340px, 28vw); max-height: calc(100vh - 120px); padding: 7px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--panel-solid); box-shadow: 0 30px 90px rgba(0,0,0,.55); pointer-events: none; overflow: hidden; }
.hover-preview img { display: block; width: 100%; max-height: 62vh; object-fit: contain; border-radius: 9px; background: var(--bg-deep); }
.hover-meta { padding: 8px 3px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.hover-meta b { display: block; overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.hover-zoom { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 0 1px; color: var(--faint); font-size: 9px; }
.hover-zoom svg { width: 11px; height: 11px; }

.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 40px; background: rgba(2,6,10,.88); backdrop-filter: blur(14px); }
.lightbox-stage { display: grid; place-items: center; max-width: 100%; max-height: 80vh; }
.lightbox-stage img, .lightbox-stage video { max-width: min(1200px, 92vw); max-height: 78vh; border-radius: 12px; box-shadow: 0 30px 100px rgba(0,0,0,.6); }
.lightbox-close { position: absolute; top: 20px; right: 24px; }
.lightbox-actions { display: flex; gap: 8px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(2,6,10,.72); backdrop-filter: blur(10px); }
.modal { width: min(460px, 100%); padding: 24px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--panel-solid); box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.modal.wide { width: min(900px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -.4px; }
.modal-copy { margin: 12px 0 16px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.modal-copy b { color: var(--text); }
.field { display: block; }
.field span { display: block; margin-bottom: 6px; color: var(--faint); font-size: 9px; letter-spacing: 1.1px; }
.field input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: rgba(0,0,0,.16); color: var(--text); font: 12px var(--mono); }
[data-theme="platinum"] .field input { background: rgba(255,255,255,.7); }
.field input:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.primary-btn { height: 38px; padding: 0 14px; border: 0; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #04101d; font-size: 11px; font-weight: 800; }
.primary-btn:hover { filter: brightness(1.06); }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.theme-card { padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel-2); text-align: left; transition: .2s; }
.theme-card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.theme-swatch { height: 70px; border-radius: 9px; overflow: hidden; position: relative; }
.theme-swatch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255,255,255,.2), transparent 55%); }
.theme-card b { display: block; margin-top: 9px; font-size: 11px; }
.theme-card span { display: block; margin-top: 3px; color: var(--faint); font-size: 9px; }
.theme-apply { margin-top: 8px; color: var(--accent); font-size: 9px; font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: 26px; z-index: 120; max-width: min(520px, calc(100vw - 30px)); padding: 10px 15px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-solid); color: var(--text); font-size: 11px; box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: .24s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255,107,125,.4); color: #ff8798; }

/* ===== Photon Lab: the chosen workbench world ===== */
.focus-card {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: min(660px, calc(100vh - 180px));
  padding: 0;
  overflow: hidden;
}
.focus-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px 11px;
  border-bottom: 1px solid var(--line);
}
.focus-title { min-width: 0; }
.focus-title span { display: none; }
.focus-title b {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.focus-actions { display: flex; gap: 5px; flex: none; }
.focus-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--muted);
}
.focus-icon:hover { border-color: var(--line-strong); color: var(--text); }
.focus-icon:disabled { opacity: .36; }
.focus-icon svg { width: 13px; height: 13px; }
.focus-stage {
  position: relative;
  flex: none;
  aspect-ratio: 16 / 10;
  min-height: 210px;
  overflow: hidden;
  background: #050708;
}
.focus-stage > img,
.focus-stage > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #050708;
}
.video-focus > video { object-fit: contain; }
.focus-empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-content: center;
  gap: 7px;
  padding: 24px;
  color: var(--faint);
  text-align: center;
}
.focus-empty svg { width: 28px; height: 28px; margin: 0 auto; opacity: .55; }
.focus-empty b { color: var(--muted); font-size: 12px; font-weight: 500; }
.focus-empty span { max-width: 260px; font-size: 10px; line-height: 1.55; }
.focus-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 42%, rgba(0,0,0,.76));
}
.focus-meta {
  position: absolute;
  left: 14px;
  right: 36px;
  bottom: 12px;
  z-index: 2;
  min-width: 0;
}
.focus-meta b {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.focus-meta span { display: block; margin-top: 4px; color: rgba(255,255,255,.7); font-size: 10px; line-height: 1.45; }
.exposure-scale {
  position: absolute;
  top: 14px;
  right: 10px;
  bottom: 44px;
  z-index: 2;
  width: 8px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 99px;
  background: linear-gradient(180deg,#f8fafb 0 8%,#d7dddf 8% 16%,#b7bfc3 16% 25%,#929da2 25% 34%,#737f85 34% 43%,#59656b 43% 52%,#414c52 52% 61%,#2d373c 61% 70%,#1d262b 70% 79%,#11191d 79% 88%,#06090b 88%);
  opacity: .9;
}
.exposure-scale i {
  position: absolute;
  left: -4px;
  right: -4px;
  top: 56%;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
.exposure-scale span {
  position: absolute;
  right: 12px;
  top: 52%;
  padding: 2px 4px;
  border-radius: 3px;
  background: var(--accent);
  color: #0a0a0a;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}
.focus-task {
  padding: 9px 14px 10px;
  border-top: 1px solid var(--line);
  background: var(--panel-2);
}
.focus-task b { display: block; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.focus-task span { display: block; margin-top: 3px; color: var(--faint); font-size: 10px; }
.focus-progress { height: 4px; margin-top: 7px; overflow: hidden; border-radius: 99px; background: var(--line); }
.focus-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .35s ease; }
.focus-task.failed .focus-progress i { background: #ff6b7d; }
.focus-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 10px;
  line-height: 1.45;
}
.focus-foot > span:first-child { min-width: 0; }
.focus-foot .mini-stat { display: flex; align-items: baseline; gap: 4px; flex: none; margin: 0; padding: 0; border: 0; }
.focus-foot .mini-stat b { color: var(--accent); font-size: 16px; }
.focus-notes { min-height: 0; padding: 12px 14px 14px; overflow: auto; border-top: 1px solid var(--line); }
.focus-notes .side-title { margin-bottom: 9px; font-size: 11px; }
.focus-notes .tips { padding-left: 14px; font-size: 10px; line-height: 1.65; }
.focus-notes .tips li { margin-bottom: 7px; }
.focus-notes .model-caps { gap: 5px; }
.focus-notes .cap-model { padding: 6px 7px; font-size: 10px; }
.focus-notes .cap-row { padding: 4px 7px; font-size: 10px; }

[data-theme="abyss"] {
  --bg: #070809;
  --bg-deep: #040506;
  --panel: rgba(13, 16, 18, .94);
  --panel-2: rgba(19, 24, 28, .94);
  --panel-solid: #0d1012;
  --line: #232b30;
  --line-strong: #3a4348;
  --text: #f5f8f8;
  --muted: #9aa7ab;
  --faint: #8a969d;
  --accent: #ff4f9a;
  --accent-2: #63e5ff;
  --accent-3: #ffb86b;
  --accent-soft: rgba(255, 79, 154, .13);
  --accent-2-soft: rgba(99, 229, 255, .1);
  --shadow: 0 20px 60px rgba(0, 0, 0, .3);
  --glow: 0 10px 28px rgba(0, 0, 0, .26);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Segoe UI Variable Display", "Segoe UI", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Mono", Consolas, monospace;
}
[data-theme="abyss"] body::before { background: linear-gradient(160deg, #040506, #070809); }
[data-theme="abyss"] body::after { display: none; }
[data-theme="abyss"] .sidebar { background: #0a0d0f; border-right-color: #232b30; backdrop-filter: none; }
[data-theme="abyss"] .brand { padding-bottom: 18px; }
[data-theme="abyss"] .brand-logo { width: 32px; height: 32px; border: 1px solid #2b353a; border-radius: 8px; box-shadow: none; }
[data-theme="abyss"] .brand-text b { font-size: 14px; letter-spacing: -.015em; }
[data-theme="abyss"] .brand-text span { font-size: 9px; letter-spacing: 1.35px; }
[data-theme="abyss"] .nav-label { display: none; }
[data-theme="abyss"] .mode-nav { gap: 5px; }
[data-theme="abyss"] .mode-btn { gap: 9px; padding: 9px 10px; border-radius: 8px; }
[data-theme="abyss"] .mode-btn:hover { background: rgba(255,255,255,.03); color: var(--text); transform: none; }
[data-theme="abyss"] .mode-btn.active { border-color: #2b353a; background: #14191d; box-shadow: none; }
[data-theme="abyss"] .mode-icon { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--accent); }
[data-theme="abyss"] .mode-icon svg { width: 17px; height: 17px; }
[data-theme="abyss"] .mode-btn.active .mode-icon { box-shadow: none; }
[data-theme="abyss"] .mode-text b { font-size: 12px; }
[data-theme="abyss"] .mode-text small { font-size: 9px; }
[data-theme="abyss"] .mode-arrow { font-size: 12px; }
[data-theme="abyss"] .basket { margin-top: 18px; padding-top: 14px; }
[data-theme="abyss"] .basket .section-head { padding: 0 4px; font-size: 10px; letter-spacing: .04em; }
[data-theme="abyss"] .basket-list { gap: 6px; padding: 0; }
[data-theme="abyss"] .basket-item { width: 50px; height: 50px; border-radius: 7px; }
[data-theme="abyss"] .basket-item.selected { box-shadow: 0 2px 8px rgba(0,0,0,.35); }
[data-theme="abyss"] .basket-item.selected::after { font-size: 8px; background: var(--accent); color: #0a0a0a; }
[data-theme="abyss"] .basket-item .ref-index { font-size: 9px; }
[data-theme="abyss"] .basket .hint { padding: 0 4px; font-size: 10px; }
[data-theme="abyss"] .sidebar-foot { gap: 4px; padding-top: 12px; }
[data-theme="abyss"] .ghost-btn { height: 32px; padding: 0 7px; border-radius: 6px; font-size: 11px; }
[data-theme="abyss"] .ghost-btn.compact { width: 30px; height: 30px; }
[data-theme="abyss"] .key-btn { height: 34px; padding: 0 8px; border-radius: 6px; font-size: 10px; }
[data-theme="abyss"] .main { width: min(100%, 1580px); padding: 20px 24px 48px; }
[data-theme="abyss"] .topbar { align-items: center; gap: 18px; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
[data-theme="abyss"] .eyebrow { display: none; }
[data-theme="abyss"] .title-block h1 { font-size: 24px; letter-spacing: -.03em; font-weight: 600; }
[data-theme="abyss"] .title-block p { margin-top: 5px; font-size: 11px; }
[data-theme="abyss"] .top-actions { gap: 6px; }
[data-theme="abyss"] .connection { height: 30px; padding: 0 9px; border-radius: 6px; background: transparent; font-size: 10px; }
[data-theme="abyss"] .workspace-grid { grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; }
[data-theme="abyss"] .card { border-color: #232b30; background: #0d1012; box-shadow: none; backdrop-filter: none; }
[data-theme="abyss"] .composer { padding: 20px; }
[data-theme="abyss"] .composer-head { margin-bottom: 14px; }
[data-theme="abyss"] .composer-head h2 { font-size: 18px; letter-spacing: -.025em; font-weight: 600; }
[data-theme="abyss"] .select-wrap { gap: 4px; min-width: 190px; }
[data-theme="abyss"] .select-wrap > span { font-size: 10px; letter-spacing: .02em; }
[data-theme="abyss"] select { height: 36px; border-radius: 6px; background-color: #14191d; font-size: 11px; }
[data-theme="abyss"] select:focus { box-shadow: 0 0 0 2px rgba(255,79,154,.18); }
[data-theme="abyss"] textarea,
[data-theme="abyss"] .prompt-editor { min-height: 120px; padding: 12px 13px 34px; border-radius: 8px; background: #090c0e; font-size: 12px; line-height: 1.65; }
[data-theme="abyss"] textarea:focus,
[data-theme="abyss"] .prompt-editor:focus { box-shadow: 0 0 0 2px rgba(255,79,154,.16); }
[data-theme="abyss"] .prompt-tools { right: 8px; bottom: 7px; gap: 4px; }
[data-theme="abyss"] .mini-btn { height: 26px; padding: 0 7px; border-radius: 5px; background: #14191d; font-size: 10px; }
[data-theme="abyss"] .ref-row { margin-top: 10px; }
[data-theme="abyss"] .ref-thumb { width: 60px; height: 62px; border-radius: 6px; }
[data-theme="abyss"] .ref-name { font-size: 10px; }
[data-theme="abyss"] .ref-index { font-size: 9px; }
[data-theme="abyss"] .add-ref { height: 32px; border-radius: 6px; font-size: 10px; }
[data-theme="abyss"] .param-grid { gap: 12px; margin-top: 16px; }
[data-theme="abyss"] .param > label { margin-bottom: 5px; font-size: 10px; letter-spacing: .02em; text-transform: none; }
[data-theme="abyss"] .segmented { gap: 4px; }
[data-theme="abyss"] .segmented button { min-width: 42px; height: 31px; border-radius: 6px; font-size: 11px; }
[data-theme="abyss"] .segmented button:hover { border-color: #4a555b; }
[data-theme="abyss"] .segmented button.active { border-color: #3a4348; background: #181d21; color: var(--text); box-shadow: none; }
[data-theme="abyss"] .composer-foot { margin-top: 18px; padding-top: 14px; }
[data-theme="abyss"] .status { font-size: 11px; }
[data-theme="abyss"] .queue-info { font-size: 10px; }
[data-theme="abyss"] .generate { height: 40px; padding: 0 14px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: #0a0a0a; font-size: 12px; font-weight: 700; box-shadow: none; }
[data-theme="abyss"] .generate:hover { filter: brightness(1.08); transform: none; box-shadow: none; }
[data-theme="abyss"] .generate svg { width: 15px; height: 15px; }
[data-theme="abyss"] .generate .price { background: rgba(0,0,0,.14); font-size: 11px; }
[data-theme="abyss"] .ref-block-head { font-size: 11px; }
[data-theme="abyss"] .empty span { font-size: 11px; }
[data-theme="abyss"] .hover-zoom { font-size: 11px; }
[data-theme="abyss"] .primary-btn { border-radius: 6px; background: var(--accent); color: #0a0a0a; }
[data-theme="abyss"] .results-section { margin-top: 20px; }
[data-theme="abyss"] .results-head { margin-bottom: 10px; }
[data-theme="abyss"] .results-head h3,
[data-theme="abyss"] .tasks-section h3 { font-size: 16px; letter-spacing: -.02em; }
[data-theme="abyss"] .results-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
[data-theme="abyss"] .result-card { border-color: #232b30; border-radius: 8px; background: #0d1012; box-shadow: none; }
[data-theme="abyss"] .result-card:hover { border-color: #3a4348; box-shadow: none; }
[data-theme="abyss"] .result-meta { padding: 9px 10px 10px; }
[data-theme="abyss"] .result-meta b { font-size: 11px; }
[data-theme="abyss"] .result-meta span { font-size: 10px; }
[data-theme="abyss"] .result-actions-bottom { margin-top: 8px; }
[data-theme="abyss"] .task-card { border-color: #232b30; border-radius: 8px; background: #0d1012; padding: 9px 11px; }
[data-theme="abyss"] .task-main b { font-size: 11px; }
[data-theme="abyss"] .task-main span { font-size: 10px; }
[data-theme="abyss"] .task-percent { font-size: 10px; }
[data-theme="abyss"] .side-title { font-size: 11px; }
[data-theme="abyss"] .tips { font-size: 10px; }
[data-theme="abyss"] .cap-row { font-size: 10px; }
[data-theme="abyss"] .hover-preview { border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
[data-theme="abyss"] .modal { border-radius: 10px; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
[data-theme="abyss"] .modal .eyebrow { display: none; }
[data-theme="abyss"] .modal-head h2 { font-size: 18px; letter-spacing: -.02em; }
[data-theme="abyss"] .field span { font-size: 10px; letter-spacing: .02em; }
[data-theme="abyss"] .theme-card { border-radius: 8px; }
[data-theme="abyss"] .theme-swatch { border-radius: 6px; }
[data-theme="abyss"] .basket-item.selected { border-color: var(--accent); }
[data-theme="abyss"] .result-check.on { background: var(--accent); border-color: var(--accent); color: #0a0a0a; }
[data-theme="abyss"] ::selection { background: var(--accent); color: #0a0a0a; }
[data-theme="abyss"] :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-theme="abyss"] textarea,
[data-theme="abyss"] input,
[data-theme="abyss"] [contenteditable="true"] { caret-color: var(--accent); }
[data-theme="abyss"] ::-webkit-scrollbar { width: 8px; height: 8px; }
[data-theme="abyss"] ::-webkit-scrollbar-track { background: transparent; }
[data-theme="abyss"] ::-webkit-scrollbar-thumb { border: 2px solid var(--bg); border-radius: 99px; background: #2b353a; }
[data-theme="abyss"] ::-webkit-scrollbar-thumb:hover { background: #3a4348; }
[data-theme="abyss"] .mode-text small,
[data-theme="abyss"] .basket .section-head,
[data-theme="abyss"] .select-wrap > span,
[data-theme="abyss"] .param > label,
[data-theme="abyss"] .mini-btn,
[data-theme="abyss"] .add-ref,
[data-theme="abyss"] .connection,
[data-theme="abyss"] .key-btn,
[data-theme="abyss"] .queue-info,
[data-theme="abyss"] .hint,
[data-theme="abyss"] .focus-empty span,
[data-theme="abyss"] .focus-foot,
[data-theme="abyss"] .focus-notes .tips,
[data-theme="abyss"] .result-meta span,
[data-theme="abyss"] .task-main span,
[data-theme="abyss"] .task-percent,
[data-theme="abyss"] .cap-row,
[data-theme="abyss"] .field span,
[data-theme="abyss"] .drawer-tabs button,
[data-theme="abyss"] .history-main span,
[data-theme="abyss"] .mini-stat,
[data-theme="abyss"] .cap-model { font-size: 11px; }
[data-theme="abyss"] .modal-copy { font-size: 12px; }
[data-theme="abyss"] .ref-block-head small { font-size: 10px; }

@media (max-width: 1100px) {
  .workspace-grid { grid-template-columns: 1fr; }
  [data-theme="abyss"] .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .side-card { position: static; }
  .focus-card { position: static; max-height: none; }
  .video-params { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hover-preview { right: 12px; width: min(300px, 34vw); }
}
@media (max-width: 820px) {
  .app { display: block; }
  .sidebar { position: static; width: 100%; height: auto; padding: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding-bottom: 12px; }
  .nav-label { display: none; }
  .mode-nav { flex-direction: row; }
  .mode-btn { flex: 1; }
  .basket { margin-top: 12px; padding-top: 12px; }
  .basket-list { max-height: 64px; }
  .sidebar-foot { flex-direction: row; flex-wrap: wrap; margin-top: 12px; }
  .key-btn { margin-left: auto; }
  .main { padding: 20px 14px 50px; }
  .topbar { align-items: flex-start; }
  .top-actions .connection { display: none; }
  .composer { padding: 16px; }
  .composer-head { flex-direction: column; }
  .select-wrap { width: 100%; min-width: 0; }
  .param-grid, .video-params { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .ref-blocks { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hover-preview { display: none !important; }
}
@media (max-width: 520px) {
  .results-grid { grid-template-columns: 1fr; }
  .composer-foot { align-items: stretch; flex-direction: column; }
  .generate { justify-content: center; }
  .param-grid, .video-params { grid-template-columns: 1fr; }
}

.focus-stage.is-empty .exposure-scale { display: none; }
