/* ================= 基础 ================= */
* { margin:0; padding:0; box-sizing:border-box; }
:root{
  --bg:#111113; --bg2:#161618; --panel:#1c1c1f; --panel2:#222226;
  --line:#2a2a2e; --line2:#3a3a40;
  --text:#e8e6e3; --text2:#9a9890; --text3:#5c5a55;
  --accent:#d4a853; --accent2:#e8c47a;
  --ok:#4ade80; --warn:#fbbf24; --err:#f87171;
  --text-node:#8b9cf7; --image-node:#e07bc4; --video-node:#f0954a; --audio-node:#4ade80;
  --script-node:#f0c95c; --stage-node:#56c8d8; --export-node:#b98ae0; --check-node:#f0879e;
  --radius:8px; --shadow:0 4px 16px rgba(0,0,0,.35); --shadow-glass:0 8px 32px rgba(0,0,0,.5);
  --mono:"Consolas","JetBrains Mono",monospace;
}
html,body{ height:100%; overflow:hidden; background:var(--bg); color:var(--text);
  font:13px/1.5 -apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",system-ui,sans-serif; user-select:none; }
button{ font-family:inherit; }
::-webkit-scrollbar{ width:7px; height:7px; }
::-webkit-scrollbar-thumb{ background:#333338; border-radius:4px; }
::-webkit-scrollbar-track{ background:transparent; }

#app{ display:flex; flex-direction:column; height:100vh; }
kbd{ background:#28282c; border:1px solid #3a3a40; border-radius:3px; padding:0 5px; font-size:11px; color:var(--text2); }
/* 线条图标统一对齐 */
.lc-ic{ display:inline-block; vertical-align:-3px; flex:none; }

/* ================= 顶栏 ================= */
#topbar{ display:flex; align-items:center; gap:10px; height:52px; padding:0 12px;
  background:rgba(20,20,23,.5); -webkit-backdrop-filter:blur(18px) saturate(1.4); backdrop-filter:blur(18px) saturate(1.4);
  border-bottom:1px solid rgba(212,168,83,.22);
  flex:none; z-index:600; }
.brand{ display:flex; align-items:center; gap:6px; flex:none; }
.logo{ font-size:20px; font-weight:500; line-height:1; cursor:pointer;
  background:linear-gradient(135deg, #f0ece2, #cbb88b);
  -webkit-background-clip:text; background-clip:text; color:transparent; -webkit-text-fill-color:transparent;
  transition:opacity .15s, transform .15s; }
.logo:hover{ opacity:.85; transform:scale(1.12); }
.project-name{ background:rgba(255,255,255,.04); border:1px solid transparent; color:var(--text); font-size:12.5px;
  padding:4px 8px; border-radius:8px; width:160px; outline:none; -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); }
.project-name:hover{ border-color:var(--line2); }
.project-name:focus{ border-color:var(--accent); background:rgba(255,255,255,.07); }
.save-status{ font-size:11px; color:var(--text3); flex:none; }
.save-status.dirty{ color:var(--warn); }
/* 菜单：玻璃胶囊（黑金质感） */
.menu{ display:flex; align-items:center; gap:6px; flex:none; }
.menu-item{ position:relative; display:inline-flex; align-items:center; gap:6px; height:30px; padding:0 12px; border-radius:99px;
  cursor:pointer; color:var(--text2); font-size:12.5px; white-space:nowrap;
  background:rgba(255,255,255,.03); border:1px solid rgba(212,168,83,.16);
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  transition:background .12s, color .12s, border-color .12s; }
.menu-item:hover{ background:rgba(212,168,83,.10); border-color:rgba(212,168,83,.42); color:#e5c06a; }
.menu-item > .lc-ic{ width:13px; height:13px; }
.menu-item .dropdown{ display:none; position:absolute; top:calc(100% + 8px); left:0; min-width:225px;
  background:rgba(24,22,18,.94); -webkit-backdrop-filter:blur(20px) saturate(1.4); backdrop-filter:blur(20px) saturate(1.4);
  border:1px solid rgba(212,168,83,.30); border-radius:12px; padding:5px;
  box-shadow:0 14px 40px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.05); z-index:700; }
.menu-item.open .dropdown{ display:block; }
.dropdown button{ display:flex; width:100%; align-items:center; justify-content:space-between; gap:8px;
  background:transparent; border:none; color:var(--text2); padding:6px 10px; border-radius:6px; cursor:pointer; font-size:12.5px; text-align:left; }
.dropdown button:hover{ background:rgba(212,168,83,.12); color:#f0cf82; }
.dropdown button kbd{ color:#a49a80; }
.dropdown hr{ border:none; border-top:1px solid rgba(212,168,83,.18); margin:4px 4px; }

/* 插入节点：网格卡片式下拉 */
.menu-item .dropdown.insert-grid{ display:none; min-width:250px; grid-template-columns:1fr 1fr; gap:6px; padding:8px; }
.menu-item.open .dropdown.insert-grid{ display:grid; }
.insert-grid button{ display:flex; flex-direction:column; align-items:center; gap:6px; width:auto; padding:11px 6px;
  border-radius:9px; border:1px solid transparent; font-size:11.5px; color:var(--text2); white-space:nowrap; }
.insert-grid button:hover{ background:rgba(212,168,83,.10); border-color:rgba(212,168,83,.35); color:#e5c06a; }
.insert-grid button .lc-ic{ width:20px; height:20px; }
.insert-grid button[data-act="n-image"] .lc-ic{ color:var(--image-node); }
.insert-grid button[data-act="n-video"] .lc-ic{ color:var(--video-node); }
.insert-grid button[data-act="n-audio"] .lc-ic{ color:var(--audio-node); }
.insert-grid button[data-act="n-script"] .lc-ic{ color:var(--script-node); }
.insert-grid button[data-act="n-text"] .lc-ic{ color:var(--text-node); }
.insert-grid button[data-act="n-imageGrid"] .lc-ic{ color:var(--script-node); }
.insert-grid button[data-act="n-stage"] .lc-ic{ color:var(--stage-node); }
.insert-grid button[data-act="n-subtitle"] .lc-ic{ color:var(--stage-node); }
.insert-grid button[data-act="n-upscale"] .lc-ic{ color:var(--export-node); }
.insert-grid button[data-act="n-export"] .lc-ic{ color:var(--export-node); }
.insert-grid button[data-act="n-check"] .lc-ic{ color:var(--check-node); }
.view-toggle-row{ display:flex; align-items:center; justify-content:space-between; padding:6px 10px; font-size:12.5px; color:var(--text2); }
/* 菜单栏内：对齐 / 自动布局 胶囊工具栏（紧挨 3D 导演台） */
.tb-sp{ flex:1; min-width:0; }
.tb-bar{ display:flex; align-items:center; gap:2px; flex:none; padding:3px 4px; border-radius:99px;
  background:rgba(255,255,255,.04); border:1px solid rgba(212,168,83,.20);
  -webkit-backdrop-filter:blur(16px) saturate(1.3); backdrop-filter:blur(16px) saturate(1.3); }
.tb-btn{ display:inline-flex; align-items:center; gap:4px; background:transparent; border:none;
  color:var(--text2); font-size:11.5px; padding:5px 8px; border-radius:99px; cursor:pointer;
  transition:background .12s, color .12s; white-space:nowrap; }
.tb-btn:hover{ background:rgba(212,168,83,.12); color:#e5c06a; }
.tb-btn .lc-ic{ width:13px; height:13px; }
.tb-sep{ width:1px; height:16px; background:rgba(255,255,255,.1); margin:0 2px; }
/* 顶部右侧：搜索 / 客服 / 充值 / 分享 / 头像 */
.top-actions{ display:flex; align-items:center; gap:8px; flex:none; }
.tb-search{ display:flex; align-items:center; gap:6px; padding:6px 10px; border-radius:99px;
  background:rgba(255,255,255,.04); border:1px solid rgba(212,168,83,.20);
  -webkit-backdrop-filter:blur(16px) saturate(1.3); backdrop-filter:blur(16px) saturate(1.3);
  transition:border-color .12s, background .12s; }
.tb-search:focus-within{ border-color:rgba(212,168,83,.6); background:rgba(255,255,255,.07); }
.tb-search .lc-ic{ width:13px; height:13px; color:var(--text3); }
.tb-search input{ width:116px; background:transparent; border:none; outline:none; color:var(--text); font-size:12px; }
.tb-search input::placeholder{ color:var(--text3); }
.tb-icon{ padding:7px 9px; }
#user-avatar{ width:28px; height:28px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, #4a6fb5, #7d6bc4); color:#eef0f8; font-size:12px; font-weight:600;
  cursor:pointer; border:1px solid rgba(255,255,255,.18); }
/* 头像 + 算力徽章（算力收进头像里：右上角金色小胶囊实时显示余额） */
#avatar-wrap{ position:relative; display:flex; align-items:center; flex:none; margin-right:6px; cursor:pointer; }
#avatar-wrap .avatar-credit{ position:absolute; right:-9px; bottom:-6px; font-size:10px; line-height:1.55; font-weight:700;
  padding:0 6px; border-radius:99px; background:linear-gradient(135deg,#e5c06a,#d4a853); color:#1c1a12;
  box-shadow:0 0 0 2px rgba(18,19,24,.85); white-space:nowrap; pointer-events:none; }
/* 独立充值按钮入口 */
#btn-recharge{ display:inline-flex; align-items:center; gap:5px; }
#btn-recharge .lc-ic{ width:14px; height:14px; color:#e0b96a; }
/* 充值按钮放大 · 醒目（金色实底，与客服按钮同高对齐） */
#btn-recharge.btn-recharge-lg{ height:38px; box-sizing:border-box; font-size:14px; font-weight:800; padding:9px 20px; border-radius:10px; gap:7px;
  color:#20190a; background:linear-gradient(135deg,#f0cf82,#d4a853); border:none;
  box-shadow:0 4px 18px rgba(212,168,83,.45), inset 0 1px 0 rgba(255,255,255,.35); letter-spacing:.5px; }
#btn-recharge.btn-recharge-lg:hover{ background:linear-gradient(135deg,#f7dc9d,#e0b96a); transform:translateY(-1px); }
#btn-recharge.btn-recharge-lg .lc-ic{ width:17px; height:17px; color:#20190a; }
.credit-chip{ margin-left:5px; font-size:11px; font-weight:700; padding:1px 8px; border-radius:99px;
  background:rgba(212,168,83,.2); color:#e0b96a; }
.btn{ background:rgba(38,38,43,.6); border:1px solid rgba(255,255,255,.08); color:var(--text); padding:6px 13px; border-radius:8px; cursor:pointer; font-size:12.5px; transition:.12s;
  -webkit-backdrop-filter:blur(14px) saturate(1.3); backdrop-filter:blur(14px) saturate(1.3); }
.btn:hover{ background:rgba(50,50,56,.65); border-color:rgba(255,255,255,.14); }
.btn.primary{ background:var(--accent); border-color:transparent; color:#111; font-weight:600; }
.btn.primary:hover{ background:var(--accent2); }
.btn.accent{ border-color:#4a4a50; }

/* ================= 工作区 ================= */
#workspace{ display:flex; flex:1; overflow:hidden; position:relative; }
#left-panel{ flex:none; width:236px; margin:12px 0 12px 12px; display:flex; flex-direction:column;
  background:rgba(24,24,26,.55); border:1px solid var(--line2); border-radius:12px; overflow:hidden;
  -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); box-shadow:var(--shadow-glass);
  transition:width .22s ease; }
/* 收纳态：只留一条窄栏 + 展开按钮 */
#left-panel.collapsed{ width:46px; }
#left-panel.collapsed .panel-head{ justify-content:center; padding:13px 0; }
#left-panel.collapsed .panel-head > .lc-ic{ display:none; }
#left-panel.collapsed .ph-text{ display:none; }
#left-panel.collapsed #tab-assets{ display:none; }
.panel-head{ display:flex; align-items:center; gap:9px; padding:12px 14px; border-bottom:1px solid var(--line); flex:none; }
.panel-head > .lc-ic{ width:16px; height:16px; color:var(--accent2); }
.ph-text{ display:flex; flex-direction:column; gap:1px; }
.ph-title{ font-size:13px; font-weight:600; color:var(--text); }
.ph-sub{ font-size:10.5px; color:var(--text3); }
.panel-toggle{ margin-left:auto; width:24px; height:24px; display:flex; align-items:center; justify-content:center;
  background:transparent; border:1px solid transparent; border-radius:7px; color:var(--text3);
  cursor:pointer; font-size:14px; line-height:1; transition:.12s; flex:none; }
.panel-toggle:hover{ background:rgba(255,255,255,.06); color:var(--text); }
#left-panel.collapsed .panel-toggle{ margin-left:0; }
.pt-glyph{ display:inline-block; transition:transform .22s ease; }
#left-panel.collapsed .pt-glyph{ transform:rotate(180deg); }
.panel-body{ flex:1; overflow-y:auto; }

/* ================= 左侧多功能面板：节点库 / 分镜大纲 / 生成记录（黑金高级质感） ================= */
#genlog-panel{ flex:none; width:298px; margin:12px 0 12px 12px; display:flex; flex-direction:column;
  background:linear-gradient(180deg,rgba(212,168,83,.07),rgba(10,10,13,.88) 32%),#101013;
  border:1px solid rgba(212,168,83,.26); border-radius:14px; overflow:hidden;
  -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
  box-shadow:0 10px 40px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05);
  transition:width .22s ease; }
#genlog-panel.collapsed{ width:46px; }
#genlog-panel.collapsed .gl-tabs{ justify-content:center; padding:12px 0; }
#genlog-panel.collapsed .gl-tabs .mm-tab{ display:none; }
#genlog-panel.collapsed .gl-subrow,
#genlog-panel.collapsed .gl-pane,
#genlog-panel.collapsed .gl-hint{ display:none; }
#genlog-panel.collapsed .gl-toggle{ margin-left:0; }

/* 面板顶部页签行：节点库 / 分镜大纲 / 生成记录 + 右上角收起（黑金质感） */
.gl-tabs{ display:flex; align-items:center; gap:3px; padding:8px 10px; flex:none;
  border-bottom:1px solid rgba(212,168,83,.18);
  background:linear-gradient(180deg,rgba(212,168,83,.10),rgba(212,168,83,0)); }
.mm-tab{ display:inline-flex; align-items:center; justify-content:center; gap:4px; min-width:0; flex:1;
  height:26px; padding:0 4px; border:none; border-radius:7px;
  background:transparent; color:var(--text2); font-size:11.5px; cursor:pointer; transition:.12s; white-space:nowrap; }
.mm-tab:hover{ color:#e5c06a; background:rgba(212,168,83,.08); }
.mm-tab.active{ background:linear-gradient(135deg,#f0cf82,#d4a853); color:#20190a; font-weight:700;
  box-shadow:0 2px 8px rgba(212,168,83,.35); }
.mm-tab .lc-ic{ width:12px; height:12px; flex:none; }
.gl-subrow{ flex:none; padding:8px 13px 0; font-size:10.5px; color:#8d8570; letter-spacing:.2px; }
.gl-toggle{ margin-left:auto; flex:none; width:26px; height:26px; display:flex; align-items:center; justify-content:center;
  background:transparent; border:1px solid transparent; border-radius:7px; color:#8d8570;
  cursor:pointer; font-size:15px; line-height:1; transition:.12s; }
.gl-toggle:hover{ background:rgba(212,168,83,.10); color:#e5c06a; }
.gl-glyph{ display:inline-block; transition:transform .22s ease; }
#genlog-panel.collapsed .gl-glyph{ transform:rotate(180deg); }
.gl-pane{ flex:1; overflow-y:auto; padding:10px 12px 14px; display:none; }
.gl-pane.active{ display:block; }
.gl-hint{ flex:none; display:flex; align-items:center; gap:7px; margin:4px 12px 12px; padding:8px 11px; border-radius:8px;
  background:rgba(212,168,83,.06); border:1px dashed rgba(212,168,83,.25); font-size:11px; color:#a49a80; }
.gl-hint .lc-ic{ width:14px; height:14px; color:#e5c06a; flex:none; }

/* 菜单栏：3D 导演台直达入口（黑金高亮，与菜单胶囊同高对齐） */
.mm-link{ display:flex; align-items:center; gap:5px; height:30px; padding:0 12px; border-radius:99px;
  border:1px solid rgba(212,168,83,.16); cursor:pointer; color:var(--text2); font-size:12.5px; white-space:nowrap; user-select:none;
  background:rgba(255,255,255,.03); transition:.12s; }
.mm-link .lc-ic{ width:14px; height:14px; color:#e5c06a; }
.mm-link:hover{ background:rgba(212,168,83,.10); border-color:rgba(212,168,83,.42); color:#e5c06a; }
.mm-link.gold,.mm-link.cyan{ color:#f0cf82; border-color:rgba(212,168,83,.5);
  background:linear-gradient(135deg,rgba(240,207,130,.16),rgba(212,168,83,.10)); font-weight:600; }
.mm-link.gold:hover,.mm-link.cyan:hover{ background:linear-gradient(135deg,rgba(247,220,157,.22),rgba(224,185,106,.16)); color:#f7dc9d; }
#btn-service{ display:inline-flex; align-items:center; gap:6px; height:38px; padding:0 15px; box-sizing:border-box;
  border-color:rgba(212,168,83,.45); background:rgba(212,168,83,.08); color:#f0cf82; font-weight:600; }
#btn-service:hover{ background:rgba(212,168,83,.14); border-color:rgba(212,168,83,.65); color:#f7dc9d; }
#btn-service .lc-ic{ width:15px; height:15px; color:#e5c06a; }

/* 节点库卡片 */
.nl-sec{ padding:9px 2px 6px; font-size:10.5px; color:var(--text3); letter-spacing:1.2px; }
.nl-grid{ display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.nl-card{ display:flex; align-items:center; gap:8px; background:var(--panel); border:1px solid var(--line);
  border-radius:8px; padding:8px 9px; cursor:pointer; transition:.12s; user-select:none; }
.nl-card:hover{ border-color:var(--accent); background:var(--panel2); }
.nl-card .ic{ flex:none; width:22px; height:22px; border-radius:6px; display:flex; align-items:center; justify-content:center;
  background:rgba(255,255,255,.06); font-size:14px; }
.nl-card .nm{ font-size:11.5px; color:var(--text2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gl-empty{ padding:30px 10px; text-align:center; color:var(--text3); font-size:12px; line-height:2; }
.tab-body{ display:none; }
.tab-body.active{ display:block; }

/* 节点库 */
.lib-section{ padding:12px 14px 5px; font-size:10.5px; color:var(--text3); letter-spacing:1.5px; text-transform:uppercase; }
.lib-grid{ display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:3px 14px; }
.lib-card{ background:var(--panel); border:1px solid var(--line); border-radius:7px; padding:8px 7px;
  cursor:grab; transition:.12s; text-align:center; }
.lib-card:hover{ border-color:var(--accent); background:var(--panel2); }
.lib-card:active{ cursor:grabbing; }
.lib-card .ic{ font-size:18px; display:block; margin-bottom:2px; }
.lib-card .nm{ font-size:11.5px; color:var(--text2); }
.lib-tip{ margin:14px 14px; padding:9px; font-size:11.5px; color:var(--text3); background:var(--panel);
  border:1px dashed var(--line2); border-radius:6px; line-height:1.7; }

/* 分镜大纲 */
.outline-list{ padding:8px; }
.outline-empty{ color:var(--text3); font-size:12px; text-align:center; padding:28px 14px; line-height:2; }
.outline-item{ background:var(--panel); border:1px solid var(--line); border-radius:6px; padding:7px 9px; margin-bottom:6px; cursor:pointer; transition:.12s; }
.outline-item:hover{ border-color:var(--accent); }
.outline-item .oi-head{ display:flex; gap:6px; align-items:center; font-size:11.5px; color:var(--accent2); margin-bottom:2px; }
.outline-item .oi-txt{ font-size:11.5px; color:var(--text2); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.outline-item .oi-tags{ margin-top:3px; display:flex; gap:4px; flex-wrap:wrap; }
.outline-item .oi-tags span{ font-size:10px; color:var(--text2); background:#28282c; padding:1px 6px; border-radius:3px; }
.outline-head{ padding:9px 12px; font-size:11.5px; color:var(--text3); border-bottom:1px solid var(--line); }

/* ================= 画布 ================= */
#canvas-wrap{ flex:1; position:relative; overflow:hidden;
  background:
    radial-gradient(920px 500px at 12% 6%, rgba(212,168,83,.06), transparent 62%),
    radial-gradient(780px 470px at 88% 94%, rgba(212,168,83,.05), transparent 65%),
    radial-gradient(120% 90% at 50% 0%, #161310 0%, #0d0b09 50%, #070605 100%); }
/* 画布金斑缓慢漂移（动态未来感） */
#canvas-wrap::before{ content:''; position:absolute; inset:-22%; z-index:0; pointer-events:none;
  background:radial-gradient(660px 420px at 32% 30%, rgba(212,168,83,.07), transparent 60%);
  animation:glowDrift 24s ease-in-out infinite alternate; }
.canvas{ position:absolute; inset:0; cursor:grab; }
.canvas.panning{ cursor:grabbing; }
.world{ position:absolute; top:0; left:0; width:0; height:0; transform-origin:0 0; z-index:1;
  /* 不加 will-change：world 含 N 节点 + 200000×200000 SVG，加 will-change 会形成过大合成层，
     画布操作（平移/缩放）后 GPU 重新光栅化整个合成层需要几帧，导致后续拖动节点前几次卡顿。
     视口剔除已保证 world 内 DOM 元素少（只视口内 20-30 个节点），平移/缩放重绘成本低 */
}
/* SVG 铺在 (-100000,-100000) 起 200000×200000：世界坐标全部落在视口内，绘制万无一失 */
#edges-svg{ position:absolute; top:-100000px; left:-100000px; width:200000px; height:200000px; pointer-events:none; z-index:3; }
#nodes-layer{ position:absolute; top:0; left:0; width:0; height:0; z-index:5; }
#groups-layer{ position:absolute; top:0; left:0; width:0; height:0; z-index:1; }
.grid-bg{ position:absolute; inset:0; pointer-events:none; z-index:0; }

/* 选区框 */
.selection-rect{ position:absolute; background:rgba(212,168,83,.10); border:1px solid var(--accent);
  border-radius:3px; pointer-events:none; z-index:60; }

/* ================= 节点 ================= */
.node{ position:absolute; min-width:240px; background:linear-gradient(180deg, #202024, #1c1c20);
  border:1px solid rgba(255,255,255,.09); border-radius:16px; z-index:10;
  box-shadow:0 8px 26px rgba(0,0,0,.4); transition:border-color .12s;
  contain:layout style;          /* 隔离节点内部布局/样式计算，N 大时减少重排范围 */
}
.node:hover{ border-color:rgba(255,255,255,.18); }
.node.selected{ border-color:var(--accent); box-shadow:0 0 0 2px rgba(212,168,83,.45), 0 10px 32px rgba(0,0,0,.5); }
.node.running{ border-color:var(--accent2); }
.node.running .n-head{ animation:pulse 1.2s infinite; }
@keyframes pulse{ 0%,100%{ border-bottom:2px solid transparent; } 50%{ border-bottom:2px solid var(--accent2); } }
.node.error{ border-color:var(--err); }
.node.collapsed .n-body{ display:none; }
.node.collapsed .n-foot{ display:none; }
.node.collapsed .n-sub{ display:none; }
/* 图片/视频节点：控件区默认收起，点击提示词输入框后展开 */
.node.ctrl-collapsed .n-sub{ display:none; }
/* 折叠态底部摘要栏：仅 ctrl-collapsed 时显示 */
.node.ctrl-collapsed .n-cfoot{ display:flex; }
.node:not(.ctrl-collapsed) .n-cfoot{ display:none; }
.n-cfoot{ display:none; align-items:center; justify-content:space-between; gap:6px;
  padding:6px 9px; border-top:1px solid var(--line); cursor:pointer; transition:background .12s; }
.n-cfoot:hover{ background:#1e1e22; }
.n-cfoot-info{ font-size:10px; color:var(--text3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.n-cfoot-hint{ font-size:9px; color:var(--text3); opacity:.5; flex:none; }
/* 折叠态预览区更大、更突出 */
.node.ctrl-collapsed .n-preview{ min-height:160px; }
.node.ctrl-collapsed .n-body{ padding-bottom:0; }

/* 预览区“尝试：”功能选项 */
.n-try{ position:absolute; bottom:12px; left:12px; display:flex; flex-direction:column; align-items:flex-start; gap:4px; z-index:2; }
.n-try-label{ font-size:10px; color:#7a7a7a; }
.n-try-btns{ display:flex; flex-direction:column; gap:4px; }
.n-try-opt{ display:inline-flex; align-items:center; gap:5px; background:#2a2a2a; border:1px solid #3a3a3a;
  color:#e6e6e6; font-size:11px; font-weight:500; padding:3px 9px; border-radius:5px; cursor:pointer; transition:.12s; white-space:nowrap; }
.n-try-opt:hover{ border-color:#6a6a6a; color:#fff; background:#323232; }
.n-try-opt .lc-ic{ vertical-align:-2px; }
/* 第二盒子：提示词+控件的独立大盒子（与上方节点盒分离，中间留缝隙） */
.n-sub{ margin-top:14px; background:rgba(29,29,33,.85); border:1px solid rgba(255,255,255,.08);
  border-radius:12px; padding:8px 9px; display:flex; flex-direction:column; gap:7px;
  box-shadow:0 4px 16px rgba(0,0,0,.35); }
.n-sub .n-prompt{ margin-top:0; }
.n-sub .n-ctrl{ padding:0; }
.n-sub .n-foot{ border-top:1px solid var(--line); }
/* 展开态：第一盒子底部内边距收窄，两盒缝隙由 .n-sub 的 margin-top 决定 */
.node:not(.ctrl-collapsed) .n-body{ padding-bottom:0; }

.n-head{ display:flex; align-items:center; gap:7px; padding:6px 0; cursor:move;
  background:transparent; position:absolute; bottom:100%; left:0; margin-bottom:7px; }
.n-tc{ display:inline-block; flex:none; width:8px; height:8px; border-radius:50%;
  box-shadow:0 0 0 2px rgba(255,255,255,.10); }
.n-title{ flex:1; font-size:18px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:move;
  color:#bcbcc2; text-shadow:0 1px 4px rgba(0,0,0,.6); display:inline-flex; align-items:center; gap:7px; }
.n-t-txt{ cursor:text; }
.n-t-txt:hover{ text-decoration:underline; text-decoration-style:dotted; text-underline-offset:2px; }
.n-status{ font-size:10px; color:var(--text3); display:none; }
.n-run{ display:none; }
.n-run.busy{ display:none; }
@keyframes spin{ to{ transform:rotate(360deg); } }
.n-fold,.n-del{ display:none; }

.n-body{ padding:10px; display:flex; flex-direction:column; }
.n-body-fill{ padding:0; }   /* 图片/视频节点：预览图贴满节点，无四周留白 */
.n-body-fill .n-preview{ border-radius:20px; }
.node-media{ border-radius:20px; }   /* 图片/视频节点：外框 20px 圆角；截图由预览区自身 overflow 处理，避免裁掉外突端口 */
/* 分栏式节点（文本/音频/脚本/字幕）：与媒体节点同构——外框 20px 圆角，显示框贴满、固定 16:9（比例由 applyPaneAspect 设置） */
.node-pane{ border-radius:20px; }
.node-pane .n-preview{ min-height:0; border-radius:0; }
.node-pane .n-preview .ph{ gap:8px; }
.node-pane .n-preview img,
.node-pane .n-preview video{ width:100%; height:100%; object-fit:cover; background:#000; }
/* 文本节点显示框：内容居中展示，超长省略 */
.pane-text{ background:#141416; }
.pane-text-body{ max-width:92%; max-height:86%; overflow:hidden; font-size:13px; line-height:1.7; color:var(--text2);
  white-space:pre-wrap; word-break:break-word; display:-webkit-box; -webkit-line-clamp:6; -webkit-box-orient:vertical; }
/* 音频节点显示框：波形居中 */
.pane-audio{ background:#141416; }
.pane-audio .waveform{ width:82%; height:auto; flex:1; }
/* 脚本节点显示框：分镜列表预览 */
.pane-script{ background:#141416; align-items:flex-start; justify-content:flex-start;
  padding:10px 12px; box-sizing:border-box; }
.node-pane.pane-script .shot-preview{ width:100%; height:100%; overflow:hidden; display:flex; flex-direction:column; gap:6px; justify-content:center; }
.shot-line{ font-size:11.5px; line-height:1.5; color:var(--text2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.shot-line b{ color:var(--accent); font-weight:600; margin-right:3px; }
.shot-line span{ color:var(--text3); margin-left:4px; }
.shot-more{ font-size:10px; color:var(--text3); margin-top:2px; }
/* 字幕节点显示框：黑底白字 */
.pane-subtitle{ background:#000; }
/* 节点内提示词输入框：独立块，与上方预览区留出缝隙 */
.n-prompt{ width:100%; margin-top:8px; box-sizing:border-box; resize:vertical; min-height:68px; max-height:150px;
  background:#141416; border:1px solid var(--line); border-radius:5px; color:var(--text2);
  font-size:12px; line-height:1.6; font-family:inherit; padding:7px 9px; outline:none; cursor:text; }
.n-prompt:focus{ border-color:var(--accent); background:#18181a; }
.n-prompt::placeholder{ color:var(--text3); font-size:11px; }
.n-preview{ width:100%; min-height:180px; border-radius:8px; background:transparent; border:none;
  display:flex; align-items:center; justify-content:center; overflow:hidden; position:relative; cursor:pointer; }
.n-preview img{ width:100%; display:block; object-fit:cover; background:#000; }
.media-missing{ opacity:.25; filter:grayscale(1); }
.n-preview .ph{ color:var(--text3); font-size:12px; padding:0; text-align:center; line-height:1.7;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; }
.ph-scene{ color:#5a5a5a; display:block; }
.ph-txt{ color:#5a5a5a; font-size:12px; }
.n-desc{ font-size:11px; color:var(--text2); margin-top:6px; line-height:1.6;
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; white-space:pre-wrap; }
.n-foot{ display:flex; gap:4px; padding:7px 9px; border-top:1px solid var(--line); flex-wrap:wrap; }
.n-foot:empty{ display:none; }
.n-chip{ font-size:10px; color:var(--text2); background:#26262a; border:1px solid var(--line2);
  padding:2px 7px; border-radius:8px; }
.n-chip.hot{ color:var(--accent2); border-color:#5a4a2a; }

/* ===== 节点内嵌控件区（替代右侧属性面板） ===== */
.n-ctrl{ display:flex; flex-direction:column; gap:4px; padding:7px 8px 2px; }
.nc-row{ display:flex; gap:4px; width:100%; }
.nc-row .n-field{ flex:1; min-width:0; }
.nc-dual .n-field{ flex:1; }
/* 时长滑块容器：range 占主，数字标签固定宽度 */
.nc-dur{ display:flex; align-items:center; gap:4px; flex:1; min-width:0; }
.nc-dur-range{ flex:1; min-width:0; height:18px; accent-color:var(--accent); cursor:pointer; }
.nc-dur-val{ flex:0 0 auto; min-width:26px; text-align:right; font-size:10px; color:var(--text2);
  background:#1a1a1e; border:1px solid var(--line2); border-radius:4px; padding:1px 4px; }
.nc-tri .n-field{ flex:1; }
.n-ctrl select.n-field{
  background:#1a1a1e; border:1px solid var(--line2); color:var(--text2);
  border-radius:4px; padding:1px 3px; font-size:10px; cursor:pointer; appearance:auto; }
.n-ctrl select.n-field:hover{ border-color:#5a5a60; }
.n-ctrl input[type="text"].n-field{
  background:#1a1a1e; border:1px solid var(--line2); color:var(--text2);
  border-radius:4px; padding:2px 6px; font-size:10px; }
.n-ctrl input[type="range"].n-field{ accent-color:var(--accent); height:24px; }
.n-ctrl textarea.n-field{
  background:#1a1a1e; border:1px solid var(--line2); color:var(--text2);
  border-radius:4px; padding:4px 6px; font-size:10px; line-height:1.55; resize:vertical; }
.n-ctrl .n-field:focus{ border-color:var(--accent); outline:none; }
/* 模式 chips */
.nc-chips{ display:flex; flex-wrap:wrap; gap:3px; }
.nc-chip{ font-size:10px; color:var(--text3); background:#1e1e22; border:1px solid var(--line2);
  padding:2px 7px; border-radius:6px; cursor:pointer; user-select:none; transition:.1s; }
.nc-chip:hover{ color:var(--text); border-color:#5a5a60; }
.nc-chip.on{ color:#111; background:var(--accent); border-color:transparent; font-weight:600; }
/* 按钮类 */
.nc-btn{ font-size:10px; color:var(--accent); background:rgba(212,168,83,.10);
  border:1px solid #5a4a2a; border-radius:4px; padding:2px 7px; cursor:pointer; transition:.12s;
  white-space:nowrap; }
.nc-btn:hover{ background:rgba(212,168,83,.20); }
.nc-btn.primary{ background:var(--accent); color:#111; border:none; font-weight:600; }
/* ⛶ 放大查看按钮（预览区左上角，悬停显示） */
.n-zoom{ position:absolute; top:5px; left:5px; width:24px; height:24px; border-radius:5px; z-index:3;
  background:rgba(14,14,16,.80); border:1px solid var(--line2); color:var(--text2); font-size:12px;
  cursor:pointer; opacity:0; transition:.12s; display:flex; align-items:center; justify-content:center; }
.n-preview:hover .n-zoom{ opacity:1; }
.n-zoom:hover{ color:#fff; border-color:var(--accent); }
/* 视频时长角标（预览区右下角） */
.dur-badge{ position:absolute; right:6px; bottom:6px; font-size:10px; color:#fff;
  background:rgba(14,14,16,.82); border:1px solid rgba(255,255,255,.16);
  padding:1px 6px; border-radius:4px; z-index:3; pointer-events:none; }
/* 灯箱：全屏居中放大查看（图片支持滚轮缩放 / 拖拽平移） */
#lightbox{ position:fixed; inset:0; z-index:9999; background:rgba(8,8,10,.92);
  display:flex; align-items:center; justify-content:center; cursor:zoom-out; overflow:hidden; }
#lightbox .lb-stage{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  pointer-events:none; overflow:hidden; }
#lightbox img.lb-img{ max-width:92vw; max-height:92vh; border-radius:6px; box-shadow:0 16px 60px rgba(0,0,0,.5);
  transform-origin:0 0; will-change:transform; user-select:none; -webkit-user-drag:none;
  pointer-events:auto; cursor:grab; touch-action:none; }
#lightbox.lb-panning img.lb-img{ cursor:grabbing; }
#lightbox .lb-badge{ position:fixed; top:12px; right:14px; z-index:3; font-size:12px; color:#fff;
  background:rgba(14,14,16,.82); border:1px solid rgba(255,255,255,.18);
  padding:3px 10px; border-radius:6px; pointer-events:none; }
#lightbox .lb-hint{ position:fixed; bottom:14px; left:50%; transform:translateX(-50%); z-index:3; font-size:11px;
  color:var(--text3); background:rgba(14,14,16,.72); border:1px solid rgba(255,255,255,.10);
  padding:3px 12px; border-radius:6px; pointer-events:none; }
#lightbox .lb-bar{ position:fixed; top:12px; left:14px; z-index:3; display:flex; gap:8px; }
#lightbox .lb-btn{ background:rgba(14,14,16,.80); border:1px solid rgba(255,255,255,.16); color:var(--text2);
  font-size:12px; padding:3px 10px; border-radius:6px; cursor:pointer; transition:.12s; }
#lightbox .lb-btn:hover{ color:#fff; border-color:var(--accent); }
#lightbox video{ max-width:92vw; max-height:92vh; border-radius:6px; box-shadow:0 16px 60px rgba(0,0,0,.5); background:#000; }

/* ================= 图片压缩器 ================= */
.cmp-src{ font-size:12.5px; color:var(--text2); margin-bottom:6px; }
.cmp-lab{ display:block; font-size:11.5px; color:var(--text3); margin:10px 0 4px; }
.cmp-target, .cmp-q{ width:100%; background:#1c1c20; border:1px solid var(--line2); color:var(--text);
  font-size:13px; padding:6px 8px; border-radius:6px; outline:none; }
.cmp-tip{ font-size:11px; color:var(--text3); margin-top:10px; line-height:1.7; }
.cmp-done{ text-align:center; }
.cmp-done img{ max-width:100%; max-height:280px; border-radius:6px; border:1px solid var(--line); }
.cmp-stat{ font-size:12.5px; color:var(--text2); line-height:1.9; margin-top:10px; }
/* 提示词框右上角 ⛶ 放大编辑按钮 */
.n-prompt-wrap{ position:relative; width:100%; }
.n-prompt-zoom{ position:absolute; top:4px; right:4px; width:20px; height:20px; border-radius:5px;
  background:rgba(14,14,16,.80); border:1px solid var(--line2); color:var(--text3); font-size:11px;
  cursor:pointer; opacity:0; transition:.12s; display:flex; align-items:center; justify-content:center; z-index:2; }
.n-prompt-wrap:hover .n-prompt-zoom{ opacity:1; }
.n-prompt-zoom:hover{ color:#fff; border-color:var(--accent); }
/* 提示词放大编辑器（居中大窗） */
#prompt-editor{ position:fixed; inset:0; z-index:9999; background:rgba(8,8,10,.82);
  display:flex; align-items:center; justify-content:center; }
#prompt-editor .pe-panel{ width:min(740px,86vw); height:min(500px,80vh); background:var(--panel2);
  border:1px solid var(--line2); border-radius:10px; display:flex; flex-direction:column; overflow:hidden;
  box-shadow:0 20px 70px rgba(0,0,0,.45); }
.pe-head{ display:flex; justify-content:space-between; align-items:center; padding:11px 15px;
  font-size:13px; font-weight:600; color:var(--text); border-bottom:1px solid var(--line); }
.pe-count{ font-size:11px; color:var(--text3); font-weight:400; }
.pe-ta{ flex:1; border:none; outline:none; resize:none; background:transparent;
  color:var(--text2); font-size:13px; line-height:1.8; padding:13px 15px; font-family:inherit; }
.pe-ta::placeholder{ color:var(--text3); }
.pe-foot{ display:flex; justify-content:space-between; align-items:center; padding:9px 15px;
  border-top:1px solid var(--line); }
.pe-tip{ font-size:11px; color:var(--text3); }
.pe-done{ font-size:12px; color:#111; background:var(--accent);
  border:none; border-radius:6px; padding:6px 16px; cursor:pointer; font-weight:600; }
.pe-done:hover{ background:var(--accent2); }
.nc-nomodel{ font-size:10px; color:var(--warn); background:rgba(251,191,36,.06);
  border:1px dashed #6a5a2a; border-radius:4px; padding:3px 7px; cursor:pointer; }
.nc-nomodel:hover{ background:rgba(251,191,36,.12); border-style:solid; }
/* 高级参数折叠 */
.nc-adv-tg{ align-self:flex-start; background:transparent; border:none; color:var(--text3);
  font-size:10px; cursor:pointer; padding:2px 0; }
.nc-adv-tg:hover{ color:var(--accent2); }
.nc-adv{ display:flex; flex-direction:column; gap:5px; padding-top:4px;
  border-top:1px dashed var(--line2); width:100%; }
/* 图片节点 · 模型行（模型+画幅一行，画幅下拉加宽显示完整比例名） */
.nc-model-row select.n-field:first-child{ flex:1.35; min-width:0; }
.nc-model-row select.n-field:last-child{ flex:1.15; min-width:112px; }
/* 节点内模型单价标签（模型选择框旁） */
.nc-price{ flex:0 0 auto; display:flex; align-items:center; font-size:9.5px; color:var(--accent2,#e0b96a);
  background:rgba(212,168,83,.10); border:1px solid #5a4a2a; border-radius:4px; padding:1px 5px;
  white-space:nowrap; }
/* 预设按钮（图片节点模式入口） */
.nc-btn.preset{ flex:1; text-align:center; }
/* 预设弹出菜单（挂在 body 上，fixed 定位） */
.nc-preset-pop{ position:fixed; z-index:9999; background:#222226; border:1px solid var(--line2);
  border-radius:8px; padding:4px; display:flex; flex-direction:column; gap:2px; min-width:128px;
  box-shadow:0 8px 24px rgba(0,0,0,.45); animation:ncPop .1s ease; }
@keyframes ncPop{ from{ opacity:0; transform:translateY(-3px); } to{ opacity:1; transform:none; } }
.nc-pm-item{ font-size:12px; color:var(--text2); padding:5px 9px; border-radius:5px; cursor:pointer;
  white-space:nowrap; transition:.08s; }
.nc-pm-item:hover{ background:rgba(212,168,83,.12); color:#fff; }
.nc-pm-item.on{ color:#111; background:var(--accent); font-weight:600; }
.nc-pm-sub{ display:flex; gap:5px; padding:4px 8px 3px; margin-top:3px;
  border-top:1px dashed var(--line2); align-items:center; }
.nc-pm-sub::before{ content:'宫格'; font-size:10px; color:var(--text3); }
/* 节点正文 textarea（文本/脚本节点） */
.n-bodyta{ width:100%; background:#18181a; border:1px solid var(--line2); color:var(--text2);
  border-radius:6px; padding:6px 8px; font-size:12px; line-height:1.7; resize:vertical; }
.n-bodyta:focus{ border-color:var(--accent); outline:none; }

/* 节点内本地上传：预览区右上角迷你按钮组 */
.n-preview{ position:relative; }
.n-progress{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:24px; font-weight:600; color:#fff; background:rgba(0,0,0,.5); border-radius:inherit; pointer-events:none; z-index:5; letter-spacing:1px; }
/* 超清节点：覆盖层底部横向进度条 */
.n-progress-track{ position:absolute; left:12px; right:12px; bottom:10px; height:6px; border-radius:99px; background:rgba(255,255,255,.16); overflow:hidden; z-index:6; pointer-events:none; }
.n-progress-fill{ display:block; height:100%; width:0%; border-radius:99px; background:linear-gradient(90deg,#8b5cf6,#6366f1); transition:width .35s ease; }
.n-up-cnr{ position:absolute; top:5px; right:5px; display:flex; gap:4px; z-index:4; }
.n-up-mini{ width:24px; height:24px; display:flex; align-items:center; justify-content:center;
  font-size:12px; color:var(--accent); background:rgba(18,18,20,.85); border:1px solid #5a4a2a;
  border-radius:6px; cursor:pointer; transition:.12s; padding:0; }
.n-up-mini:hover{ background:rgba(212,168,83,.25); border-color:var(--accent); color:#fff; }
.n-up-clear{ width:24px; height:24px; display:flex; align-items:center; justify-content:center;
  font-size:11px; color:var(--text3); background:rgba(18,18,20,.85); border:1px solid var(--line2);
  border-radius:6px; cursor:pointer; transition:.12s; padding:0; }
.n-up-clear:hover{ color:var(--err); border-color:var(--err); }
/* 图片/视频节点收起态：提示词输入框一并隐藏（点击节点主体展开） */
.node.ctrl-collapsed .n-prompt{ display:none; }
/* 本地封面角标 */
.cover-tag{ position:absolute; left:5px; top:5px; font-size:9px; color:#fff; background:rgba(30,30,34,.85);
  padding:2px 6px; border-radius:6px; z-index:3; }
/* 节点内嵌本地视频（封面 = 首帧，可播放） */
.n-preview video{ position:absolute; inset:0; width:100%; height:100%; display:block; background:#000; object-fit:cover; }

/* 端口（单端口·居中·带光晕，任何缩放保持屏幕尺寸） */
.port{ position:absolute; top:50%; width:20px; height:20px; margin-top:-10px; border-radius:50%;
  background:#26282f; border:1.5px solid #55607c; cursor:crosshair; z-index:30; transition:.12s;
  transform:scale(var(--iz,1)); touch-action:none; display:flex; align-items:center; justify-content:center; }
.port::before{ content:'+'; font-size:13px; line-height:1; color:#8d95a8; }
.port:hover{ border-color:#9fb2dd; background:#2e313b; transform:scale(calc(var(--iz,1) * 1.25)); }
.port.in{ left:-10px; border-color:#5b8dd9; background:#22304a; box-shadow:0 0 0 3px rgba(91,141,217,.12); }
.port.out{ right:-10px; border-color:#3cb8a8; background:#14302c; box-shadow:0 0 0 3px rgba(60,184,168,.12); }
.port.connected{ background:var(--ok); border-color:var(--ok); }
.port.drag-over{ background:var(--ok); border-color:var(--ok); transform:scale(calc(var(--iz,1) * 1.4)); }

/* @ 引用节点菜单 */
.mention-menu{ position:fixed; z-index:9999; width:256px; max-height:230px; overflow:auto;
  background:rgba(28,28,32,.95); border:1px solid var(--line2); border-radius:8px;
  box-shadow:0 10px 32px rgba(0,0,0,.45); backdrop-filter:blur(8px); }
.mention-hint{ padding:6px 9px; font-size:10px; color:var(--text3); border-bottom:1px solid var(--line); position:sticky; top:0; background:#1c1c20; }
.mention-item{ display:flex; align-items:center; gap:7px; padding:7px 9px; cursor:pointer; }
.mention-item:hover,.mention-item.active{ background:rgba(212,168,83,.10); }
.mi-icon{ width:18px; height:18px; border-radius:5px; display:flex; align-items:center; justify-content:center; font-size:10px; flex:none; }
.mi-thumb{ width:18px; height:18px; border-radius:5px; object-fit:contain; flex:none; background:#171719; }
.mi-title{ flex:1; font-size:11.5px; color:var(--text2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.mi-state{ font-size:10px; color:var(--text3); flex:none; }
/* 连线拖动中的全局光标 */
body.linking{ cursor:crosshair !important; }
body.linking .node{ pointer-events:none; }
body.linking .port{ pointer-events:auto; }
.n-preview img{ -webkit-user-drag:none; user-select:none; }

/* 连线组：灰色细实线 + 箭头；相连节点生成中时（.edge-active）出现流动动画 */
.edge-g{ cursor:pointer; }
.edge-base{ fill:none; stroke:#7f9dcc; stroke-width:max(1.5px, calc(1.5px * var(--iz,1)));
  pointer-events:all; marker-end:url(#edge-arrow); transition:stroke .15s, filter .15s; }
.edge-flow{ fill:none; stroke:#9ea4c8; stroke-width:max(1.2px, calc(1.2px * var(--iz,1)));
  stroke-dasharray:2 10; stroke-linecap:round; animation:edge-flow 1s linear infinite;
  pointer-events:none; opacity:0; transition:opacity .2s; }
/* 连线命中层：透明加宽 stroke，恒 6px 屏幕宽（随 zoom 反比），避免放大后命中区过大误触 */
.edge-hit{ stroke-width:calc(6px * var(--iz,1)); }
@keyframes edge-flow{ to{ stroke-dashoffset:-24; } }
/* 生成中：线变亮 + 流动动画显现（executor 通过 syncActive 切换类名） */
.edge-g.edge-active .edge-base{ stroke:#a9adc9; stroke-width:max(1.6px, calc(1.6px * var(--iz,1))); }
.edge-g.edge-active .edge-flow{ opacity:.9; }
.edge-g:hover .edge-base{ stroke:#9fb8e4; filter:drop-shadow(0 0 3px rgba(127,157,204,.55)); }
.edge-g.selected .edge-base{ stroke:#c9d4ee; }
/* 新建连线：灰色闪烁确认 */
@keyframes edge-new{ 0%,100%{ stroke:#77777e; } 50%{ stroke:#e8e8ec; } }
.edge-g.edge-new .edge-base{ animation:edge-new .4s ease 2; }
.edge-ghost{ fill:none; stroke:#9a9aa0; stroke-width:max(1.6px, calc(1.6px * var(--iz,1)));
  stroke-dasharray:7 5; stroke-linecap:round; pointer-events:none; }

/* 连接线右键菜单 */
.edge-menu{ position:fixed; z-index:9999; background:#222226; border:1px solid var(--line2);
  border-radius:8px; box-shadow:0 6px 20px rgba(0,0,0,.4); padding:3px; transform:translateY(-100%); margin-top:-3px; }
.edge-menu button{ display:flex; align-items:center; gap:6px; width:100%;
  background:transparent; border:none; color:var(--text); padding:7px 12px;
  border-radius:5px; cursor:pointer; font-size:12.5px; white-space:nowrap; transition:.12s; }
.edge-menu button:hover{ background:rgba(248,113,113,.12); color:var(--err); }

/* 编组框：深灰实色背景，在节点下层；可拖动整组 */
.node-group{ position:absolute; border:1px solid #333338; border-radius:8px;
  background:#2b2b30; z-index:1; pointer-events:auto; cursor:grab; }
.node-group:active{ cursor:grabbing; }
.node-group.collapsed{ background:rgba(43,43,48,.35); border-style:dashed; border-color:#3a3a40; }
.node-group .g-title{ position:absolute; top:-38px; left:14px; display:inline-flex; align-items:center; gap:6px;
  background:#33333a; color:#e8e6e3; font-size:20px; font-weight:600; padding:6px 14px 6px 16px; border-radius:7px;
  border:1px solid #44444c; cursor:text; white-space:nowrap; pointer-events:auto; }
.node-group .g-title-text{ user-select:none; }
.node-group .g-fold{ position:absolute; top:-12px; right:9px; width:22px; height:22px; border-radius:50%;
  background:#33333a; border:1px solid #44444c; color:#e8e6e3; cursor:pointer; font-size:11px; pointer-events:auto; }
.node-group .g-rename{ display:inline-flex; align-items:center; justify-content:center;
  width:16px; height:16px; border-radius:3px; background:transparent; border:none;
  color:var(--text3); cursor:pointer; font-size:9px; pointer-events:auto; transition:.12s; }
.node-group .g-rename:hover{ color:var(--accent); background:rgba(212,168,83,.12); }

/* 迷你地图 & 缩放 */
.minimap{ position:absolute; right:12px; bottom:12px; width:180px; height:112px;
  background:rgba(22,22,26,.55); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  border:1px solid var(--line2); border-radius:12px; overflow:hidden; z-index:90; cursor:pointer;
  box-shadow:var(--shadow-glass); }
.minimap canvas{ width:100%; height:100%; display:block; }
.zoom-ctrl{ position:absolute; left:12px; bottom:12px; display:flex; align-items:center; gap:2px;
  background:rgba(22,22,26,.55); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  border:1px solid var(--line2); border-radius:12px; padding:3px; z-index:90; box-shadow:var(--shadow-glass); }
.zoom-ctrl button{ width:28px; height:28px; background:transparent; border:none; color:var(--text2); font-size:15px; cursor:pointer; border-radius:6px; }
.zoom-ctrl button:hover{ background:#2e2e33; color:var(--text); }
#zoom-label{ font-size:11px; color:var(--text2); min-width:42px; text-align:center; }

/* ================= 属性面板 ================= */
.props-empty{ text-align:center; color:var(--text3); padding:56px 20px; }
.pe-icon{ font-size:34px; margin-bottom:10px; }
.pe-sub{ font-size:11px; margin-top:7px; color:var(--text3); opacity:.7; }
.props-body{ padding:11px; }
.p-section{ font-size:10.5px; color:var(--accent2); letter-spacing:1.5px; margin:12px 2px 7px; text-transform:uppercase; }
.p-section:first-child{ margin-top:3px; }
.p-row{ margin-bottom:9px; }
.p-row label{ display:block; font-size:11.5px; color:var(--text2); margin-bottom:4px; }
.p-row input[type=text],.p-row input[type=number],.p-row textarea,.p-row select{
  width:100%; background:#18181a; border:1px solid var(--line2); color:var(--text); border-radius:6px;
  padding:6px 8px; font-size:12.5px; outline:none; font-family:inherit; }
.p-row textarea{ resize:vertical; min-height:60px; line-height:1.6; }
.p-row input:focus,.p-row textarea:focus,.p-row select:focus{ border-color:var(--accent); }
.p-row .inline{ display:flex; gap:7px; align-items:center; }
.p-row .inline > *{ flex:1; }
.p-hint{ font-size:11px; color:var(--text3); margin-top:3px; line-height:1.6; }
.p-btn{ width:100%; margin-top:5px; background:#26262a; border:1px solid var(--line2); color:var(--accent2);
  padding:7px; border-radius:6px; cursor:pointer; font-size:12.5px; }
.p-btn:hover{ background:#2e2e33; }
.p-btn.primary{ background:var(--accent); color:#111; border:none; font-weight:600; }
.p-btn.danger{ background:#3a1a1a; border-color:#6a2a2a; color:#f87171; }

/* 设置中心（模型 API 管理） */
.set-wrap{ display:flex; flex-direction:column; gap:0; }
.set-tabs{ display:flex; gap:3px; border-bottom:1px solid var(--line); padding-bottom:0; }
.set-tab{ background:transparent; border:none; color:var(--text2); font-size:12px; padding:8px 13px;
  cursor:pointer; border-bottom:2px solid transparent; border-radius:5px 5px 0 0; }
.set-tab:hover{ color:var(--text); background:rgba(212,168,83,.06); }
.set-tab.active{ color:var(--accent2); border-bottom-color:var(--accent2); }
.set-body{ padding:13px 4px; min-height:200px; max-height:46vh; overflow:auto; }
.set-grid-head{ display:none; }
/* 模型配置卡片：行1 名称+协议+删除；行2 模型ID+地址；行3 Key */
.set-card{ border:1px solid var(--line2); border-radius:8px; padding:8px; margin-bottom:8px;
  background:rgba(24,24,28,.4); }
.sc-r1{ display:grid; grid-template-columns:1.2fr 130px 30px; gap:7px; margin-bottom:6px; align-items:center; }
.sc-r2{ display:grid; grid-template-columns:1fr 1.2fr; gap:7px; margin-bottom:6px; }
.sc-r2:has(> input:only-child){ grid-template-columns:1fr; }
.sc-r3{ display:grid; grid-template-columns:1fr; gap:7px; }
.set-card input, .set-card select{ width:100%; background:#1a1a1e; border:1px solid var(--line2); color:var(--text);
  border-radius:6px; padding:6px 8px; font-size:12px; }
.set-card input:focus, .set-card select:focus{ border-color:var(--accent); outline:none; }
.set-card select{ cursor:pointer; }
.s-del{ background:transparent; border:1px solid var(--line2); color:var(--text3); border-radius:6px;
  padding:4px 0; cursor:pointer; font-size:12px; }
.s-del:hover{ color:var(--err); border-color:var(--err); }
.set-empty{ text-align:center; color:var(--text3); font-size:12px; padding:32px 0 20px; line-height:2; }
.set-foot{ display:flex; justify-content:space-between; align-items:center; gap:11px;
  border-top:1px solid var(--line); padding-top:11px; }
.set-hint{ font-size:10px; color:var(--text3); line-height:1.6; max-width:320px; }
.model-empty{ display:flex; align-items:center; gap:7px; justify-content:space-between;
  color:var(--text3); font-size:11px; }
.model-empty .p-btn{ width:auto; margin:0; padding:4px 9px; font-size:11px; }
.p-chip-row{ display:flex; flex-wrap:wrap; gap:5px; }
.p-chip{ font-size:11px; background:#222226; border:1px solid var(--line2); color:var(--text2);
  padding:3px 9px; border-radius:12px; cursor:pointer; }
.p-chip.active{ background:#2a2a2e; border-color:var(--accent); color:var(--accent2); }
.p-tags{ display:flex; flex-wrap:wrap; gap:5px; }
.p-tag{ font-size:10.5px; background:#26262a; color:var(--text2); padding:2px 8px; border-radius:4px; }

/* ================= 资产库 ================= */
.assets-filter{ display:flex; gap:6px; padding:10px 10px 0; }
.assets-filter .af-btn{ flex:1; background:rgba(255,255,255,.04); border:1px solid var(--line); color:var(--text3);
  border-radius:99px; padding:5px 0; font-size:11.5px; cursor:pointer; transition:.12s; }
.assets-filter .af-btn:hover{ color:var(--text); border-color:var(--line2); }
.assets-filter .af-btn.active{ background:var(--accent); border-color:var(--accent); color:#111; font-weight:600; }
.assets-list{ padding:9px; display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.asset-card{ background:var(--panel); border:1px solid var(--line); border-radius:7px; overflow:hidden; cursor:grab; transition:.12s;
  /* 视口外的卡片跳过布局/绘制：滚动资产库不再对全部卡片做合成，显著减卡顿 */
  content-visibility:auto; contain-intrinsic-size:auto 96px; }
.asset-card:hover{ border-color:var(--accent); }
.asset-card:active{ cursor:grabbing; }
.asset-card .ac-thumb{ height:74px; background:#141416; display:flex; align-items:center; justify-content:center; overflow:hidden; position:relative; }
.asset-card .ac-thumb img{ width:100%; height:100%; object-fit:cover; }
.asset-card .ac-thumb video{ width:100%; height:100%; object-fit:cover; background:#000; pointer-events:none; }
.asset-card .ac-thumb .ph{ font-size:18px; }
.asset-card .ac-badge{ position:absolute; right:3px; bottom:3px; display:inline-flex; align-items:center; gap:3px; padding:1px 5px; border-radius:5px; font-size:9px; line-height:1.5; color:#fff; background:rgba(22,22,24,.94); border:1px solid rgba(255,255,255,.14); }
.asset-card .ac-badge.bad-video{ color:#ffd28a; border-color:rgba(255,210,138,.45); }
.asset-card .ac-badge.bad-audio{ color:#9fd0ff; border-color:rgba(159,208,255,.4); }
.asset-card .ac-badge.bad-image{ color:#b9e6a8; border-color:rgba(185,230,168,.4); }
.asset-card .ac-info{ padding:5px 7px; }
.asset-card .ac-name{ font-size:10.5px; color:var(--text2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.asset-card .ac-name .ac-ext{ font-size:9px; color:var(--text3); }
.asset-card .ac-meta{ font-size:9.5px; color:var(--text3); margin-top:1px; }
.assets-empty{ color:var(--text3); font-size:11.5px; text-align:center; padding:36px 14px; line-height:2; }

/* ================= 右键菜单 ================= */
.ctx-menu{ position:fixed; min-width:180px; background:rgba(34,34,38,.92); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px);
  border:1px solid var(--line2); border-radius:12px; padding:4px; box-shadow:var(--shadow-glass); z-index:300; }
.ctx-menu button{ display:block; width:100%; background:transparent; border:none; color:var(--text2);
  padding:6px 10px; border-radius:5px; cursor:pointer; font-size:12.5px; text-align:left; }
.ctx-menu button:hover{ background:#2e2e33; color:var(--text); }
.ctx-menu hr{ border:none; border-top:1px solid var(--line); margin:3px; }

/* ================= 弹层 ================= */
.modal-mask{ position:fixed; inset:0; background:rgba(8,8,10,.6); -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px);
  z-index:400; display:flex; align-items:center; justify-content:center; }
.modal{ background:rgba(34,34,38,.96); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  border:1px solid var(--line2); border-radius:14px; box-shadow:var(--shadow-glass);
  min-width:400px; max-width:74vw; max-height:84vh; display:flex; flex-direction:column; overflow:hidden; }
.modal-head{ display:flex; align-items:center; padding:13px 16px; border-bottom:1px solid var(--line); }
.modal-head h3{ flex:1; font-size:14px; }
.modal-close{ background:transparent; border:none; color:var(--text3); font-size:17px; cursor:pointer; }
.modal-close:hover{ color:var(--text); }
.modal-body{ padding:14px 16px; overflow-y:auto; }
.modal-foot{ padding:11px 16px; border-top:1px solid var(--line); display:flex; gap:9px; justify-content:flex-end; }
.modal input[type=text],.modal textarea,.modal select{ width:100%; background:#18181a; border:1px solid var(--line2);
  color:var(--text); border-radius:6px; padding:7px 9px; font-size:12.5px; outline:none; font-family:inherit; }
.modal textarea{ min-height:76px; resize:vertical; }
.modal label{ display:block; font-size:11.5px; color:var(--text2); margin:9px 0 4px; }

/* 重命名组模态框 */
.modal.rename-group{ min-width:360px; max-width:400px; }
.modal.rename-group .modal-head h3{ font-size:13px; }
.modal.rename-group .modal-body{ padding:18px 20px; }
.modal.rename-group input[type=text]{
  width:100%; background:#141416; border:1.5px solid var(--line2); color:var(--text);
  border-radius:8px; padding:11px 13px; font-size:14px; outline:none; font-family:inherit;
  transition:border-color .15s;
}
.modal.rename-group input[type=text]:focus{ border-color:var(--accent); }
.modal.rename-group .modal-foot{ padding:13px 20px; }
.modal.rename-group .btn.primary{
  background:var(--accent); border:none;
  color:#111; border-radius:6px; padding:7px 20px; font-size:12.5px; cursor:pointer; font-weight:600;
}
.modal.rename-group .btn:not(.primary){
  background:transparent; border:1px solid var(--line2); color:var(--text2);
  border-radius:6px; padding:7px 16px; font-size:12.5px; cursor:pointer;
}


/* 模板库 */
.tpl-grid{ display:grid; grid-template-columns:1fr 1fr; gap:9px; }
.tpl-card{ background:var(--panel); border:1px solid var(--line); border-radius:8px; padding:11px; cursor:grab; transition:.12s; }
.tpl-card:hover{ border-color:var(--accent); }
.tpl-card:active{ cursor:grabbing; }
.tpl-card .tc-name{ font-size:12.5px; font-weight:600; }
.tpl-card .tc-info{ font-size:10.5px; color:var(--text3); margin:4px 0 8px; }
.tpl-card .tc-actions{ display:flex; gap:5px; }
.tpl-card .tc-actions button{ flex:1; font-size:11px; padding:4px; border-radius:5px; cursor:pointer; }
.tpl-empty{ grid-column:1/-1; color:var(--text3); text-align:center; padding:32px 10px; font-size:12.5px; line-height:2; }

/* 历史 */
.hist-list{ display:flex; flex-direction:column; gap:7px; }
.hist-item{ display:flex; align-items:center; gap:9px; background:var(--panel); border:1px solid var(--line);
  padding:8px 11px; border-radius:7px; }
.hist-item .hi-time{ font-size:10.5px; color:var(--text3); width:145px; flex:none; }
.hist-item .hi-name{ flex:1; font-size:12px; color:var(--text2); }
.hist-item button{ background:#26262a; border:1px solid var(--line2); color:var(--accent2); font-size:11px;
  padding:3px 11px; border-radius:5px; cursor:pointer; }
.hist-item button:hover{ background:#2e2e33; }
.rev-logs{ margin-top:12px; }
.rev-log{ font-size:11px; color:var(--text3); padding:3px 0; border-bottom:1px dashed var(--line); }

/* ================= 3D 导演台 ================= */
.stage-modal{ width:96vw; height:92vh; max-width:1400px; }
.stage-layout{ display:flex; flex:1; min-height:0; }
.stage-view{ flex:1; position:relative; background:#0e0e10; border-radius:0 0 0 0; }
.stage-view canvas{ position:absolute; inset:0; }
.stage-panel{ width:280px; flex:none; border-left:1px solid var(--line); display:flex; flex-direction:column; }
.stage-panel .sp-body{ flex:1; overflow-y:auto; padding:11px; }
.stage-tools{ display:flex; flex-wrap:wrap; gap:5px; padding:9px; border-bottom:1px solid var(--line); }
.stage-tools button{ flex:1; min-width:84px; background:#222226; border:1px solid var(--line2); color:var(--text2);
  border-radius:6px; padding:6px 4px; font-size:11px; cursor:pointer; }
.stage-tools button.active{ background:#2a2a2e; border-color:var(--accent); color:var(--accent2); }
.stage-tools button:hover{ color:var(--text); }
.sp-obj{ display:flex; align-items:center; gap:7px; background:var(--panel); border:1px solid var(--line);
  border-radius:6px; padding:6px 8px; margin-bottom:6px; cursor:pointer; }
.sp-obj.active{ border-color:var(--accent); }
.sp-obj .so-ic{ font-size:15px; }
.sp-obj .so-nm{ flex:1; font-size:12px; }
.sp-obj .so-del{ background:transparent; border:none; color:var(--text3); cursor:pointer; }
.sp-obj .so-del:hover{ color:var(--err); }
.stage-hint{ font-size:10.5px; color:var(--text3); line-height:1.8; margin-top:9px; padding:9px;
  border:1px dashed var(--line2); border-radius:6px; }

/* ================= Toast（屏幕居中提示） ================= */
#toast-root{ position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); z-index:5000;
  display:flex; flex-direction:column; align-items:center; gap:12px; pointer-events:none; }
.toast{ background:rgba(30,30,34,.96); -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  border:1px solid var(--line2); border-left:4px solid var(--accent); border-radius:12px; padding:13px 24px;
  font-size:14px; font-weight:600; color:var(--text); box-shadow:0 12px 44px rgba(0,0,0,.55);
  animation:tin .22s ease; min-width:230px; max-width:430px; text-align:center; }
.toast.ok{ border-left-color:var(--ok); }
.toast.warn{ border-left-color:var(--warn); }
.toast.err{ border-left-color:var(--err); }
@keyframes tin{ from{ transform:translateY(12px) scale(.96); opacity:0; } to{ transform:none; opacity:1; } }
.toast.out{ opacity:0; transition:.25s; }

/* ================= 登录/注册弹窗（居中卡片 + 登录/注册切换） ================= */
.auth-card{ position:relative; width:360px; max-width:92vw; background:rgba(30,30,34,.97);
  border:1px solid rgba(255,255,255,.1); border-radius:18px; padding:24px 26px 20px; color:#e8e6e3;
  box-shadow:0 24px 80px rgba(0,0,0,.6); }
.auth-card .auth-x{ position:absolute; top:14px; right:14px; background:none; border:none; color:#9a9aa2; font-size:14px; cursor:pointer; }
.auth-brand{ text-align:center; margin:2px 0 18px; }
.auth-logo{ font-size:32px; line-height:1.2; color:#d4a853; }
.auth-brand-name{ font-size:18px; font-weight:700; color:#fff; }
.auth-sub{ font-size:12px; color:#8a8a8e; margin-top:2px; }
.auth-tabs{ display:flex; background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.08);
  border-radius:999px; padding:4px; margin-bottom:16px; }
.auth-tab{ flex:1; padding:9px 0; border-radius:999px; border:none; cursor:pointer; font-size:13.5px;
  color:#9a9aa2; background:transparent; transition:all .15s ease; }
.auth-tab.on{ background:linear-gradient(135deg,#f0cf82,#d4a853); color:#151515; font-weight:700; }
.auth-inp{ width:100%; box-sizing:border-box; padding:12px 14px; margin-bottom:12px; border-radius:12px;
  border:1px solid #3c3c44; background:rgba(255,255,255,.05); color:#e8e6e3; font-size:13.5px; outline:none; transition:border-color .15s; }
.auth-inp:focus{ border-color:#d4a853; }
.auth-inp::placeholder{ color:#8a8a8e; }
.auth-submit{ width:100%; padding:12px; border-radius:12px; border:none;
  background:linear-gradient(135deg,#f0cf82,#d4a853); color:#151515; font-weight:700; font-size:14px; cursor:pointer; margin-top:2px; }
.auth-submit:hover{ filter:brightness(1.05); }
.auth-note{ font-size:11.5px; color:#7a7a82; text-align:center; margin-top:12px; line-height:1.6; }

/* 视频节点预览的 Ken Burns 动画 */
.kenburns{ animation:kb 4s ease-in-out infinite alternate; }
@keyframes kb{ from{ transform:scale(1.05) translate(1.5%,1%); } to{ transform:scale(1.22) translate(-2.5%,-2%); } }

/* 音频波形 */
.waveform{ display:flex; align-items:flex-end; gap:2px; height:42px; padding:4px 6px; }
.waveform i{ flex:1; background:var(--audio-node); border-radius:2px; min-height:2px; opacity:.8; }
.waveform.play i{ animation:wv 1s ease-in-out infinite alternate; }
.waveform.play i:nth-child(2n){ animation-delay:.12s; }
.waveform.play i:nth-child(3n){ animation-delay:.24s; }
@keyframes wv{ from{ transform:scaleY(.3); } to{ transform:scaleY(1); } }

/* ================= 首页视图（黑金未来主题） ================= */
.home-view{ position:fixed; inset:0; z-index:200; overflow-y:auto; background:#0b0a07; }
.home-view::before{ content:''; position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(circle, rgba(212,168,83,.065) 1px, transparent 1.6px),
    radial-gradient(120% 85% at 50% 0%, #1b1710 0%, #0f0d09 55%, #070605 100%);
  background-size: 26px 26px, 100% 100%; }
/* 巨型金环轨道（缓慢自转的未来感装饰） */
.home-view::after{ content:''; position:fixed; z-index:0; pointer-events:none; left:50%; top:42%;
  width:min(115vh,980px); height:min(115vh,980px); transform:translate(-50%,-50%);
  border-radius:50%; border:1px dashed rgba(212,168,83,.16);
  box-shadow:inset 0 0 140px rgba(212,168,83,.05), 0 0 60px rgba(212,168,83,.04);
  animation:spin 90s linear infinite; }
#home-particles{ position:fixed; inset:0; z-index:0; pointer-events:none; }
.home-inner{ position:relative; z-index:1; max-width:1280px; margin:0 auto; padding:60px 48px 96px; min-height:100%;
  display:flex; flex-direction:column; }

.home-hero{ position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:20px; text-align:center; padding:56px 16px 40px; }
.home-hero-main{ display:flex; flex-direction:column; gap:6px; min-width:280px; align-items:center; }
.home-brand-text{ display:flex; flex-direction:column; gap:6px; }
.home-logo-row{ display:flex; align-items:center; gap:20px; margin-bottom:4px; }
/* ∞ 徽标：鎏金渐变 + 旋转光环 */
.home-logo{ position:relative; font-size:50px; line-height:1; font-weight:600;
  background:linear-gradient(135deg,#f8ecc9,#d4a853 55%,#8a6a2f);
  -webkit-background-clip:text; background-clip:text; color:transparent; -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 0 16px rgba(212,168,83,.4)); }
.home-logo::before{ content:''; position:absolute; left:50%; top:50%; width:112px; height:112px;
  transform:translate(-50%,-50%); border-radius:50%; pointer-events:none;
  background:conic-gradient(from 0deg, transparent 0deg 70deg, rgba(232,196,122,.95) 100deg, rgba(212,168,83,.28) 135deg, transparent 175deg 360deg);
  -webkit-mask:radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask:radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  animation:spin 5s linear infinite; }
.home-eyebrow{ font-size:11px; letter-spacing:.42em; color:#c9a86a; text-transform:uppercase;
  text-shadow:0 0 12px rgba(212,168,83,.35); }
.home-title{ font-size:44px; font-weight:700; letter-spacing:1px; line-height:1.08;
  background:linear-gradient(100deg, #f5e9c8 15%, #a8863f 38%, #f8ecc9 50%, #a8863f 62%, #f5e9c8 85%);
  background-size:220% 100%; -webkit-background-clip:text; background-clip:text; color:transparent;
  -webkit-text-fill-color:transparent; filter:drop-shadow(0 2px 18px rgba(212,168,83,.25)); }
.home-desc{ font-size:15.5px; color:#b9a77e; letter-spacing:.5px; }
.home-hero-side{ display:flex; flex-direction:column; align-items:center; gap:10px; }
.home-new-btn{ position:relative; overflow:hidden; display:inline-flex; align-items:center; gap:8px; font-size:14px; font-weight:600;
  color:#fff; background:linear-gradient(135deg,#e0b45c,#c19345); border:1px solid #e8c47a; border-radius:10px; padding:13px 30px;
  cursor:pointer; transition:all .18s; box-shadow:0 6px 22px rgba(212,168,83,.35); }
.home-new-btn:hover{ background:linear-gradient(135deg,#eac06a,#d4a853); transform:translateY(-1px);
  box-shadow:0 10px 32px rgba(212,168,83,.5); }
.home-new-btn::after{ content:''; position:absolute; top:0; left:-80%; width:55%; height:100%;
  background:linear-gradient(105deg, transparent, rgba(255,255,255,.4), transparent);
  animation:btnSheen 3.4s ease-in-out infinite; }
.home-new-btn .lc-ic{ width:15px; height:15px; }
.home-hero-tip{ font-size:12px; color:#8d8570; }

/* 首页广告位：创作专区（占位元素） */
.home-ads{ margin:10px 16px; }
.home-ads-head{ display:flex; align-items:center; gap:10px; padding:6px 2px 10px; }
.home-ads-title{ font-size:15px; font-weight:700; color:#f0e6c8; text-shadow:0 0 14px rgba(212,168,83,.25); }
.home-ads-note{ flex:none; font-size:10px; color:#e0b96a; border:1px solid rgba(212,168,83,.35); background:rgba(212,168,83,.08);
  padding:2px 8px; border-radius:4px; letter-spacing:1px; }
.home-ad-grid{ display:grid; grid-template-columns:repeat(4, 1fr); gap:14px; }
.home-ad-card{ position:relative; display:flex; flex-direction:column; gap:8px;
  background:linear-gradient(160deg, rgba(38,33,24,.55), rgba(16,14,10,.75)); border:1px solid rgba(212,168,83,.2);
  border-radius:14px; padding:16px; text-decoration:none; overflow:hidden;
  -webkit-backdrop-filter:blur(14px); backdrop-filter:blur(14px);
  transition:transform .16s, box-shadow .16s, border-color .16s; }
.home-ad-card::after{ content:''; position:absolute; inset:0; pointer-events:none; opacity:0; transition:opacity .3s;
  background:radial-gradient(300px circle at 78% 15%, rgba(212,168,83,.16), transparent 60%); }
.home-ad-card:hover{ transform:translateY(-3px); border-color:rgba(212,168,83,.55);
  box-shadow:0 12px 34px rgba(0,0,0,.5), 0 0 24px rgba(212,168,83,.12); }
.home-ad-card:hover::after{ opacity:1; }
.ad-icon{ width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center;
  background:rgba(212,168,83,.12); color:#e0b96a; box-shadow:inset 0 0 0 1px rgba(212,168,83,.25); }
.ad-icon .lc-ic{ width:19px; height:19px; }
.ad-name{ font-size:14px; font-weight:700; color:#efe6cc; }
.ad-desc{ font-size:11.5px; color:#8d8570; line-height:1.5; min-height:34px; }
.ad-cta{ font-size:12px; font-weight:600; color:#e0b96a; }
.home-ad-card.ad-voice .ad-icon{ background:rgba(74,222,128,.12); color:var(--audio-node); box-shadow:inset 0 0 0 1px rgba(74,222,128,.25); }
.home-ad-card.ad-manga .ad-icon{ background:rgba(240,201,92,.16); color:var(--script-node); box-shadow:inset 0 0 0 1px rgba(240,201,92,.25); }
.home-ad-card.ad-live .ad-icon{ background:rgba(240,149,74,.12); color:var(--video-node); box-shadow:inset 0 0 0 1px rgba(240,149,74,.25); }
.home-ad-card.ad-explain .ad-icon{ background:rgba(86,200,216,.14); color:var(--stage-node); box-shadow:inset 0 0 0 1px rgba(86,200,216,.25); }
@media (max-width:900px){ .home-ad-grid{ grid-template-columns:repeat(2, 1fr); } }

.home-stats{ display:flex; align-items:center; justify-content:center;
  border-top:1px solid rgba(212,168,83,.16); border-bottom:1px solid rgba(212,168,83,.16); padding:24px 20px; }
.stat{ display:flex; flex-direction:column; align-items:center; gap:5px; padding:0 48px; }
.stat-num{ font-size:28px; font-weight:700; letter-spacing:.5px;
  background:linear-gradient(135deg,#f5e6bd,#d4a853 60%,#a9853c);
  -webkit-background-clip:text; background-clip:text; color:transparent; -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 0 12px rgba(212,168,83,.3)); }
.stat-label{ font-size:12px; color:#8d8570; letter-spacing:1px; }
.stat-sep{ width:1px; height:34px; background:rgba(212,168,83,.18); }

.home-list-head{ display:flex; align-items:center; justify-content:center; gap:18px; padding:36px 0 18px; }
.home-sec-title{ font-size:15px; font-weight:700; color:#f0e6c8; letter-spacing:.5px; }
.home-new-top{ display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:600;
  color:#e0b96a; background:rgba(212,168,83,.06); border:1px solid rgba(212,168,83,.35); border-radius:8px; padding:7px 14px; cursor:pointer; transition:all .15s; }
.home-new-top:hover{ background:rgba(212,168,83,.14); border-color:#d4a853; box-shadow:0 0 14px rgba(212,168,83,.2); }
.home-new-top .lc-ic{ width:13px; height:13px; }

.home-body{ flex:1; }
.home-list{ display:grid; grid-template-columns:repeat(auto-fill, minmax(272px, 1fr)); gap:20px; }

.hc-card{ display:flex; flex-direction:column;
  background:linear-gradient(165deg, rgba(34,29,21,.6), rgba(14,12,9,.8)); border:1px solid rgba(212,168,83,.2);
  border-radius:18px; overflow:hidden; cursor:pointer;
  -webkit-backdrop-filter:blur(12px); backdrop-filter:blur(12px);
  transition:border-color .16s, transform .14s ease-out, box-shadow .16s; }
.hc-card:hover{ border-color:rgba(212,168,83,.6); transform:translateY(-3px);
  box-shadow:0 16px 40px rgba(0,0,0,.55), 0 0 28px rgba(212,168,83,.14); }
.hc-cover{ position:relative; aspect-ratio:16/9; display:flex; align-items:center; justify-content:center;
  background:
    radial-gradient(circle, rgba(212,168,83,.08) 1px, transparent 1.6px),
    linear-gradient(150deg, rgba(36,31,21,.8), rgba(12,10,7,.9));
  background-size: 20px 20px, 100% 100%;
  border-bottom:1px solid rgba(212,168,83,.16); overflow:hidden; }
.hc-cover::after{ content:''; position:absolute; inset:0; z-index:1;
  background:linear-gradient(160deg, rgba(212,168,83,.2), rgba(212,168,83,0) 60%); }
.hc-card:nth-child(3n+2) .hc-cover::after{ background:linear-gradient(160deg, rgba(96,140,220,.18), rgba(96,140,220,0) 60%); }
.hc-card:nth-child(3n+3) .hc-cover::after{ background:linear-gradient(160deg, rgba(150,110,220,.18), rgba(150,110,220,0) 60%); }
.hc-figure{ position:relative; z-index:2; width:158px; height:70px; max-width:72%;
  transition:transform .16s; filter:drop-shadow(0 6px 14px rgba(0,0,0,.5)); }
.hc-card:hover .hc-figure{ transform:scale(1.05); }
.hc-card-body{ display:flex; flex-direction:column; gap:5px; padding:16px 18px 14px; }
.hc-name{ font-size:15px; font-weight:650; color:#efe6cc; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hc-meta{ font-size:12px; color:#8d8570; display:flex; align-items:center; gap:6px; }
.hc-meta::before{ content:'●'; font-size:7px; color:#d4a853; }
.hc-actions{ display:flex; align-items:center; gap:6px; margin:0 6px; padding:12px 12px 14px;
  border-top:1px solid rgba(212,168,83,.14); }
.hc-btn{ display:inline-flex; align-items:center; gap:5px; font-size:12px; color:#9a9078;
  background:transparent; border:1px solid transparent; border-radius:7px; padding:6px 12px; cursor:pointer; transition:all .13s; }
.hc-btn:hover{ color:#f0e6c8; background:rgba(212,168,83,.1); }
.hc-btn.primary{ color:#e0b96a; background:rgba(212,168,83,.12); border:1px solid rgba(212,168,83,.35); font-weight:600; }
.hc-btn.primary:hover{ background:rgba(212,168,83,.2); color:#f5d088; border-color:#d4a853; }
.hc-btn.danger{ color:#c98a7e; }
.hc-btn.danger:hover{ color:#f2a99b; background:rgba(248,113,113,.12); }

.home-empty{ padding:110px 20px 40px; display:flex; flex-direction:column; align-items:center; gap:16px; }
.home-empty-icon{ color:#6a5f45; filter:drop-shadow(0 0 14px rgba(212,168,83,.2)); }
.home-empty-text{ font-size:14px; color:#8d8570; }
.home-empty-btn{ font-size:13.5px; font-weight:600; color:#fff; background:linear-gradient(135deg,#e0b45c,#c19345); border:none;
  border-radius:10px; padding:11px 26px; cursor:pointer; transition:all .18s; box-shadow:0 4px 18px rgba(212,168,83,.3); }
.home-empty-btn:hover{ filter:brightness(1.06); transform:translateY(-1px); box-shadow:0 8px 26px rgba(212,168,83,.45); }

.home-prompt input{ font-size:14px; }

/* ================= 首页特效（克制的入场动效 + 卡片光斑） ================= */
@keyframes homeRise{ from{ opacity:0; transform:translateY(16px); } to{ opacity:1; transform:none; } }
.home-logo{ animation:homeRise .7s ease-out both; }
.home-eyebrow{ animation:homeRise .7s .1s ease-out both; }
.home-title{ animation:homeRise .7s .2s ease-out both, shine 6s 1.4s linear infinite; }
.home-desc{ animation:homeRise .7s .3s ease-out both; }
.home-new-btn{ animation:homeRise .7s .42s ease-out both; }
.home-ads{ animation:homeRise .7s .5s ease-out both; }
.home-stats{ animation:homeRise .7s .58s ease-out both; }
.hc-card{ position:relative; }
.hc-card::before{ content:''; position:absolute; inset:0; z-index:2; pointer-events:none;
  background:radial-gradient(340px circle at var(--mx,50%) var(--my,50%), rgba(212,168,83,.12), transparent 60%);
  opacity:0; transition:opacity .25s; }
.hc-card:hover::before{ opacity:1; }

/* 背景光晕跟随鼠标（柔和的暖光，跟着光标缓慢漂移） */
.home-glow{ position:fixed; top:0; left:0; width:720px; height:720px; border-radius:50%;
  background:radial-gradient(circle, rgba(212,168,83,.16), transparent 62%);
  pointer-events:none; z-index:0; transition:transform .5s ease-out; }

/* ============ 黑金动态特效 ============ */
/* 标题鎏金流光 */
@keyframes shine{ to{ background-position:-220% 0; } }
/* 按钮扫光 */
@keyframes btnSheen{ 0%{ left:-80%; } 55%{ left:135%; } 100%{ left:135%; } }
/* 充值按钮呼吸辉光 */
@keyframes goldPulse{ 0%,100%{ box-shadow:0 4px 18px rgba(212,168,83,.45), inset 0 1px 0 rgba(255,255,255,.35); }
  50%{ box-shadow:0 4px 32px rgba(212,168,83,.75), inset 0 1px 0 rgba(255,255,255,.35); } }
/* 顶栏 ∞ 徽标呼吸辉光 */
@keyframes logoGlow{ 0%,100%{ filter:drop-shadow(0 0 4px rgba(212,168,83,.2)); }
  50%{ filter:drop-shadow(0 0 12px rgba(212,168,83,.55)); } }
/* 画布背景金斑漂移 */
@keyframes glowDrift{ from{ transform:translate3d(-3.5%,-2.5%,0); } to{ transform:translate3d(4%,3.5%,0); } }
#btn-recharge.btn-recharge-lg{ animation:goldPulse 3.2s ease-in-out infinite; }
#topbar .logo{ animation:logoGlow 4s ease-in-out infinite; }

/* ================= 智能对齐参考线 ================= */
.align-guides{ position:absolute; inset:0; pointer-events:none; z-index:60; overflow:hidden; }
.ag-line{ position:absolute; }
.ag-v{ width:1px; background:var(--accent2); box-shadow:none; }
.ag-h{ height:1px; background:var(--accent2); box-shadow:none; }

/* ================= 提示词面板（跟随节点，位于节点正下方） ================= */
.prompt-panel{ position:absolute; left:0; top:0; z-index:80; width:560px; box-sizing:border-box; cursor:default; }
.pp-inner{ box-sizing:border-box; background:#181818; border:1px solid #2e2e32; border-radius:16px;
  box-shadow:0 8px 32px rgba(0,0,0,.55); overflow:hidden; width:100%; }
/* 面板所属节点标题：明确"这个面板在编辑谁 / ▶ 会生成谁"，避免点生成跑错节点 */
.pp-node-title{ display:flex; align-items:center; gap:6px; padding:7px 12px 0;
  font-size:11.5px; color:#c9a86a; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pp-node-title .lc-ic{ color:#8f8f8f; flex:none; }
.pp-top{ display:flex; align-items:center; justify-content:space-between; gap:8px; padding:8px 10px 4px; }
.pp-tags{ display:flex; align-items:center; gap:6px; flex-wrap:nowrap; }
.pp-tag{ display:inline-flex; align-items:center; gap:4px; background:#222222; border:1px solid #2e2e32; white-space:nowrap;
  color:#b0b0b0; font-size:11px; padding:4px 10px; border-radius:99px; cursor:pointer; transition:.12s; }
.pp-tag:hover{ border-color:#3a3a3e; color:#d0d0d0; background:#1e1e1e; }
.pp-tag .lc-ic{ vertical-align:-2px; }
.pp-plus{ font-weight:500; margin-right:1px; }
.pp-tag-style.on{ color:#fff; background:rgba(59,130,246,.16); }
.pp-style-now{ display:inline-flex; align-items:center; font-size:11px; color:#9ec0ff;
  padding:2px 7px; border-radius:5px; background:rgba(59,130,246,.12); white-space:nowrap; }
.pp-modes{ display:flex; align-items:center; gap:6px; padding:0 10px 8px; flex-wrap:nowrap; overflow-x:auto; }
.pp-chip{ font-size:10.5px; color:#aaaaaa; background:#242424; border:1px solid #343434; white-space:nowrap; flex:none;
  padding:3px 12px; border-radius:99px; cursor:pointer; user-select:none; transition:.1s; }
.pp-chip:hover{ color:#fff; border-color:#4a4a4a; }
.pp-chip.on{ color:#fff; border-color:#3b82f6; background:rgba(59,130,246,.16); }
.pp-zoom{ flex:none; background:transparent; border:none; color:#7a7a7a;
  cursor:pointer; padding:4px; border-radius:5px; display:flex; align-items:center; }
.pp-zoom:hover{ color:#b0b0b0; background:#222222; }
.pp-input{ width:100%; box-sizing:border-box; background:transparent; border:none; outline:none; resize:none;
  color:#d0d0d0; font-size:13px; line-height:1.6; font-family:inherit; padding:6px 14px; min-height:60px; max-height:140px;
  overflow-y:auto; white-space:pre-wrap; word-break:break-word; cursor:text; }
.pp-input::placeholder{ color:#4a4a4a; font-size:12.5px; }
.pp-input:empty::before{ content:attr(data-placeholder); color:#4a4a4a; font-size:12.5px; pointer-events:none; }
/* 语音输入按钮：提示词输入框右下角，单色线条风格 */
.pp-input-wrap{ position:relative; }
.pp-voice{
  position:absolute; right:6px; bottom:6px;
  width:26px; height:26px;
  background:transparent; border:1px solid #2e2e32; border-radius:6px;
  color:#8a8a8a; display:flex; align-items:center; justify-content:center;
  cursor:pointer; padding:0;
  transition:color .15s, border-color .15s, background .15s;
}
.pp-voice:hover{ color:#d0b88a; border-color:#5a5a52; }
.pp-voice.recording{
  background:#b3261e; color:#fff; border-color:#b3261e;
  animation:pp-voice-pulse 1.2s ease-in-out infinite;
}
@keyframes pp-voice-pulse{
  0%,100%{ box-shadow:0 0 0 0 rgba(179,38,30,.55); }
  50%   { box-shadow:0 0 0 6px rgba(179,38,30,0); }
}
/* 资产拖拽期间隐藏列表所有 img，浏览器不再解码大图，主线程腾出来响应 dragover/drop，避免拖快了放不下 */
#assets-list.dragging .ac-thumb img,
#assets-list.dragging .ac-thumb video{ visibility:hidden; }
#assets-list.dragging .ac-thumb{ background:#1a1a1a; }
/* 提示词内嵌 @ 引用块：图片缩略图 + 名称，等比例显示不裁切 */
.pp-mention{ display:inline-flex; align-items:center; gap:5px; vertical-align:middle; margin:0 2px;
  background:#242424; border:1px solid #343434; border-radius:6px; padding:2px 7px 2px 2px;
  font-size:12px; color:#c9c9c9; cursor:text; user-select:text; white-space:nowrap; }
.pp-mention-img{ width:20px; height:20px; object-fit:contain; border-radius:4px; background:#171719; flex:none; }
.pp-bar{ display:flex; align-items:center; justify-content:space-between; gap:8px;
  padding:8px 10px; border-top:1px solid #252525; }
.pp-bar-left{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; flex:1; min-width:0; }
/* 统一自定义下拉：按钮 + 弹层（符号 ▾、深色、hover 一致） */
.pp-drop{ display:inline-flex; align-items:center; gap:4px; background:#222; border:1px solid #2e2e32;
  color:#c4c4c4; border-radius:6px; padding:4px 8px; font-size:11px; cursor:pointer; white-space:nowrap; }
.pp-drop:hover{ background:#222; border-color:#4a4a4a; color:#d0d0d0; }
.pp-drop-sm{ padding:3px 6px; }
.pp-caret{ font-size:9px; color:#7a7a7a; }
.pp-drop-pop{ position:fixed; top:0; left:0; padding:6px; background:#1a1a1a;
  border:1px solid #2e2e32; border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.5);
  z-index:99999; min-width:120px; }
.pp-drop-grid{ display:grid; grid-template-columns:repeat(5,1fr); gap:5px; width:250px; }
.pp-drop-item{ display:flex; align-items:center; justify-content:center; height:24px; padding:0 10px;
  background:transparent; border:1px solid transparent; border-radius:6px; color:#b0b0b0; font-size:11px;
  cursor:pointer; user-select:none; white-space:nowrap; }
.pp-drop-grid .pp-drop-item{ background:#242424; border-color:#2e2e32; color:#9a9a9a; font-size:10.5px; padding:0 5px; height:22px; }
.pp-drop-item:hover{ background:#242424; color:#c9c9c9; }
.pp-drop-grid .pp-drop-item:hover{ background:#242424; border-color:#3a3a3e; color:#c9c9c9; }
.pp-drop-item.on{ color:#fff; background:#2e2e2e; }
.pp-drop-grid .pp-drop-item.on{ background:#2e2e2e; border-color:#5a5a5a; color:#fff; }
.pp-bar-right{ display:flex; align-items:center; gap:6px; flex:none; }
.pp-model{ display:inline-flex; align-items:center; gap:5px; }
.pp-model-ic{ color:#9a9a9a; display:inline-flex; }
.pp-sep{ width:1px; height:16px; background:#2e2e2e; flex:none; }
.pp-mid{ color:#4a4a4a; font-size:11px; flex:none; }
/* 视频时长迷你滑块 */
.pp-dur-slider{ display:flex; align-items:center; gap:5px; flex:none; }
.pp-dur-range{ width:90px; height:16px; accent-color:var(--accent); cursor:pointer; }
.pp-dur-val{ font-size:11px; color:var(--text2); background:#1a1a1e; border:1px solid var(--line2);
  border-radius:4px; padding:1px 5px; min-width:30px; text-align:center; }
.pp-nomodel{ background:rgba(248,113,113,.12); border:1px solid rgba(248,113,113,.3); color:var(--err); white-space:nowrap;
  border-radius:6px; padding:4px 10px; font-size:11px; cursor:pointer; }
.pp-run{ flex:none; width:32px; height:32px; border-radius:50%; background:#7a7a7a; border:none; cursor:pointer;
  color:#111; display:flex; align-items:center; justify-content:center; transition:.12s; padding:0; }
.pp-run:hover{ background:#9a9a9a; }
.pp-bar-right{ display:flex; align-items:center; gap:4px; flex:none; }
.pp-tool{ flex:none; width:26px; height:26px; border-radius:6px; background:transparent; border:none; cursor:pointer;
  color:#9a9a9a; display:flex; align-items:center; justify-content:center; padding:0; position:relative; }
.pp-tool:hover{ color:#c9c9c9; background:#222222; }
.pp-tool-dot::after{ content:''; position:absolute; top:3px; right:3px; width:5px; height:5px; border-radius:50%; background:#3b82f6; }
.pp-count{ font-size:11px; color:#7a7a7a; padding:0 2px; }
.pp-run.busy{ opacity:.6; cursor:wait; animation:spin 1s linear infinite; }
.pp-run:disabled{ cursor:wait; }

/* 底部面板单价标签（图片/视频节点，随分辨率档位实时变动） */
.pp-price{ display:inline-flex; align-items:baseline; gap:3px; flex:none; font-size:12.5px; font-weight:700;
  color:#e0b96a; background:rgba(224,185,106,.1); border:1px solid rgba(224,185,106,.32); border-radius:6px; padding:3px 8px; white-space:nowrap; }
.pp-price-unit{ font-size:9px; font-weight:400; font-style:normal; color:#b8a06a; }

/* 模型下拉：后台禁用的模型显示为灰色 + 琥珀「暂不可用」标签；点不动（点击无响应），悬停无高亮 */
.pp-drop-item.off{ color:#76767f; cursor:not-allowed; }
.pp-drop-item.off:hover{ background:transparent; color:#76767f; }
.pp-dis-tag{ font-style:normal; font-weight:400; font-size:10px; color:#e0b96a; margin-left:6px; white-space:nowrap; }
.pp-drop.pp-dis{ color:#8a8a92; }
.pp-run.off{ opacity:.4; cursor:not-allowed; background:rgba(255,255,255,.04) !important; border-color:#3a3a42 !important; color:#9a9aa2 !important; }

/* 风格选择弹层 */
.pp-style-pop{ position:fixed; z-index:9999; width:320px; max-height:380px; overflow-y:auto;
  background:#1d1d20; border:1px solid #3e3e46; border-radius:10px; box-shadow:0 12px 40px rgba(0,0,0,.6); padding:8px; }
.pp-style-head{ font-size:11px; color:var(--text3); padding:4px 6px 8px; }
.pp-style-grid{ display:grid; grid-template-columns:1fr 1fr; gap:5px; }
.pp-style-item{ font-size:11px; color:var(--text2); background:#26262c; border:1px solid var(--line2);
  padding:6px 8px; border-radius:6px; cursor:pointer; text-align:center; white-space:nowrap; transition:.1s; }
.pp-style-item:hover{ border-color:var(--accent); color:var(--text); }
.pp-style-item.on{ color:var(--accent); border-color:rgba(212,168,83,.6); background:rgba(212,168,83,.10); }
