/* ==========================================================================
   三氏华丰贸易有限公司工作平台 —— 样式表
   ========================================================================== */

:root {
  --bg: #07080b;
  --bg-soft: #0a0c11;
  --panel: #0e1016;
  --panel-2: #12141c;
  --panel-3: #171a23;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e8eaf1;
  --text-dim: #a6abba;
  --muted: #717788;
  --accent: #4d7dff;
  --accent-soft: rgba(124, 92, 255, 0.16);
  --cyan: #43dcff;
  --warm: #ff9d5c;
  --ok: #38d39f;
  --danger: #ff5f73;
  --radius-lg: 22px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.85);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", ui-monospace, "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(124, 92, 255, 0.13), transparent 62%),
    radial-gradient(760px 480px at 88% 0%, rgba(42, 212, 238, 0.09), transparent 60%),
    radial-gradient(700px 600px at 60% 120%, rgba(255, 140, 90, 0.07), transparent 65%),
    var(--bg);
  overflow: hidden;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

::selection { background: rgba(124, 92, 255, 0.35); }

/* ------------------------------- 顶栏 ------------------------------- */

.topbar {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 13, 0.72);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 5;
}

.brand { display: flex; align-items: center; gap: 11px; }

.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(140deg, #8b6bff, #5a3bf0 55%, #43dcff);
  box-shadow: 0 6px 18px -6px rgba(124, 92, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: 0.06em; white-space: nowrap; }
.brand-text span {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
}

.topnav { display: flex; align-items: center; gap: 4px; margin-left: 6px; flex-wrap: nowrap; }

.topnav-item {
  appearance: none; border: 0; background: transparent; color: var(--muted); flex: none;
  font-family: inherit; font-size: 13px; padding: 7px 13px; border-radius: 9px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: color 0.18s, background 0.18s;
}
.topnav-item:hover { color: var(--text-dim); background: rgba(255, 255, 255, 0.04); }
.topnav-item.is-active { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.topnav-item .count {
  font-family: var(--mono); font-size: 10px; padding: 1px 5px; border-radius: 5px;
  background: rgba(255, 255, 255, 0.08); color: var(--text-dim);
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.mode-chip {
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  font-size: 12px; color: var(--text-dim);
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
}
.mode-chip .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--warm);
  box-shadow: 0 0 0 3px rgba(255, 157, 92, 0.16);
}
.mode-chip.live { color: #b7f6dd; border-color: rgba(56, 211, 159, 0.28); background: rgba(56, 211, 159, 0.08); }
.mode-chip.live .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(56, 211, 159, 0.18); animation: pulse 2.4s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ------------------------------- 按钮 ------------------------------- */

.btn {
  appearance: none; font-family: inherit; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 11px; border: 1px solid transparent;
  padding: 9px 14px; transition: all 0.18s ease; text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-ghost {
  color: var(--text-dim); background: rgba(255, 255, 255, 0.035); border-color: var(--line);
}
.btn-ghost:hover:not(:disabled) { color: var(--text); background: rgba(255, 255, 255, 0.075); border-color: var(--line-strong); }
.btn-ghost.danger:hover { color: #ffc4cc; border-color: rgba(255, 95, 115, 0.4); background: rgba(255, 95, 115, 0.1); }

.btn-primary {
  color: #fff; font-weight: 600; font-size: 14px; padding: 13px 18px;
  background: linear-gradient(135deg, #8a67ff, #6b45f5 52%, #4d2ee0);
  box-shadow: 0 12px 26px -12px rgba(110, 71, 255, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 18px 34px -14px rgba(110, 71, 255, 1); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary kbd {
  font-family: var(--mono); font-size: 10px; padding: 2px 5px; border-radius: 5px;
  background: rgba(0, 0, 0, 0.25); color: rgba(255, 255, 255, 0.7); margin-left: 4px;
}

.icon-btn {
  appearance: none; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim); width: 27px; height: 27px; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer; transition: all 0.16s;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.09); }

.link-btn {
  appearance: none; border: 0; background: none; color: var(--muted); font-family: inherit;
  font-size: 12px; cursor: pointer; padding: 2px 0;
}
.link-btn:hover { color: var(--text-dim); }

/* ------------------------------ 主体布局 ------------------------------ */

.workspace {
  height: calc(100vh - 62px);
  display: grid;
  grid-template-columns: 392px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 22px 20px;
  max-width: 1680px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

/* ------------------------------ 创作面板 ------------------------------ */

.console {
  background: linear-gradient(180deg, rgba(20, 22, 30, 0.92), rgba(11, 13, 18, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
  min-height: 0;
}

.console-scroll {
  overflow-y: auto;
  padding: 20px 20px 6px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
.console-scroll::-webkit-scrollbar { width: 8px; }
.console-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 8px; }
.console-scroll::-webkit-scrollbar-track { background: transparent; }

.field { padding-bottom: 22px; margin-bottom: 2px; }
.field + .field { border-top: 1px solid rgba(255, 255, 255, 0.05); padding-top: 18px; }

.field-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 11px; gap: 10px;
}
.field-head h2 {
  margin: 0; font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--text-dim); display: flex; align-items: center; gap: 8px;
}
.field-head h2 em {
  font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--muted);
  padding: 1px 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.05);
}
.field-head .opt {
  font-size: 10px; color: var(--muted); border: 1px solid var(--line);
  padding: 0 5px; border-radius: 4px; letter-spacing: 0;
}
.field-head .hint, .field-head .counter { font-size: 11px; color: var(--muted); }
.field-head .counter b { color: var(--text-dim); font-weight: 500; font-family: var(--mono); }
.field-head .value { font-size: 11px; color: var(--muted); }
.field-head .value b { color: var(--text); font-family: var(--mono); font-size: 13px; }

/* 提示词 */

.textarea-wrap {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(6, 7, 11, 0.6);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea-wrap:focus-within {
  border-color: rgba(124, 92, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12);
}

#prompt {
  width: 100%; border: 0; background: transparent; color: var(--text);
  font-family: inherit; font-size: 13.5px; line-height: 1.72;
  padding: 13px 14px 8px; resize: vertical; min-height: 116px; max-height: 280px;
  outline: none; display: block;
}
#prompt::placeholder { color: #575d6d; }

.prompt-tools {
  display: flex; gap: 6px; padding: 0 12px 10px; flex-wrap: wrap;
}
.chip-mini {
  appearance: none; font-family: inherit; font-size: 11px; cursor: pointer;
  color: var(--muted); background: rgba(255, 255, 255, 0.045);
  border: 1px solid transparent; border-radius: 7px; padding: 4px 9px;
  transition: all 0.16s;
}
.chip-mini:hover { color: #cfc4ff; background: var(--accent-soft); border-color: rgba(124, 92, 255, 0.3); }

.idea-row { display: flex; gap: 7px; margin-top: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.idea-row::-webkit-scrollbar { display: none; }
.idea {
  appearance: none; font-family: inherit; font-size: 11.5px; white-space: nowrap; cursor: pointer;
  color: var(--text-dim); background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px;
  transition: all 0.16s;
}
.idea:hover { color: #fff; border-color: rgba(124, 92, 255, 0.45); background: rgba(124, 92, 255, 0.13); }

/* 上传 */

.uploader {
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer; transition: all 0.18s; overflow: hidden; outline: none;
}
.uploader:hover, .uploader:focus-visible { border-color: rgba(124, 92, 255, 0.5); background: rgba(124, 92, 255, 0.055); }
.uploader.dragging { border-color: var(--accent); background: rgba(124, 92, 255, 0.12); }

.uploader-empty {
  display: flex; align-items: center; gap: 12px; padding: 15px 14px; color: var(--muted);
}
.uploader-empty svg { color: #8b7bff; flex: none; }
.uploader-empty strong { display: block; font-size: 12.5px; color: var(--text-dim); font-weight: 500; margin-bottom: 3px; }
.uploader-empty span { font-size: 11px; color: var(--muted); }

.uploader-filled { display: flex; align-items: center; gap: 12px; padding: 10px; }
.uploader-filled img { width: 62px; height: 44px; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); }
.uploader-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.uploader-meta span { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploader-meta small { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }

/* 模型 */

.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* 折叠式模型选择 */
.model-collapse { border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,0.025); overflow: hidden; }
.model-collapse.open { border-color: rgba(124, 92, 255, 0.5); }
.model-toggle {
  appearance: none; width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 9px 11px; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; color: var(--text); text-align: left;
}
.model-toggle:hover { background: rgba(124, 92, 255, 0.07); }
.model-toggle .mt-cur { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.model-toggle .mt-cur small { font-size: 9px; color: var(--muted); letter-spacing: 0.05em; }
.model-toggle .mt-cur strong { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-toggle .mt-chev { flex: none; color: var(--muted); transform: rotate(90deg); transition: transform 0.18s; }
.model-collapse.open .model-toggle .mt-chev { transform: rotate(-90deg); }
.model-panel { padding: 8px; border-top: 1px solid var(--line); }

/* 生成按钮上的积分消耗 */
.btn-cost {
  font-size: 11px; font-weight: 600; color: #ffd48a;
  background: rgba(255, 190, 90, 0.12); border: 1px solid rgba(255, 190, 90, 0.3);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.btn-primary:disabled .btn-cost { opacity: 0.55; }
.btn-cost.free { color: #7ee2a8; background: rgba(80, 220, 150, 0.1); border-color: rgba(80, 220, 150, 0.3); }

.model-card {
  appearance: none; text-align: left; font-family: inherit; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025);
  border-radius: 11px; padding: 10px 11px; color: var(--text-dim);
  transition: all 0.18s; position: relative; overflow: hidden;
}
.model-card strong { display: block; font-size: 12.5px; color: var(--text); font-weight: 600; margin-bottom: 3px; }
.model-card span { font-size: 10.5px; color: var(--muted); display: block; line-height: 1.4; }
.model-card em {
  position: absolute; top: 8px; right: 9px; font-style: normal; font-size: 9px;
  padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); color: var(--text-dim);
  letter-spacing: 0.04em;
}
.model-card:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }
.model-card.active {
  border-color: rgba(124, 92, 255, 0.65);
  background: linear-gradient(150deg, rgba(124, 92, 255, 0.2), rgba(124, 92, 255, 0.06));
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.18);
}
.model-card.active em { background: rgba(255, 255, 255, 0.16); color: #fff; }

/* 画幅 */

.ratio-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }

.ratio {
  appearance: none; font-family: inherit; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025);
  border-radius: 9px; padding: 9px 0 6px; display: flex; flex-direction: column;
  align-items: center; gap: 6px; color: var(--muted); transition: all 0.16s;
}
.ratio i {
  display: block; width: var(--w); height: var(--h);
  border: 1.5px solid currentColor; border-radius: 2.5px; opacity: 0.75;
}
.ratio span { font-size: 9.5px; font-family: var(--mono); letter-spacing: -0.02em; }
.ratio:hover { color: var(--text-dim); border-color: var(--line-strong); }
.ratio.active {
  color: #cfc4ff; border-color: rgba(124, 92, 255, 0.7);
  background: rgba(124, 92, 255, 0.15);
}
.ratio.active i { opacity: 1; }

/* 时长滑杆 */

.range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) var(--pct, 10%), rgba(255, 255, 255, 0.1) var(--pct, 10%));
  outline: none; cursor: pointer; margin: 6px 0 8px;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: #fff; border: 3px solid #6b45f5; cursor: grab;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.range::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #6b45f5; cursor: grab;
}
.range-scale {
  display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); font-family: var(--mono);
}

/* 分辨率 */

.segment {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
  border-radius: 10px; padding: 3px;
}
.segment button {
  appearance: none; font-family: var(--mono); font-size: 11px; cursor: pointer;
  border: 0; background: transparent; color: var(--muted); border-radius: 7px;
  padding: 7px 0; transition: all 0.16s;
}
.segment button:hover:not(:disabled) { color: var(--text-dim); background: rgba(255, 255, 255, 0.05); }
.segment button.active { color: #fff; background: rgba(124, 92, 255, 0.55); box-shadow: 0 2px 10px -3px rgba(124, 92, 255, 0.8); }
.segment button:disabled { opacity: 0.3; cursor: not-allowed; }

/* 开关 */

.toggles { display: flex; flex-direction: column; gap: 2px; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; cursor: pointer;
}
.switch-row strong { display: block; font-size: 12.5px; font-weight: 500; color: var(--text-dim); margin-bottom: 2px; }
.switch-row small { font-size: 10.5px; color: var(--muted); }
.switch-row input { display: none; }
.switch {
  width: 38px; height: 21px; border-radius: 999px; background: rgba(255, 255, 255, 0.12);
  position: relative; transition: background 0.2s; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px;
  border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.switch-row input:checked + .switch { background: #6b45f5; }
.switch-row input:checked + .switch::after { transform: translateX(17px); }

/* 面板底部 */

.console-foot {
  padding: 13px 18px 17px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(11, 13, 18, 0.4), rgba(11, 13, 18, 0.96));
}
.cost-hint {
  font-size: 10.5px; color: var(--muted); margin-bottom: 9px; font-family: var(--mono);
  display: flex; align-items: center; gap: 6px;
}
.cost-hint::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.console-foot .btn-primary { width: 100%; }
/* 底部按钮组：生成 + 提示词拆解 并排 */
.foot-actions { display: flex; gap: 10px; align-items: stretch; }
.foot-actions .btn-primary { flex: 1; width: auto; }
.foot-actions .btn-ghost { white-space: nowrap; }

/* ------------------------- 提示词拆解弹窗 ------------------------- */
.pd-sub { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin: 0 0 12px; }
.pd-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--line); border-radius: 12px; padding: 22px 16px;
  cursor: pointer; text-align: center; transition: border-color 0.15s, background 0.15s;
  color: var(--fg);
}
.pd-drop:hover, .pd-drop.drag { border-color: var(--accent); background: rgba(94, 130, 255, 0.06); }
.pd-drop svg { opacity: 0.6; }
.pd-drop b { font-size: 13px; }
.pd-drop span { font-size: 11px; color: var(--muted); }
.pd-preview { margin-top: 12px; }
.pd-preview img, .pd-preview video { max-width: 100%; max-height: 240px; border-radius: 10px; display: block; background: #000; }
.pd-frames { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pd-frames img { width: 84px; height: 47px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.pd-frame-hint { font-size: 11px; color: var(--muted); margin: 6px 0 0; }
.pd-model-row { margin-top: 12px; }
.pd-model-row .fl { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.pd-warn { font-size: 12px; color: #ffb37a; margin: 10px 0 0; line-height: 1.6; }
.pd-result { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pd-result-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: rgba(94, 130, 255, 0.08); }
.pd-result-head b { font-size: 12.5px; }
.pd-result-body { margin: 0; padding: 12px; font-size: 12.5px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto; font-family: inherit; color: var(--fg); }
.pd-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.pd-cost { margin-right: auto; align-self: center; font-size: 12.5px; color: var(--b-dim, #9aa7c0); }

/* -------------------------------- 舞台 -------------------------------- */

.studio { display: flex; flex-direction: column; gap: 15px; min-height: 0; min-width: 0; }

.stage-shell {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(18, 20, 28, 0.85), rgba(9, 10, 15, 0.95));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.stage-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px; border-bottom: 1px solid var(--line); gap: 12px;
}
.stage-title { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.rec-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #ff4d61;
  box-shadow: 0 0 0 3px rgba(255, 77, 97, 0.14);
}
.stage-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.stage-tags span {
  font-size: 10px; font-family: var(--mono); color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px;
  background: rgba(255, 255, 255, 0.025);
}

.stage {
  flex: 1; min-height: 0; position: relative;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(124, 92, 255, 0.07), transparent 65%),
    #05060a;
  overflow: hidden;
}
.stage::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 20%, transparent 78%);
}

/* 空状态 */

.stage-empty { position: relative; z-index: 1; text-align: center; padding: 30px; width: 100%; height: 100%; display: grid; place-items: center; }
.aurora {
  position: absolute; inset: -20%;
  background:
    radial-gradient(38% 30% at 30% 35%, rgba(124, 92, 255, 0.35), transparent 70%),
    radial-gradient(34% 26% at 70% 60%, rgba(42, 212, 238, 0.24), transparent 70%),
    radial-gradient(30% 24% at 50% 80%, rgba(255, 157, 92, 0.2), transparent 70%);
  filter: blur(46px); opacity: 0.75;
  animation: drift 16s ease-in-out infinite alternate;
}
@keyframes drift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); }
  50% { transform: translate3d(2%, 2%, 0) scale(1.08); }
  100% { transform: translate3d(-1%, 1%, 0) scale(1.03); }
}
.empty-inner { position: relative; z-index: 1; max-width: 430px; }
.empty-icon {
  width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 16px;
  display: grid; place-items: center; color: #cfc4ff;
  background: rgba(124, 92, 255, 0.14);
  border: 1px solid rgba(124, 92, 255, 0.3);
  box-shadow: 0 16px 40px -18px rgba(124, 92, 255, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}
.empty-inner h3 { margin: 0 0 9px; font-size: 19px; font-weight: 600; letter-spacing: 0.02em; }
.empty-inner p { margin: 0; font-size: 12.5px; line-height: 1.75; color: var(--muted); }

/* 生成中 */

.stage-loading {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  align-items: center; gap: 18px; padding: 26px; width: 100%;
}
.scan {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(124, 92, 255, 0.09) 46%, rgba(42, 212, 238, 0.14) 50%, rgba(124, 92, 255, 0.09) 54%, transparent 100%);
  animation: scan 3.6s linear infinite;
}
@keyframes scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
.ring { position: relative; width: 120px; height: 120px; }
.ring svg { transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 6; }
.ring-fill {
  fill: none; stroke: url(#ringGrad); stroke: #8b6bff; stroke-width: 6;
  stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327;
  transition: stroke-dashoffset 0.7s cubic-bezier(0.3, 0.8, 0.3, 1);
  filter: drop-shadow(0 0 8px rgba(124, 92, 255, 0.75));
}
.ring-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 1px; font-family: var(--mono);
}
.ring-label b { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; }
.ring-label span { font-size: 11px; color: var(--muted); align-self: flex-end; margin-bottom: 34px; }

.loading-text { text-align: center; display: flex; flex-direction: column; gap: 5px; }
.loading-text strong { font-size: 15px; font-weight: 600; letter-spacing: 0.03em; }
.loading-text span { font-size: 12px; color: var(--text-dim); }
.loading-text em { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

.steps { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 2px; }
.steps span {
  font-size: 10.5px; color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px; transition: all 0.3s;
}
.steps span.done { color: #9fe8cd; border-color: rgba(56, 211, 159, 0.3); background: rgba(56, 211, 159, 0.08); }
.steps span.current {
  color: #c8dbff; border-color: rgba(124, 92, 255, 0.6); background: rgba(124, 92, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.08);
}

/* 结果 */

.stage-result { position: relative; width: 100%; height: 100%; display: grid; place-items: center; background: #000; }
#player { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.play-overlay {
  position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.55));
  color: #fff; transition: opacity 0.25s; backdrop-filter: blur(1px);
}
.play-overlay svg {
  width: 62px; height: 62px; padding: 17px 15px 17px 21px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(8px);
}
.play-overlay.hide { opacity: 0; pointer-events: none; }

/* 失败 */

.stage-error { position: relative; z-index: 1; text-align: center; padding: 30px; max-width: 440px; }
.err-icon {
  width: 46px; height: 46px; margin: 0 auto 16px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; font-weight: 700;
  color: #ffc4cc; background: rgba(255, 95, 115, 0.14); border: 1px solid rgba(255, 95, 115, 0.35);
}
.stage-error h3 { margin: 0 0 8px; font-size: 16px; }
.stage-error p { margin: 0 0 16px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }

/* 舞台底部 */

.stage-foot {
  border-top: 1px solid var(--line);
  padding: 11px 16px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  min-height: 52px;
  background: rgba(8, 9, 13, 0.5);
}
.result-meta { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; flex: 1; }
.result-meta .pill {
  font-size: 10.5px; font-family: var(--mono); color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 7px;
  background: rgba(255, 255, 255, 0.025);
}
.result-meta .pill.accent { color: #cfc4ff; border-color: rgba(124, 92, 255, 0.35); background: rgba(124, 92, 255, 0.1); }
.result-meta .placeholder { font-size: 11.5px; color: #5f6575; }
.result-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.result-actions .btn { font-size: 11.5px; padding: 7px 11px; border-radius: 9px; }

/* ------------------------------- 作品库 ------------------------------- */

.filmstrip-wrap {
  flex: none;
  background: rgba(14, 16, 22, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 13px 16px 14px;
}
.filmstrip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.filmstrip-head h2 {
  margin: 0; font-size: 12px; font-weight: 600; color: var(--text-dim);
  letter-spacing: 0.04em; display: flex; align-items: center; gap: 7px;
}
.filmstrip-head h2 span {
  font-family: var(--mono); font-size: 10px; color: var(--muted);
  background: rgba(255, 255, 255, 0.06); padding: 1px 6px; border-radius: 5px;
}

.filmstrip {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; min-height: 74px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
.filmstrip::-webkit-scrollbar { height: 5px; }
.filmstrip::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.13); border-radius: 5px; }
.film-empty { font-size: 11.5px; color: #5c6272; padding: 24px 2px; }

.work {
  flex: none; width: 132px; cursor: pointer; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025);
  overflow: hidden; transition: all 0.18s; position: relative; text-align: left;
  padding: 0; font-family: inherit; color: inherit;
}
.work:hover { border-color: rgba(124, 92, 255, 0.5); transform: translateY(-2px); }
.work.active { border-color: rgba(124, 92, 255, 0.8); box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.16); }
.work-thumb {
  height: 74px; background: #0a0b10 center/cover no-repeat;
  display: grid; place-items: center; position: relative; overflow: hidden;
}
.work-thumb video, .work-thumb img { width: 100%; height: 100%; object-fit: cover; }
.work-thumb .ph { color: #4a4f5e; }
.work-thumb .badge {
  position: absolute; top: 4px; left: 4px; font-size: 8.5px; font-family: var(--mono);
  padding: 1px 4px; border-radius: 3px; background: rgba(0, 0, 0, 0.6); color: #d6d9e3;
  backdrop-filter: blur(4px);
}
.work-thumb .badge.demo { color: #ffd2ac; }
.work-thumb .badge.err { color: #ffb5bf; }
.work-thumb .badge.run { color: #cfc4ff; }
.work-info { padding: 6px 8px 7px; }
.work-info p {
  margin: 0 0 3px; font-size: 10.5px; line-height: 1.35; color: var(--text-dim);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.work-info small { font-size: 9.5px; color: var(--muted); font-family: var(--mono); }

/* ------------------------------- 弹窗 ------------------------------- */

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(3, 4, 7, 0.72); backdrop-filter: blur(8px); }
.modal-card {
  position: relative; width: 100%; max-width: 468px;
  background: linear-gradient(180deg, #14161f, #0c0e14);
  border: 1px solid var(--line-strong); border-radius: 20px;
  box-shadow: 0 40px 100px -30px #000;
  animation: modalIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
  max-height: 90vh; overflow: auto;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.modal-card header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px 18px 14px; border-bottom: 1px solid var(--line);
}
.modal-card h3 { margin: 0; font-size: 14.5px; font-weight: 600; letter-spacing: 0.02em; }
.modal-body { padding: 16px 18px 20px; }
.modal-note { margin: 0 0 15px; font-size: 11.5px; line-height: 1.7; color: var(--muted); }
.modal-note code {
  font-family: var(--mono); font-size: 10.5px; background: rgba(255, 255, 255, 0.07);
  padding: 1px 5px; border-radius: 4px; color: #cfc4ff;
}
.modal-label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 7px; letter-spacing: 0.04em; }
.key-row { display: flex; gap: 7px; }
.key-row input {
  flex: 1; min-width: 0; font-family: var(--mono); font-size: 12.5px;
  background: rgba(5, 6, 10, 0.75); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; color: var(--text); outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.key-row input:focus { border-color: rgba(124, 92, 255, 0.6); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.12); }
.modal-actions { display: flex; gap: 8px; margin-top: 12px; }
.key-status { font-size: 11.5px; margin-top: 10px; min-height: 16px; color: var(--muted); }
.key-status.ok { color: #8ee9c6; }
.key-status.bad { color: #ffb0bb; }
.modal-steps {
  margin: 16px 0 0; padding-left: 17px; font-size: 11.5px; line-height: 1.85; color: var(--text-dim);
}
.modal-steps a { color: #b3a2ff; text-decoration: none; border-bottom: 1px dashed rgba(179, 162, 255, 0.4); }
.modal-warn {
  margin: 15px 0 0; font-size: 11px; line-height: 1.7; color: #ffcfb0;
  background: rgba(255, 157, 92, 0.08); border: 1px solid rgba(255, 157, 92, 0.22);
  border-radius: 10px; padding: 9px 11px;
}

/* -------------------------------- Toast -------------------------------- */

.toasts {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  font-size: 12.5px; color: var(--text); background: rgba(24, 26, 36, 0.96);
  border: 1px solid var(--line-strong); border-radius: 11px; padding: 9px 15px;
  box-shadow: 0 16px 40px -14px #000; animation: toastIn 0.22s ease;
  backdrop-filter: blur(10px); max-width: 90vw;
}
.toast.ok { border-color: rgba(56, 211, 159, 0.4); color: #c6f7e3; }
.toast.err { border-color: rgba(255, 95, 115, 0.4); color: #ffc9d0; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.toast.out { opacity: 0; transform: translateY(6px); transition: all 0.2s; }

/* ------------------------------- 响应式 ------------------------------- */

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 352px minmax(0, 1fr); padding: 14px; gap: 14px; }
  .ratio-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 960px) {
  body { overflow: auto; }
  .workspace { grid-template-columns: 1fr; height: auto; }
  .topbar { gap: 14px; padding: 0 14px; }
  .topnav { display: none; }
  .console { max-height: none; }
  .console-scroll { overflow: visible; }
  .stage-shell { min-height: 60vh; }
  .stage { min-height: 300px; }
  .stage-foot { padding: 10px 13px; }
}

@media (max-width: 560px) {
  .brand-text span { display: none; }
  .mode-chip span { display: none; }
  .btn-ghost span { display: inline; }
  .model-grid { grid-template-columns: 1fr; }
  .ratio-grid { grid-template-columns: repeat(3, 1fr); }
  .field-head .hint { display: none; }
}

/* hidden 属性优先于布局类，避免被 display:grid/flex 覆盖 */
[hidden] { display: none !important; }

/* ==========================================================================
   v2 新增：积分 / 资产管理 / 模式切换 / 设置面板
   ========================================================================== */

/* 顶栏积分 */
.credit-pill {
  appearance: none; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 8px 6px 11px; border-radius: 999px;
  border: 1px solid rgba(255, 157, 92, 0.28);
  background: linear-gradient(135deg, rgba(255, 157, 92, 0.16), rgba(255, 157, 92, 0.06));
  color: #ffd9bd; font-size: 12.5px; transition: all 0.18s;
}
.credit-pill svg { color: #ffb37a; }
.credit-pill b { font-family: var(--mono); font-size: 13px; font-weight: 600; color: #ffe7d5; }
.credit-pill .plus {
  font-size: 10.5px; padding: 3px 8px; border-radius: 999px;
  background: rgba(255, 157, 92, 0.22); color: #ffd0ad;
}
.credit-pill:hover { border-color: rgba(255, 157, 92, 0.55); background: linear-gradient(135deg, rgba(255, 157, 92, 0.24), rgba(255, 157, 92, 0.1)); }

/* 模式切换 */
.mode-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line);
  border-radius: 13px; padding: 4px; margin-bottom: 20px;
}
.mode-tab {
  appearance: none; font-family: inherit; cursor: pointer; border: 1px solid transparent;
  background: transparent; border-radius: 10px; padding: 8px 6px 7px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); transition: all 0.18s;
}
.mode-tab svg { opacity: 0.8; }
.mode-tab b { font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; }
.mode-tab small { font-size: 9.5px; opacity: 0.75; }
.mode-tab:hover { color: var(--text-dim); background: rgba(255, 255, 255, 0.04); }
.mode-tab.is-active {
  color: #fff; border-color: rgba(124, 92, 255, 0.6);
  background: linear-gradient(150deg, rgba(124, 92, 255, 0.28), rgba(124, 92, 255, 0.1));
  box-shadow: 0 6px 18px -10px rgba(124, 92, 255, 0.9);
}
.mode-tab.is-active svg { opacity: 1; }

/* 自定义模型提示 */
.model-custom {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border: 1px solid rgba(124, 92, 255, 0.32); background: rgba(124, 92, 255, 0.09);
  border-radius: 11px; padding: 10px 12px;
}
.model-custom strong { display: block; font-size: 12.5px; font-family: var(--mono); color: #d6ccff; margin-bottom: 2px; }
.model-custom small { font-size: 10.5px; color: var(--muted); }

.btn.full { width: 100%; margin-top: 8px; font-size: 12px; padding: 8px; }

/* 积分提示 */
.cost-hint { display: flex; justify-content: space-between; align-items: center; }
.balance-hint { color: var(--muted); }
.balance-hint b { color: #ffcfa8; font-family: var(--mono); }

/* 图片结果舞台 */
.stage-image { position: relative; width: 100%; height: 100%; display: grid; place-items: center; background: #05060a; padding: 12px; }
.stage-image img {
  max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.9);
}

/* 资产库视图 */
.assets-view {
  height: calc(100vh - 62px); overflow-y: auto; padding: 26px 30px 40px;
  max-width: 1400px; margin: 0 auto; position: relative; z-index: 2;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent;
}
.assets-view::-webkit-scrollbar { width: 8px; }
.assets-view::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }

.assets-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.assets-head h1 { margin: 0 0 6px; font-size: 21px; letter-spacing: 0.02em; display: flex; align-items: center; gap: 9px; }
.assets-head h1 .count {
  font-family: var(--mono); font-size: 11px; padding: 2px 8px; border-radius: 6px;
  background: rgba(255,255,255,.07); color: var(--text-dim); font-weight: 500;
}
.assets-head p { margin: 0; font-size: 12.5px; color: var(--muted); }

.assets-drop {
  border: 1px dashed rgba(255,255,255,.14); border-radius: 16px;
  background: rgba(255,255,255,.015); padding: 18px; margin-bottom: 20px;
  transition: all .18s;
}
.assets-drop.dragging { border-color: var(--accent); background: rgba(77,125,255,.1); }
.assets-drop-inner { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 12px; }
.assets-drop-inner svg { color: #8b7bff; }

.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }

.asset-card {
  border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: rgba(255,255,255,.025); position: relative; transition: all .18s;
}
.asset-card:hover { border-color: rgba(77,125,255,.45); transform: translateY(-2px); box-shadow: 0 16px 36px -22px #000; }
.asset-thumb { aspect-ratio: 4/3; background: #0a0b10 center/cover no-repeat; display: block; width: 100%; object-fit: cover; }
.asset-body { padding: 9px 10px 10px; }
.asset-body p { margin: 0 0 4px; font-size: 11.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-body small { font-size: 10px; color: var(--muted); font-family: var(--mono); }
.asset-tools { display: flex; gap: 5px; margin-top: 8px; }
.asset-tools .btn { font-size: 10.5px; padding: 5px 8px; border-radius: 7px; flex: 1; }
.asset-src {
  position: absolute; top: 8px; left: 8px; font-size: 9px; font-family: var(--mono);
  padding: 2px 6px; border-radius: 5px; background: rgba(0,0,0,.6); color: #d6d9e3; backdrop-filter: blur(4px);
}
.asset-src.gen { color: #cfc4ff; }
.asset-del {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 7px;
  display: grid; place-items: center; border: 1px solid var(--line);
  background: rgba(8,9,13,.72); color: var(--text-dim); cursor: pointer; opacity: 0; transition: all .16s;
}
.asset-card:hover .asset-del { opacity: 1; }
.asset-del:hover { color: #ffc4cc; border-color: rgba(255,95,115,.45); }

.assets-empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.assets-empty svg { color: #3f4557; margin-bottom: 14px; }
.assets-empty h3 { margin: 0 0 8px; font-size: 15px; color: var(--text-dim); }
.assets-empty p { margin: 0; font-size: 12.5px; }

/* 弹窗宽版 */
.modal-card.wide { max-width: 620px; }

/* 余额卡 */
.balance-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-radius: 16px; padding: 16px 18px; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(255,157,92,.16), rgba(77,125,255,.14));
  border: 1px solid rgba(255,157,92,.22);
}
.balance-left span { font-size: 11px; color: #ffcfae; letter-spacing: .06em; }
.balance-left strong { display: flex; align-items: center; gap: 7px; margin: 5px 0 6px; color: #fff; }
.balance-left strong b { font-size: 28px; font-family: var(--mono); font-weight: 600; letter-spacing: -.02em; }
.balance-left strong svg { color: #ffb37a; }
.balance-left small { font-size: 10.5px; color: rgba(255,255,255,.55); }
.balance-right {
  font-size: 10.5px; padding: 4px 10px; border-radius: 999px;
  background: rgba(56,211,159,.14); color: #9fe8cd; border: 1px solid rgba(56,211,159,.3);
}

.section-title { margin: 18px 0 10px; font-size: 12px; color: var(--text-dim); font-weight: 600; letter-spacing: .04em; }

.packages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.package {
  appearance: none; font-family: inherit; cursor: pointer; position: relative;
  border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 12px;
  padding: 13px 8px 11px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--text-dim); transition: all .18s;
}
.package b { font-size: 17px; font-family: var(--mono); color: #fff; font-weight: 600; }
.package b i { font-size: 10px; font-style: normal; color: var(--muted); margin-left: 2px; }
.package span { font-size: 10.5px; color: var(--muted); }
.package em {
  position: absolute; top: -7px; right: 6px; font-style: normal; font-size: 9px;
  padding: 1px 6px; border-radius: 999px; background: linear-gradient(135deg,#8a67ff,#6b45f5); color: #fff;
}
.package:hover { border-color: rgba(77,125,255,.55); background: rgba(77,125,255,.12); transform: translateY(-1px); }
.package:active { transform: translateY(0); }

.custom-recharge { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.custom-recharge label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.custom-recharge input {
  flex: 1; min-width: 0; background: rgba(5,6,10,.7); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 11px; color: var(--text); font-family: var(--mono); font-size: 12px; outline: none;
}
.custom-recharge input:focus { border-color: rgba(77,125,255,.6); }

.pay-note {
  margin: 12px 0 0; font-size: 11px; line-height: 1.7; color: var(--muted);
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px;
}
.pay-note b { color: #ffd0ad; }
.pay-note code, .adv-note code {
  font-family: var(--mono); font-size: 10px; background: rgba(255,255,255,.08);
  padding: 1px 4px; border-radius: 4px; color: #cfc4ff;
}

.ledger { max-height: 190px; overflow-y: auto; border-top: 1px solid var(--line); }
.ledger-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 2px; border-bottom: 1px solid rgba(255,255,255,.04); font-size: 11.5px;
}
.ledger-row .l-note { color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-row .l-time { color: var(--muted); font-size: 10px; font-family: var(--mono); }
.ledger-row .l-amt { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.ledger-row .l-amt.plus { color: #8ee9c6; }
.ledger-row .l-amt.minus { color: #ffb0bb; }
.ledger-empty { padding: 16px 2px; font-size: 11.5px; color: var(--muted); }

/* 供应商切换 */
.provider-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.provider-tab {
  appearance: none; font-family: inherit; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 12px;
  padding: 11px 13px; color: var(--text-dim); transition: all .18s;
}
.provider-tab strong { display: block; font-size: 12.5px; margin-bottom: 3px; color: var(--text); }
.provider-tab span { font-size: 10.5px; color: var(--muted); }
.provider-tab:hover { border-color: var(--line-strong); background: rgba(255,255,255,.05); }
.provider-tab.is-active {
  border-color: rgba(77,125,255,.65); background: linear-gradient(150deg, rgba(77,125,255,.2), rgba(77,125,255,.05));
  box-shadow: inset 0 0 0 1px rgba(77,125,255,.16);
}

.form-grid { display: flex; flex-direction: column; gap: 4px; }
.fl { display: block; font-size: 11px; color: var(--muted); margin: 10px 0 6px; letter-spacing: .03em; }
.fl span { opacity: .7; }
.fi {
  width: 100%; background: rgba(5,6,10,.72); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; color: var(--text); font-family: inherit; font-size: 12.5px; outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.fi:focus { border-color: rgba(77,125,255,.6); box-shadow: 0 0 0 3px rgba(77,125,255,.1); }
.fi.mono { font-family: var(--mono); font-size: 11.5px; }
.fi.ta { resize: vertical; line-height: 1.6; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.adv-note { font-size: 11px; line-height: 1.7; color: var(--muted); margin: 0 0 4px; }
#advancedBox { border-top: 1px dashed var(--line); margin-top: 16px; padding-top: 4px; }
.modal-warn a { color: #b3a2ff; }

/* 资产选择器 */
.asset-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-height: 46vh; overflow-y: auto; }
.picker-item {
  appearance: none; border: 1px solid var(--line); background: rgba(255,255,255,.03);
  border-radius: 10px; overflow: hidden; cursor: pointer; padding: 0; transition: all .16s;
}
.picker-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.picker-item:hover { border-color: rgba(77,125,255,.6); transform: translateY(-2px); }
.picker-empty { grid-column: 1/-1; text-align: center; padding: 32px 10px; color: var(--muted); font-size: 12px; }

@media (max-width: 960px) {
  .assets-view { height: auto; padding: 18px; }
  .packages { grid-template-columns: repeat(2, 1fr); }
  .asset-picker { grid-template-columns: repeat(3, 1fr); }
  .assets-head { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   v3 新增：@ 引用素材 / 资产分类 / 任务中心
   ========================================================================== */

/* 顶栏运行中指示 */
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #38d39f;
  box-shadow: 0 0 0 0 rgba(56, 211, 159, .8); animation: livePulse 1.6s infinite;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(56, 211, 159, .55); }
  70% { box-shadow: 0 0 0 6px rgba(56, 211, 159, 0); }
  100% { box-shadow: 0 0 0 0 rgba(56, 211, 159, 0); }
}

.chip-mini.chip-at {
  display: inline-flex; align-items: center; gap: 4px;
  color: #cfc4ff; background: var(--accent-soft);
  border-color: rgba(124, 92, 255, .34); font-weight: 500;
}
.chip-mini.chip-at:hover { background: rgba(124, 92, 255, .26); color: #fff; }

/* ---------------------------- 参考素材 ---------------------------- */

.ref-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ref-actions .btn { justify-content: center; font-size: 12px; padding: 8px; }

.ref-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px;
}
.ref-grid:empty { display: none; }

.ref-card {
  position: relative; border: 1px solid var(--line); border-radius: 11px;
  overflow: hidden; background: rgba(255, 255, 255, .03);
}
.ref-card.is-first { border-color: rgba(255, 157, 92, .55); box-shadow: 0 0 0 1px rgba(255, 157, 92, .18); }

.ref-thumb { position: relative; aspect-ratio: 1 / 1; background: #0a0b10; }
.ref-thumb img, .ref-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }

.ref-first {
  position: absolute; left: 5px; bottom: 5px; font-style: normal;
  font-size: 9px; padding: 1px 5px; border-radius: 5px;
  background: rgba(255, 122, 61, .92); color: #fff; letter-spacing: .04em;
}
.ref-vbadge {
  position: absolute; right: 5px; bottom: 5px; width: 16px; height: 16px; border-radius: 5px;
  display: grid; place-items: center; background: rgba(0, 0, 0, .6); color: #dfe3ee; backdrop-filter: blur(4px);
}
.ref-del {
  position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 6px;
  display: grid; place-items: center; padding: 0; line-height: 1; font-size: 13px;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(0, 0, 0, .62);
  color: #e8eaf1; cursor: pointer; opacity: 0; transition: opacity .16s;
}
.ref-card:hover .ref-del { opacity: 1; }
.ref-del:hover { background: rgba(255, 95, 115, .85); border-color: transparent; }
.ref-name {
  display: block; padding: 5px 6px 6px; font-size: 10px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ref-empty {
  margin: 10px 0 0; font-size: 11px; line-height: 1.7; color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, .1); border-radius: 10px; padding: 10px 12px;
}
.ref-empty code {
  font-family: var(--mono); font-size: 11px; color: #cfc4ff;
  background: rgba(124, 92, 255, .16); padding: 1px 5px; border-radius: 5px;
}

/* ---------------------------- @ 提及浮层 ---------------------------- */

.mention {
  position: fixed; z-index: 80;
  display: flex; flex-direction: column; overflow: hidden;
  background: linear-gradient(180deg, rgba(22, 24, 33, .98), rgba(12, 14, 19, .99));
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 14px;
  box-shadow: 0 26px 70px -18px rgba(0, 0, 0, .95), 0 0 0 1px rgba(124, 92, 255, .12);
  backdrop-filter: blur(20px);
}
.mention-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 11px 7px; font-size: 11px; color: var(--muted); letter-spacing: .04em;
}
.mention-head .link-btn { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; }

.mention-tabs { display: flex; gap: 4px; padding: 0 10px 8px; }
.mention-tab {
  appearance: none; font-family: inherit; cursor: pointer; font-size: 10.5px;
  padding: 3px 9px; border-radius: 999px; color: var(--muted);
  border: 1px solid var(--line); background: transparent; transition: all .16s;
}
.mention-tab:hover { color: var(--text-dim); background: rgba(255, 255, 255, .04); }
.mention-tab.is-active { color: #e3dbff; border-color: rgba(124, 92, 255, .5); background: rgba(124, 92, 255, .18); }

.mention-list {
  flex: 1; min-height: 0; overflow-y: auto; padding: 0 6px 6px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent;
}
.mention-list::-webkit-scrollbar { width: 6px; }
.mention-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 6px; }

.mention-item {
  appearance: none; font-family: inherit; width: 100%; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 9px; padding: 6px 7px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--text);
}
.mention-item:hover, .mention-item.is-active { background: rgba(124, 92, 255, .16); border-color: rgba(124, 92, 255, .32); }
.m-thumb {
  position: relative; width: 36px; height: 36px; border-radius: 8px; overflow: hidden;
  background: #07080c; flex: none; border: 1px solid var(--line);
}
.m-thumb img, .m-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, .32); color: #fff; font-style: normal;
}
.m-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.m-body b { font-size: 11.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-body small { font-size: 9.5px; color: var(--muted); font-family: var(--mono); }
.m-at { color: #8b7bff; font-size: 13px; opacity: .8; }
.mention-empty { padding: 22px 14px; text-align: center; font-size: 11.5px; line-height: 1.7; color: var(--muted); }
.mention-foot {
  padding: 6px 11px 8px; font-size: 9.5px; color: #5c6272;
  border-top: 1px solid rgba(255, 255, 255, .05); font-family: var(--mono);
}

/* ---------------------------- 资产分类 ---------------------------- */

.cat-tabs { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.cat-tab {
  appearance: none; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; padding: 7px 13px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .025); color: var(--muted);
  transition: all .16s;
}
.cat-tab span {
  font-family: var(--mono); font-size: 10px; padding: 1px 5px; border-radius: 5px;
  background: rgba(255, 255, 255, .07); color: var(--text-dim);
}
.cat-tab:hover { color: var(--text-dim); border-color: var(--line-strong); }
.cat-tab.is-active {
  color: #fff; border-color: rgba(124, 92, 255, .6);
  background: linear-gradient(150deg, rgba(124, 92, 255, .26), rgba(124, 92, 255, .08));
}
.cat-note { margin: 0 0 0 auto; font-size: 11px; color: var(--muted); }
.cat-note .link-btn { font-size: 11px; }

.asset-thumb-wrap { position: relative; }
.asset-thumb { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #0a0b10; }
.asset-kind {
  position: absolute; right: 7px; top: 7px; display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; padding: 2px 6px; border-radius: 5px;
  background: rgba(42, 212, 238, .18); color: #9fe9f7; border: 1px solid rgba(42, 212, 238, .35);
  backdrop-filter: blur(4px);
}
.asset-dur {
  position: absolute; right: 7px; bottom: 7px; font-family: var(--mono); font-size: 9.5px;
  padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .68); color: #dfe3ee;
}
.asset-card .asset-src { top: auto; bottom: 7px; left: 7px; }

/* ---------------------------- 任务中心 ---------------------------- */

.tasks-view {
  height: calc(100vh - 62px); overflow-y: auto; padding: 26px 30px 44px;
  max-width: 1400px; margin: 0 auto; position: relative; z-index: 2;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.14) transparent;
}
.tasks-view::-webkit-scrollbar { width: 8px; }
.tasks-view::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; }

.tasks-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.tasks-head h1 { margin: 0 0 6px; font-size: 21px; letter-spacing: .02em; display: flex; align-items: center; gap: 9px; }
.tasks-head h1 .count {
  font-family: var(--mono); font-size: 11px; padding: 2px 8px; border-radius: 6px;
  background: rgba(255,255,255,.07); color: var(--text-dim); font-weight: 500;
}
.tasks-head p { margin: 0; font-size: 12.5px; color: var(--muted); }

.task-stats { display: flex; gap: 10px; }
.stat {
  min-width: 92px; padding: 10px 14px; border-radius: 13px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .025);
  display: flex; flex-direction: column; gap: 3px;
}
.stat b { font-family: var(--mono); font-size: 19px; font-weight: 600; color: #fff; letter-spacing: -.02em; }
.stat small { font-size: 10px; color: var(--muted); }
.stat:first-child b { color: #8ee9c6; }

.task-filters { display: flex; align-items: center; gap: 7px; margin-bottom: 14px; }
.task-filter {
  appearance: none; font-family: inherit; cursor: pointer; font-size: 12px;
  padding: 6px 13px; border-radius: 999px; color: var(--muted);
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02); transition: all .16s;
}
.task-filter:hover { color: var(--text-dim); background: rgba(255, 255, 255, .05); }
.task-filter.is-active { color: #e3dbff; border-color: rgba(124, 92, 255, .5); background: rgba(124, 92, 255, .17); }
.task-clear { margin-left: auto; font-size: 11.5px; }

.task-list { display: flex; flex-direction: column; gap: 10px; }

.task-row {
  display: grid; grid-template-columns: 74px minmax(0, 1fr) 104px 92px auto;
  gap: 16px; align-items: center;
  padding: 12px 14px; border-radius: 15px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .022);
  transition: border-color .18s, background .18s, transform .18s;
  cursor: pointer;
}
.task-row:hover { border-color: rgba(124, 92, 255, .4); background: rgba(124, 92, 255, .06); }
.task-row[data-status="running"], .task-row[data-status="queued"] { border-color: rgba(124, 92, 255, .32); }

.t-thumb {
  position: relative; width: 74px; height: 56px; border-radius: 10px;
  overflow: hidden; background: #07080c; border: 1px solid var(--line);
}
.t-thumb img, .t-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-thumb .ph { width: 100%; height: 100%; display: grid; place-items: center; color: #3f4557; }
.t-ring {
  position: absolute; inset: -1px; border-radius: 11px; pointer-events: none;
  background: conic-gradient(from -90deg, rgba(139, 107, 255, .95) calc(var(--p) * 1%), rgba(255, 255, 255, .07) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}

.t-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.t-title { display: flex; align-items: center; gap: 7px; min-width: 0; }
.t-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46%;
}
.t-name-input {
  font-family: inherit; font-size: 13px; font-weight: 500; color: #fff;
  background: rgba(5, 6, 10, .85); border: 1px solid rgba(124, 92, 255, .6);
  border-radius: 7px; padding: 3px 8px; outline: none; width: 260px; max-width: 60%;
}
.t-edit {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  cursor: pointer; padding: 2px; border-radius: 5px; display: grid; place-items: center;
  opacity: 0; transition: opacity .16s, color .16s;
}
.task-row:hover .t-edit { opacity: 1; }
.t-edit:hover { color: #cfc4ff; }

.t-badge {
  font-size: 9.5px; padding: 2px 7px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); color: var(--muted); background: rgba(255, 255, 255, .04);
}
.t-badge.running { color: #cfc4ff; border-color: rgba(124, 92, 255, .45); background: rgba(124, 92, 255, .16); }
.t-badge.transfer { color: #ffd9a0; border-color: rgba(255, 176, 74, .4); background: rgba(255, 176, 74, .14); animation: txPulse 1.6s ease-in-out infinite; }
.t-thumb .ph.is-transfer { color: #c99a5e; grid-auto-flow: row; gap: 4px; font-size: 11px; }
.t-badge.ok { color: #9fe8cd; border-color: rgba(56, 211, 159, .35); background: rgba(56, 211, 159, .12); }
.t-badge.bad { color: #ffb0bb; border-color: rgba(255, 95, 115, .35); background: rgba(255, 95, 115, .12); }

.t-sub { font-size: 11px; color: var(--text-dim); font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-prompt { font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-bar { height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .07); overflow: hidden; margin-top: 2px; }
.t-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #8b6bff, #43dcff); transition: width .5s; }
.task-row[data-status="failed"] .t-bar i { background: linear-gradient(90deg, #ff5f73, #ff9d5c); }
.task-row[data-status="succeeded"] .t-bar i { background: linear-gradient(90deg, #38d39f, #43dcff); }
.task-row[data-status="failed"] .t-bar { opacity: .45; }

.t-metric { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.t-metric b { font-family: var(--mono); font-size: 15px; font-weight: 600; color: #fff; letter-spacing: -.01em; }
.t-metric small { font-size: 9.5px; color: var(--muted); }
.task-row[data-status="running"] .t-metric:first-of-type b { color: #cfc4ff; }

.t-actions { display: flex; gap: 5px; }
.t-actions .btn { font-size: 11px; padding: 5px 9px; border-radius: 8px; white-space: nowrap; }

.task-none { text-align: center; padding: 54px 20px; color: var(--muted); font-size: 12.5px; }
.tasks-empty { text-align: center; padding: 78px 20px; color: var(--muted); }
.tasks-empty svg { color: #3f4557; margin-bottom: 14px; }
.tasks-empty h3 { margin: 0 0 8px; font-size: 15px; color: var(--text-dim); }
.tasks-empty p { margin: 0; font-size: 12.5px; }

@media (max-width: 1180px) {
  .task-row { grid-template-columns: 74px minmax(0, 1fr) 92px auto; }
  .t-metric:nth-of-type(2) { display: none; }
}
@media (max-width: 960px) {
  .tasks-view { height: auto; padding: 18px; }
  .tasks-head { flex-direction: column; align-items: flex-start; }
  .task-row { grid-template-columns: 60px minmax(0, 1fr); }
  .t-actions { grid-column: 1 / -1; }
  .t-metric { display: none; }
  .ref-grid { grid-template-columns: repeat(4, 1fr); }
  .cat-note { margin-left: 0; width: 100%; }
}

/* ==========================================================================
   v4：三栏布局（左参数 / 中剧本 / 右小预览）+ 大号 @ 素材选择器
   ========================================================================== */

/* ------------------------------- 三栏骨架 ------------------------------- */

.workspace {
  grid-template-columns: 286px minmax(400px, 1fr) 400px;
  gap: 14px;
  padding: 14px 18px 16px;
  max-width: 1780px;
}

/* 左栏参数面板 */
.console-params .console-scroll { padding: 15px 16px 8px; }
.console-params .mode-tabs { margin-bottom: 14px; padding: 3px; gap: 3px; }
.console-params .mode-tab { padding: 7px 3px 6px; gap: 2px; }
.console-params .mode-tab b { font-size: 10.5px; }
.console-params .mode-tab small { font-size: 9px; }
.console-params .model-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
.console-params .model-card { padding: 9px 9px 8px; border-radius: 10px; }
.console-params .model-card strong { font-size: 11.5px; }
.console-params .model-card span { font-size: 9.5px; }
.console-params .ratio-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
.console-params .ratio { padding: 7px 4px; }
.console-params .segment button { font-size: 11px; padding: 6px 2px; }
.console-params .switch-row strong { font-size: 12px; }
.console-params .switch-row small { font-size: 10px; }
.console-params .fi { font-size: 12px; padding: 8px 10px; }

/* ------------------------------- 中栏剧本 ------------------------------- */

.script-panel {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  background: linear-gradient(180deg, rgba(20, 22, 30, 0.92), rgba(11, 13, 18, 0.95));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}

.script-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 22px 13px;
}
.script-head-left h2 {
  margin: 0 0 6px; font-size: 15px; font-weight: 600; letter-spacing: 0.03em;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}
.script-head-left h2 em {
  font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--muted);
  padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.06);
}
.script-head-left p { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.script-head-left p code {
  font-family: var(--mono); font-size: 10.5px; color: #cfc4ff;
  background: rgba(124, 92, 255, 0.16); padding: 1px 5px; border-radius: 5px;
}
.script-head .counter {
  flex: none; font-family: var(--mono); font-size: 11px; color: var(--muted);
  padding: 3px 8px; border-radius: 7px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.script-head .counter b { color: var(--text-dim); font-weight: 500; }

.script-panel .textarea-wrap {
  flex: 1; min-height: 0; margin: 0 22px;
  display: flex; flex-direction: column;
  background: rgba(6, 7, 11, 0.62);
}
.script-panel #prompt {
  flex: 1; min-height: 200px; max-height: none; resize: none;
  font-size: 14.5px; line-height: 1.92; padding: 16px 18px 10px;
}
.script-panel .prompt-tools { padding: 0 16px 11px; align-items: center; }
.script-panel .chip-mini { font-size: 11.5px; padding: 5px 10px; }
.tools-hint {
  margin-left: auto; font-size: 10px; color: #5c6272; font-family: var(--mono);
  display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
}
.tools-hint kbd {
  font-family: var(--mono); font-size: 9.5px; padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--text-dim);
}

.script-panel .idea-row { margin: 12px 22px 0; }

/* 中栏参考素材区 */
.script-refs {
  margin: 14px 22px 0; padding-top: 13px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}
.ref-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.ref-title { display: flex; align-items: center; gap: 7px; }
.ref-title h2 {
  margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.03em;
  color: var(--text-dim); display: flex; align-items: center; gap: 7px;
}
.ref-title h2 em {
  font-style: normal; font-family: var(--mono); font-size: 9.5px; color: var(--muted);
  padding: 1px 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.05);
}
.ref-title .opt {
  font-size: 9.5px; color: var(--muted); border: 1px solid var(--line);
  padding: 0 5px; border-radius: 4px;
}
.ref-title .hint { font-size: 10.5px; color: var(--muted); }
.ref-actions { display: flex; gap: 7px; }
.ref-actions .btn { justify-content: center; font-size: 11.5px; padding: 6px 10px; border-radius: 9px; }
.script-refs .ref-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.script-refs .ref-name { font-size: 9.5px; padding: 4px 5px 5px; }
.script-refs .ref-empty { margin: 0; font-size: 10.5px; padding: 8px 10px; }

/* 中栏底栏 */
.script-foot {
  margin-top: 14px; display: flex; align-items: center; gap: 14px;
  padding: 11px 22px 14px;
}
.script-foot .cost-hint { flex: 1; margin-bottom: 0; justify-content: flex-start; }
.script-foot .balance-hint { margin-left: 14px; }
.script-foot .btn-primary { width: auto; min-width: 210px; justify-content: center; }

/* ------------------------------ 右栏小预览 ------------------------------ */

.preview-panel { display: flex; flex-direction: column; gap: 12px; min-height: 0; min-width: 0; }
.preview-panel .stage-shell { flex: none; }
.preview-panel .stage-bar { padding: 8px 12px; gap: 8px; }
.preview-panel .stage-title { font-size: 11px; gap: 6px; }
.preview-panel .stage-tags span { font-size: 9px; padding: 1px 5px; }

.preview-panel .stage { flex: none; height: clamp(158px, 23vh, 226px); }

/* 空状态缩略 */
.preview-panel .stage-empty { padding: 14px; }
.preview-panel .empty-icon { width: 38px; height: 38px; margin-bottom: 9px; border-radius: 12px; }
.preview-panel .empty-inner { max-width: 300px; }
.preview-panel .empty-inner h3 { font-size: 14px; margin-bottom: 6px; }
.preview-panel .empty-inner p { font-size: 10.5px; line-height: 1.65; }

/* 生成中缩略 */
.preview-panel .stage-loading { gap: 9px; padding: 12px; }
.preview-panel .ring { width: 62px; height: 62px; }
.preview-panel .ring svg { width: 62px; height: 62px; }
.preview-panel .ring-label b { font-size: 15px; }
.preview-panel .ring-label span { font-size: 9px; margin-bottom: 17px; }
.preview-panel .loading-text { gap: 3px; }
.preview-panel .loading-text strong { font-size: 12px; }
.preview-panel .loading-text span { font-size: 10.5px; }
.preview-panel .loading-text em { font-size: 9.5px; }
.preview-panel .steps { gap: 4px; }
.preview-panel .steps span { font-size: 9px; padding: 2px 7px; }

/* 结果缩略 */
.preview-panel .play-overlay svg { width: 42px; height: 42px; padding: 12px 10px 12px 14px; }
.preview-panel #player { background: #000; }
.preview-panel .stage-image { padding: 8px; }
.preview-panel .stage-error { padding: 16px; }
.preview-panel .stage-error h3 { font-size: 13.5px; }
.preview-panel .stage-error p { font-size: 11px; margin-bottom: 12px; }
.preview-panel .err-icon { width: 34px; height: 34px; margin-bottom: 10px; font-size: 16px; }

/* 结果底栏：按钮两列排布 */
.preview-panel .stage-foot { padding: 9px 12px 10px; min-height: 0; gap: 8px; flex-direction: column; align-items: stretch; }
.preview-panel .result-meta { gap: 5px; }
.preview-panel .result-meta .pill { font-size: 9.5px; padding: 2px 6px; }
.preview-panel .result-meta .placeholder { font-size: 10.5px; }
.preview-panel .result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
.preview-panel .result-actions .btn {
  justify-content: center; font-size: 11px; padding: 6px 8px; border-radius: 8px;
}

/* 右栏最近任务：两列网格 + 纵向滚动 */
.preview-panel .filmstrip-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 11px 12px 10px; }
.preview-panel .filmstrip-head { margin-bottom: 8px; }
.preview-panel .filmstrip-head h2 { font-size: 11.5px; }
.preview-panel .filmstrip {
  flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; overflow-y: auto; overflow-x: hidden; padding: 0 2px 2px 0; align-content: start;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
.preview-panel .filmstrip::-webkit-scrollbar { width: 5px; height: 5px; }
.preview-panel .work { width: auto; }
.preview-panel .work-thumb { height: 52px; }
.preview-panel .work-info { padding: 5px 7px 6px; }
.preview-panel .work-info p { font-size: 10px; }
.preview-panel .work-info small { font-size: 9px; }
.preview-panel .film-empty { grid-column: 1 / -1; padding: 16px 2px; font-size: 11px; line-height: 1.7; }

/* ------------------------- 大号 @ 素材选择器 ------------------------- */

.mention { width: min(760px, calc(100vw - 32px)); }

.mention-head { padding: 11px 14px 8px; font-size: 11.5px; }
.mention-tabs { padding: 0 13px 9px; gap: 6px; }
.mention-tab { font-size: 11px; padding: 4px 11px; }

.mention-list {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px; padding: 0 13px 12px; align-content: start;
}

.m-card {
  appearance: none; font-family: inherit; cursor: pointer; padding: 0; text-align: left;
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 11px;
  background: rgba(255, 255, 255, 0.03); color: var(--text);
  transition: border-color 0.16s, background 0.16s, transform 0.16s, box-shadow 0.16s;
}
.m-card:hover { border-color: rgba(124, 92, 255, 0.55); background: rgba(124, 92, 255, 0.1); transform: translateY(-1px); }
.m-card.is-active {
  border-color: #8b6bff; background: rgba(124, 92, 255, 0.16);
  box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.24);
}

.m-card-thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden;
  background: #07080c; display: grid; place-items: center;
}
.m-card-thumb img, .m-card-thumb video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.m-card-kind {
  position: absolute; top: 5px; right: 5px; display: inline-flex; align-items: center; gap: 3px;
  font-size: 8.5px; padding: 1px 5px; border-radius: 4px; letter-spacing: 0.02em;
  background: rgba(42, 212, 238, 0.2); color: #a6ecf8; border: 1px solid rgba(42, 212, 238, 0.34);
  backdrop-filter: blur(4px);
}
.m-card-kind.gen { background: rgba(124, 92, 255, 0.24); color: #c8dbff; border-color: rgba(139, 107, 255, 0.42); }
.m-card-play {
  position: absolute; left: 5px; bottom: 5px; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); color: #fff;
  backdrop-filter: blur(4px);
}
.m-card-name {
  display: block; padding: 6px 8px 7px; font-size: 10.5px; line-height: 1.35; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-card.is-active .m-card-name { color: #fff; }

.mention-pager {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 9px; border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px; color: var(--muted);
}
.mention-pager .link-btn { font-size: 11px; color: var(--text-dim); }
.mention-pager .link-btn:disabled { opacity: 0.32; cursor: default; color: var(--muted); }
.mention-pageinfo { font-family: var(--mono); font-size: 10.5px; color: var(--text-dim); min-width: 42px; text-align: center; }
.mention-total { margin-left: auto; font-size: 10px; font-family: var(--mono); color: #5c6272; }
.mention-foot { padding: 6px 14px 9px; font-size: 9.5px; }

/* ------------------------------- 响应式 ------------------------------- */

@media (max-width: 1500px) {
  .workspace { grid-template-columns: 272px minmax(360px, 1fr) 368px; }
}
@media (max-width: 1320px) {
  .workspace { grid-template-columns: 260px minmax(0, 1fr) 330px; gap: 12px; }
  .script-panel .textarea-wrap { margin: 0 16px; }
  .script-refs { margin: 12px 16px 0; }
  .script-panel .idea-row { margin: 10px 16px 0; }
  .script-head { padding: 15px 16px 11px; }
  .script-foot { padding: 10px 16px 12px; }
  .script-foot .btn-primary { min-width: 168px; }
  .script-refs .ref-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .workspace { grid-template-columns: 1fr; height: auto; }
  .console-params { order: 2; }
  .script-panel { order: 1; min-height: 70vh; }
  .preview-panel { order: 3; }
  .preview-panel .stage { height: 220px; }
  .mention-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .mention-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .script-foot { flex-direction: column; align-items: stretch; }
  .script-foot .btn-primary { width: 100%; }
}

.mention-list .mention-empty { grid-column: 1 / -1; padding: 30px 14px; }
.mention-list::-webkit-scrollbar { width: 7px; }

/* ==========================================================================
   v5：资产文件夹 / 素材改名归类 / 命名弹窗
   ========================================================================== */

/* ------------------------------- 文件夹栏 ------------------------------- */

.folder-bar {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 13px;
  background: rgba(255, 255, 255, 0.022);
}
.folder-list { display: flex; gap: 7px; flex-wrap: wrap; }

.folder-chip {
  appearance: none; font-family: inherit; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; padding: 6px 11px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim); transition: all 0.16s; white-space: nowrap;
  max-width: 220px;
}
.folder-chip svg { color: #8b7bff; opacity: 0.85; flex: none; }
.folder-chip span {
  font-family: var(--mono); font-size: 9.5px; padding: 1px 5px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.07); color: var(--text-dim); flex: none;
}
.folder-chip .cname { overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.folder-chip:hover { border-color: rgba(124, 92, 255, 0.45); background: rgba(124, 92, 255, 0.1); color: #fff; }
.folder-chip.is-active {
  color: #fff; border-color: rgba(124, 92, 255, 0.65);
  background: linear-gradient(150deg, rgba(124, 92, 255, 0.28), rgba(124, 92, 255, 0.1));
  box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.14);
}
.folder-op {
  font-style: normal; font-size: 10px; line-height: 1; color: var(--muted);
  width: 15px; height: 15px; border-radius: 4px; display: grid; place-items: center;
  background: rgba(0, 0, 0, 0.28); flex: none;
}
.folder-op:hover { color: #fff; background: rgba(124, 92, 255, 0.5); }
.folder-op[data-folder-empty] { width: auto; padding: 0 4px; font-size: 9px; color: #ffb98a; }
.folder-op[data-folder-empty]:hover { color: #fff; background: rgba(255, 140, 60, 0.55); }

/* ---------------- 资产库批量管理（多选删除） ---------------- */
.multi-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 12px; margin-bottom: 4px;
  border: 1px solid rgba(124, 92, 255, 0.4);
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.12), rgba(124, 92, 255, 0.05));
}
.multi-bar b { font-size: 12.5px; color: #cfc4ff; }
.multi-bar .folder-tip { margin-left: auto; }
.asset-grid.is-multi .asset-card { cursor: pointer; }
.asset-check {
  position: absolute; top: 6px; right: 6px; z-index: 3;
  width: 22px; height: 22px; border-radius: 7px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700; color: #fff;
  background: rgba(0, 0, 0, 0.45); border: 1.5px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(3px);
}
.asset-card.is-picked { border-color: rgba(124, 92, 255, 0.75); box-shadow: 0 0 0 2px rgba(124, 92, 255, 0.35); }
.asset-card.is-picked .asset-check { background: #4d7dff; border-color: #82b0ff; }
.folder-add { border-style: dashed; color: var(--muted); }
.folder-add:hover { color: #cfc4ff; }
.folder-tip { margin-left: auto; font-size: 10.5px; color: #5c6272; }

/* 素材卡片按钮排布 */
.asset-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: 8px; }
.asset-tools .btn { font-size: 10px; padding: 5px 6px; border-radius: 7px; justify-content: center; gap: 3px; }

/* 归类小弹层 */
.move-menu {
  position: fixed; z-index: 90; padding: 6px;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(180deg, rgba(24, 26, 36, 0.99), rgba(13, 15, 21, 0.99));
  box-shadow: 0 24px 60px -20px #000, 0 0 0 1px rgba(124, 92, 255, 0.1);
  backdrop-filter: blur(16px); max-height: 320px; overflow-y: auto;
  animation: modalIn 0.16s ease;
}
.move-head {
  font-size: 10px; color: var(--muted); letter-spacing: 0.06em;
  padding: 5px 8px 7px;
}
.move-item {
  appearance: none; font-family: inherit; width: 100%; text-align: left; cursor: pointer;
  font-size: 11.5px; color: var(--text-dim); padding: 7px 9px; border-radius: 8px;
  border: 1px solid transparent; background: transparent;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.move-item:hover { color: #fff; background: rgba(124, 92, 255, 0.16); border-color: rgba(124, 92, 255, 0.3); }
.move-item.is-active { color: #cfc4ff; background: rgba(124, 92, 255, 0.1); }
.move-item.move-new { color: #8b7bff; border-top: 1px solid rgba(255, 255, 255, 0.06); border-radius: 0 0 8px 8px; }

/* 命名弹窗 */
.modal-card.narrow { max-width: 400px; }
.modal-card.narrow .modal-body { padding: 14px 18px 16px; }
.dlg-tip { margin: 8px 0 0; font-size: 10.5px; line-height: 1.7; color: var(--muted); }
#dlgInput { width: 100%; }

/* ==========================================================================
   v6 · 账号系统：登录注册门页 / 个人中心 / 审批管理
   ========================================================================== */

/* 未登录时隐藏应用本体 */
body.authing .topbar,
body.authing main { display: none !important; }

/* ------------------------------ 登录门页 ------------------------------ */

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1000px 600px at 20% -10%, rgba(124, 92, 255, 0.2), transparent 60%),
    radial-gradient(860px 520px at 82% 8%, rgba(42, 212, 238, 0.13), transparent 58%),
    radial-gradient(760px 640px at 55% 115%, rgba(255, 140, 90, 0.1), transparent 62%),
    var(--bg);
}

.auth-card {
  position: relative;
  width: min(420px, 100%);
  background: rgba(14, 16, 22, 0.9);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 30px 30px 22px;
  backdrop-filter: blur(20px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font-size: 17px;
}
.auth-brand .brand-mark {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #4a9eff);
  box-shadow: 0 8px 22px -8px rgba(124, 92, 255, 0.7);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 18px;
}
.auth-tab {
  appearance: none; font-family: inherit; cursor: pointer;
  border: none; background: transparent;
  color: var(--text-dim);
  font-size: 13.5px; font-weight: 600;
  padding: 9px 0;
  border-radius: 9px;
  transition: 0.18s;
}
.auth-tab.is-active { background: var(--accent-soft); color: #cfc4ff; }

.auth-form { display: flex; flex-direction: column; gap: 6px; }
.auth-form .fl { margin-top: 8px; }
.auth-form .fi { width: 100%; }
.auth-submit { margin-top: 16px; width: 100%; justify-content: center; }

.auth-msg { min-height: 18px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.auth-msg.bad { color: var(--danger); }
.agree-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; }
.agree-row input { width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; }
.agree-row a { color: var(--accent); text-decoration: none; }
.agree-row a:hover { text-decoration: underline; }

.auth-pane .pending-icon {
  width: 54px; height: 54px;
  border-radius: 16px;
  display: grid; place-items: center;
  margin: 4px auto 14px;
  color: var(--warm);
  background: rgba(255, 157, 92, 0.12);
  border: 1px solid rgba(255, 157, 92, 0.3);
}
.auth-pane h3 { margin: 0 0 8px; text-align: center; font-size: 17px; }
.auth-pane p { margin: 0 0 18px; text-align: center; font-size: 13px; line-height: 1.8; color: var(--text-dim); }
.auth-pane .btn { margin: 0 auto; }

.auth-foot {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
  text-align: center;
}

/* 顶栏用户胶囊 */
.user-chip {
  appearance: none; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
  font-size: 12.5px;
  transition: 0.18s;
}
.user-chip:hover { border-color: var(--line-strong); background: var(--panel-3); }
.user-chip .avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-style: normal; font-weight: 700; font-size: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #4a9eff);
}
.user-chip b { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.count.warn { background: rgba(255, 157, 92, 0.18); color: var(--warm); }

/* ------------------------------ 个人中心 ------------------------------ */

.profile-view {
  height: calc(100dvh - 62px);
  overflow-y: auto;
  padding: 30px clamp(20px, 4vw, 48px) 60px;
}
.profile-head { margin-bottom: 22px; }
.profile-head h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: -0.01em; }
.profile-head p { margin: 0; color: var(--muted); font-size: 13px; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1180px;
}
.p-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
}
.p-card.p-wide { grid-column: 1 / -1; }

.p-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.p-card-head h3 {
  margin: 0; font-size: 14.5px;
  display: flex; align-items: center; gap: 8px;
  color: var(--text);
}
.p-card-head h3 svg { color: var(--accent); }

.p-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-style: normal; font-weight: 700; font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #4a9eff);
}
.p-role {
  font-size: 10.5px; font-weight: 600;
  color: #cfc4ff;
  background: var(--accent-soft);
  border: 1px solid rgba(124, 92, 255, 0.32);
  padding: 3px 9px;
  border-radius: 999px;
}

.p-info { display: flex; flex-direction: column; gap: 10px; }
.p-row {
  display: flex; justify-content: space-between; gap: 16px;
  font-size: 13px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--line);
}
.p-row:last-child { border-bottom: none; padding-bottom: 0; }
.p-row span { color: var(--muted); }
.p-row b { font-weight: 600; word-break: break-all; text-align: right; }
.p-row b.ok { color: var(--ok); }
.p-row b.bad { color: var(--danger); }

.profile-view .balance-card {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.16), rgba(42, 212, 238, 0.08));
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.profile-view .balance-left { display: flex; flex-direction: column; gap: 4px; }
.profile-view .balance-left span { font-size: 11.5px; color: var(--muted); }
.profile-view .balance-left strong {
  display: flex; align-items: center; gap: 9px;
  font-size: 30px; color: #fff;
}
.profile-view .balance-left strong svg { color: var(--warm); }
.profile-view .balance-left small { font-size: 11.5px; color: var(--text-dim); }

.quick-yuan { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.yuan-chip {
  appearance: none; font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 9px 14px;
  font-size: 13.5px; font-weight: 700;
  transition: 0.18s;
}
.yuan-chip small { font-size: 10px; font-weight: 500; color: var(--muted); }
.yuan-chip:hover { border-color: rgba(124, 92, 255, 0.55); background: var(--accent-soft); color: #cfc4ff; }

.custom-recharge {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 10px;
}
.custom-recharge label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.custom-recharge input {
  width: 130px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  padding: 9px 12px;
  font-family: inherit; font-size: 13px;
}
.custom-recharge input:focus { outline: none; border-color: rgba(124, 92, 255, 0.55); }

.profile-view .pay-note { margin: 0 0 16px; font-size: 11px; color: var(--muted); }

.p-form { display: flex; flex-direction: column; gap: 6px; }
.p-form .fl { margin-top: 8px; }
.p-form .fi { width: 100%; }
.p-form .btn { margin-top: 14px; align-self: flex-start; }
.p-form-status { min-height: 18px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.p-form-status.ok { color: var(--ok); }
.p-form-status.bad { color: var(--danger); }

/* 审批管理 */
.admin-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.admin-search { margin-top: 10px; }
.admin-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
}
.admin-row .a-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-row .a-main b { font-size: 13.5px; }
.admin-row .a-main small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-status { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.a-status.ok { color: var(--ok); background: rgba(56, 211, 159, 0.12); }
.a-status.warn { color: var(--warm); background: rgba(255, 157, 92, 0.14); }
.a-status.bad { color: var(--danger); background: rgba(255, 95, 115, 0.12); }
.a-actions { display: flex; gap: 8px; }
.a-by { font-size: 11px; color: var(--muted); white-space: nowrap; }

.btn-sm { padding: 6px 14px !important; font-size: 12px !important; }

/* 响应式 */
@media (max-width: 980px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   v7 · 商用化：注册验证码 / 真实支付订单 / 运营配置
   ========================================================================== */

/* 注册验证码行 */
.code-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.code-row .fi { flex: 1; width: auto; }
.btn-code { white-space: nowrap; font-size: 12px !important; padding: 9px 12px !important; }

/* 充值订单面板 */
.order-panel {
  margin-top: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.order-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 13.5px; }
.order-body { display: flex; gap: 14px; align-items: flex-start; }
.order-body img { border-radius: 10px; background: #fff; padding: 6px; flex-shrink: 0; }
.order-side { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--text-dim); }
.order-side p { margin: 0; line-height: 1.7; }
.order-side small { font-family: var(--mono); color: var(--muted); }

/* 运营配置 */
.ops-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 8px; }
.ops-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 14px;
  margin: 0;
  min-width: 0;
}
.ops-group legend { font-size: 12.5px; font-weight: 700; color: #cfc4ff; padding: 0 6px; }
.ops-group small { font-weight: 400; color: var(--muted); }
.ops-sub { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.ops-sub b { color: var(--text); }
.ops-group .ta { width: 100%; font-size: 11px; }
.switch-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); cursor: pointer; white-space: nowrap; }
.switch-inline input { accent-color: var(--accent); }
.chips { display: flex; gap: 8px; }
.ops-group .fi { margin-bottom: 2px; }
.ops-group select.fi { appearance: auto; }

@media (max-width: 980px) {
  .ops-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   v8 · 首页 + 一键剧本转视频
   ========================================================================== */

/* ------------------------------ 首页 ------------------------------ */

.home-view {
  height: calc(100dvh - 62px);
  overflow-y: auto;
  padding: 44px clamp(24px, 5vw, 72px) 60px;
}

.home-hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto 46px;
}

.home-eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #cfc4ff;
  background: var(--accent-soft);
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 18px;
}

.home-hero-text h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.22;
  letter-spacing: -0.015em;
}

.home-hero-text > p {
  margin: 0 0 26px;
  max-width: 560px;
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--text-dim);
}

.home-hero-actions { display: flex; gap: 12px; margin-bottom: 26px; }
.btn-lg { padding: 13px 28px !important; font-size: 15px !important; }

.home-hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.home-hero-meta b { color: var(--text); font-size: 15px; margin-right: 2px; }
.home-hero-meta i { width: 1px; height: 14px; background: var(--line-strong); }

.home-hero-art {
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(124, 92, 255, 0.14), rgba(42, 212, 238, 0.08) 60%, transparent);
  border: 1px solid var(--line);
  padding: 26px;
  box-shadow: var(--shadow);
}

.home-section-title {
  max-width: 1240px;
  margin: 0 auto 20px;
  font-size: 19px;
  letter-spacing: -0.01em;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  max-width: 1240px;
  margin: 0 auto;
}

.home-card {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 22px 24px;
  transition: 0.2s;
}
.home-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124, 92, 255, 0.5);
  box-shadow: 0 14px 34px -18px rgba(124, 92, 255, 0.55);
}
.home-card-art {
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}
.home-card h3 { margin: 0 0 8px; font-size: 15.5px; }
.home-card p { margin: 0; font-size: 12.8px; line-height: 1.85; color: var(--text-dim); }

.home-foot {
  max-width: 1240px;
  margin: 42px auto 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.home-foot a { color: #5b9bff; cursor: pointer; }

/* --------------------------- 剧本转视频 --------------------------- */

.script-view {
  height: calc(100dvh - 62px);
  overflow-y: auto;
  padding: 34px clamp(24px, 4.5vw, 64px) 70px;
}

.script-head { max-width: 1080px; margin: 0 auto 22px; }
.script-head h1 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.01em; }
.script-head p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.8; }

.script-step { max-width: 1080px; margin: 0 auto 20px; }

.script-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px 24px;
}

.script-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.script-card-head h3 {
  margin: 0;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.st-no {
  font-style: normal;
  width: 24px; height: 24px;
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #4a9eff);
}
.st-hint { font-size: 12px; color: var(--muted); font-weight: 400; }

.script-card textarea,
.script-card select {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.8;
  resize: vertical;
}
.script-card textarea.mono { font-family: var(--mono); font-size: 12.5px; }
.script-card textarea:focus, .script-card select:focus { outline: none; border-color: rgba(124, 92, 255, 0.55); }

.script-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.script-grid3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.script-grid3 textarea { font-size: 12.5px; }

.script-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.sa-item {
  margin: 0;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.sa-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #fff; }
.sa-item figcaption {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px;
  font-size: 11.5px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.sa-kind {
  flex-shrink: 0;
  font-size: 10px; font-weight: 700;
  color: #cfc4ff;
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 2px 6px;
}
.sa-fail {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--danger);
  background: rgba(255, 95, 115, 0.08);
  border: 1px solid rgba(255, 95, 115, 0.25);
  border-radius: 10px;
  padding: 8px 12px;
}

.script-params {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 6px;
}
.script-params select.fi { appearance: auto; }

.batch-progress { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.bp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 12.5px;
}
.bp-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.bp-status { flex-shrink: 0; color: var(--muted); }
.bp-status.run { color: #43dcff; }
.bp-status.ok { color: var(--ok); }
.bp-status.bad { color: var(--danger); }

@media (max-width: 1080px) {
  .home-hero { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: repeat(2, 1fr); }
  .script-grid3 { grid-template-columns: 1fr; }
  .script-params { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .home-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   v9 · 三氏华丰：引用链接预览 / 模型定价后台 / 会员账务
   ========================================================================== */

/* 任务行里的引用链接 */
.t-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 2px;
}
.ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #9db4ff;
  background: rgba(90, 120, 255, 0.1);
  border: 1px solid rgba(90, 120, 255, 0.3);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  max-width: 180px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  transition: 0.15s;
}
.ref-chip:hover {
  color: #cfd9ff;
  border-color: rgba(90, 120, 255, 0.6);
  background: rgba(90, 120, 255, 0.18);
}
.ref-chip svg { flex-shrink: 0; }

/* 引用预览弹窗 */
.ref-viewer-body { display: flex; justify-content: center; }
.ref-viewer-body img {
  max-width: 100%;
  max-height: 62vh;
  border-radius: 12px;
  background: #fff;
}
.ref-viewer-body video {
  max-width: 100%;
  max-height: 62vh;
  border-radius: 12px;
  background: #000;
}

/* 一键生成估价面板 */
.cost-estimate {
  margin-top: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cost-estimate .est-row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-dim);
}
.cost-estimate .est-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.cost-estimate .est-row:last-of-type { border-top: 1px dashed var(--line); padding-top: 6px; }
.cost-estimate .est-row:last-of-type b { color: #cfc4ff; font-size: 14px; }
.cost-estimate .est-warn { font-size: 12px; color: var(--danger); }
.cost-estimate .est-ok { font-size: 12px; color: var(--ok); }

/* 定价管理行 */
.pr-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.pr-row:last-child { border-bottom: none; }
.pr-row.is-off .pr-name { color: var(--muted); text-decoration: line-through; }
.pr-row .pr-name { flex: 1; font-size: 13px; }
.pr-row .pr-factor { font-size: 11.5px; color: var(--muted); }
.pr-row .pr-factor-input { width: 84px; padding: 6px 10px; }
.pr-row .pr-label-input { width: 130px; padding: 6px 10px; font-size: 12.5px; }

/* 会员账务 */
.a-fin {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  color: var(--text-dim);
}
.a-fin b { color: #cfc4ff; font-variant-numeric: tabular-nums; }

.user-ledger-sum {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.16), rgba(42, 212, 238, 0.08));
  border: 1px solid rgba(124, 92, 255, 0.3);
  border-radius: var(--radius);
  padding: 12px 18px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.user-ledger-sum b { color: #fff; font-size: 15px; margin-left: 4px; }

/* ------------------------- 顶栏窄屏适配（电商中心加入后共 8 个入口） ------------------------- */
@media (max-width: 1600px) {
  .topbar { gap: 16px; padding: 0 18px; }
  .topnav { gap: 1px; margin-left: 2px; }
  .topnav-item { padding: 7px 9px; font-size: 12.5px; }
  .brand-text span { display: none; }
  .topbar-right { gap: 8px; }
  .topbar-right .btn { padding: 8px 11px; }
}
@media (max-width: 1380px) {
  #btnSettings span { display: none; }
  .credit-pill .plus { display: none; }
  .brand-text strong { font-size: 13.5px; }
}
@media (max-width: 1240px) {
  .mode-chip { display: none; }
}

/* ==========================================================================
   高级会员（v12.9）
   ========================================================================== */

.p-prem-badge {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  white-space: nowrap;
}
.p-prem-badge.is-on {
  color: #ffd88a;
  border-color: rgba(255, 200, 100, 0.4);
  background: rgba(255, 190, 90, 0.12);
}
.prem-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 12px 0;
}
.prem-plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.prem-plan b { font-size: 13px; color: var(--text-dim); }
.prem-plan strong { font-size: 26px; letter-spacing: -0.02em; }
.prem-plan strong small { font-size: 12px; color: var(--muted); margin-left: 4px; font-weight: 500; }
.prem-plan span { font-size: 12px; color: var(--muted); flex: 1; }
.prem-plan .btn { margin-top: 10px; width: 100%; }
.prem-plan.is-best { border-color: rgba(255, 200, 100, 0.45); background: linear-gradient(160deg, rgba(255, 190, 90, 0.08), var(--panel-2) 55%); }
.prem-plan.is-best em {
  position: absolute;
  top: -9px;
  right: 12px;
  font-style: normal;
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #1a1206;
  background: linear-gradient(120deg, #ffd88a, #ffb14d);
  font-weight: 700;
}
.prem-benefits { font-size: 12.5px; color: var(--text-dim); }
.prem-benefits p { margin: 6px 0 4px; }
.prem-benefits ul { margin: 0; padding-left: 18px; line-height: 1.9; }
.prem-state p { margin: 10px 0 0; font-size: 12.5px; }
.prem-ok { color: var(--ok); }
.prem-warn { color: var(--warm); }
.prem-quota { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2, rgba(255,255,255,.03)); }
.prem-quota .q-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 3px 0; color: var(--text-dim); }
.prem-quota .q-row b { color: var(--text); font-weight: 600; }
.prem-quota .q-tip { margin: 8px 0 0; font-size: 11.5px; color: var(--text-dim); line-height: 1.6; }
.user-chip.is-premium #userNick::after {
  content: "★";
  margin-left: 4px;
  color: #ffd88a;
  font-size: 11px;
}

/* ==========================================================================
   华丰学堂（v12.9）
   ========================================================================== */

.academy-view { max-width: 1180px; margin: 0 auto; padding: 26px 28px 60px; overflow-y: auto; height: 100%; }
.academy-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.academy-eyebrow { font-size: 11px; letter-spacing: 0.18em; color: var(--muted); }
.academy-head h1 { margin: 4px 0 6px; font-size: 24px; letter-spacing: -0.01em; }
.academy-head p { margin: 0; max-width: 720px; font-size: 13px; line-height: 1.7; color: var(--text-dim); }
.academy-head p b { color: var(--text); }
.ac-prem-chip { font-size: 12px; padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255, 200, 100, 0.4); color: #ffd88a; background: rgba(255, 190, 90, 0.1); white-space: nowrap; }

.ac-tabs { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.ac-tab {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 12px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  cursor: pointer; text-align: left; transition: border-color 0.15s, background 0.15s;
}
.ac-tab b { font-size: 14px; }
.ac-tab span { font-size: 11.5px; color: var(--muted); }
.ac-tab:hover { border-color: var(--line-strong); }
.ac-tab.is-active { border-color: rgba(124, 92, 255, 0.55); background: var(--accent-soft); }
.ac-tab.is-active span { color: rgba(232, 234, 241, 0.75); }

.ac-loading { padding: 60px 0; text-align: center; color: var(--muted); font-size: 13px; }
.ac-empty { padding: 70px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.ac-empty svg { opacity: 0.5; }
.ac-empty h3 { margin: 12px 0 6px; font-size: 15px; color: var(--text-dim); }
.ac-empty p { margin: 0; font-size: 12.5px; }

.ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ac-card {
  display: flex; gap: 12px; padding: 14px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); cursor: pointer;
  transition: border-color 0.15s, transform 0.15s; position: relative;
}
.ac-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.ac-card.is-lock .ac-thumb { color: var(--muted); }
.ac-thumb {
  width: 64px; height: 64px; flex: none; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: linear-gradient(140deg, rgba(124, 92, 255, 0.25), rgba(42, 212, 238, 0.14));
  color: var(--text);
}
.ac-card.is-lock .ac-thumb { background: var(--panel-3); }
.ac-badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 10px; padding: 2px 7px; border-radius: 999px; font-weight: 600;
}
.ac-badge.is-free { background: rgba(56, 211, 159, 0.16); color: var(--ok); }
.ac-badge.is-lock { background: rgba(255, 157, 92, 0.16); color: var(--warm); }
.ac-card-main { min-width: 0; flex: 1; }
.ac-card-main b { display: block; font-size: 13.5px; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-card-main p { margin: 0 0 8px; font-size: 12px; color: var(--text-dim); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ac-card-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.ac-del { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity 0.15s; }
.ac-card:hover .ac-del { opacity: 1; }

.ac-player-card { max-width: 860px; width: 92vw; }
.ac-player-meta { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

.ac-manage { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.ac-mcard { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.ac-mcard h3 { margin: 0 0 6px; font-size: 14.5px; }
.ac-mtip { margin: 0 0 12px; font-size: 12px; color: var(--muted); line-height: 1.6; }
.ac-mcard .fl { display: block; font-size: 12px; color: var(--text-dim); margin: 10px 0 4px; }
.ac-mcard .fi { width: 100%; padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text); font-size: 13px; font-family: var(--font); }
.ac-mcard .btn { margin-top: 14px; width: 100%; }
.ac-up-status { margin-top: 10px; font-size: 12px; color: var(--text-dim); min-height: 18px; }
.ac-up-prog { display: block; height: 6px; border-radius: 999px; background: var(--panel-3); overflow: hidden; margin-bottom: 6px; }
.ac-up-prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--cyan)); transition: width 0.2s; }
.ac-up-status .ac-ok { color: var(--ok); }
.ac-up-status .ac-err { color: var(--danger); }

.ac-admins { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.ac-admin-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 999px; font-size: 12px;
  border: 1px solid rgba(56, 211, 159, 0.35); background: rgba(56, 211, 159, 0.08);
}
.ac-admin-chip i { font-style: normal; color: var(--muted); font-size: 11px; }
.ac-admin-chip button { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 2px; }
.ac-admin-chip button:hover { color: var(--danger); }
.ac-admin-none { font-size: 12px; color: var(--muted); }
.ac-cands { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 220px; overflow-y: auto; }
.ac-cand {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 12.5px;
}
.ac-cand:hover:not(:disabled) { border-color: var(--line-strong); }
.ac-cand:disabled { opacity: 0.55; cursor: not-allowed; }
.ac-cand i { font-style: normal; color: var(--muted); flex: 1; font-size: 11.5px; }
.ac-cand b { color: var(--ok); font-size: 11.5px; }
.ac-cand em { font-style: normal; color: var(--muted); font-size: 11px; }

/* 电商中心 PH 锁定卡 */
.ec-prem-lock {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center; padding: 40px 24px;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(3px);
}
.ec-prem-lock svg { color: #ffd88a; }
.ec-prem-lock h3 { margin: 6px 0 0; font-size: 16px; }
.ec-prem-lock p { margin: 0; max-width: 440px; font-size: 12.5px; line-height: 1.7; color: var(--text-dim); }
.ec-prem-lock .btn { margin-top: 12px; }

/* ============================ 同款视频素材库 ============================ */
.remake-view { max-width: 1080px; margin: 0 auto; padding: 26px 20px 60px; }
.remake-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px; }
.remake-card {
  margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px;
  background: var(--panel, rgba(255,255,255,0.03)); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.remake-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.18); }
.rc-video { position: relative; aspect-ratio: 16 / 10; background: #000; overflow: hidden; }
.rc-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.remake-card figcaption { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.rc-title { font-size: 14px; color: var(--text); line-height: 1.45; }
.rc-desc { font-size: 12px; color: var(--muted); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rc-meta { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-actions { display: flex; gap: 8px; margin-top: 6px; }
.rc-actions .btn { flex: 1; }
.remake-empty { padding: 48px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* 复制同款弹窗 */
.modal-card.remake-modal { width: min(1240px, 96vw); max-width: none; }
.rm-modal-body { max-height: min(90vh, 1000px); overflow: auto; padding: 18px 22px 22px; }
.rm-cols { display: grid; grid-template-columns: 420px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .rm-cols { grid-template-columns: 1fr; } }
.remake-modal-preview video { width: 100%; border-radius: 10px; background: #000; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.rm-meta { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.rm-meta b { font-size: 14px; color: var(--text); }
.rm-meta span { font-size: 12px; color: var(--muted); line-height: 1.6; }
.remake-modal-form { display: flex; flex-direction: column; gap: 10px; }
.remake-modal-form .fl { font-size: 12px; color: var(--muted); }
.remake-modal-form textarea.fi { resize: vertical; }
.rm-refs { display: flex; flex-wrap: wrap; gap: 6px; }
.rm-ref-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 10px; max-width: 220px;
}
.rm-ref-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-ref-del {
  border: 0; background: rgba(255,255,255,0.08); color: var(--muted); border-radius: 999px;
  width: 18px; height: 18px; line-height: 1; cursor: pointer; font-size: 11px;
}
.rm-ref-del:hover { color: var(--danger); }

/* ============================ 素材库板块 Tab ============================ */
.rm-lib-tabs {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 18px 0 16px;
}
.rm-lib-media { display: flex; gap: 8px; }
.rm-tab {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line, rgba(255,255,255,0.12)); border-radius: 999px;
  background: transparent; color: var(--text-dim, #b9bdc9);
  padding: 8px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.15s ease;
}
.rm-tab:hover { color: var(--text, #fff); border-color: rgba(77,125,255,0.6); }
.rm-tab.is-active {
  background: linear-gradient(135deg, #4d7dff, #2f5bff); color: #fff;
  border-color: transparent; box-shadow: 0 4px 14px rgba(77,125,255,0.35);
}
.rm-lib-biz { display: flex; gap: 8px; }
.rm-biz {
  border: 1px solid var(--line, rgba(255,255,255,0.12)); border-radius: 999px;
  background: transparent; color: var(--text-dim, #b9bdc9);
  padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.15s ease;
}
.rm-biz:hover { color: var(--text, #fff); }
.rm-biz.is-active { background: rgba(42,212,238,0.14); color: #43dcff; border-color: rgba(42,212,238,0.5); }
.rm-count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 999px; background: rgba(255,255,255,0.12); font-size: 11px; line-height: 18px;
  text-align: center; font-weight: 500;
}
.rm-tab.is-active .rm-count, .rm-biz.is-active .rm-count { background: rgba(255,255,255,0.22); }

/* 图片素材卡片预览 */
.rc-video img { width: 100%; height: 100%; object-fit: cover; display: block; }
