/* ============================================================
   灵感AI · 网页版样式
   基调：近乎全黑的底 + 白字 + 一点信号橙（取自 REC 灯）。
   层次靠留白、毛玻璃和发丝线，不靠发光和描边。
   ============================================================ */

/* 字体 / 圆角 / 品牌色 / 阴影 / 动效节奏统一在 tokens.css，这里只留主题差异 */

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #060708;
  --bg-2: #111316;
  --panel: rgba(255, 255, 255, 0.03);
  --panel-2: rgba(255, 255, 255, 0.05);
  --panel-solid: #0e1013;
  --foot: rgba(17, 19, 22, 0.86);
  --surface-2: rgba(255, 255, 255, 0.05);
  --surface-3: rgba(255, 255, 255, 0.09);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.17);
  --text: #f4f5f6;
  --text-2: #a9b0b8;
  --muted: #939ba5;
  --primary: #f4f5f6;
  --primary-ink: #0b0c0e;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #ff5a5a;
  --rec: #ff453a;
  --fx-rgb: 235 240 246;
  --fx-accent-rgb: 255 110 50;
  --arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a9b0b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f6;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, 0.66);
  --panel-2: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --foot: rgba(255, 255, 255, 0.88);
  --surface-2: rgba(16, 20, 24, 0.045);
  --surface-3: rgba(16, 20, 24, 0.08);
  --line: rgba(16, 20, 24, 0.08);
  --line-strong: rgba(16, 20, 24, 0.18);
  --text: #101215;
  --text-2: #4b525a;
  --muted: #66707b;
  --primary: #111316;
  --primary-ink: #ffffff;
  --ok: #0c8f63;
  --warn: #b26a00;
  --err: #d2322f;
  --rec: #e5352b;
  --fx-rgb: 30 34 40;
  --fx-accent-rgb: 232 86 28;
  --arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234b525a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
}

/* ---------------- 基础 ---------------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 var(--sans);
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: auto;
  transition: background-color var(--dur-slow) ease, color var(--dur-slow) ease;
}

h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: var(--ico-stroke); stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-2); background-clip: content-box; border: 3px solid transparent; }

.hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.muted { color: var(--muted); font-size: 13.5px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.spacer { flex: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ---------------- 按钮 ---------------- */
/* 主行动按钮：和生图、复刻两个控制台共用同一套规格（tokens.css 的 --cta-*） */
.primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--cta-gap);
  height: var(--cta-h);
  padding: var(--cta-pad);
  border: 0;
  border-radius: var(--cta-r);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: var(--cta-fs);
  font-weight: var(--cta-fw);
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px var(--accent-ring);
  transition: background var(--dur-fast) var(--ease), opacity var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.primary:hover:not(:disabled) { background: var(--brand-strong); }
.primary:active:not(:disabled) { transform: none; }
.primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.primary kbd {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 0;
  border: 0;
  opacity: 0.72;
}
.primary.small { height: 36px; padding: 0 14px; font-size: 12.5px; gap: 6px; }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 13.5px;
  white-space: nowrap;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.ghost-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.ghost-btn:disabled { opacity: 0.32; cursor: not-allowed; }

.ibtn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: transparent;
  color: var(--text-2);
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
.ibtn svg { width: 17px; height: 17px; }
.ibtn:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
a.ibtn { text-decoration: none; }
.icon-sun, .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: block; }

/* ---------------- 顶栏 ---------------- */
.app { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100vh; }

.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 68px;
  padding: 0 28px;
  animation: fade var(--dur-slow) ease both;
}
.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.mark { width: 26px; height: 26px; color: var(--accent); stroke-width: var(--ico-stroke); flex: none; }

/* 模块切换：一个分段控件，选中项是实心的 */
.tabs {
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.tab {
  position: relative;
  height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color var(--dur-slow) var(--ease), color var(--dur-slow) ease, box-shadow var(--dur-slow) ease;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.active { background: var(--primary); color: var(--primary-ink); font-weight: 600; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.7); }
.pending {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 8px;
  vertical-align: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.bar-right { justify-self: end; display: flex; align-items: center; gap: 8px; }
.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 280px;
  height: 38px;
  margin-right: 4px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-badge::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--muted); }
.model-badge.ok { color: var(--text-2); }
.model-badge.ok::before { background: var(--ok); box-shadow: 0 0 10px var(--ok); }

/* 顶栏右侧：当前账号与积分 */
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--text-2);
  white-space: nowrap;
}
.user-chip b { font-family: var(--mono); font-weight: 600; color: var(--accent); }
.user-chip i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.user-chip .u-sep { width: 1px; height: 12px; background: var(--line-strong); }
a.user-chip { text-decoration: none; transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease; }
a.user-chip:hover { border-color: var(--line-strong); color: var(--text); }
.pay-entry { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 999px; text-decoration: none; }

/* ---------------- 舞台 ---------------- */
.stage { flex: 1; min-height: 0; padding: 4px 28px 28px; }
.view { display: grid; grid-template-columns: 396px minmax(0, 1fr); gap: 20px; height: 100%; min-height: 0; }

/* 玻璃面板：粒子在后面透出一点 */
.glass {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  backdrop-filter: blur(22px) saturate(1.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: background-color var(--dur-slow) ease, border-color var(--dur-slow) ease;
}

/* 左：参数 */
.rail { display: flex; flex-direction: column; min-height: 0; overflow: hidden; animation: rise var(--dur-slow) var(--dur-fast) var(--ease) both; }
.rail-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 24px; }
.rail-head { padding: 26px 0 20px; }
.rail-head-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rail-head-top .ghost-btn { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: var(--r-sm); flex: none; }
.rail-head h1 { font-size: 28px; font-weight: 600; letter-spacing: 0.01em; line-height: 1.2; }
.rail-head p { margin-top: 6px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.group { padding: 18px 0 22px; border-top: 1px solid var(--line); }
.group-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.field-head label, .row3 label { font-size: 13.5px; color: var(--text-2); }

.type-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  text-align: left;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.type-toggle:hover, .type-toggle[aria-expanded="true"] { border-color: var(--line-strong); background: var(--surface-3); }
.tt-main { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.tt-main strong { font-size: 15px; font-weight: 600; }
/* 展开/收起：图标用 SVG，跟文字中线对齐，不再用字体里的上下标字符 */
.chev { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; line-height: 1; color: var(--muted); }
.chev svg { width: 12px; height: 12px; flex: none; transition: transform var(--dur-fast) var(--ease); }
.type-toggle[aria-expanded="true"] .chev svg { transform: rotate(180deg); }

.type-panel {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  animation: pop var(--dur-slow) var(--ease) both;
}
.tabs#catTabs { height: auto; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; padding: 0; border: 0; border-radius: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
#catTabs .tab { height: 28px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; color: var(--muted); }
#catTabs .tab.active { background: var(--surface-3); color: var(--text); box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease, background-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.chip:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: 600; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 32px;
  margin: 0;
  cursor: grab;
  /* --ratio：当前值在 min~max 之间的比例；填充画在输入框自己身上，
     百分比按整个宽度算，右端正好停在滑块圆心，不会和圆点错开 */
  --ratio: 0.4;
  --fill: calc(9px + (100% - 18px) * var(--ratio));
  background: linear-gradient(to right, var(--accent) var(--fill), var(--surface-3) var(--fill)) no-repeat center / 100% 4px;
  border-radius: 999px;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: transparent;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
  transition: transform var(--dur-fast) var(--ease);
}
input[type="range"]:active { cursor: grabbing; }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.18); }
input[type="range"]::-moz-range-track { height: 4px; background: transparent; border-radius: 999px; }
input[type="range"]::-moz-range-progress { height: 4px; background: transparent; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: 0; border-radius: 50%; background: #fff; }
/* 刻度按真实数值定位，30s 正好落在滑块圆心下方 */
.range-scale { position: relative; height: 14px; margin-top: 2px; font-family: var(--mono); font-size: 11px; line-height: 14px; color: var(--muted); }
.range-scale span { position: absolute; top: 0; left: 0; white-space: nowrap; transform: translateX(-50%); }

.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.row3 > div { min-width: 0; }
.row3 label { display: block; margin-bottom: 8px; }

select, .modal-card input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background-color: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: var(--arrow);
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}
select:hover, .modal-card input:hover { border-color: var(--line-strong); }
select:focus, .modal-card input:focus {
  outline: none;
  border-color: var(--accent);
  background-color: var(--panel-solid);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.dropzone {
  border: 1px dashed var(--line-strong);
  border-radius: var(--r);
  padding: 10px;
  background: var(--surface-2);
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs:empty { display: none; }
.thumbs > .hint { display: none; }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .idx {
  position: absolute; left: 4px; top: 4px; padding: 0 6px; border-radius: 5px;
  background: rgba(0, 0, 0, 0.7); color: #fff; font-family: var(--mono); font-size: 10.5px; line-height: 17px;
}
.thumb .del {
  position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 7px;
  background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 14px; line-height: 22px; opacity: 0;
  transition: opacity var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.thumb:hover .del { opacity: 1; }
.thumb .del:hover { background: var(--err); }
.dashed-btn { width: 100%; padding: 14px 10px; border: 0; background: transparent; color: var(--muted); font-size: 13.5px; transition: color var(--dur-fast) ease; }
.dashed-btn::before { content: "+ "; color: var(--accent); font-weight: 600; }
.dashed-btn:hover { color: var(--text); }

textarea {
  display: block;
  width: 100%;
  min-height: 150px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.75;
  resize: vertical;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
textarea::placeholder, .modal-card input::placeholder { color: var(--muted); opacity: 0.75; }
textarea:hover { border-color: var(--line-strong); }
textarea:focus { outline: none; border-color: var(--accent); background-color: var(--panel-solid); box-shadow: 0 0 0 4px var(--accent-ring); }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag {
  height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--text-2); font-size: 12.5px;
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.tag:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.rail-foot { padding: 16px 24px 18px; border-top: 1px solid var(--line); background: var(--foot); }
.rail-foot .primary { width: 100%; }
.status { min-height: 20px; margin-top: 10px; font-size: 13px; color: var(--muted); line-height: 1.5; word-break: break-word; }
.status.busy { color: var(--text-2); }
.status.err { color: var(--err); }
.busy-dot { display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--accent); vertical-align: 1px; animation: blink 1s steps(1) infinite; }

/* ---------------- 右：监视器 ---------------- */
.viewport {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  animation: rise var(--dur-slow) var(--dur-fast) var(--ease) both;
}
/* 空的时候不铺底色，让粒子大字直接立在页面上；有结果后铺底色保证脚本好读 */
.viewport:not(.has-result) { background: var(--panel-solid); -webkit-backdrop-filter: none; backdrop-filter: none; border: 1px solid var(--line); box-shadow: var(--shadow); }
.viewport.has-result { background: var(--panel-2); }

.vp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 16px;
}
.viewport.has-result .vp-head { border-bottom: 1px solid var(--line); }
.vp-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.vp-title h2 { font-size: 20px; font-weight: 600; letter-spacing: 0.01em; }
.rec { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; color: var(--rec); }
.rec i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: blink 0.9s steps(1) infinite; }
.rec b { margin-left: 4px; font-weight: 500; letter-spacing: 0.04em; color: var(--text-2); }
.vp-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }


/* 数据：大数字，一行读完 */
.datastrip {
  display: flex;
  align-items: flex-end;
  gap: 36px;
  margin: 18px 22px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  animation: rise var(--dur-slow) var(--ease) both;
}
.meta-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.meta-item:first-child { flex: 1 1 auto; }
.meta-item span { font-size: 12.5px; color: var(--muted); }
.meta-item strong { min-width: 0; font-size: 22px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta-item:nth-child(n + 2) strong { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.meta-item:first-child strong { font-size: 15px; font-weight: 500; padding-bottom: 3px; }

.script-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 22px 14px; }
.script-bar { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.count { font-family: var(--mono); font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.view-switch { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.mini-btn { height: 26px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-family: var(--mono); font-size: 12px; transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease; }
.mini-btn:hover { color: var(--text); }
.mini-btn.on { background: var(--primary); color: var(--primary-ink); }

.script-box {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 6px 8px 16px 0;
  outline: none;
  font-size: 14.5px; line-height: 1.9;
  caret-color: var(--accent); cursor: text;
  counter-reset: ln;
}
.script-line { position: relative; min-height: 1.9em; padding: 0 14px 0 58px; counter-increment: ln; border-radius: 6px; transition: background-color var(--dur-fast) ease; }
.script-box:not(:focus-within) .script-line:hover { background: var(--surface-2); }
.script-line::before {
  content: counter(ln, decimal-leading-zero);
  position: absolute; left: 0; width: 40px; text-align: right;
  font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); opacity: 0.45;
}
.script-line.tc { margin-top: 12px; font-family: var(--mono); font-weight: 600; color: var(--accent); }
.script-line.tc::before { color: var(--accent); opacity: 1; }
.script-line.sec { font-weight: 600; letter-spacing: 0.03em; margin-top: 4px; }
.fld { font-weight: 600; color: var(--text); }

.ref-chip {
  display: inline-flex; align-items: center; margin: 0 2px; padding: 0 7px;
  border: 1px solid var(--accent-ring); border-radius: 6px; background: var(--accent-soft); color: var(--accent);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.ref-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.shot-table { flex: 1; min-height: 0; overflow: auto; margin-top: 4px; }
.shot-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.shot-grid th {
  position: sticky; top: 0; z-index: 1; padding: 9px 12px;
  background: var(--panel-solid); border-bottom: 1px solid var(--line-strong); text-align: left;
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: 0.1em; color: var(--muted); white-space: nowrap;
}
.shot-grid td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.65; }
.shot-grid tbody tr { transition: background-color var(--dur-fast) ease; }
.shot-grid tbody tr:hover { background: var(--surface-2); }
.c-dur strong { display: block; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--accent); white-space: nowrap; }
.c-sec { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.c-ref { margin-left: 6px; font-family: var(--mono); font-size: 11px; color: var(--accent); white-space: nowrap; }
.c-scene { font-weight: 500; }
.c-act { margin-top: 2px; color: var(--text-2); font-size: 13px; }
.c-line-text { white-space: pre-wrap; }
.c-chars { display: inline-block; margin-top: 4px; font-family: var(--mono); font-size: 11px; color: var(--ok); }
.c-chars.over { color: var(--err); }
.c-mute { color: var(--muted); }
.c-sound, .c-cam { color: var(--text-2); }
.shot-table-empty { padding: 40px; text-align: center; color: var(--muted); }

/* 空状态：文字压在底部，中间留给粒子聚成的大字 */
.empty { position: absolute; left: 0; right: 0; bottom: 30px; padding: 0 20px; text-align: center; pointer-events: none; }
.empty p { font-size: 15px; font-weight: 500; color: var(--text-2); }
.empty span { display: block; margin-top: 3px; font-size: 13px; color: var(--muted); }
.viewport.is-busy .empty { visibility: hidden; }

/* ---------------- 筹备中的模块 ---------------- */
.view.placeholder { display: block; position: relative; }
.ph { position: absolute; left: 0; right: 0; top: 62%; text-align: center; animation: rise var(--dur-slow) var(--ease) both; }
.ph p { font-size: 14px; color: var(--text-2); }
.ph-badge {
  display: inline-block; margin-right: 10px; padding: 2px 10px;
  border: 1px solid var(--accent-ring); border-radius: 999px;
  font-family: var(--mono); font-size: 12px; color: var(--accent);
}
.ph .ghost-btn { margin-top: 22px; }

/* ---------------- 悬停预览 ---------------- */
.ref-preview { position: fixed; z-index: 60; width: 224px; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--panel-solid); pointer-events: none; }
.ref-preview img { display: block; width: 100%; max-height: 224px; object-fit: contain; background: #000; }
.ref-preview-cap { padding: 7px 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- 设置弹窗 ---------------- */
.modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: fade var(--dur-slow) ease both;
}
.modal-card {
  width: min(580px, 100%); max-height: calc(100vh - 48px); overflow-y: auto;
  padding: 30px 30px 24px; border: 1px solid var(--line-strong); border-radius: 22px;
  background: var(--panel-solid); box-shadow: var(--shadow);
  animation: rise var(--dur-slow) var(--ease) both;
}
.modal-card h3 { font-size: 22px; font-weight: 600; }
.modal-card .muted { margin-top: 6px; line-height: 1.7; }
.modal-card label { display: block; margin: 18px 0 7px; font-size: 13.5px; color: var(--text-2); }
.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.modal-actions .hint { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- 动效 ---------------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes blink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0.2; } }
@keyframes seg { from { opacity: 0; transform: scaleX(0.5); transform-origin: left; } to { opacity: 1; transform: none; } }
@keyframes video-scan { from { transform: translateY(0); } to { transform: translateY(480%); } }
@keyframes progress-sweep { 0% { transform: translateX(-110%); } 60% { transform: translateX(190%); } 100% { transform: translateX(300%); } }
@keyframes orbit-breathe { 0%, 100% { filter: drop-shadow(0 0 8px rgba(220,157,112,.08)); } 50% { filter: drop-shadow(0 0 18px rgba(220,157,112,.25)); } }
@keyframes status-pulse { 0%, 100% { opacity: .45; transform: scale(.82); } 50% { opacity: 1; transform: scale(1.12); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- 自适应 ---------------- */
@media (max-width: 1180px) {
  .view { grid-template-columns: 352px minmax(0, 1fr); }
  .model-badge { max-width: 160px; }
  .tab { padding: 0 14px; }
  .datastrip { gap: 24px; }
  .meta-item strong { font-size: 19px; }
}

@media (max-width: 960px) {
  .bar { grid-template-columns: auto 1fr auto; height: auto; padding: 12px 16px; gap: 10px; }
  .model-badge { display: none; }
  .brand span { display: none; }
  .stage { padding: 4px 16px 16px; overflow-y: auto; }
  /* 上下堆叠：参数按内容撑开，整页滚动 */
  .view { grid-template-columns: 1fr; height: auto; min-height: 100%; }
  .rail { min-height: max-content; }
  .rail-body { overflow: visible; }
  .viewport { min-height: 560px; }
  .viewport.has-result { min-height: 640px; }
  .datastrip { flex-wrap: wrap; gap: 16px 24px; }
  .meta-item:first-child { flex-basis: 100%; }
}

/* 原创视频工作台：脚本与成片操作保留在左侧创作区 */
.glass { background: var(--panel-solid); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: var(--shadow); }
.rail { border-color: var(--line); }
.viewport { border-radius: var(--r-lg); }
.viewport.has-result { border: 1px solid var(--line); }
.vp-head { flex: none; }
.script-wrap { position: relative; z-index: 1; }
.empty { top: 46%; bottom: auto; transform: translateY(-50%); color: var(--muted); }
.empty p { color: var(--text-2); font-size: 16px; }
.script-editor.is-busy .empty { visibility: hidden; }
.ref-media-group { padding-bottom: 4px; }
.media-ref-block { margin-top: 12px; }
.media-ref-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.media-ref-head b { color: var(--text-2); font-size: 12px; font-weight: 600; }
.media-ref-list { display: grid; gap: 5px; }
.media-ref-list:empty { display: none; }
.media-ref-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.media-ref-item > span { min-width: 0; overflow: hidden; color: var(--text-2); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
.media-ref-item small { margin-left: auto; color: var(--muted); font: 10.5px var(--mono); white-space: nowrap; }
.media-ref-remove, .media-ref-add { border: 0; background: transparent; color: var(--muted); font-size: 11px; }
.media-ref-remove:hover, .media-ref-add:hover:not(:disabled) { color: var(--accent); }
.media-ref-add { width: 100%; margin-top: 5px; padding: 8px; border: 1px dashed var(--line-strong); border-radius: 8px; text-align: center; }
.media-ref-add:disabled { opacity: .45; cursor: not-allowed; }
.dashed-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 素材入口保持在输入区上沿，点击后再展开弹层管理。 */
.asset-toolbar.dropzone {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.asset-toolbar.dropzone.drag { outline: 1px dashed var(--accent); outline-offset: 5px; background: transparent; }
.asset-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-solid);
  color: var(--text-2);
  font-size: 11px;
  white-space: nowrap;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.asset-chip:hover:not(:disabled), .asset-chip[aria-expanded="true"] { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.asset-chip:disabled { opacity: .7; cursor: default; }
.asset-chip svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--ico-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.asset-chip .asset-capacity { color: var(--muted); font: 9px var(--mono); }
.asset-chip i {
  width: 6px;
  height: 6px;
  margin-left: 1px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.asset-chip[aria-expanded="true"] i { transform: rotate(225deg) translate(-1px, -1px); }
.asset-inline-preview { display: flex; align-items: center; gap: 5px; margin: 0 0 7px; }
.asset-inline-preview[hidden] { display: none; }
.asset-upload-status { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; color: var(--text-2); font-size: 10px; }
.asset-upload-status[hidden] { display: none; }
.asset-upload-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.asset-upload-status.is-reading .asset-upload-dot { background: var(--accent); animation: status-pulse 1.2s ease-in-out infinite; }
.asset-upload-meter { flex: 1; min-width: 30px; height: 2px; overflow: hidden; border-radius: 99px; background: var(--line); }
.asset-upload-meter i { display: block; width: 0; height: 100%; background: var(--accent); transition: width var(--dur-fast) ease; }
.asset-popover-layer { position: fixed; inset: 0; z-index: 1001; pointer-events: none; }
.asset-popover {
  position: fixed;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  max-height: min(68vh, 430px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--panel-solid);
  box-shadow: 0 18px 46px rgba(13, 20, 29, .2), 0 2px 7px rgba(13, 20, 29, .08);
  pointer-events: auto;
  animation: asset-pop-in var(--dur-fast) ease-out;
}
.asset-popover[hidden] { display: none; }
@keyframes asset-pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.asset-popover-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.asset-popover-head > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.asset-popover-head strong { color: var(--text); font-size: 12px; font-weight: 600; }
.asset-popover-head span { color: var(--muted); font: 9px var(--mono); }
.asset-popover-close { flex: none; width: 25px; height: 25px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; }
.asset-popover-close:hover { background: var(--surface-2); color: var(--text); }
.asset-thumb-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; min-height: 54px; padding: 12px; overflow: auto; }
.asset-thumb-grid .thumb { width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 8px; }
.asset-thumb-grid .thumb .idx { left: 4px; top: 4px; padding: 0 4px; font-size: 8px; line-height: 15px; }
.asset-thumb-grid .thumb .del { right: 4px; top: 4px; width: 18px; height: 18px; font-size: 12px; line-height: 18px; opacity: 1; }
.asset-empty-note { grid-column: 1 / -1; padding: 15px 6px; color: var(--muted); font-size: 10px; text-align: center; }
.asset-popover-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border-top: 1px solid var(--line); background: var(--surface-2); }
.asset-popover-foot > span { min-width: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.asset-popover-add { flex: none; min-height: 30px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--panel-solid); color: var(--text-2); font-size: 10px; }
.asset-popover-add:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.asset-popover-add:disabled { opacity: .45; cursor: not-allowed; }
.asset-support-note { flex: none; margin: 0; padding: 9px 12px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.asset-popover .media-ref-list { flex: 1; min-height: 0; padding: 9px 10px; overflow: auto; }
.asset-popover .media-ref-item { padding: 8px; border-radius: var(--r-sm); }
.asset-popover .media-ref-remove { flex: none; padding: 4px 6px; border-radius: 5px; font-size: 10px; }
.asset-popover .media-ref-remove:hover { background: var(--surface-3); }
@media (max-width: 520px) {
  .asset-toolbar.dropzone { gap: 5px; }
  .asset-chip { min-height: 30px; gap: 4px; padding: 0 8px; font-size: 10px; }
  .asset-chip .asset-capacity { font-size: 8px; }
  .asset-inline-thumb { width: 36px; height: 36px; }
  .asset-popover { max-height: min(64vh, 390px); }
  .asset-thumb-grid { gap: 6px; padding: 9px; }
  .asset-popover-foot { align-items: flex-start; }
}
/* 原创视频工作台 */
.stage { padding: 8px 18px 18px; }
.view[data-view="original"] {
  width: min(100%, 1780px);
  margin: 0 auto;
  grid-template-columns: minmax(370px, 450px) minmax(420px, 1fr) minmax(170px, 215px);
  gap: 12px;
}
.creator-column { display: grid; grid-template-rows: minmax(340px,.95fr) minmax(275px,1.05fr); gap: 10px; min-width: 0; min-height: 0; }
.prompt-panel, .script-editor, .video-preview, .video-history {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}
.prompt-panel { display: flex; flex-direction: column; }
.prompt-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px 9px; border-bottom: 1px solid var(--line); }
.prompt-head > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.prompt-head h1 { flex: none; font-size: 16px; font-weight: 600; }
.prompt-head > div > span { overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.prompt-head .ghost-btn { flex: none; height: 29px; padding: 0 9px; font-size: 11px; }
.prompt-body { flex: 1; min-height: 0; overflow-y: auto; padding: 9px 13px 11px; }
.asset-toolbar { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin-bottom: 8px; }
.asset-control { display: grid; align-content: start; gap: 4px; min-width: 0; min-height: 39px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.asset-control-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 0; }
.asset-pick { min-width: 0; padding: 0; overflow: hidden; border: 0; background: transparent; color: var(--text-2); font-size: 10.5px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.asset-pick:hover:not(:disabled) { color: var(--text); }
.asset-pick:disabled { opacity: .45; cursor: not-allowed; }
.asset-capacity { flex: none; color: var(--muted); font: 9px var(--mono); white-space: nowrap; }
.asset-control .thumbs { display: flex; flex-wrap: wrap; gap: 4px; }
.asset-control .thumb { width: 34px; height: 34px; border-radius: 6px; }
.asset-control .media-ref-list { display: grid; gap: 3px; }
.asset-control .media-ref-item { padding: 3px 4px; border: 0; background: transparent; }
.asset-control .media-ref-item > span { font-size: 9.5px; }
.asset-control .media-ref-item small { font-size: 8px; }
.prompt-body textarea { width: 100%; min-height: 88px; height: 88px; padding: 10px 11px; border-radius: var(--r-sm); font-size: 12.5px; line-height: 1.65; resize: vertical; }
.prompt-body .quick { gap: 5px; margin-top: 6px; }
.prompt-body .tag { height: 24px; padding: 0 8px; border-radius: 7px; font-size: 10px; }
.composer-primary-controls { display: grid; grid-template-columns: minmax(0,1.18fr) minmax(62px,.58fr) minmax(92px,.9fr); align-items: end; gap: 6px; margin-top: 8px; }
.content-type-field { position: relative; min-width: 0; }
.content-type-field .type-toggle { height: 38px; padding: 0 9px; border-radius: 8px; }
.content-type-field .tt-main { gap: 5px; }
.content-type-field .tt-main strong { font-size: 11px; }
.content-type-field .tt-main .hint, .content-type-field .chev { font-size: 9px; }
.content-type-field .type-panel { max-height: 210px; overflow: auto; margin: 5px 0 0; padding: 8px; }
.type-panel.type-panel-floating { position: fixed; z-index: 1000; margin: 0; overflow: auto; overscroll-behavior: contain; border-color: var(--line-strong); background: var(--panel-solid); box-shadow: 0 16px 40px rgba(12,18,27,.22); }
.content-type-field .tabs#catTabs { gap: 3px; margin-bottom: 6px; }
.content-type-field #catTabs .tab { height: 24px; padding: 0 7px; font-size: 10px; }
.content-type-field .chip { height: 27px; padding: 0 8px; font-size: 10px; }
.composer-select { display: grid; gap: 3px; min-width: 0; color: var(--muted); font-size: 9px; }
.composer-select select { height: 32px; padding: 0 21px 0 7px; border-radius: 7px; font-size: 10px; }
.prompt-panel .primary, .script-editor .video-generate { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.prompt-panel .primary:hover:not(:disabled), .script-editor .video-generate:hover:not(:disabled) { background: var(--brand-strong); filter: none; }
.prompt-body > .status { max-height: 12px; min-height: 0; margin-top: 2px; overflow: hidden; font-size: 8px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.prompt-body > .status:empty { display: none; }

.script-editor { position: relative; display: flex; flex-direction: column; }
.script-workspace-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 8px; border-bottom: 1px solid var(--line); }
.script-workspace-head .vp-title { gap: 7px; }
.script-workspace-head .vp-title h2 { font-size: 14px; font-weight: 600; }
.script-workspace-head .hint { font-size: 10px; }
.script-workspace-head .vp-actions { gap: 4px; }
.script-workspace-head .vp-actions .ghost-btn { height: 26px; padding: 0 7px; font-size: 9.5px; }
.script-editor .datastrip { flex: none; flex-wrap: nowrap; align-items: center; gap: 8px; margin: 0 12px; padding: 5px 0; overflow: hidden; }
.script-editor .meta-item { flex-direction: row; align-items: baseline; gap: 4px; }
.script-editor .meta-item[hidden] { display: none; }
.script-editor .meta-item span { flex: none; font-size: 8px; }
.script-editor .meta-item strong { max-width: 90px; font-size: 10px; }
.script-editor .meta-item:first-child { flex: 1 1 auto; min-width: 0; }
.script-editor .meta-item:first-child strong { max-width: none; overflow: hidden; font-size: 10px; }
.script-editor .script-wrap { flex: 1; min-height: 0; padding: 0 12px 8px; }
.script-editor .script-bar { padding: 7px 0; }
.script-editor .script-box { flex: 1; min-height: 0; overflow: auto; font-size: 12px; line-height: 1.7; }
.script-editor .script-line { padding-left: 38px; }
.script-editor .script-line::before { width: 28px; }
.script-editor .empty { top: 48%; bottom: auto; display: grid; justify-items: center; gap: 4px; transform: translateY(-50%); }
.script-editor .empty strong { color: var(--text-2); font-size: 13px; font-weight: 500; }
.script-editor .empty span { color: var(--muted); font-size: 10px; }
.script-editor.is-busy .empty { visibility: hidden; }

.video-compose { flex: none; margin-top: auto; padding: 8px 11px 10px; border-top: 1px solid var(--line); background: var(--panel-solid); }
.video-compose[hidden] { display: none; }
.video-compose-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.video-compose-head strong { font-size: 11px; font-weight: 600; }
.video-quote { display: flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.video-quote b { color: var(--text); font: 600 14px/1 var(--mono); }
.video-quote > span { color: var(--muted); font-size: 9px; }
.video-quote.bad b { color: var(--err); }
.video-compose-controls { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(118px,1fr) minmax(92px,.9fr); align-items: end; gap: 6px; }
.video-control { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: var(--muted); font-size: 9px; }
.video-control select { width: 100%; height: 32px; padding: 0 21px 0 7px; border-radius: 7px; background-color: var(--bg-2); font-size: 10px; }
.video-generate { width: 100%; height: 32px; padding: 0 5px; border-radius: 7px; font-size: 10px; letter-spacing: 0; white-space: nowrap; }
.video-compose-status { min-height: 0; margin-top: 0; color: var(--muted); font-size: 9.5px; line-height: 1.35; }
.video-compose-status:not(:empty) { min-height: 13px; margin-top: 4px; }
.video-compose-status.err { color: var(--err); }
.video-compose-status.ok { color: var(--ok); }
.video-compose-status.busy { color: var(--text-2); }

.video-preview, .video-history { display: flex; flex-direction: column; }
.video-preview-head, .video-history-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; }
.video-preview-head h2, .video-history-head h2 { font-size: 14px; font-weight: 600; }
.video-preview-head span, .video-history-head > span { color: var(--muted); font: 10px var(--mono); }
.video-preview-head span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.video-preview-head span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #9aa3ad; }
.video-preview.is-generating .video-preview-head span::before, .video-preview.is-preparing .video-preview-head span::before { background: #ce8c61; animation: status-pulse 1.5s ease-in-out infinite; }
.video-preview.is-error .video-preview-head span::before { background: var(--err); }
.video-preview.has-video .video-preview-head span::before { background: var(--ok); }
.video-preview-screen { position: relative; flex: 1; display: grid; place-items: center; min-height: 220px; margin: 0 11px 11px; padding: 8px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #11151b; }
.preview-frame { position: relative; display: block; width: auto; height: 100%; max-width: 100%; max-height: 100%; aspect-ratio: 9 / 16; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 7px; background: #141a22; box-shadow: 0 10px 26px rgba(0,0,0,.24); }
.preview-frame::after { content: ""; position: absolute; inset: 0; z-index: 4; border: 1px solid rgba(255,255,255,.035); border-radius: inherit; pointer-events: none; }
.video-preview-empty { position: absolute; inset: 0; z-index: 1; overflow: hidden; color: #edf0f4; }
.preview-idle-image { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: linear-gradient(155deg,#202a32,#41433d 48%,#1b2426); }
.preview-idle-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview-idle-image img[hidden] { display: none; }
.preview-idle-image::before { content: ""; position: absolute; inset: 0; z-index: 1; opacity: .24; background: linear-gradient(180deg,rgba(255,255,255,.1),transparent 28%,rgba(0,0,0,.2)),repeating-linear-gradient(0deg,transparent 0 22px,rgba(255,255,255,.045) 23px); }
.preview-image-shade { position: absolute; inset: 30% 0 0; z-index: 2; background: linear-gradient(180deg,transparent 12%,rgba(7,10,13,.2) 42%,rgba(7,10,13,.82)); }
.preview-frame-index { position: absolute; z-index: 3; top: 10px; left: 10px; color: rgba(255,255,255,.76); font: 8px var(--mono); letter-spacing: .08em; }
.preview-empty-copy { position: absolute; z-index: 3; left: 10px; right: 10px; bottom: 17px; display: grid; gap: 5px; text-align: left; }
.preview-overline { color: rgba(231,236,241,.56); font: 8px var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.preview-empty-copy strong { color: #f4f5f7; font-size: 12px; font-weight: 500; }
.preview-empty-copy > span:last-child { color: rgba(235,239,244,.68); font-size: 9px; line-height: 1.5; }
.video-preview-screen video { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; object-fit: contain; background: #090c10; }
.video-preview-screen video[hidden] { display: none; }
.video-preview-meta { flex: none; padding: 0 13px 10px; color: var(--muted); font-size: 10px; }
.video-task-overlay { position: absolute; inset: 0; z-index: 2; display: grid; align-content: center; justify-items: stretch; gap: 10px; overflow: hidden; padding: 24px 18px; color: #edf0f4; background: rgba(13,18,24,.82); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.video-task-overlay[hidden], .video-preview-failure[hidden] { display: none; }
.video-scan-line { position: absolute; inset: -30% 0 auto; height: 24%; pointer-events: none; background: linear-gradient(180deg,transparent,rgba(208,155,117,.08),transparent); animation: video-scan 5s linear infinite; }
.task-overlay-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.task-overlay-head > span:last-child { color: #d7ae90; font: 11px var(--mono); }
.video-task-overlay > strong { position: relative; font-size: 14px; font-weight: 600; }
.preview-task-detail { position: relative; color: #a9b3be; font-size: 10px; line-height: 1.5; }
.video-progress-track { position: relative; width: 100%; height: 3px; margin: 3px 0; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.13); }
.video-progress-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: #d49a73; transition: width var(--dur-slow) ease; }
.video-progress-track[data-indeterminate] > span { width: 34%; animation: progress-sweep 1.8s ease-in-out infinite; }
.preview-task-steps { position: relative; display: flex; justify-content: space-between; gap: 8px; color: rgba(215,222,230,.4); font-size: 8px; }
.preview-task-steps span { position: relative; padding-top: 10px; }
.preview-task-steps span::before { content: ""; position: absolute; left: 0; top: 0; width: 4px; height: 4px; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; }
.preview-task-steps span.done, .preview-task-steps span.current { color: #e0b493; }
.preview-task-steps span.done::before, .preview-task-steps span.current::before { border-color: #d49a73; background: #d49a73; }
.preview-motion-label { position: relative; display: inline-flex; align-items: center; gap: 6px; color: #b7c0ca; font-size: 9px; }
.preview-motion-label i { width: 5px; height: 5px; border-radius: 50%; background: #d49a73; animation: status-pulse 1.5s ease-in-out infinite; }
.video-preview-failure { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; padding: 24px; color: #eff1f4; text-align: center; background: rgba(17,22,29,.94); }
.preview-failure-mark { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(222,131,108,.44); border-radius: 50%; color: #e19b86; font: 16px var(--mono); }
.video-preview-failure strong { font-size: 13px; font-weight: 600; }
.video-preview-failure p { max-width: 240px; margin: 0; color: #adb7c2; font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; }

.video-history { padding-bottom: 7px; }
.video-history-head { padding: 12px 11px 9px; }
.video-history-head h2 { font-size: 13px; }
.video-history-list { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 0 7px; overflow: auto; }
.video-history-card { display: flex; align-items: flex-start; gap: 6px; width: 100%; padding: 7px 5px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); text-align: left; }
.video-history-card:hover, .video-history-card.active { border-color: var(--line); background: var(--surface-2); }
.video-history-index { flex: none; padding-top: 2px; color: var(--muted); font: 9px var(--mono); }
.video-history-copy { display: grid; gap: 3px; min-width: 0; }
.video-history-copy b { overflow: hidden; font-size: 10px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.video-history-copy small { color: var(--muted); font-size: 8.5px; }
.video-history-prompt { display: -webkit-box; overflow: hidden; color: var(--text-2); font-size: 9px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.video-history-empty { padding: 16px 5px; color: var(--muted); font-size: 10px; text-align: center; }
.video-history-more { flex: none; margin: 7px 9px 0; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--text-2); font-size: 9px; }
@media (max-width: 1280px) and (min-width: 961px) {
  .view[data-view="original"] { grid-template-columns: minmax(360px,430px) minmax(340px,1fr) minmax(155px,185px); gap: 9px; }
  .prompt-head, .script-workspace-head { padding-right: 10px; padding-left: 10px; }
  .prompt-body { padding-right: 10px; padding-left: 10px; }
  .video-compose { padding-right: 9px; padding-left: 9px; }
  .video-compose-controls { grid-template-columns: minmax(0,1.15fr) minmax(110px,.95fr) minmax(86px,.9fr); gap: 5px; }
}
@media (max-width: 960px) {
  .stage { overflow: auto; }
  .view[data-view="original"] { width: 100%; height: auto; min-height: 0; grid-template-columns: minmax(0,1fr); }
  .creator-column { grid-template-rows: minmax(340px,auto) minmax(420px,auto); }
  .prompt-body { overflow: visible; }
  .script-editor { min-height: 450px; }
  .video-preview { min-height: 590px; }
  .video-preview-screen { min-height: 475px; }
  .video-history { max-height: 360px; }
  .video-history-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); align-content: start; }
}
@media (max-width: 520px) {
  .stage { padding: 8px; }
  .view[data-view="original"] { gap: 8px; }
  .creator-column { grid-template-rows: minmax(340px,auto) minmax(440px,auto); }
  .prompt-head > div { align-items: flex-start; flex-direction: column; gap: 1px; }
  .asset-toolbar { gap: 4px; }
  .asset-control { padding: 5px; }
  .asset-pick { font-size: 9.5px; }
  .asset-capacity { font-size: 8px; }
  .prompt-body textarea { min-height: 82px; height: 82px; }
  .composer-primary-controls { grid-template-columns: minmax(0,1.18fr) minmax(58px,.58fr) minmax(84px,.9fr); gap: 5px; }
  .video-preview { min-height: 520px; }
  .video-preview-screen { min-height: 405px; }
}

/* The prompt and its attachments share one stable input frame. */
.idea-composer.dropzone {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 142px;
  padding: 9px 10px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.idea-composer.dropzone:focus-within { border-color: var(--accent); background: var(--panel-solid); }
.idea-composer.dropzone.drag { border-color: var(--accent); background: var(--accent-soft); outline: 0; }
.idea-composer .asset-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.idea-composer .asset-chip { min-height: 28px; padding: 0 8px; font-size: 10px; }
.idea-composer .asset-chip svg { width: 13px; height: 13px; }
.idea-composer .asset-chip i { width: 5px; height: 5px; }
.asset-inline-preview { position: relative; width: max-content; min-height: 0; margin: 8px 0 2px; }
.asset-inline-preview[hidden] { display: none; }
.asset-image-stack {
  position: relative;
  display: block;
  width: 43px;
  height: 48px;
  margin: 0 5px 3px 2px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-solid);
  box-shadow: 2px 2px 0 var(--panel-solid), 3px 3px 0 var(--line-strong), 5px 5px 0 var(--panel-solid), 6px 6px 0 var(--line);
  cursor: pointer;
}
.asset-image-stack img { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.asset-image-count {
  position: absolute;
  top: -5px;
  left: -5px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  place-items: center;
  border: 1px solid var(--panel-solid);
  border-radius: 999px;
  background: #46505b;
  color: #fff;
  font: 9px/1 var(--mono);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
.asset-image-stack:hover { border-color: var(--accent); transform: translateY(-1px); }
.asset-upload-status { width: 100%; min-height: 14px; margin: 5px 0 1px; font-size: 9px; }
.asset-upload-meter { flex: none; width: 42px; }
.idea-composer textarea#idea {
  flex: 1;
  width: 100%;
  min-height: 66px;
  height: 66px;
  margin-top: 2px;
  padding: 5px 1px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  line-height: 1.6;
  resize: vertical;
}
.idea-composer textarea#idea:focus { border: 0; outline: 0; background: transparent; box-shadow: none; }
.asset-popover.image-ref-popover { max-height: min(68vh, 430px); }
@media (max-width: 520px) {
  .idea-composer.dropzone { min-height: 134px; padding: 8px; }
  .idea-composer .asset-toolbar { gap: 4px; }
  .idea-composer .asset-chip { min-height: 27px; padding: 0 7px; font-size: 9px; }
  .idea-composer textarea#idea { min-height: 62px; height: 62px; }
}

.duration-picker { position: relative; min-width: 0; }
.duration-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font: 10px var(--mono);
  white-space: nowrap;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.duration-trigger svg { flex: none; width: 11px; height: 11px; color: var(--muted); transition: transform var(--dur-fast) ease; }
.duration-trigger[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.duration-trigger[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--accent); }
.duration-trigger:disabled { opacity: .65; cursor: not-allowed; }
.duration-popover {
  position: fixed;
  z-index: 1102;
  display: grid;
  gap: 11px;
  width: 280px;
  padding: 14px 15px 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel-solid);
  box-shadow: 0 16px 40px rgba(12, 18, 27, .18), 0 2px 8px rgba(12, 18, 27, .06);
  animation: asset-pop-in var(--dur-fast) ease-out;
}
.duration-popover[hidden] { display: none; }
.duration-popover > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.duration-popover > header strong { color: var(--text); font-size: 12px; font-weight: 600; }
.duration-popover > header span { color: var(--muted); font: 9px var(--mono); }
.duration-current { display: flex; align-items: baseline; justify-content: center; gap: 4px; padding: 1px 0 0; }
.duration-current strong { color: var(--text); font: 500 30px/1.05 var(--sans); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.duration-current span { color: var(--muted); font-size: 10px; }
.duration-popover input[type="range"] { height: 24px; }
.duration-popover input[type="range"]:disabled { cursor: not-allowed; opacity: .5; }
.duration-range-ends { display: flex; justify-content: space-between; margin-top: -8px; color: var(--muted); font: 8px/1 var(--mono); }
.duration-presets { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.duration-presets button { height: 36px; padding: 0 4px; border: 1px solid transparent; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font: 10px var(--mono); transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, color var(--dur-fast) ease; }
.duration-presets button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-3); color: var(--text); }
.duration-presets button.active { border-color: var(--accent-ring); background: var(--accent-soft); color: var(--accent); }
.duration-presets button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 1280px) and (min-width: 961px) {
}
@media (max-width: 520px) {
  .duration-trigger { height: 32px; gap: 4px; padding: 0 7px; font-size: 9px; }
  .duration-popover { width: min(280px, calc(100vw - 24px)); padding: 13px; }
  .duration-presets { gap: 5px; }
  .duration-presets button { height: 34px; }
}

.composer-primary-controls {
  grid-template-columns: minmax(0,1.18fr) minmax(62px,.58fr) minmax(92px,.9fr);
  align-items: end;
  gap: 6px;
}
.composer-primary-controls .type-toggle { width: 100%; }
.composer-primary-controls .duration-picker { align-self: end; }
.composer-primary-controls #btnGenerate { width: 100%; height: 32px; padding: 0 8px; border-radius: 8px; font-size: 10px; white-space: nowrap; }
.composer-primary-controls #btnGenerate kbd { display: none; }
.video-compose-controls { grid-template-columns: minmax(0,1.2fr) minmax(118px,1fr) minmax(92px,.9fr); }
.video-output-control { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.video-control-label { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.video-output-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-2);
  color: var(--text-2);
  font-size: 10px;
  white-space: nowrap;
}
.video-output-trigger:hover, .video-output-trigger[aria-expanded="true"] { border-color: var(--line-strong); color: var(--text); }
.video-output-trigger span { overflow: hidden; text-overflow: ellipsis; }
.video-output-trigger svg { flex: none; width: 11px; height: 11px; color: var(--muted); transition: transform var(--dur-fast) ease; }
.video-output-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.video-output-popover {
  position: fixed;
  z-index: 1103;
  display: grid;
  gap: 15px;
  max-height: min(78vh, 440px);
  padding: 15px 16px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel-solid);
  box-shadow: 0 16px 40px rgba(12,18,27,.18), 0 2px 8px rgba(12,18,27,.06);
  animation: asset-pop-in var(--dur-fast) ease-out;
}
.video-output-popover[hidden] { display: none; }
.video-output-popover > header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.video-output-popover > header strong { color: var(--text); font-size: 13px; font-weight: 600; }
.video-output-popover > header span { color: var(--muted); font-size: 9px; }
.video-output-popover > section { display: grid; gap: 8px; }
.video-output-popover > section > label { color: var(--text-2); font-size: 10px; font-weight: 500; }
.video-ratio-options { display: grid; grid-template-columns: repeat(auto-fit,minmax(54px,1fr)); gap: 6px; }
.video-ratio-option {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 72px;
  padding: 7px 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font: 9px var(--mono);
}
.video-ratio-option:hover { border-color: var(--line-strong); background: var(--surface-3); }
.video-ratio-option.selected { border-color: var(--accent-ring); background: var(--accent-soft); color: var(--accent); }
.video-ratio-shape { display: block; max-width: 28px; max-height: 28px; border: 1px solid currentColor; border-radius: 5px; }
.video-resolution-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.video-resolution-option {
  min-width: 0;
  min-height: 36px;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 9px;
  white-space: nowrap;
}
.video-resolution-option:hover { border-color: var(--line-strong); background: var(--surface-3); }
.video-resolution-option.selected { border-color: var(--accent-ring); background: var(--accent-soft); color: var(--accent); }
@media (max-width: 1280px) and (min-width: 961px) {
  .composer-primary-controls { grid-template-columns: minmax(0,1.15fr) minmax(58px,.58fr) minmax(88px,.9fr); }
  .video-compose-controls { grid-template-columns: minmax(0,1.15fr) minmax(110px,.95fr) minmax(86px,.9fr); }
}
@media (max-width: 1100px) and (min-width: 961px) {
  .video-compose-controls { grid-template-columns: minmax(0,1.15fr) minmax(110px,.95fr) minmax(84px,.9fr); }
  .video-generate { height: 32px; }
}
@media (max-width: 520px) {
  .composer-primary-controls { grid-template-columns: minmax(0,1.18fr) minmax(58px,.58fr) minmax(84px,.9fr); gap: 5px; }
  .composer-primary-controls #btnGenerate { font-size: 9px; }
  .composer-language-row .composer-select { grid-template-columns: auto 112px; }
  .video-compose-controls { grid-template-columns: minmax(0,1fr) minmax(104px,.9fr); }
  .video-generate { grid-column: 1 / -1; height: 34px; }
  .video-output-popover { width: min(430px,calc(100vw - 24px)); padding: 13px; }
  .video-ratio-options { grid-template-columns: repeat(auto-fit,minmax(48px,1fr)); gap: 5px; }
  .video-ratio-option { min-height: 66px; }
}

/* 空白脚本编辑器只在脚本生成后出现，避免占出一整张空卡片。 */
.creator-column:not(.has-script) {
  grid-template-rows: minmax(340px,auto) minmax(170px,auto);
  align-content: start;
}
.creator-column:not(.has-script) .script-editor { min-height: 170px; }

/* Clearer type scale and stronger text contrast across the user workspace. */
.app { font-size: 15px; }
.app .hint, .app .muted { color: var(--text-2); font-size: 13px; font-weight: 500; }
.app .tab { font-size: 15px; font-weight: 500; }
.app .ghost-btn, .app .ibtn { font-size: 13px; }
.app .brand { font-size: 18px; }
.app .model-badge, .app .user-chip { font-size: 13px; }
.app .prompt-head h1 { font-size: 18px; }
.app .prompt-head > div > span { color: var(--text-2); font-size: 12.5px; font-weight: 500; }
.app .prompt-head .ghost-btn { height: 32px; padding: 0 11px; font-size: 13px; }
.app .asset-chip { min-height: 32px; gap: 7px; padding: 0 10px; font-size: 12px; font-weight: 500; }
.app .asset-chip .asset-capacity { color: var(--text-2); font-size: 10.5px; font-weight: 500; }
.app .asset-popover-head strong { font-size: 14px; }
.app .asset-popover-head span, .app .asset-support-note { color: var(--text-2); font-size: 11.5px; }
.app .asset-popover-foot > span { color: var(--text-2); font-size: 11px; }
.app .asset-popover-add { min-height: 34px; padding: 0 12px; font-size: 12px; }
.app .asset-empty-note { color: var(--text-2); font-size: 12px; }
.app .asset-upload-status { color: var(--text-2); font-size: 11px; }
.app .idea-composer textarea#idea { font-size: 14px; line-height: 1.65; }
.app .prompt-body .tag { height: 29px; padding: 0 10px; font-size: 12px; }
.app .content-type-field .type-toggle { height: 40px; padding: 0 11px; }
.app .content-type-field .tt-main strong { font-size: 13px; font-weight: 600; }
.app .content-type-field .tt-main .hint, .app .content-type-field .chev { color: var(--text-2); font-size: 11px; }
.app .content-type-field #catTabs .tab { height: 30px; padding: 0 10px; font-size: 12px; }
.app .content-type-field .chip { height: 32px; padding: 0 10px; font-size: 12px; }
.app .duration-trigger { height: 36px; padding: 0 10px; font-size: 12px; font-weight: 500; }
.app .duration-presets button { height: 38px; font-size: 12px; }
.app .composer-select { gap: 4px; color: var(--text-2); font-size: 11.5px; font-weight: 500; }
.app .composer-select select { height: 36px; padding-left: 9px; font-size: 12px; }
.app .composer-primary-controls {
  grid-template-columns: minmax(0,1.18fr) minmax(58px,.56fr) minmax(72px,.72fr) minmax(88px,.9fr);
  gap: 5px;
  margin-top: 9px;
}
.app .composer-primary-controls #btnGenerate { height: 36px; padding: 0 7px; font-size: 13px; font-weight: 600; }
.app .prompt-body > .status { max-height: 32px; font-size: 11.5px; line-height: 1.4; white-space: normal; }
.app .script-workspace-head .vp-title h2 { font-size: 16px; }
.app .script-workspace-head .hint { font-size: 12px; }
.app .script-workspace-head .vp-actions .ghost-btn { height: 30px; padding: 0 9px; font-size: 11.5px; }
.app .script-editor .meta-item span { color: var(--text-2); font-size: 10.5px; }
.app .script-editor .meta-item strong, .app .script-editor .meta-item:first-child strong { font-size: 12px; }
.app .script-editor .script-box { font-size: 14px; line-height: 1.75; }
.app .script-editor .script-line { padding-left: 42px; }
.app .script-editor .script-line::before { width: 32px; }
.app .script-editor .empty strong { font-size: 16px; font-weight: 600; }
.app .script-editor .empty span { color: var(--text-2); font-size: 12.5px; }
.app .video-compose-head strong { font-size: 13px; }
.app .video-quote > span { color: var(--text-2); font-size: 11.5px; }
.app .video-control, .app .video-control-label { color: var(--text-2); font-size: 11px; font-weight: 500; }
.app .video-control select, .app .video-output-trigger { height: 36px; padding: 0 10px; font-size: 12px; }
.app .video-generate { height: 36px; padding: 0 9px; font-size: 12px; font-weight: 600; }
.app .video-compose-status { color: var(--text-2); font-size: 11.5px; }
.app .video-preview-head h2, .app .video-history-head h2 { font-size: 16px; }
.app .video-preview-head span, .app .video-history-head > span { font-size: 11.5px; }
.app .preview-empty-copy strong { font-size: 14px; }
.app .preview-empty-copy > span:last-child { color: rgba(245,247,250,.82); font-size: 11.5px; }
.app .video-preview-meta, .app .preview-task-detail { font-size: 11.5px; }
.app .preview-task-steps { font-size: 10px; }
.app .preview-motion-label { font-size: 11px; }
.app .video-preview-failure p { font-size: 12px; }
.app .video-history-copy b { font-size: 12px; }
.app .video-history-copy small, .app .video-history-prompt, .app .video-history-empty, .app .video-history-more { font-size: 11px; }
.app .video-output-popover > header strong { font-size: 15px; }
.app .video-output-popover > header span, .app .video-output-popover > section > label { color: var(--text-2); font-size: 12px; }
.app .video-ratio-option { font-size: 11px; }
.app .video-resolution-option { font-size: 11.5px; }
@media (max-width: 520px) {
  .app .composer-primary-controls {
    grid-template-columns: minmax(0,1.1fr) minmax(54px,.5fr) minmax(64px,.64fr) minmax(80px,.82fr);
    gap: 4px;
  }
  .app .composer-primary-controls #btnGenerate { font-size: 11.5px; }
  .app .duration-trigger { padding: 0 7px; font-size: 11px; }
  .app .content-type-field .type-toggle { padding: 0 8px; }
  .app .content-type-field .tt-main { gap: 3px; }
  .app .content-type-field .tt-main strong { font-size: 12px; }
  .app .content-type-field .tt-main .hint, .app .content-type-field .chev { font-size: 10px; }
  .app .composer-select select { font-size: 11.5px; }
  .app .video-output-popover > section > label { font-size: 12px; }
}

/* ============================================================
   首屏模块落位：刷新 /app#edit 这类地址时，先用 html[data-boot-view]
   只显示目标模块，别让第一帧闪一下「原创视频」（标记由 js/boot-view.js 写入，
   app.js 的 switchView 接管后即撤掉）
   ============================================================ */
html[data-boot-view] .ws-main .view { display: none !important; }
html[data-boot-view="original"] .ws-main .view[data-view="original"] { display: grid !important; }
html[data-boot-view="edit"] .ws-main .view[data-view="edit"],
html[data-boot-view="remake"] .ws-main .view[data-view="remake"],
html[data-boot-view="director"] .ws-main .view[data-view="director"],
html[data-boot-view="image"] .ws-main .view[data-view="image"] { display: block !important; }
/* 复刻 / 导演 / 生图是整屏三栏，左边「内容类型」先别出来 */
html[data-boot-view="remake"] .ws-side,
html[data-boot-view="director"] .ws-side,
html[data-boot-view="image"] .ws-side { display: none !important; }
/* 顶栏选中态也先跟着 hash 走，省得亮错模块 */
html[data-boot-view="original"] .app .ws-tab[data-view="original"],
html[data-boot-view="remake"] .app .ws-tab[data-view="remake"],
html[data-boot-view="director"] .app .ws-tab[data-view="director"],
html[data-boot-view="edit"] .app .ws-tab[data-view="edit"],
html[data-boot-view="image"] .app .ws-tab[data-view="image"] { background: var(--text); color: var(--bg); }
