/* 视频创作工作台 — 即梦式全能参考 + 生成记忆 重构
   设计系统见 design-system/MASTER.md。准则摘要：
   深色电影感 + Soft 微立体；Inter 排版（标题渐变描金）；靛蓝/青强调；
   无障碍：正文对比≥4.5:1、可见焦点、内联 SVG 图标、cursor-pointer、≥44px、reduced-motion、断点 375/768/1024/1440。 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg:#04120f;
  --panel:#0a1d18; --panel-2:#122e26; --panel-3:rgba(255,255,255,.05);
  --line:rgba(26,58,48,.85); --line-strong:rgba(52,211,153,.32);
  --text:#eafaf2; --muted:#92d5b8; --weak:#5f8f7a;
  --primary:#34d399; --primary-2:#6ee7b7;
  --ok:#34d399; --warn:#fbbf24; --err:#f87171; --info:#34d399;
  --btn-text:#04120f; --ring:#6ee7b7;
  --radius:14px; --radius-sm:9px;
  --shadow:0 14px 44px rgba(0,0,0,.45);
  --dur:220ms; --ease:cubic-bezier(.22,.61,.36,1);
  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI','PingFang SC','Microsoft YaHei',system-ui,sans-serif;
}
* { box-sizing:border-box; }
html,body { margin:0; padding:0; }
html { -webkit-text-size-adjust:100%; }
body { font-family:var(--font); color:var(--text); line-height:1.55; min-height:100vh;
  background:
    radial-gradient(1000px 520px at 18% -12%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 55%),
    radial-gradient(820px 480px at 94% 6%, color-mix(in srgb, var(--primary-2) 10%, transparent), transparent 50%),
    var(--bg);
  background-attachment:fixed; font-feature-settings:'ss01','cv11'; }
/* 壁纸层（仅作背景；应用垫透明主题色，使壁纸透出且不压暗成黑） */
body.has-wallpaper::before { content:''; position:fixed; inset:0; z-index:0; background-image:var(--wp-url);
  background-size:cover; background-position:center; background-repeat:no-repeat; opacity:var(--wp-dim, 0.9); }
.app { position:relative; z-index:1; background:color-mix(in srgb, var(--bg) 44%, transparent); }
.hidden { display:none !important; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.icon { width:1em; height:1em; display:inline-block; vertical-align:-.14em; flex:none; }
:focus-visible { outline:2px solid var(--ring); outline-offset:2px; border-radius:6px; }

::selection { background:color-mix(in srgb,var(--primary) 40%, transparent); }

/* ===== 整体两栏 ===== */
.app { display:grid; grid-template-columns:248px 1fr; min-height:100vh; }
@media (max-width:900px){ .app { grid-template-columns:72px 1fr; } }

/* ===== 左栏 ===== */
.rail { position:sticky; top:0; height:100vh; display:flex; flex-direction:column;
  background:color-mix(in srgb,var(--panel) 84%, transparent); border-right:1px solid var(--line);
  padding:14px 12px; gap:14px; }
.rail-brand { display:flex; align-items:center; gap:10px; padding:6px 8px; font-weight:700; letter-spacing:-.02em; font-size:15px; }
.rail-brand .icon { width:20px; height:20px; color:var(--primary); }
.rail-nav { display:flex; flex-direction:column; gap:4px; }
.rail-item { display:flex; align-items:center; gap:10px; width:100%; padding:11px 12px; border:0; border-radius:11px;
  background:transparent; color:var(--muted); font-size:14px; font-weight:600; font-family:inherit; cursor:pointer; text-align:left;
  transition:all var(--dur) var(--ease); touch-action:manipulation; }
.rail-item .icon { width:18px; height:18px; }
.rail-item:hover { color:var(--text); background:var(--panel-2); }
.rail-item.active { color:#fff; background:color-mix(in srgb,var(--primary) 22%, var(--panel-2)); box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--primary) 45%, transparent); }
.rail-list { flex:1; overflow:auto; display:flex; flex-direction:column; gap:8px; min-height:0; }
.rail-list .list-title { font-size:11px; color:var(--muted); margin:10px 8px 2px; letter-spacing:.06em; text-transform:uppercase; }
.list-item { display:flex; flex-direction:column; gap:7px; padding:10px 12px; border-radius:11px; cursor:pointer;
  background:var(--panel-2); border:1px solid var(--line); transition:all var(--dur) var(--ease); }
.list-item:hover { border-color:var(--line-strong); transform:translateY(-1px); }
.list-item .li-top { display:flex; }
.list-item .li-badge { font-size:10px; padding:1px 7px; border-radius:5px; background:color-mix(in srgb,var(--primary) 20%, var(--panel-3)); color:var(--primary-2); font-weight:600; }
.list-item .li-title { font-weight:600; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.list-item .li-meta { font-size:11px; color:var(--muted); }
.list-empty { color:var(--muted); font-size:12px; padding:16px 10px; display:flex; flex-direction:column; align-items:center; gap:8px; text-align:center; }
.list-empty .le-icon { width:34px; height:34px; color:var(--primary-2); opacity:.8; }
.list-empty .le-icon .icon { width:34px; height:34px; }
.list-empty span { font-size:11px; opacity:.75; }
.rail-hints { border-top:1px solid var(--line); padding:12px 8px 4px; }
.hint-title { font-size:11px; color:var(--muted); letter-spacing:.06em; text-transform:uppercase; margin-bottom:8px; }
.hint-list { margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:8px; }
.hint-list li { font-size:12px; color:var(--muted); display:flex; gap:8px; line-height:1.4; }
.hint-list li::before { content:'·'; color:var(--primary-2); font-weight:700; flex:none; }
.hint-list code { background:rgba(255,255,255,.06); padding:0 5px; border-radius:5px; font-size:11px; }
.rail-foot { display:flex; align-items:center; gap:8px; border-top:1px solid var(--line); padding:12px 8px 4px; }
.conn { flex:1; display:flex; align-items:center; gap:8px; font-size:12px; color:var(--muted); white-space:nowrap; overflow:hidden; }
.dot { width:8px; height:8px; border-radius:50%; background:var(--warn); flex:none; }
.conn.ok .dot { background:var(--ok); } .conn.err .dot { background:var(--err); }
.rail-foot-btn { width:34px; height:34px; border:1px solid var(--line); background:var(--panel-2); color:var(--muted);
  border-radius:9px; cursor:pointer; display:grid; place-items:center; transition:all var(--dur) var(--ease); touch-action:manipulation; }
.rail-foot-btn:hover { color:var(--text); border-color:var(--line-strong); }
.rail-foot-btn .icon { width:17px; height:17px; }

/* ===== 主画布 ===== */
.stage { padding:18px 22px 40px; }
.stage-top { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.title { background:transparent; border:1px solid transparent; color:var(--text); font-size:20px; font-weight:700;
  font-family:inherit; padding:6px 4px; border-radius:8px; flex:1; min-width:0;
  background:linear-gradient(90deg,#fff,rgba(255,255,255,.7)); -webkit-background-clip:text; background-clip:text; color:transparent; }
.title:hover, .title:focus { border-color:var(--line); }
.title::placeholder { color:var(--muted); }
.stage-top-right { display:flex; align-items:center; gap:8px; }
.credits { display:flex; align-items:center; gap:6px; font-size:13px; font-weight:600; color:var(--text);
  background:var(--panel-2); border:1px solid var(--line); padding:6px 12px; border-radius:20px; }
.credits .icon { width:15px; height:15px; color:var(--primary-2); }

/* 视图 */
.view-head { display:flex; align-items:baseline; gap:12px; margin-bottom:16px; flex-wrap:wrap; }
.view-head h2 { margin:0; font-size:18px; }
.view-sub { color:var(--muted); font-size:13px; }
.view-head .ghost-btn { margin-left:auto; }

/* 模式切换 */
.modes { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
.mode { display:flex; align-items:center; gap:8px; padding:10px 16px; border:1px solid var(--line); border-radius:999px;
  background:var(--panel-2); color:var(--muted); cursor:pointer; font-size:14px; font-weight:600; font-family:inherit;
  transition:all var(--dur) var(--ease); touch-action:manipulation; }
.mode .icon { width:17px; height:17px; }
.mode:hover { color:var(--text); border-color:var(--line-strong); }
.mode.active { color:#fff; border-color:var(--primary); background:color-mix(in srgb,var(--primary) 24%, var(--panel-2)); }

/* 参考区 */
.refzone { padding:13px 14px; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); margin-bottom:14px; }
.refzone-title { font-size:13px; font-weight:700; margin-bottom:6px; letter-spacing:-.01em; }
.refzone-title b { color:var(--primary-2); }
.ref-note { margin:0 0 10px; font-size:11px; color:var(--muted); }
.ref-note code { background:rgba(255,255,255,.06); padding:1px 5px; border-radius:5px; font-size:11px; }
.ref-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.ref-slot { display:flex; flex-direction:column; gap:6px; }
.slot-label { font-size:12px; color:var(--muted); font-weight:600; }
.drop { min-height:96px; border:1px dashed var(--line-strong); border-radius:var(--radius-sm); background:var(--panel-2);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:10px; }
.drop img, .drop video { max-width:100%; max-height:120px; border-radius:8px; }
.drop-ic { width:32px; height:32px; color:var(--muted); }
.drop-ic .icon { width:28px; height:28px; }
.drop .drop-ui { display:flex; flex-wrap:wrap; gap:6px; align-items:center; width:100%; }
.drop .drop-note { font-size:11px; color:var(--muted); }
.drop .drop-name { font-size:12px; color:var(--text); max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-align:center; }

.ref-addbar { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; align-items:center; }
.ref-addbar select, .ref-addbar input { background:var(--panel-2); border:1px solid var(--line); color:var(--text);
  border-radius:var(--radius-sm); padding:9px 11px; font-size:13px; font-family:inherit; }
.ref-addbar select { min-width:110px; }
.ref-addbar select:focus, .ref-addbar input:focus { border-color:var(--primary); }
.add-btn { display:flex; align-items:center; gap:6px; padding:10px 14px; border:0; border-radius:var(--radius-sm); cursor:pointer;
  background:linear-gradient(135deg,var(--primary),var(--primary-2)); color:var(--btn-text); font-weight:700; font-size:13px;
  font-family:inherit; transition:filter var(--dur) var(--ease); touch-action:manipulation; }
.add-btn:hover { filter:brightness(1.07); } .add-btn .icon { width:15px; height:15px; }
.upload-btn { display:flex; align-items:center; gap:6px; padding:10px 14px; border:1px solid var(--line-strong); border-radius:var(--radius-sm);
  background:var(--panel-2); color:var(--text); cursor:pointer; font-size:13px; font-weight:600; font-family:inherit; transition:all var(--dur) var(--ease); touch-action:manipulation; }
.upload-btn:hover { border-color:var(--primary); } .upload-btn .icon { width:15px; height:15px; }

.ref-list { display:flex; flex-wrap:wrap; gap:8px; }
.ref-chip { display:inline-flex; align-items:center; gap:8px; padding:5px 6px 5px 5px; border:1px solid var(--line); border-radius:10px; background:var(--panel-2); }
.ref-chip .rc-thumb { width:38px; height:38px; border-radius:7px; overflow:hidden; background:var(--panel-3); display:grid; place-items:center; flex:none; }
.ref-chip .rc-thumb img, .ref-chip .rc-thumb video { width:100%; height:100%; object-fit:cover; }
.ref-chip .rc-thumb .icon { width:18px; height:18px; color:var(--muted); }
.ref-chip .rc-label { font-size:12px; color:var(--text); font-weight:600; white-space:nowrap; max-width:180px; overflow:hidden; text-overflow:ellipsis; }
.ref-chip .rc-del { width:22px; height:22px; border:0; background:transparent; color:var(--muted); cursor:pointer; border-radius:6px; display:grid; place-items:center; transition:all var(--dur) var(--ease); }
.ref-chip .rc-del:hover { color:#fff; background:var(--err); } .ref-chip .rc-del .icon { width:13px; height:13px; }
.ref-list .ref-empty { color:var(--muted); font-size:12px; padding:2px 2px; }

/* 提示词 */
.prompt-card { position:relative; margin-bottom:16px; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); overflow:visible; }
.prompt-toolbar { display:flex; align-items:center; gap:10px; padding:10px 14px; border-bottom:1px solid var(--line); }
.prompt-toolbar #prompt-count { font-size:12px; color:var(--muted); margin-left:auto; }
.tool-btn { display:inline-flex; align-items:center; gap:6px; background:var(--panel-2); border:1px solid var(--line); color:var(--text);
  padding:6px 12px; border-radius:8px; cursor:pointer; font-size:13px; font-weight:600; font-family:inherit; transition:all var(--dur) var(--ease); touch-action:manipulation; }
.tool-btn:hover { border-color:var(--primary); color:#fff; } .tool-btn .icon { width:15px; height:15px; }
.link-btn { background:none; border:none; color:var(--info); cursor:pointer; font-size:12px; padding:2px 0; font-family:inherit; }
.link-btn:hover { text-decoration:underline; }
.prompt-area { min-height:240px; max-height:460px; overflow:auto; color:var(--text); font-size:15px; line-height:1.8;
  padding:14px 16px; outline:none; white-space:pre-wrap; word-break:break-word; }
.prompt-area:focus { box-shadow:inset 0 0 0 1px var(--primary); }
.prompt-area:empty::before { content:attr(data-placeholder); color:color-mix(in srgb,var(--muted) 55%, transparent); }
.inline-chip { display:inline-flex; align-items:center; gap:6px; vertical-align:middle; margin:0 2px; padding:3px 6px 3px 4px;
  border-radius:8px; background:var(--panel-3); border:1px solid var(--line-strong); cursor:zoom-in; }
.inline-chip img, .inline-chip video { width:22px; height:22px; border-radius:5px; object-fit:cover; }
.inline-chip .chip-ic { width:18px; height:18px; color:var(--primary-2); display:grid; place-items:center; }
.inline-chip .chip-label { font-size:12px; color:var(--text); font-weight:600; }
.inline-chip:hover { border-color:var(--primary); }
.ref-menu { position:absolute; z-index:40; min-width:240px; max-height:320px; overflow:auto; background:color-mix(in srgb,var(--panel) 92%, transparent);
  border:1px solid var(--line-strong); border-radius:12px; box-shadow:var(--shadow); padding:0; backdrop-filter:blur(14px); -webkit-backdrop-filter:blur(14px); }
.ref-cats { display:flex; gap:6px; padding:8px; border-bottom:1px solid var(--line); position:sticky; top:0; background:inherit; }
.ref-cat { flex:1; padding:7px 8px; border:1px solid var(--line); background:var(--panel-2); color:var(--muted); border-radius:8px; cursor:pointer; font-size:12px; font-weight:600; font-family:inherit; touch-action:manipulation; }
.ref-cat.active { border-color:var(--primary); color:#fff; background:color-mix(in srgb,var(--primary) 18%, var(--panel-2)); }
.ref-items { padding:6px; }
.ref-items-hint { font-size:10px; color:var(--muted); padding:2px 6px 6px; text-transform:uppercase; letter-spacing:.06em; }
.ref-menu-item { display:flex; align-items:center; gap:10px; width:100%; padding:8px 10px; border:1px solid transparent; background:transparent; color:var(--text);
  cursor:pointer; font-size:13px; font-family:inherit; border-radius:8px; text-align:left; transition:background var(--dur) var(--ease); }
.ref-menu-item.active { background:var(--panel-3); border-color:var(--primary); }
.ref-menu-item:hover { background:var(--panel-3); }
.ref-menu-item .rm-thumb { width:30px; height:30px; border-radius:6px; overflow:hidden; background:var(--panel-3); display:grid; place-items:center; flex:none; }
.ref-menu-item .rm-thumb img, .ref-menu-item .rm-thumb video { width:100%; height:100%; object-fit:cover; }
.ref-menu-item .rm-thumb .icon { width:16px; height:16px; color:var(--muted); }
.ref-menu .ref-empty { padding:12px; color:var(--muted); font-size:12px; }
.hover-preview { position:fixed; z-index:80; pointer-events:none; background:#000; border:1px solid var(--line-strong); border-radius:12px;
  box-shadow:var(--shadow); overflow:hidden; max-width:min(460px,80vw); }
.hover-preview img, .hover-preview video { display:block; max-width:100%; max-height:320px; object-fit:contain; }
.hover-preview audio { display:block; width:min(420px,72vw); padding:16px; }
.hover-preview .hv-cap { padding:6px 12px; font-size:12px; color:var(--muted); background:rgba(10,12,17,.9); text-align:center; }

/* 参数 */
.params { display:flex; flex-direction:column; gap:14px; padding:16px; border:1px solid var(--line); border-radius:var(--radius); background:var(--panel); margin-bottom:16px; }
.param-row { display:flex; align-items:center; gap:12px; }
.param-row > label, .param-row > .field-label { flex:none; width:96px; font-size:13px; color:var(--muted); }
.param-row label b { color:var(--text); }
.param-row input[type=range] { -webkit-appearance:none; appearance:none; flex:1; height:6px; background:var(--line); border-radius:6px; padding:0; }
.param-row input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:20px; height:20px; border-radius:50%;
  background:linear-gradient(135deg,var(--primary),var(--primary-2)); cursor:pointer; border:3px solid #fff; box-shadow:0 2px 8px rgba(0,0,0,.45); }
.param-row input[type=text], .param-row input[type=url], .param-row input[type=number], .param-row input:not([type]), .param-row select {
  flex:1; background:var(--panel-2); border:1px solid var(--line); color:var(--text); border-radius:var(--radius-sm); padding:10px 12px; font-size:13px; font-family:inherit; }
.param-row select { min-width:120px; }
.ratio-group { display:flex; flex-wrap:wrap; gap:8px; flex:1; }
.ratio-group button { background:var(--panel-2); border:1px solid var(--line); color:var(--muted); padding:9px 12px; border-radius:8px;
  cursor:pointer; font-size:12px; font-weight:600; font-family:inherit; min-height:38px; transition:all var(--dur) var(--ease); touch-action:manipulation; }
.ratio-group button:hover { color:var(--text); border-color:var(--line-strong); }
.ratio-group button.active { border-color:var(--primary); color:#fff; background:color-mix(in srgb,var(--primary) 24%, var(--panel-2)); }
.adv { align-self:flex-start; background:none; border:none; color:var(--info); cursor:pointer; font-size:13px; padding:4px 0; font-family:inherit; }
.adv .adv-caret { display:inline-block; transition:transform var(--dur) var(--ease); margin-left:4px; }
.adv[aria-expanded="true"] .adv-caret { transform:rotate(90deg); }
#adv-body { display:flex; flex-direction:column; gap:12px; padding-top:2px; }
#adv-body .param-row > label { width:150px; }

/* 底部生成条 */
.genbar { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 16px;
  border:1px solid var(--line); border-radius:var(--radius); background:color-mix(in srgb,var(--panel) 92%, transparent);
  position:relative; margin-top:12px; }
.genbar-left { display:flex; flex-direction:column; gap:6px; min-width:0; }
.genbar-refs { display:flex; gap:6px; flex-wrap:wrap; }
.genbar-refs:empty { display:none; }
.genbar-ref-thumb { width:34px; height:34px; border-radius:7px; overflow:hidden; background:var(--panel-3); display:grid; place-items:center; }
.genbar-ref-thumb img, .genbar-ref-thumb video { width:100%; height:100%; object-fit:cover; }
.genbar-ref-thumb .icon { width:16px; height:16px; color:var(--muted); }
.genbar-meta { font-size:12px; color:var(--muted); }
.gen-btn { display:flex; align-items:center; justify-content:center; gap:8px; padding:14px 26px; border:0; border-radius:12px; cursor:pointer;
  font-size:16px; font-weight:700; color:var(--btn-text); font-family:inherit;
  background:linear-gradient(135deg,var(--primary),var(--primary-2)); box-shadow:0 10px 28px rgba(124,134,255,.35);
  transition:transform .12s var(--ease), filter var(--dur) var(--ease); touch-action:manipulation; }
.gen-btn .icon { width:18px; height:18px; }
.gen-btn:hover { filter:brightness(1.07); } .gen-btn:active { transform:translateY(1px) scale(.995); }
.gen-btn:disabled { filter:grayscale(.4) brightness(.8); opacity:.65; cursor:not-allowed; }

.status { margin-top:12px; font-size:13px; min-height:20px; }
.status.ok { color:var(--ok); } .status.err { color:var(--err); } .status.info { color:var(--info); }
.retry-btn { margin-top:10px; width:100%; padding:11px; border:1px solid var(--line-strong); background:var(--panel-2); color:var(--text);
  border-radius:var(--radius-sm); cursor:pointer; font-size:13px; font-weight:600; font-family:inherit;
  display:flex; align-items:center; justify-content:center; gap:8px; transition:all var(--dur) var(--ease); touch-action:manipulation; }
.retry-btn:hover { border-color:var(--primary); color:#fff; } .retry-btn.pinned { border-color:var(--primary); } .retry-btn .icon { width:16px; height:16px; }

/* 结果 */
.result-area { margin-top:24px; }
.videos-head { display:flex; align-items:baseline; gap:12px; margin-bottom:14px; }
.videos-head h2 { margin:0; font-size:17px; }
.videos-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:14px; }
.vid-card { background:var(--panel-2); border:1px solid var(--line); border-radius:14px; overflow:hidden; cursor:pointer; transition:all var(--dur) var(--ease); }
.vid-card:hover { transform:translateY(-3px); border-color:var(--line-strong); box-shadow:0 12px 30px rgba(0,0,0,.35); }
.vid-card.generating { border-color:color-mix(in srgb,var(--primary) 50%, var(--line)); pointer-events:none; }
.vid-note { grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 12px; border:1px dashed var(--err); border-radius:10px; background:color-mix(in srgb,var(--err) 10%, var(--panel-2)); color:var(--err); font-size:12px; }
.vid-note-del { flex:none; padding:6px 12px; border:1px solid transparent; border-radius:8px; background:var(--err); color:#fff; cursor:pointer; font-size:12px; font-weight:600; font-family:inherit; transition:filter var(--dur) var(--ease); touch-action:manipulation; }
.vid-note-del:hover { filter:brightness(1.1); }
.vid-preview { aspect-ratio:16/9; background:var(--panel-3); display:grid; place-items:center; overflow:hidden; }
.vid-preview video { width:100%; height:100%; object-fit:cover; }
.vid-no { color:var(--muted); font-size:13px; display:flex; flex-direction:column; align-items:center; gap:6px; }
.vid-no .icon { width:26px; height:26px; color:var(--primary-2); }
.vid-cap { padding:9px 11px; }
.vid-p { font-size:12px; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; line-height:1.4; }
.vid-meta { font-size:11px; color:var(--muted); margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gen-card { display:flex; flex-direction:column; align-items:center; gap:10px; color:var(--muted); }
.gen-card .spinner { width:34px; height:34px; }
.gen-text { font-size:13px; color:var(--text); }
#gen-elapsed { font-size:12px; color:var(--primary-2); }
.videos-empty { grid-column:1/-1; min-height:220px; border:1px dashed var(--line-strong); border-radius:var(--radius); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; color:var(--muted); text-align:center; }
.videos-empty .ve-icon { width:56px; height:56px; border-radius:16px; display:grid; place-items:center; color:var(--primary); background:var(--panel-2); border:1px solid var(--line); }
.videos-empty .ve-icon .icon { width:26px; height:26px; }
.videos-empty p { margin:0; font-size:15px; color:var(--text); }
.videos-empty span { font-size:13px; }
.list-item.new { flex-direction:row; align-items:center; gap:8px; color:var(--primary); font-weight:600; }
.list-item.active { border-color:var(--primary); background:color-mix(in srgb,var(--primary) 16%, var(--panel-2)); }
.list-item .li-top { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.list-item .li-actions { display:flex; gap:4px; opacity:0; transition:opacity var(--dur) var(--ease); }
.list-item:hover .li-actions { opacity:1; }
.li-btn { width:26px; height:26px; border:1px solid var(--line); background:var(--panel-2); color:var(--muted); border-radius:7px; cursor:pointer; display:grid; place-items:center; transition:all var(--dur) var(--ease); }
.li-btn:hover { color:#fff; border-color:var(--line-strong); }
.li-btn.li-del:hover { background:var(--err); border-color:var(--err); }
.li-btn .icon { width:14px; height:14px; }

/* 玻璃材质（弥散光透入，克制 blur 只在叶片卡） */
.panel, .refzone, .prompt-card, .params, .genbar, .vid-card, .lib-card, .mem-card, .rail, .topbar {
  background-color:color-mix(in srgb, var(--panel) 74%, transparent);
  backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
}
/* 覆盖输入/拾起层更深的玻璃 */
.panel-2, .prompt-card { border:1px solid var(--line); }
.credits, .stage-top-right { display:none; }
.empty { min-height:220px; display:flex; flex-direction:column; align-items:center; justify-content:center; color:var(--muted); text-align:center; border:1px dashed var(--line-strong); border-radius:var(--radius); }
.empty-icon { width:64px; height:64px; border-radius:18px; display:grid; place-items:center; color:var(--primary); background:var(--panel-2); border:1px solid var(--line); margin-bottom:12px; }
.empty-icon .icon { width:28px; height:28px; }
.empty p { margin:0 0 6px; font-size:15px; color:var(--text); } .empty span { font-size:13px; }
.result-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.result-head h2 { margin:0; font-size:17px; }
.result-actions { display:flex; gap:8px; }
.ghost-btn { display:flex; align-items:center; gap:6px; background:var(--panel-2); border:1px solid var(--line); color:var(--muted);
  padding:9px 14px; border-radius:var(--radius-sm); cursor:pointer; font-size:13px; font-weight:600; font-family:inherit;
  transition:all var(--dur) var(--ease); touch-action:manipulation; }
.ghost-btn .icon { width:15px; height:15px; }
.ghost-btn:hover { color:var(--text); border-color:var(--line-strong); }
.video-wrap { position:relative; aspect-ratio:16/9; background:#000; border-radius:12px; overflow:hidden; border:1px solid var(--line); }
video { width:100%; height:100%; object-fit:contain; display:block; background:#000; }
.loading { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:14px; background:rgba(6,8,13,.86); color:var(--muted); }
.spinner { width:44px; height:44px; border-radius:50%; border:3px solid var(--line); border-top-color:var(--primary); animation:spin 1s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.result-meta { margin-top:12px; font-size:12px; color:var(--muted); }
.result-meta .chip { background:var(--panel-2); border:1px solid var(--line); padding:4px 10px; border-radius:6px; margin:2px 4px 2px 0; font-size:12px; display:inline-block; }
details.raw { margin-top:12px; } details.raw summary { cursor:pointer; color:var(--muted); font-size:13px; padding:4px 0; }
details.raw pre { background:var(--panel-2); border:1px solid var(--line); border-radius:var(--radius-sm); padding:12px; font-size:12px; overflow:auto; max-height:260px; white-space:pre-wrap; word-break:break-all; }

/* 记忆 / 参考库 / 历史 网格 */
.grid-mem { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:14px; }
.mem-card { background:var(--panel-2); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; display:flex; flex-direction:column; transition:all var(--dur) var(--ease); }
.mem-card:hover { border-color:var(--line-strong); transform:translateY(-3px); }
.mem-card .mem-video { aspect-ratio:16/9; background:var(--panel-3); position:relative; display:flex; align-items:center; justify-content:center; }
.mem-card .mem-video video { width:100%; height:100%; object-fit:cover; }
.mem-card .mem-no-video { color:var(--muted); }
.mem-card .mem-no-video .icon { width:30px; height:30px; }
.mem-card .mem-body { padding:12px 14px; display:flex; flex-direction:column; gap:8px; flex:1; }
.mem-card .mem-title { font-weight:700; font-size:14px; }
.mem-card .mem-badges { display:flex; gap:6px; flex-wrap:wrap; }
.mem-badge { font-size:11px; padding:2px 8px; border-radius:6px; background:var(--panel-3); border:1px solid var(--line); color:var(--muted); }
.mem-card .mem-prompt { font-size:12px; color:var(--muted); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.mem-card .mem-actions { display:flex; gap:8px; margin-top:auto; }
.lib-add { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; align-items:center; }
.lib-add input, .lib-add select { background:var(--panel-2); border:1px solid var(--line); color:var(--text); border-radius:var(--radius-sm); padding:10px 12px; font-size:13px; font-family:inherit; }
.lib-add input[placeholder*="参考名"] { flex:1; min-width:160px; }
.lib-add input[placeholder*="网址"] { flex:2; min-width:200px; }
.lib-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px; }
.lib-card { background:var(--panel-2); border:1px solid var(--line); border-radius:var(--radius); padding:14px; display:flex; flex-direction:column; gap:10px; }
.lib-cats { display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap; }
.lib-cats .ref-cat { flex:none; }
.lib-card .lc-head { display:flex; align-items:center; gap:10px; }
.lib-card .lc-thumb { width:44px; height:44px; border-radius:9px; overflow:hidden; background:var(--panel-3); display:grid; place-items:center; flex:none; }
.lib-card .lc-thumb img, .lib-card .lc-thumb video { width:100%; height:100%; object-fit:cover; }
.lib-card .lc-thumb .icon { width:20px; height:20px; color:var(--primary-2); }
.lib-card .lc-icon { width:40px; height:40px; border-radius:10px; background:var(--panel-3); display:grid; place-items:center; color:var(--primary-2); }
.lib-card .lc-icon .icon { width:20px; height:20px; }
.lib-card .lc-name { font-weight:700; font-size:14px; }
.lib-card .lc-meta { font-size:11px; color:var(--muted); }
.lib-card .lc-url { font-size:11px; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lib-card .lc-actions { display:flex; gap:8px; }
.history-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:14px; }
.recover-bar { display:flex; gap:8px; margin-bottom:16px; align-items:center; }
.recover-bar input { flex:1; background:var(--panel-2); border:1px solid var(--line); color:var(--text); border-radius:var(--radius-sm); padding:11px 12px; font-size:13px; font-family:inherit; min-width:0; }
.recover-bar input:focus { border-color:var(--primary); }
.h-card { background:var(--panel-2); border:1px solid var(--line); border-radius:12px; overflow:hidden; cursor:pointer; position:relative; transition:all var(--dur) var(--ease); }
.h-card:hover { transform:translateY(-3px); border-color:var(--line-strong); }
.h-card video { width:100%; aspect-ratio:16/9; object-fit:cover; display:block; background:#000; }
.h-card .h-cap { padding:8px 10px; font-size:12px; color:var(--muted); }
.h-card .h-cap .p { color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.h-del { position:absolute; top:6px; right:6px; background:rgba(0,0,0,.62); border:none; color:#fff; width:28px; height:28px; border-radius:7px; cursor:pointer; display:grid; place-items:center; transition:background var(--dur) var(--ease); }
.h-del .icon { width:14px; height:14px; } .h-del:hover { background:var(--err); }
.h-empty { color:var(--muted); font-size:13px; padding:16px 0; }

::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background:var(--line-strong); border-radius:6px; border:2px solid transparent; background-clip:padding-box; }
::-webkit-scrollbar-thumb:hover { background:var(--muted); }
::-webkit-scrollbar-track { background:transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
  .spinner { animation:none; }
}

/* 玻璃材质（最后声明以覆盖各面板的实色背景；弥散光透入） */
.panel, .refzone, .prompt-card, .params, .genbar, .vid-card, .lib-card, .mem-card, .rail, .topbar {
  background-color:color-mix(in srgb, var(--panel) 72%, transparent);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
/* 光标指到项目项时显示重命名/删除 */
.list-item:hover .li-actions { opacity:1; }

/* 引用框：@ + 加粗标签 */
.inline-chip .chip-label b { color:var(--text); font-weight:700; }

/* 提示词全屏（沉浸式书写，仍可 @ 引用） */
.prompt-card.fullscreen { position:fixed; inset:18px; z-index:130; max-height:none; margin:0; display:flex; flex-direction:column; background:color-mix(in srgb,var(--panel) 82%, transparent); backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px); box-shadow:var(--shadow); }
.prompt-card.fullscreen .prompt-area { flex:1; min-height:0; max-height:none; }

/* 视频预览大窗口 */
.preview-card { width:min(880px, 94vw); }
.preview-card .video-wrap { aspect-ratio:16/9; }
.preview-card .result-actions { margin-left:auto; display:flex; gap:8px; }

/* 工作区：左创作（更宽） / 右项目视频（窄栏）双栏 */
.work { display:grid; grid-template-columns:minmax(0,1fr) minmax(300px, 330px); gap:20px; align-items:start; }
.work-left { min-width:0; }
.work-right { align-self:start; min-width:0; padding-top:0; }
.work-right .result-area { margin-top:0; }
@media (max-width:1080px){ .work { grid-template-columns:1fr; } .work-right { position:static; max-height:none; } }
.work.full { grid-template-columns:1fr !important; }
.work.full .work-right { display:none; }
.vid-card { position:relative; }
.vid-del { position:absolute; top:6px; right:6px; width:26px; height:26px; border:0; background:rgba(0,0,0,.62); color:#fff; border-radius:7px; cursor:pointer; display:grid; place-items:center; opacity:0; transition:opacity var(--dur) var(--ease), background var(--dur) var(--ease); }
.vid-card:hover .vid-del { opacity:1; }
.vid-del:hover { background:var(--err); }
.vid-del .icon { width:14px; height:14px; }
.ghost-btn.del:hover { background:var(--err); border-color:var(--err); color:#fff; }

/* ===== 外观 / 主题（dsh-dream-skin · Mirage 8 套） ===== */
.modal { position:fixed; inset:0; z-index:100; background:rgba(0,0,0,.55); display:flex; align-items:center; justify-content:center; }
.modal-card { width:min(700px, 92vw); max-height:86vh; overflow:auto; background:color-mix(in srgb, var(--panel) 94%, transparent); border:1px solid var(--line-strong); border-radius:18px; padding:20px 22px; backdrop-filter:blur(16px); -webkit-backdrop-filter:blur(16px); box-shadow:var(--shadow); }
.modal-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.modal-head h2 { margin:0; font-size:18px; }
.theme-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:20px; }
@media (max-width:560px){ .theme-grid{ grid-template-columns:repeat(2,1fr); } }
.theme-swatch { display:flex; align-items:center; gap:8px; padding:10px; border:1px solid var(--line); border-radius:12px; background:var(--panel-2); color:var(--text); cursor:pointer; font-size:13px; font-weight:600; font-family:inherit; transition:all var(--dur) var(--ease); text-align:left; }
.theme-swatch:hover { border-color:var(--line-strong); }
.theme-swatch.active { border-color:var(--primary); background:color-mix(in srgb,var(--primary) 16%, var(--panel-2)); }
.tw-dot { width:16px; height:16px; border-radius:50%; flex:none; box-shadow:0 0 0 2px rgba(255,255,255,.15); }
.wp-section { border-top:1px solid var(--line); padding-top:16px; }
.wp-title { font-size:14px; font-weight:700; margin-bottom:10px; }
.wp-actions { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; align-items:center; }
.wp-opts { display:flex; gap:18px; flex-wrap:wrap; margin-bottom:10px; }
.wp-opt { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--muted); }
.wp-opt input[type=range]{ width:120px; }
.wp-note { font-size:11px; color:var(--muted); }

/* 8 套主题令牌（同一材质骨架，不同色相气质） */
html[data-theme="abyss"] { --bg:#070a18; --panel:#0e1330; --panel-2:#18204a; --line:rgba(90,110,190,.22); --line-strong:rgba(99,140,255,.4); --text:#eef1fb; --muted:#aab3d8; --weak:#7c86ad; --primary:#6b8cff; --primary-2:#8ea0ff; --ring:#7c9bff; --btn-text:#0a0d22; }
html[data-theme="nebula"] { --bg:#0b0818; --panel:#170f2c; --panel-2:#221548; --line:rgba(150,120,200,.2); --line-strong:rgba(167,139,250,.38); --text:#f1edfb; --muted:#c0b0e0; --weak:#8a7bb0; --primary:#a78bfa; --primary-2:#67e8f9; --ring:#a78bfa; --btn-text:#0d0a1e; }
html[data-theme="ember"] { --bg:#140b07; --panel:#241208; --panel-2:#3a1d0c; --line:rgba(200,120,60,.2); --line-strong:rgba(251,146,60,.4); --text:#fbf1ea; --muted:#e0b48f; --weak:#a97a55; --primary:#fb8b24; --primary-2:#fbbf24; --ring:#fb923c; --btn-text:#150a04; }
html[data-theme="midnight"] { --bg:#050505; --panel:#0f0f10; --panel-2:#1c1c1f; --line:rgba(255,255,255,.08); --line-strong:rgba(255,255,255,.2); --text:#f2f2f3; --muted:#9aa0a8; --weak:#6b7078; --primary:#7aa2f7; --primary-2:#9fb7ff; --ring:#7aa2f7; --btn-text:#05060a; }
html[data-theme="ivory"] { color-scheme:light; --bg:#f2efe9; --panel:#fdfcf9; --panel-2:#ffffff; --line:rgba(0,0,0,.08); --line-strong:rgba(0,0,0,.16); --text:#1c1c1e; --muted:#6b6b70; --weak:#9a9aa0; --primary:#0a84ff; --primary-2:#3fa7ff; --ring:#0a84ff; --btn-text:#ffffff; --shadow:0 12px 40px rgba(0,0,0,.12); }
html[data-theme="mist"] { color-scheme:light; --bg:#eef1f4; --panel:#fbfcfd; --panel-2:#ffffff; --line:rgba(0,0,0,.08); --line-strong:rgba(0,0,0,.15); --text:#1f2933; --muted:#66707d; --weak:#9aa3ad; --primary:#0ea5e9; --primary-2:#38bdf8; --ring:#0ea5e9; --btn-text:#ffffff; --shadow:0 12px 40px rgba(0,0,0,.12); }
html[data-theme="rose"] { color-scheme:light; --bg:#fbf1f3; --panel:#fff7f9; --panel-2:#ffffff; --line:rgba(0,0,0,.07); --line-strong:rgba(0,0,0,.14); --text:#2a2226; --muted:#8d7f86; --weak:#b3a6ad; --primary:#ec4899; --primary-2:#f472b6; --ring:#ec4899; --btn-text:#ffffff; --shadow:0 12px 40px rgba(0,0,0,.12); }
/* 浅色主题：标题/光斑柔和化 */
html[data-theme="ivory"], html[data-theme="mist"], html[data-theme="rose"] {
  --glass-alpha:62%;
}
html[data-theme="ivory"] .title, html[data-theme="mist"] .title, html[data-theme="rose"] .title { background:transparent; -webkit-background-clip:border-box; background-clip:border-box; color:var(--text); -webkit-text-fill-color:var(--text); }
html[data-theme="ivory"] body::before, html[data-theme="mist"] body::before, html[data-theme="rose"] body::before { filter:blur(var(--wp-blur,8px)) brightness(var(--wp-dim,.9)); }
