/* ============ Aether ============ */
:root {
  --bg: #0b0c10;
  --panel: #14161d;
  --panel-2: #191c25;
  --panel-3: #212531;
  --border: #292e3b;
  --border-light: #394054;
  --text: #e9ebf2;
  --muted: #949aad;
  --dim: #666e82;
  --accent: #7c5cff;
  --accent-2: #4d9fff;
  --blue: #4d9fff;
  --purple: #a56cff;
  --pink: #f0629c;
  --teal: #2fd0b8;
  --amber: #f2ad4c;
  --ok: #3ed598;
  --err: #ff6b73;
  --radius: 12px;
  --shadow: 0 14px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
button:disabled { cursor: not-allowed; opacity: .45; }
svg { display: block; }
[hidden] { display: none !important; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #33394a; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #454d63; }

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

/* ---------- Topbar ---------- */
.topbar {
  height: 56px;
  flex: 0 0 56px;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  background: linear-gradient(180deg, #161922, #11131a);
  border-bottom: 1px solid var(--border);
  z-index: 30;
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 210px; }
.brand-mark { width: 28px; height: 28px; color: var(--accent); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.brand-tag {
  font-size: 9px; font-weight: 700; letter-spacing: 1.2px;
  color: var(--accent-2); background: rgba(77, 159, 255, .12);
  border: 1px solid rgba(77, 159, 255, .28);
  padding: 3px 6px; border-radius: 5px;
}

.topbar-center, .topbar-right { display: flex; align-items: center; gap: 6px; }
.topbar-center { flex: 1; }
.topbar-right { margin-left: auto; }
.tsep { width: 1px; height: 20px; background: var(--border-light); margin: 0 6px; }

.tbtn {
  height: 32px; padding: 0 11px;
  display: inline-flex; align-items: center; gap: 7px;
  color: #c8cddd; background: #1c202b;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 12.5px; white-space: nowrap;
  transition: .16s ease;
}
.tbtn svg { width: 15px; height: 15px; }
.tbtn:hover { background: #252a37; color: #fff; border-color: var(--border-light); }
.tbtn.primary {
  background: linear-gradient(135deg, #7c5cff, #5a6cff);
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 3px 12px rgba(124, 92, 255, .28);
}
.tbtn.primary:hover { filter: brightness(1.12); }
.tbtn.icon { width: 32px; padding: 0; justify-content: center; }
.tbtn.api-entry {
  background: linear-gradient(135deg, #7c5cff, #5a6cff);
  border-color: transparent; color: #fff; font-weight: 600;
  box-shadow: 0 3px 12px rgba(124, 92, 255, .3);
}
.tbtn.api-entry:hover { filter: brightness(1.12); color: #fff; }
.tbtn.api-entry.pending { background: linear-gradient(135deg, #ff9f43, #ff6b73); box-shadow: 0 3px 12px rgba(255,107,115,.3); }
.points-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 12px; border-radius: 16px;
  background: rgba(124, 92, 255, .12); border: 1px solid rgba(124, 92, 255, .3);
  color: #c9b8ff; font-size: 12.5px; font-weight: 600;
  white-space: nowrap; cursor: default;
}
.points-pill svg { width: 14px; height: 14px; color: #ffce5c; }
.points-pill em { font-style: normal; color: #ffd66b; font-size: 14px; }
.tbtn:active { transform: translateY(1px); }
/* 画布云端同步状态 */
.cloud-save-status {
  display: none; align-items: center; height: 32px; padding: 0 4px;
  font-size: 12px; color: #8b93a7; white-space: nowrap;
}
.cloud-save-status:not(:empty) { display: inline-flex; }
.cloud-save-status.ok { color: #4ade80; }
.cloud-save-status.err { color: #ff6b73; }

/* ---------- Workspace ---------- */
.workspace { flex: 1; display: flex; min-height: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 236px; flex: 0 0 236px;
  background: linear-gradient(180deg, #141721, #11131a);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 16px 12px 12px;
  z-index: 20;
}
.side-head { padding: 0 6px 12px; }
.side-title { font-size: 13px; font-weight: 700; letter-spacing: .3px; }
.side-sub { color: var(--dim); font-size: 11px; margin-top: 3px; }

.node-list { display: flex; flex-direction: column; gap: 6px; }
.node-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 9px; border-radius: 10px;
  background: #1a1d27; border: 1px solid transparent;
  text-align: left; transition: .15s ease;
}
.node-item:hover { background: #222635; border-color: var(--border-light); transform: translateX(2px); }
.ni-icon {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 9px; display: grid; place-items: center;
}
.ni-icon svg { width: 17px; height: 17px; }
.node-item[data-color="blue"] .ni-icon { color: var(--blue); background: rgba(77,159,255,.14); }
.node-item[data-color="purple"] .ni-icon { color: var(--purple); background: rgba(165,108,255,.14); }
.node-item[data-color="pink"] .ni-icon { color: var(--pink); background: rgba(240,98,156,.14); }
.node-item[data-color="teal"] .ni-icon { color: var(--teal); background: rgba(47,208,184,.14); }
.node-item[data-color="amber"] .ni-icon { color: var(--amber); background: rgba(242,173,76,.14); }
.ni-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ni-text strong { font-size: 12.5px; font-weight: 600; }
.ni-text small { font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.ni-plus { margin-left: auto; color: var(--dim); font-size: 17px; line-height: 1; }
.node-item:hover .ni-plus { color: var(--accent-2); }

.side-guide {
  margin-top: auto; padding: 12px 8px 4px;
  border-top: 1px solid var(--border);
}
.guide-title { font-size: 11px; color: var(--dim); margin-bottom: 9px; letter-spacing: .5px; }
.guide-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; color: #9ca3b6; font-size: 11px; }
.guide-row kbd {
  min-width: 38px; text-align: center;
  padding: 2px 5px; border-radius: 5px;
  background: #202430; border: 1px solid var(--border-light);
  font-size: 10px; color: #c0c7d8; font-family: inherit;
}

.side-status, .side-api-entry {
  width: 100%; margin-top: 10px; padding: 10px 9px;
  display: flex; align-items: center; gap: 8px; text-align: left;
  border-radius: 8px; background: #191c25;
  border: 1px solid var(--border);
  font-size: 11.5px; color: var(--muted);
}
.side-api-entry { cursor: pointer; transition: .16s; }
.side-api-entry:hover { background: #232735; border-color: #5a4bd6; color: #fff; }
.side-api-entry svg { width: 14px; height: 14px; margin-left: auto; color: #7c6cff; flex: 0 0 14px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff9f43; flex: 0 0 7px; box-shadow: 0 0 8px rgba(255,159,67,.5); }
.side-status.ready .status-dot, .side-api-entry.ready .status-dot { background: var(--ok); box-shadow: 0 0 8px rgba(62,213,152,.6); }
.side-status.ready .status-text, .side-api-entry.ready .status-text { color: #b9e8d4; }

/* ---------- Canvas ---------- */
.canvas-area { flex: 1; position: relative; min-width: 0; overflow: hidden; }
.canvas-viewport {
  position: absolute; inset: 0;
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(190, 200, 230, .16) 1px, transparent 1.2px);
  background-size: 24px 24px;
  cursor: default;
  overflow: hidden;
}
.canvas-viewport.panning { cursor: grabbing; }
.canvas-viewport.linking { cursor: crosshair; }
/* 框选矩形：空白处左键拖动多选节点 */
.marquee-box {
  position: absolute; z-index: 30; display: none;
  border: 1px solid var(--accent);
  background: rgba(124, 92, 255, .14);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, .25) inset;
  pointer-events: none;
}
/* 拖文件进画布时的整屏高亮提示 */
.canvas-viewport.file-drop-active::after {
  content: '松开以导入 · 图片 / 视频 / 音频';
  position: absolute; inset: 12px; z-index: 50;
  display: grid; place-items: center;
  border: 2px dashed var(--accent, #8b7bff);
  border-radius: 14px;
  background: rgba(90, 76, 190, .10);
  color: #d9d3ff; font-size: 15px; font-weight: 600; letter-spacing: .3px;
  pointer-events: none;
}
.canvas-viewport.file-drop-active {
  box-shadow: inset 0 0 0 2px rgba(139, 123, 255, .35);
}
/* 参考行命中高亮 */
.vref-line.drag-hover {
  background: rgba(139, 123, 255, .16);
  border-radius: 7px;
  outline: 1px dashed var(--accent, #8b7bff);
}
.world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }

.edge-layer {
  position: absolute; left: 0; top: 0;
  width: 1px; height: 1px; overflow: visible;
  pointer-events: none; z-index: 1;
}
.edge-path {
  fill: none; stroke: #4d5568; stroke-width: 2.5;
  pointer-events: stroke; cursor: pointer;
  transition: stroke .15s;
}
.edge-path:hover { stroke: #8b94ad; stroke-width: 3.5; }
.edge-path.selected { stroke: var(--accent-2); filter: drop-shadow(0 0 5px rgba(77,159,255,.6)); }
.edge-temp { fill: none; stroke: var(--accent-2); stroke-width: 2.5; stroke-dasharray: 6 5; }

/* ---------- Node card ---------- */
.node {
  position: absolute; z-index: 2;
  width: 320px;
  background: linear-gradient(180deg, #1c1f2a 0%, #171921 100%);
  border: 1px solid #2f3545;
  border-radius: 13px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .48), 0 1px 0 rgba(255,255,255,.03) inset;
  color: var(--text);
  display: flex; flex-direction: column;
  transition: border-color .15s, box-shadow .15s;
}
.node.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124,92,255,.28), 0 16px 44px rgba(0,0,0,.6);
  z-index: 4;
}
.node.running { border-color: var(--amber); }
.node[data-color="blue"] { --nc: var(--blue); --nb: rgba(77,159,255,.15); }
.node[data-color="purple"] { --nc: var(--purple); --nb: rgba(165,108,255,.15); }
.node[data-color="pink"] { --nc: var(--pink); --nb: rgba(240,98,156,.15); }
.node[data-color="teal"] { --nc: var(--teal); --nb: rgba(47,208,184,.15); }
.node[data-color="amber"] { --nc: var(--amber); --nb: rgba(242,173,76,.15); }

.node-head {
  height: 44px; flex: 0 0 44px;
  display: flex; align-items: center; gap: 9px;
  padding: 0 11px;
  border-bottom: 1px solid #2a2f3c;
  border-radius: 13px 13px 0 0;
  cursor: grab;
}
.node-head:active { cursor: grabbing; }
.node.dragging { z-index: 6; box-shadow: 0 20px 52px rgba(0,0,0,.7), 0 0 0 2px rgba(124,92,255,.35); }
.node.dragging .node-head { cursor: grabbing; }
.node-head::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 44px;
  border-radius: 13px 13px 0 0; background: var(--nb); opacity: .55; pointer-events: none;
}
.node-icon {
  width: 25px; height: 25px; border-radius: 7px;
  display: grid; place-items: center;
  background: var(--nb); color: var(--nc);
  position: relative; z-index: 1;
}
.node-icon svg { width: 15px; height: 15px; }
.node-title { font-weight: 650; font-size: 12.5px; position: relative; z-index: 1; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-dim { position: relative; z-index: 1; flex-shrink: 0; font-size: 10px; color: var(--dim); padding: 1px 6px; border-radius: 5px; background: rgba(255,255,255,.05); font-variant-numeric: tabular-nums; }
.node-subtitle { font-size: 10px; color: var(--dim); position: relative; z-index: 1; }
.node-head-actions { margin-left: auto; display: flex; gap: 3px; position: relative; z-index: 1; }
.nh-btn {
  width: 24px; height: 24px; border-radius: 6px;
  display: grid; place-items: center; color: var(--dim);
  transition: .15s;
}
.nh-btn svg { width: 13px; height: 13px; }
.nh-btn.capture:hover { color: #7ec8ff; }
.nh-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.nh-btn.danger:hover { background: rgba(255,107,115,.15); color: var(--err); }
.nh-btn.run { color: var(--nc); }
.nh-btn.run:hover { background: var(--nb); color: var(--nc); }
.nh-btn.edit.active { color: var(--nc); background: var(--nb); }

.node-body { padding: 11px; display: flex; flex-direction: column; gap: 10px; }
.node-foot {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; border-top: 1px solid #2a2f3c;
  border-radius: 0 0 13px 13px;
  background: rgba(0,0,0,.1);
}
.status-line { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--dim); min-width: 0; flex: 1; }
.status-line .st-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-line.ok { color: var(--ok); }
.status-line.err { color: var(--err); }
.status-line.loading { color: var(--amber); }
.status-line .st-pct { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--amber); flex: 0 0 auto; }
.spinner {
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid rgba(242,173,76,.25); border-top-color: var(--amber);
  animation: spin .7s linear infinite; flex: 0 0 11px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Ports ---------- */
.port {
  position: absolute; width: 14px; height: 14px;
  border-radius: 50%; background: #0e1016;
  border: 2px solid var(--pc, #7d8699);
  z-index: 6; cursor: crosshair;
  transition: transform .12s, box-shadow .12s;
}
.port.in { left: -8px; }
.port.out { right: -8px; }
.port:hover { transform: scale(1.4); box-shadow: 0 0 10px var(--pc, #7d8699); }
.port.connected::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--pc, #7d8699);
}
.port[data-type="text"] { --pc: var(--blue); }
.port[data-type="image"] { --pc: var(--purple); }
.port[data-type="video"] { --pc: var(--pink); }
.port[data-type="audio"] { --pc: var(--teal); }
.port[data-type="script"] { --pc: var(--amber); }

.port-label {
  position: absolute; font-size: 9px; color: var(--dim);
  pointer-events: none; white-space: nowrap;
}
.port-label.pl-in { left: 12px; }
.port-label.pl-out { right: 12px; }

/* ---------- Node fields ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; color: #9aa2b5; font-weight: 600; letter-spacing: .2px;
}
.field-label .lite { color: var(--dim); font-weight: 400; }
.n-input, .n-select, .n-textarea {
  width: 100%; background: #12141c;
  border: 1px solid #2d3342; border-radius: 8px;
  padding: 8px 9px; font-size: 12px; line-height: 1.5;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.n-input:focus, .n-select:focus, .n-textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124,92,255,.16);
}
.n-textarea { resize: vertical; min-height: 72px; max-height: 340px; }
.n-select { appearance: none; cursor: pointer; padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23949aad' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 7px center; background-size: 13px;
}
.n-row { display: flex; gap: 8px; }
.n-row > * { flex: 1; min-width: 0; }
.n-check {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: #9aa2b5; cursor: pointer;
  padding: 2px 1px;
}
.n-check input {
  appearance: none; width: 14px; height: 14px; border-radius: 4px;
  border: 1px solid #3a4256; background: #12141c; cursor: pointer;
  display: grid; place-items: center; flex: 0 0 14px;
}
.n-check input:checked { background: var(--accent); border-color: var(--accent); }
.n-check input:checked::after { content: ""; width: 6px; height: 3px; border-left: 1.6px solid #fff; border-bottom: 1.6px solid #fff; transform: rotate(-45deg) translate(1px,-1px); }
.dropzone.dragover { border-color: var(--nc) !important; background: var(--nb) !important; }

.n-btn {
  height: 28px; padding: 0 10px; border-radius: 7px;
  background: #242938; border: 1px solid var(--border-light);
  color: #c9cfdf; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  transition: .15s;
}
.n-btn:hover { background: #2e3446; color: #fff; }
.n-btn svg { width: 12px; height: 12px; }
.n-btn.accent { background: var(--nb); border-color: color-mix(in srgb, var(--nc) 45%, transparent); color: var(--nc); }
.n-btn.accent:hover { background: color-mix(in srgb, var(--nc) 24%, transparent); }
.n-btn.sm { height: 24px; padding: 0 8px; font-size: 10.5px; }
.n-btn:disabled { opacity: .4; }

.gen-btn {
  height: 34px; width: 100%; border-radius: 8px;
  background: linear-gradient(135deg, var(--nc), color-mix(in srgb, var(--nc) 55%, #5a6cff));
  color: #0e1016; font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  box-shadow: 0 4px 14px var(--nb);
  transition: .15s;
}
.gen-btn svg { width: 14px; height: 14px; }
.gen-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.gen-btn:active { transform: translateY(0); }

.dropzone {
  min-height: 62px; border-radius: 9px;
  border: 1.5px dashed #333a4b; background: #12141b;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--dim); font-size: 11px; cursor: pointer;
  transition: .15s; position: relative; overflow: hidden;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--nc); color: var(--nc); background: var(--nb); }
.dropzone svg { width: 16px; height: 16px; }
.dropzone img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.dropzone .clear-ref {
  position: absolute; right: 5px; top: 5px; z-index: 2;
  width: 20px; height: 20px; border-radius: 6px;
  background: rgba(10,12,18,.8); color: #fff;
  display: grid; place-items: center; font-size: 14px; line-height: 1;
}
.dropzone .clear-ref:hover { background: var(--err); }

/* ---------- Results ---------- */
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.result-grid.single { grid-template-columns: 1fr; }
.result-item {
  position: relative; border-radius: 8px; overflow: hidden;
  background: #0e1016; border: 1px solid #2c3241;
  cursor: zoom-in;
}
/* 按图片原始比例完整显示，不裁切、不拉伸 */
.result-item img { width: 100%; height: auto; max-width: 100%; object-fit: contain; display: block; }
.result-item .dl-btn {
  position: absolute; right: 5px; bottom: 5px;
  width: 24px; height: 24px; border-radius: 6px;
  background: rgba(10,12,18,.82); color: #fff;
  display: grid; place-items: center; opacity: 0; transition: .15s;
}
.result-item:hover .dl-btn { opacity: 1; }
.result-item .dl-btn svg { width: 13px; height: 13px; }

.media-box {
  border-radius: 9px; overflow: hidden; border: 1px solid #2c3241;
  background: #0b0d13; position: relative;
}
.media-box video { width: 100%; display: block; max-height: 240px; background: #000; }
.audio-box { padding: 11px; }
.audio-box audio { width: 100%; height: 36px; }

.script-box {
  background: #12141c; border: 1px solid #2d3342;
  border-radius: 9px; max-height: 300px; overflow: auto; padding: 4px 0;
}
.script-line {
  padding: 8px 10px; border-bottom: 1px solid #232835;
  display: flex; gap: 9px; align-items: flex-start;
}
.script-line:last-child { border-bottom: none; }
.script-num {
  flex: 0 0 20px; height: 20px; border-radius: 6px;
  background: rgba(242,173,76,.15); color: var(--amber);
  display: grid; place-items: center; font-size: 10px; font-weight: 700;
}
.script-content { font-size: 11px; line-height: 1.6; color: #c4cada; white-space: pre-wrap; word-break: break-word; }

.text-output {
  background: #12141c; border: 1px solid #2d3342; border-radius: 9px;
  padding: 9px 10px; font-size: 11.5px; line-height: 1.65;
  color: #c8cede; white-space: pre-wrap; word-break: break-word;
  max-height: 220px; overflow: auto;
}
.placeholder {
  color: var(--dim); font-size: 11px; text-align: center;
  padding: 14px 8px; border: 1px dashed #2c3241; border-radius: 9px;
}

/* ---------- Empty hint ---------- */
.empty-hint {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none; z-index: 10;
  transition: opacity .2s;
}
.empty-hint h2 { font-size: 19px; font-weight: 650; margin: 20px 0 8px; letter-spacing: -.3px; }
.empty-hint p { color: var(--muted); font-size: 12.5px; margin: 0 0 20px; }
.empty-hint .btn { pointer-events: auto; margin: 0 5px; }
.empty-visual { display: flex; align-items: center; justify-content: center; gap: 0; }
.ev-node { width: 34px; height: 34px; border-radius: 9px; border: 2px solid; }
.ev-node.n1 { border-color: var(--blue); background: rgba(77,159,255,.16); }
.ev-node.n2 { border-color: var(--purple); background: rgba(165,108,255,.16); }
.ev-node.n3 { border-color: var(--pink); background: rgba(240,98,156,.16); }
.ev-line { width: 42px; height: 2px; background: linear-gradient(90deg, #4d5568, #6d768c); }

/* ---------- Zoom bar ---------- */
.zoom-bar {
  position: absolute; right: 16px; bottom: 16px; z-index: 12;
  display: flex; align-items: center; gap: 2px;
  background: rgba(25, 28, 37, .94); border: 1px solid var(--border-light);
  border-radius: 9px; padding: 3px; box-shadow: 0 6px 20px rgba(0,0,0,.4);
  backdrop-filter: blur(8px);
}
.zoom-bar button {
  min-width: 28px; height: 26px; padding: 0 6px;
  border-radius: 6px; display: grid; place-items: center;
  color: var(--muted); font-size: 15px; transition: .15s;
}
.zoom-bar button:hover { background: #2b3040; color: #fff; }
.zoom-bar #zoom-label { font-size: 11px; min-width: 44px; font-variant-numeric: tabular-nums; }
.zoom-bar svg { width: 14px; height: 14px; }
.zsep { width: 1px; height: 16px; background: var(--border-light); margin: 0 2px; }

/* 底部悬浮 TV Director 工具栏 */
.tv-bar {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 7px 9px; border-radius: 999px;
  background: rgba(18, 20, 28, .88); backdrop-filter: blur(14px);
  border: 1px solid #2a2f3c; box-shadow: 0 10px 30px rgba(0,0,0,.45);
  z-index: 30;
}
.tv-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; color: #b8bdcb;
  transition: .15s;
}
.tv-btn:hover { background: #262b38; color: #fff; }
.tv-btn svg { width: 19px; height: 19px; }
.tv-sep { width: 1px; height: 22px; background: #2a2f3c; margin: 0 4px; }
.tv-brand {
  display: flex; align-items: center; gap: 7px; height: 38px;
  padding: 0 16px 0 12px; border-radius: 999px;
  background: linear-gradient(135deg, #22c1c3, #4f7cff);
  color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 4px 14px rgba(79, 124, 255, .4);
  transition: .15s;
}
.tv-brand:hover { filter: brightness(1.1); }
.tv-brand svg { width: 17px; height: 17px; }

/* ---------- Popover ---------- */
.popover {
  position: fixed; z-index: 80; width: 176px;
  background: #1b1e28; border: 1px solid var(--border-light);
  border-radius: 10px; padding: 6px; box-shadow: var(--shadow);
}
.pop-title { font-size: 10px; color: var(--dim); padding: 5px 8px 7px; letter-spacing: .5px; }
.pop-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px; border-radius: 7px; text-align: left; font-size: 12px; color: #cbd1e0;
}
.pop-item:hover { background: #292e3e; color: #fff; }
.pop-dot { width: 8px; height: 8px; border-radius: 50%; }
.pop-dot.blue { background: var(--blue); }
.pop-dot.purple { background: var(--purple); }
.pop-dot.pink { background: var(--pink); }
.pop-dot.teal { background: var(--teal); }
.pop-dot.amber { background: var(--amber); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 6, 10, .74); backdrop-filter: blur(5px);
  display: grid; place-items: center; padding: 20px;
}
/* 确认框必须盖在历史/设置等弹窗之上，否则点「删除」后确认框藏在后面，看起来像没反应 */
#confirm-modal { z-index: 1200; }
#prompt-expand-modal { z-index: 1100; }
.modal {
  width: min(660px, 100%); max-height: calc(100vh - 40px);
  background: #171a23; border: 1px solid var(--border-light);
  border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.65);
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-sm { width: min(400px, 100%); }
.modal-lg { width: min(720px, 100%); }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 22px 14px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; }
.modal-close { font-size: 22px; color: var(--dim); line-height: 1; padding: 0 2px; }
.modal-close:hover { color: #fff; }
.modal-body { padding: 18px 22px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot {
  padding: 14px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 8px;
  background: #141720;
}

.form-row { display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 11.5px; font-weight: 600; color: #b9c0d2; }
.form-row input {
  width: 100%; height: 36px; padding: 0 11px;
  background: #101219; border: 1px solid #2d3342; border-radius: 8px;
  outline: none; font-size: 12.5px; transition: .15s;
}
.form-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124,92,255,.16); }
.form-row small { color: var(--dim); font-size: 10.5px; line-height: 1.5; }
.form-row.compact input { height: 32px; font-size: 12px; }

.section-label {
  font-size: 11.5px; font-weight: 700; color: #cfd5e4;
  padding-top: 6px; border-top: 1px solid var(--border);
  display: flex; align-items: baseline; gap: 8px;
}
.section-label span { font-size: 10.5px; color: var(--dim); font-weight: 400; }
.model-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.test-row { display: flex; align-items: center; gap: 12px; padding-top: 4px; }
.test-result { font-size: 11.5px; color: var(--muted); }
.test-result.ok { color: var(--ok); }
.test-result.err { color: var(--err); }

/* 模型勾选白名单 */
.model-pick { display: flex; flex-direction: column; gap: 10px; padding: 10px 11px; background: #0e1017; border: 1px solid var(--border); border-radius: 9px; }
.model-pick-head { font-size: 11.5px; font-weight: 700; color: #cfd5e4; display: flex; align-items: baseline; gap: 8px; }
.model-pick-head span { font-size: 10.5px; color: var(--dim); font-weight: 400; }
.model-pick-group { display: flex; flex-direction: column; gap: 5px; }
.model-pick-title { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.model-pick-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 150px; overflow-y: auto; }
.model-pick-tip { font-size: 11px; color: var(--dim); }
.model-pick-item {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  padding: 4px 8px; border: 1px solid #2d3342; border-radius: 7px;
  background: #12151d; font-size: 11px; color: #b9c0d2; transition: .15s; user-select: none;
}
.model-pick-item:hover { border-color: var(--accent); }
.model-pick-item input { margin: 0; width: 13px; height: 13px; accent-color: var(--accent); cursor: pointer; }
.model-pick-item.checked { border-color: var(--accent); background: rgba(124,92,255,.12); color: #e6e9f2; }
.model-pick-name.aliased { color: #cfc0ff; }
.model-rename-btn {
  display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 1px;
  border-radius: 4px; color: var(--dim); background: transparent; opacity: .55; transition: .14s;
}
.model-rename-btn:hover { color: #fff; opacity: 1; background: #2e3446; }
.model-rename-btn svg { width: 12px; height: 12px; }

.advanced-details { border: 1px solid var(--border); border-radius: 8px; background: #0e1017; }
.advanced-details > summary {
  list-style: none; cursor: pointer; padding: 9px 11px;
  font-size: 11px; font-weight: 600; color: var(--muted); user-select: none;
}
.advanced-details > summary::-webkit-details-marker { display: none; }
.advanced-details > summary::before { content: '▸ '; color: var(--accent); }
.advanced-details[open] > summary::before { content: '▾ '; }
.advanced-details > .form-row { padding: 0 11px 11px; }

.btn {
  height: 34px; padding: 0 14px; border-radius: 8px;
  font-size: 12px; font-weight: 600; transition: .15s;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn.primary { background: linear-gradient(135deg, #7c5cff, #5a6cff); color: #fff; }
.btn.primary:hover { filter: brightness(1.12); }
.btn.ghost { background: #252a38; border: 1px solid var(--border-light); color: #ccd2e1; }
.btn.ghost:hover { background: #2e3446; color: #fff; }
.btn.danger { background: rgba(255,107,115,.16); border: 1px solid rgba(255,107,115,.45); color: #ff9298; }
.btn.danger:hover { background: rgba(255,107,115,.26); }

/* ---------- Toast ---------- */
.toast-wrap {
  position: absolute; right: 16px; bottom: 62px; z-index: 90;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; align-items: flex-end;
}
.toast {
  min-width: 200px; max-width: 360px;
  padding: 10px 13px; border-radius: 9px;
  background: #212533; border: 1px solid var(--border-light);
  box-shadow: 0 8px 26px rgba(0,0,0,.5);
  font-size: 12px; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 9px;
  animation: toastIn .22s ease;
}
.toast.out { animation: toastOut .2s ease forwards; }
.toast .t-icon { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 1px; }
.toast.ok { border-color: rgba(62,213,152,.4); }
.toast.ok .t-icon { color: var(--ok); }
.toast.err { border-color: rgba(255,107,115,.45); }
.toast.err .t-icon { color: var(--err); }
.toast.info .t-icon { color: var(--accent-2); }
@keyframes toastIn { from { opacity: 0; transform: translateX(14px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(14px); } }

/* ---------- Image lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,6,10,.92); display: grid; place-items: center;
  padding: 40px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.7); }
.lightbox .lb-close { position: absolute; top: 20px; right: 24px; font-size: 28px; color: #fff; }

/* ---------- Image generator (LibTV-style, 三类参考) ---------- */
.node[data-type="image"] { width: 420px; }
.node[data-type="image"] .node-body { padding: 0; gap: 0; }
.igen-stage {
  min-height: 240px; margin: 10px 10px 4px; border-radius: 10px;
  overflow: hidden; background: #0a0c11; border: 1px solid #332d47;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
/* 图片舞台空态：与参考图一致的大号图片占位图标 */
.igen-empty {
  width: 100%; height: 100%; min-height: 240px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: radial-gradient(circle at 50% 42%, #1c2030, #0c0e14 72%);
}
.igen-empty-icon {
  width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); color: #6c7488;
}
.igen-empty-icon svg { width: 30px; height: 30px; }
.igen-empty-text { font-size: 11px; color: #60697d; }
.igen-dim {
  position: absolute; left: 16px; top: 16px; z-index: 3;
  padding: 2px 7px; border-radius: 5px; font-size: 9.5px; color: #9aa2b5;
  background: rgba(10,12,18,.72); border: 1px solid rgba(255,255,255,.08);
  pointer-events: none;
}
/* 预览下方参数摘要：参数: 图生图 / 图片高清 */
.igen-meta {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 3px 14px 7px;
}
.igen-meta-label { font-size: 10px; color: #7d8598; }
.igen-meta-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 6px; font-size: 10px;
  background: #1c1f2b; border: 1px solid #34394a; color: #b6bdd0;
}
.igen-stage .result-grid { padding: 8px; width: 100%; }
.igen-stage .result-item img { max-height: 420px; }
.node[data-type="image"] .igen-btn {
  background: linear-gradient(135deg, #a86bff, #6f5cff);
  box-shadow: 0 4px 14px rgba(168,107,255,.25);
}

/* 参考区：干净的缩略图网格（图片/视频/音频），去掉名称/标题/加号 */
.vref-line { gap: 5px; }
.vref-items { flex: 1; min-width: 0; display: flex; gap: 7px; flex-wrap: wrap; align-items: flex-start; }

/* ---------- Video generator (LibTV-style) ---------- */
.node[data-type="video"] { width: 452px; }
.node[data-type="video"] .node-body { padding: 0; gap: 0; }
.vgen { display: flex; flex-direction: column; }

/* 预览舞台 */
.vstage {
  min-height: 240px; margin: 10px 10px 4px; border-radius: 10px; overflow: hidden;
  background: #0a0c11; border: 1px solid #2c3241;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
/* 视频按原始宽高比完整显示，不裁切、不拉伸 */
.vstage video { width: 100%; height: auto; max-height: none; object-fit: contain; background: #000; display: block; }
.vstage-empty { width: 100%; height: 100%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #1c2030, #0c0e14 70%); }
.vstage-play {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  color: #6c7488;
}
.vstage-play svg { width: 30px; height: 30px; }

/* 预览舞台中央的生成进度覆盖层（视频/图片/音频通用） */
.stage-progress {
  position: absolute; inset: 0; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle at 50% 45%, rgba(24,20,40,.82), rgba(9,10,16,.92) 72%);
  backdrop-filter: blur(2px);
}
.sp-ring {
  --p: 0%;
  width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(#a86bff var(--p), rgba(255,255,255,.09) 0);
  box-shadow: 0 0 30px rgba(168,107,255,.28);
}
.sp-ring::before {
  content: ''; position: absolute; inset: 8px; border-radius: 50%;
  background: #12131c;
}
.sp-num {
  position: relative; font-size: 26px; font-weight: 700; letter-spacing: -.5px;
  color: #f3efff; font-variant-numeric: tabular-nums;
}
.sp-label {
  font-size: 12px; color: #b9a7dd; letter-spacing: 1px;
}
.stage-progress .sp-label::after {
  content: ''; display: inline-block; margin-left: 3px;
  animation: spdots 1.2s steps(4,end) infinite; overflow: hidden; vertical-align: bottom;
  width: 0;
}
@keyframes spdots { 0%{width:0} 25%{width:5px} 50%{width:10px} 75%{width:15px} 100%{width:0} }
/* 音频舞台较矮，缩小进度环 */
.astage .stage-progress { gap: 8px; }
.astage .sp-ring { width: 68px; height: 68px; }
.astage .sp-ring::before { inset: 6px; }
.astage .sp-num { font-size: 18px; }

/* 生成失败覆盖层：固化在结果区，刷新/重建后依然显示 */
.stage-error {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  padding: 16px 12px; text-align: center;
  background: radial-gradient(circle at 50% 42%, rgba(58,20,26,.88), rgba(13,10,14,.95) 72%);
  backdrop-filter: blur(2px);
}
.stage-error .se-icon {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,90,90,.13); border: 1px solid rgba(255,90,90,.42);
  color: #ff6b6b;
}
.stage-error .se-icon svg { width: 20px; height: 20px; }
.stage-error .se-title { font-size: 15px; font-weight: 700; color: #ff8b8b; letter-spacing: 1px; }
.stage-error .se-msg {
  max-width: 94%; font-size: 12px; line-height: 1.5; color: #edcece;
  word-break: break-word; overflow-wrap: anywhere;
  max-height: 3.2em; overflow: hidden;
}
.stage-error .se-hint { font-size: 11px; color: #9c8489; }
/* 音频舞台较矮，压缩失败提示 */
.astage .stage-error { gap: 5px; padding: 8px; }
.astage .stage-error .se-icon { width: 30px; height: 30px; }
.astage .stage-error .se-icon svg { width: 15px; height: 15px; }
.astage .stage-error .se-title { font-size: 13px; }
.astage .stage-error .se-msg { font-size: 11px; max-height: 2em; }
.astage .stage-error .se-hint { display: none; }

/* 生成器面板 */
.vgen-panel { padding: 8px 10px 11px; display: flex; flex-direction: column; gap: 9px; }
.vchip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.gchip {
  height: 26px; padding: 0 10px; border-radius: 7px;
  background: #222634; border: 1px solid #333a4c; color: #b9c0d2;
  font-size: 11px; transition: .15s; white-space: nowrap;
}
.gchip:hover { background: #2c3142; color: #fff; }
.gchip.active { background: var(--nb); border-color: var(--nc); color: var(--nc); }

.vtool-row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.vtool {
  height: 26px; padding: 0 8px; border-radius: 6px; display: inline-flex;
  align-items: center; gap: 4px; color: #9aa2b5; font-size: 10.5px; transition: .15s;
}
.vtool svg { width: 13px; height: 13px; }
.vtool:hover { background: #262b3a; color: #fff; }

.chip-selected { display: flex; gap: 5px; flex-wrap: wrap; }
.chip-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 6px 3px 8px; border-radius: 6px;
  background: rgba(240,98,156,.12); border: 1px solid rgba(240,98,156,.3);
  color: #f3a8c8; font-size: 10px;
}
.chip-tag button { color: #f3a8c8; font-size: 13px; line-height: 1; padding: 0; }

/* 引用素材区：嵌在提示词大框内部（上缩略图方块 + 下名称胶囊，横排连续） */
.vrefs {
  display: flex; flex-direction: column; gap: 4px;
  padding: 0 0 7px; margin: 0 0 3px;
  background: transparent; border: 0; border-bottom: 1px solid #262b38;
}
.vrefs:not(:has(.ref-thumb)) { border-bottom: 0; padding-bottom: 0; margin-bottom: 0; }
.ref-empty { font-size: 10.5px; color: var(--dim); padding: 4px; }
.ref-thumb {
  position: relative; width: 46px; overflow: visible; flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; background: transparent;
}
.ref-media {
  position: relative; width: 46px; height: 46px; border-radius: 7px;
  overflow: hidden; border: 1px solid #3a4152; background: #0c0e14;
}
.ref-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-video-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: #1a1424; color: #cba3f2;
}
.ref-video-fallback svg { width: 20px; height: 20px; }
.ref-name {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  width: 46px; max-width: 46px; padding: 1px 3px; border-radius: 4px;
  background: #1b1e28; border: 1px solid #2d3342; color: #c3c9d8;
  font-size: 9px; line-height: 1.4; white-space: nowrap; overflow: hidden;
}
.ref-name svg { width: 10px; height: 10px; flex: 0 0 auto; color: #9aa2b5; }
.ref-name em { font-style: normal; overflow: hidden; text-overflow: ellipsis; }
.ref-badge {
  position: absolute; left: 3px; bottom: 3px; width: 16px; height: 16px;
  border-radius: 4px; background: rgba(10,12,18,.82); color: #8d95a8;
  display: grid; place-items: center;
}
.ref-badge svg { width: 10px; height: 10px; }
.ref-del {
  position: absolute; right: -4px; top: -4px; width: 16px; height: 16px; z-index: 2;
  border-radius: 50%; background: rgba(10,12,18,.92); color: #fff;
  display: grid; place-items: center; font-size: 11px; line-height: 1;
  opacity: 0; transition: opacity .12s;
}
.ref-thumb:hover .ref-del { opacity: 1; }
.ref-del:hover { background: var(--err); }

/* 提示词大框：缩略图 + 文字同处一个框（对齐 LibTV） */
.vprompt, .agen-prompt {
  position: relative; background: #12141c; border: 1px solid #2d3342;
  border-radius: 9px; padding: 8px 9px 6px;
  transition: border-color .15s, box-shadow .15s;
}
.vprompt:focus-within, .agen-prompt:focus-within {
  border-color: var(--accent); box-shadow: 0 0 0 2px rgba(124,92,255,.16);
}
.vprompt .n-textarea, .agen-prompt .n-textarea {
  background: transparent; border: 0; border-radius: 0; padding: 2px 1px;
  min-height: 88px; box-shadow: none;
}
.vprompt .n-textarea:focus, .agen-prompt .n-textarea:focus { border: 0; box-shadow: none; }

/* 提示词框放大按钮 */
.prompt-expand-btn {
  position: absolute; top: 6px; right: 7px; z-index: 3;
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 6px; color: var(--dim); background: rgba(20,22,30,.85);
  border: 1px solid #2d3342; opacity: .55; transition: .14s;
}
.prompt-expand-btn:hover { color: #fff; opacity: 1; border-color: var(--accent); background: #23273a; }
.prompt-expand-btn svg { width: 14px; height: 14px; }

/* 放大编辑弹窗 */
.prompt-expand-modal { width: min(880px, 100%); }
.prompt-expand-box { min-height: min(62vh, 560px); display: flex; flex-direction: column; }
.prompt-expand-box #prompt-expand-refs:empty { display: none; }
.prompt-expand-box .n-textarea {
  flex: 1; min-height: 320px; font-size: 13.5px; line-height: 1.7;
  padding: 8px 4px; resize: none;
}

.vfoot { display: flex; flex-direction: column; gap: 7px; }
.vfoot-row { display: flex; gap: 6px; }
.vfoot-row > * { flex: 1; min-width: 0; }
.vfoot-row .n-select { height: 30px; font-size: 11px; padding: 0 24px 0 8px; }
.vgen-btn {
  height: 38px; width: 100%; border-radius: 9px; margin-top: 1px;
  background: linear-gradient(135deg, var(--nc), color-mix(in srgb, var(--nc) 55%, #5a6cff));
  color: #0e1016; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; gap: 7px;
  box-shadow: 0 4px 14px var(--nb); transition: .15s;
}
.vgen-btn svg { width: 15px; height: 15px; }
.vgen-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
/* 生成中：禁用生成按钮，防止重复提交 */
.vgen-btn:disabled, .gen-btn:disabled, .nh-btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); pointer-events: none; }
.vcost {
  margin-left: auto; padding: 3px 8px; border-radius: 6px;
  background: rgba(0,0,0,.22); font-size: 11px; font-weight: 700;
}
.node[data-type="video"] .status-line { font-size: 10px; }

/* ---------- 多类型参考素材（图 / 视频 / 音频） ---------- */
.node[data-type="video"] .vrefs { min-height: 0; }
.vref-line {
  display: flex; align-items: center; gap: 6px; min-height: 28px;
  padding: 2px; border-radius: 6px; transition: background .12s, box-shadow .12s;
}
.vref-line + .vref-line { border-top: 1px dashed #2b3140; }
.vref-line.empty { min-height: 22px; padding: 1px 2px; }
.vref-line.port-hover {
  background: rgba(255,255,255,.05);
  box-shadow: inset 0 0 0 1px var(--nc);
}
.vref-items { flex: 1; min-width: 0; display: flex; gap: 7px; flex-wrap: wrap; align-items: flex-start; }
.vref-empty-hint {
  display: flex; align-items: center; gap: 5px; height: 20px; padding: 0 3px;
  color: #4a5163; font-size: 9.5px;
}
.vref-empty-hint svg { width: 12px; height: 12px; }
.vref-empty-hint i { font-style: normal; }
.ref-thumb.ref-video .ref-media { border-color: #6a4a8f; }
.ref-thumb.ref-audio .ref-media { border-color: #2f8f86; }
.ref-media video { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1; }
.ref-pending {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #5c6577; background: repeating-linear-gradient(45deg,#151922,#151922 5px,#12151d 5px,#12151d 10px);
}
.ref-pending svg { width: 16px; height: 16px; }
.ref-thumb .ref-type-icon {
  position: absolute; left: 2px; top: 2px; width: 14px; height: 14px;
  border-radius: 4px; background: rgba(10,12,18,.8); color: #d7a6ff;
  display: grid; place-items: center;
}
.ref-thumb .ref-type-icon svg { width: 10px; height: 10px; }
.ref-media.ref-audio-icon {
  display: grid; place-items: center;
  color: #5fd3c4; background: #142624;
}
.ref-media.ref-audio-icon svg { width: 24px; height: 24px; }
.ref-thumb .ref-src-label {
  position: absolute; left: 0; right: 0; bottom: 2px;
  text-align: center; font-size: 9px; color: #a9e6de;
}

/* ---------- Audio generator (LibTV-style) ---------- */
.node[data-type="audio"] { width: 420px; }
.node[data-type="audio"] .node-body { padding: 0; gap: 0; }
.agen { display: flex; flex-direction: column; }
.astage {
  height: 140px; margin: 10px 10px 4px; border-radius: 10px; overflow: hidden;
  background: #0b1014; border: 1px solid #2c3b41; padding: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  position: relative;
}
.astage audio { width: 100%; max-width: 360px; }
.astage-head { display: flex; align-items: center; gap: 6px; color: #6fd6c5; font-size: 11px; }
.astage-head svg { width: 16px; height: 16px; }
.astage-empty { width: 100%; height: 100%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, #14262a, #0b1014 70%); }
.astage-wave { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: rgba(95,211,196,.06); border: 1px solid rgba(95,211,196,.16); color: #4c9c92; }
.astage-wave svg { width: 26px; height: 26px; }
.agen-panel { padding: 8px 10px 11px; display: flex; flex-direction: column; gap: 9px; }
.agen-prompt textarea { min-height: 74px; }
.node[data-type="audio"] .vgen-btn.agen-btn {
  background: linear-gradient(135deg, #35c7b2, #268f9f);
  box-shadow: 0 4px 14px rgba(53,199,178,.22);
}
.node[data-type="audio"] .gchip.active { background: rgba(53,199,178,.16); border-color: #35c7b2; color: #7ee0d1; }
.node[data-type="audio"] .chip-tag { background: rgba(53,199,178,.12); border-color: rgba(53,199,178,.32); color: #8fe2d5; }
.node[data-type="audio"] .status-line { font-size: 10px; }

/* ---------- Node picker（拖线到空白处选择节点类型） ---------- */
.node-picker {
  position: fixed; z-index: 160; min-width: 180px; padding: 6px;
  background: #1b1e28; border: 1px solid var(--border-light);
  border-radius: 10px; box-shadow: var(--shadow); animation: toastIn .14s ease;
}
.np-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 3px 8px 7px; font-size: 11px; color: #e3e7f0; font-weight: 600;
}
.np-title span { font-size: 9px; color: #737c90; font-weight: 400; }
.np-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 7px 8px; border-radius: 7px; font-size: 12px; color: #cbd1e0; text-align: left;
}
.np-item:hover { background: #2b3040; color: #fff; }
.np-item.primary { background: rgba(124,92,255,.14); color: #c3b5ff; }
.np-item.primary:hover { background: rgba(124,92,255,.24); }
.np-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: #262b39; }
.np-icon svg { width: 14px; height: 14px; }
.np-label { display: flex; align-items: center; gap: 6px; }
.np-label em { font-style: normal; font-size: 9px; padding: 1px 5px; border-radius: 4px; background: #7c5cff; color: #fff; }

/* ---------- Float menu ---------- */
.float-menu {
  position: fixed; z-index: 150; min-width: 120px; max-height: 320px; overflow: auto;
  background: #1b1e28; border: 1px solid var(--border-light);
  border-radius: 9px; padding: 5px; box-shadow: var(--shadow);
  animation: toastIn .14s ease;
}
.float-menu button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 6px 8px; border-radius: 6px; font-size: 11.5px; color: #cbd1e0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.float-menu button:hover { background: #2b3040; color: #fff; }
.float-menu.ctx-menu button svg { width: 14px; height: 14px; flex: 0 0 14px; }
.float-menu button.active { background: #2b3040; color: #fff; outline: 1px solid #5b6b8c; outline-offset: -1px; }
.float-menu .menu-thumb {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 5px; overflow: hidden;
  display: grid; place-items: center; background: #0c0e14; border: 1px solid #333a4c;
  position: relative;
}
.float-menu .menu-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.float-menu .menu-thumb-video { color: #d7a6ff; }
.float-menu .menu-thumb-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.float-menu .menu-thumb-video svg { position: relative; width: 14px; height: 14px; }
.float-menu .menu-thumb-audio { color: #5fd3c4; background: #142624; }
.float-menu .menu-thumb-audio svg { width: 16px; height: 16px; }
.float-menu .menu-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 900px) {
  .sidebar { width: 190px; flex-basis: 190px; }
  .brand { min-width: auto; }
  .brand-tag, .side-guide { display: none; }
  .topbar-center .tbtn:not(.primary) { display: none; }
  .topbar-right .tbtn:not(#btn-settings) { display: none; }
}

/* ============ 登录 / 注册遮罩 ============ */
.auth-overlay {
  position: fixed; inset: 0; z-index: 1000;
  display: none; /* 默认隐藏：有 token 时刷新不再闪登录框，由 JS 按登录态决定显隐 */
  align-items: center; justify-content: center;
  background: rgba(8, 9, 13, .82);
  backdrop-filter: blur(6px);
}
.auth-card {
  width: min(400px, 92vw);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 32px;
  box-shadow: var(--shadow);
}
.auth-brand {
  display: flex; align-items: center; gap: 8px; margin-bottom: 20px;
}
.auth-brand .brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.auth-brand .brand-mark svg { width: 18px; height: 18px; }
.auth-brand .brand-name { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.auth-brand .brand-tag { font-size: 9px; color: var(--dim); letter-spacing: 2px; margin-left: 2px; }
.auth-card h2 { margin: 0 0 6px; font-size: 20px; }
.auth-sub { margin: 0 0 22px; font-size: 12.5px; color: var(--muted); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 12px; color: var(--muted); }
.auth-field input {
  height: 42px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--panel-2);
  color: var(--text); font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, .18); }
.auth-msg { min-height: 18px; font-size: 12.5px; color: var(--ok); }
.auth-cancel { margin-top: 14px; width: 100%; height: 38px; border-radius: 9px; background: transparent; border: 1px solid var(--border); color: var(--muted); font-size: 13px; cursor: pointer; }
.auth-cancel:hover { background: var(--panel-2); color: var(--text); }
.auth-msg.err { color: var(--err); }
.auth-submit {
  height: 44px; border-radius: 9px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 15px; font-weight: 600;
  transition: opacity .15s, transform .05s;
}
.auth-submit:hover { opacity: .92; }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: .55; cursor: not-allowed; }
.auth-switch {
  margin-top: 18px; text-align: center; font-size: 13px; color: var(--muted);
}
.auth-switch button {
  background: none; border: none; color: var(--accent-2);
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 0 2px;
}
.auth-switch button:hover { text-decoration: underline; }

.auth-code-row { display: flex; gap: 8px; }
.auth-code-row input { flex: 1; }
.auth-send {
  flex: 0 0 auto; height: 42px; padding: 0 14px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--panel-2);
  color: var(--accent-2); font-size: 13px; cursor: pointer;
  white-space: nowrap; transition: .15s;
}
.auth-send:hover { border-color: var(--accent); }
.auth-send:disabled { opacity: .55; cursor: not-allowed; }

/* ============ 账号管理后台 ============ */
.admin-modal { width: min(680px, 94vw); }
.admin-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; }
.admin-count { font-size: 13px; color: var(--muted); }
.admin-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; }
.admin-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border);
}
.admin-row.banned { opacity: .65; }
.admin-row-main { flex: 1; min-width: 0; }
.admin-row-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.admin-row-email { font-size: 12px; color: var(--muted); margin-top: 2px; word-break: break-all; }
.admin-row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.admin-status { font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.admin-status.st-active { background: rgba(74, 222, 128, .15); color: #4ade80; }
.admin-status.st-banned { background: rgba(248, 113, 113, .15); color: #f87171; }
.admin-date { font-size: 11px; color: var(--dim); }
.admin-row-actions { display: flex; gap: 6px; }
.admin-tag { font-size: 10px; padding: 2px 7px; border-radius: 6px; background: rgba(124, 92, 255, .2); color: #b8a6ff; }
.admin-tag.self { background: rgba(96, 165, 250, .2); color: #7cb8ff; }
.admin-points { display: flex; align-items: center; gap: 8px; }
.admin-pts-val { font-size: 12.5px; font-weight: 600; color: #ffd66b; white-space: nowrap; }
.admin-pts-edit { display: flex; align-items: center; gap: 4px; }
.admin-pts-input {
  width: 72px; height: 28px; padding: 0 8px; font-size: 12px;
  border-radius: 7px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text);
}
.admin-loading, .admin-empty { padding: 30px; text-align: center; color: var(--dim); font-size: 13px; }
.admin-msg { font-size: 12.5px; color: var(--err); min-height: 18px; }

.admin-create {
  padding: 14px; border-radius: 12px;
  background: var(--panel-2); border: 1px dashed var(--border);
}
.admin-create-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; color: var(--text); }
.admin-create-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.admin-create-row input[type="text"] {
  flex: 1; min-width: 120px; height: 34px; padding: 0 10px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 13px;
}
.admin-create-row input[type="text"]:focus { outline: none; border-color: var(--accent); }
.admin-create-admin { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.admin-create-admin input { accent-color: var(--accent); }
.admin-create-msg { font-size: 12.5px; margin-top: 8px; min-height: 16px; color: var(--muted); }
.admin-create-msg.err { color: var(--err); }
.admin-create-msg.ok { color: #4ade80; }

/* ============ 历史版本 ============ */
.history-modal .modal-head { flex-shrink: 0; }
.history-savebar {
  display: flex; gap: 8px; align-items: center;
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  background: var(--panel-2, #141720); flex-shrink: 0;
}
.history-savebar input[type="text"] {
  flex: 1; min-width: 0; height: 34px; padding: 0 11px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 12.5px;
}
.history-savebar input[type="text"]:focus { outline: none; border-color: var(--accent); }
.history-savebar .btn { white-space: nowrap; }
.history-count { font-size: 11.5px; color: var(--dim); white-space: nowrap; margin-left: 2px; }
.history-list { padding: 12px 22px 20px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.hist-empty { padding: 46px 20px; text-align: center; color: var(--dim); font-size: 13px; line-height: 1.7; }
.hist-empty-icon { width: 46px; height: 46px; margin: 0 auto 12px; color: var(--dim); opacity: .6; }
.hist-empty-icon svg { width: 100%; height: 100%; }
.hist-item {
  display: flex; align-items: center; gap: 13px;
  padding: 11px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--panel-2, #1a1e28);
  transition: border-color .15s, background .15s;
}
.hist-item:hover { border-color: var(--accent); background: #1e2330; }
.hist-thumb {
  width: 92px; height: 60px; flex-shrink: 0; border-radius: 8px;
  overflow: hidden; background: #0c0e14; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.hist-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hist-noimg { color: var(--dim); opacity: .5; }
.hist-noimg svg { width: 26px; height: 26px; display: block; }
.hist-info { flex: 1; min-width: 0; }
.hist-label { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-meta { font-size: 11px; color: var(--dim); margin-top: 5px; }
.hist-acts { display: flex; gap: 6px; flex-shrink: 0; }
.hist-acts .btn { padding: 7px 13px; font-size: 12px; }
@media (max-width: 560px) {
  .hist-thumb { width: 64px; height: 46px; }
  .hist-acts { flex-direction: column; }
  .hist-acts .btn { padding: 5px 10px; }
}

/* ============ 素材下载按钮（图片/视频/音频） ============ */
.vstage > .dl-media-btn, .astage > .dl-media-btn, .result-item .dl-btn {
  opacity: .65; transition: opacity .15s, background .15s;
}
.vstage:hover > .dl-media-btn, .astage:hover > .dl-media-btn,
.result-item:hover .dl-btn,
.vstage > .dl-media-btn:hover, .astage > .dl-media-btn:hover, .result-item .dl-btn:hover { opacity: 1; }
.vstage > .dl-media-btn:hover, .astage > .dl-media-btn:hover { background: rgba(120,90,220,.9); }
.vstage > .dl-media-btn svg, .astage > .dl-media-btn svg { width: 15px; height: 15px; }
/* 触屏 / 窄屏没有 hover，下载按钮始终完全显示 */
@media (hover: none) {
  .vstage > .dl-media-btn, .astage > .dl-media-btn, .result-item .dl-btn { opacity: 1; }
}

/* ============ 历史记录双标签 ============ */
.hist-tabs { display: flex; gap: 4px; padding: 0 22px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.hist-tab {
  padding: 11px 18px; background: none; border: none; cursor: pointer;
  color: var(--dim); font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.hist-tab:hover { color: var(--text); }
.hist-tab.active { color: var(--accent, #a86bff); border-bottom-color: var(--accent, #a86bff); }
/* 生成作品网格 */
.works-list {
  padding: 14px 22px 22px; overflow: auto; flex: 1;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px;
}
.work-item {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--panel-2, #1a1e28); transition: border-color .15s;
}
.work-item:hover { border-color: var(--accent, #a86bff); }
.work-thumb {
  position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden;
  background: #0c0e14; display: flex; align-items: center; justify-content: center; cursor: zoom-in;
}
.work-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-thumb .hist-noimg { color: var(--dim); opacity: .5; }
.work-thumb .hist-noimg svg { width: 40px; height: 40px; }
.work-play {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
}
.work-play svg { width: 38px; height: 38px; color: #fff; opacity: .9; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.work-info { padding: 10px 11px 8px; }
.work-kind { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: var(--text); }
.work-kind svg { width: 14px; height: 14px; color: var(--accent, #a86bff); }
.work-kind em { font-style: normal; font-size: 10px; color: var(--dim); font-weight: 400; margin-left: auto; }
.work-desc { font-size: 11.5px; color: var(--muted, #b6bdd0); margin-top: 6px; line-height: 1.4; height: 2.8em; overflow: hidden; }
.work-meta { font-size: 10.5px; color: var(--dim); margin-top: 6px; }
.work-acts { display: flex; gap: 6px; padding: 0 11px 10px; }
.work-acts .btn { padding: 6px 9px; font-size: 12px; flex: 1; display: grid; place-items: center; }
.work-acts .btn svg { width: 15px; height: 15px; }
/* 作品预览弹窗 */
.work-preview-box { width: min(92vw, 820px); max-height: 90vh; display: flex; flex-direction: column; }
.wp-stage {
  flex: 1; min-height: 260px; max-height: 66vh; margin: 4px 20px 12px; border-radius: 10px;
  background: #0a0c11; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.wp-stage img, .wp-stage video { max-width: 100%; max-height: 64vh; object-fit: contain; display: block; }
.wp-audio { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--accent, #a86bff); padding: 30px; }
.wp-audio svg { width: 44px; height: 44px; }
.wp-audio audio { width: min(80vw, 480px); }
.wp-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 18px; }
@media (max-width: 560px) {
  .works-list { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px; }
  .work-acts { flex-wrap: wrap; }
}

/* ==================== 首页：项目 + 作品广场 ==================== */
.home-view { position: fixed; inset: 0; z-index: 60; background: #faf9f7; color: #2a2a2e; display: flex; flex-direction: column; overflow: hidden; }
.home-view[hidden] { display: none; }
body.editor-mode .home-view { display: none; }
body:not(.editor-mode) .app { display: none !important; }

.home-topbar { height: 60px; flex: 0 0 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: #fff; border-bottom: 1px solid #efede9; }
.home-brand { display: flex; align-items: center; gap: 10px; }
.home-brand .brand-mark { width: 30px; height: 30px; color: #e08a5b; display: block; }
.home-brand .brand-mark svg { width: 100%; height: 100%; }
.home-brand-name { font-size: 19px; font-weight: 800; letter-spacing: -.5px; color: #23232a; }
.home-top-actions { display: flex; align-items: center; gap: 14px; }
.home-points { font-size: 13px; color: #b4703f; background: #fff5ec; border: 1px solid #f6e2cf; padding: 6px 12px; border-radius: 20px; font-weight: 600; }
.home-user { font-size: 13px; color: #555; background: #f4f2ef; border: 1px solid #e8e5e0; padding: 7px 14px; border-radius: 20px; cursor: pointer; }
.home-user:hover { background: #ece9e4; }
.home-user.need-login { color: #fff; background: #d97757; border-color: #d97757; font-weight: 600; }
.home-user.need-login:hover { background: #c9663f; }
.home-new-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #fff; background: #e8844f; border: none; padding: 9px 16px; border-radius: 9px; cursor: pointer; font-weight: 600; box-shadow: 0 3px 10px rgba(232,132,79,.28); }
.home-new-btn:hover { background: #dc7640; }
.home-new-btn svg { width: 16px; height: 16px; }

.home-scroll { flex: 1; overflow-y: auto; padding: 28px 32px 60px; }
.home-section { max-width: 1440px; margin: 0 auto 30px; }
.home-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.home-tabs { display: flex; gap: 22px; }
.home-tab { font-size: 15px; color: #8a8781; background: none; border: none; padding: 4px 0 8px; cursor: pointer; position: relative; font-weight: 500; }
.home-tab.active { color: #23232a; font-weight: 700; }
.home-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #e8844f; border-radius: 2px; }
.home-refresh { background: none; border: none; color: #a09d97; cursor: pointer; padding: 6px; border-radius: 6px; }
.home-refresh:hover { background: #f0eee9; color: #e8844f; }
.home-refresh svg { width: 17px; height: 17px; display: block; }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.proj-loading, .proj-empty { grid-column: 1 / -1; color: #aaa; font-size: 13px; padding: 30px 0; text-align: center; }
.proj-card { position: relative; background: #fff; border: 1px solid #ece9e4; border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.proj-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.07); }
.proj-thumb { height: 140px; background: linear-gradient(135deg,#fff4ec,#ffe9d8); display: grid; place-items: center; overflow: hidden; position: relative; }
.proj-thumb img { width: 100%; height: 100%; object-fit: cover; }
.proj-thumb .proj-mountain { color: #e8b58e; }
.proj-thumb .proj-mountain svg { width: 46px; height: 46px; }
.proj-create .proj-thumb { background: linear-gradient(135deg,#fff6ee,#ffeadd); }
.proj-create-plus { width: 42px; height: 42px; background: #fff; border: 1px dashed #e0b48e; border-radius: 12px; display: grid; place-items: center; color: #e8844f; font-size: 26px; font-weight: 300; box-shadow: 0 2px 8px rgba(232,132,79,.12); }
.proj-info { padding: 12px 14px 14px; }
.proj-title { font-size: 14px; font-weight: 600; color: #2a2a2e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-create .proj-title { text-align: center; color: #c98355; font-weight: 600; }
.proj-date { font-size: 11px; color: #aaa69f; margin-top: 6px; }
.proj-create .proj-date { text-align: center; }
.proj-more { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 6px; background: rgba(255,255,255,.9); border: none; color: #888; cursor: pointer; display: grid; place-items: center; font-size: 17px; opacity: 0; transition: opacity .15s; }
.proj-card:hover .proj-more { opacity: 1; }
.proj-more:hover { background: #fff; color: #e8844f; }
.proj-end { text-align: center; color: #bbb; font-size: 12px; padding: 18px 0 4px; }

.square-section { border-top: 1px solid #eae7e2; padding-top: 26px; }
.square-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; gap: 20px; }
.square-title { font-size: 20px; font-weight: 800; color: #23232a; margin: 0; }
.square-sub { font-size: 12px; color: #a5a19a; margin: 5px 0 0; }
.square-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e8e5e0; border-radius: 9px; padding: 8px 12px; width: 240px; }
.square-search svg { width: 16px; height: 16px; color: #b0aca5; flex: 0 0 16px; }
.square-search input { border: none; outline: none; font-size: 13px; color: #333; width: 100%; background: transparent; }
.square-search input::placeholder { color: #bbb7b0; }
.square-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 4px; }
.square-cats::-webkit-scrollbar { height: 0; }
.square-cat { flex: 0 0 auto; font-size: 12px; color: #6f6c66; background: #fff; border: 1px solid #ebe8e3; padding: 7px 14px; border-radius: 18px; cursor: pointer; white-space: nowrap; }
.square-cat:hover { border-color: #e8b58e; color: #c98355; }
.square-cat.active { background: #fff2e8; border-color: #f0d3b8; color: #c96f36; font-weight: 600; }
.square-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.square-loading, .square-empty { grid-column: 1 / -1; color: #aaa; font-size: 13px; padding: 34px 0; text-align: center; }
.sq-card { background: transparent; border-radius: 12px; overflow: hidden; cursor: pointer; }
.sq-thumb { height: 150px; border-radius: 11px; overflow: hidden; background: #eee; position: relative; }
.sq-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sq-thumb .sq-noimg { width: 100%; height: 100%; display: grid; place-items: center; color: #ccc; font-size: 30px; background: linear-gradient(135deg,#f3f1ed,#eae7e1); }
.sq-like { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.4); color: #fff; font-size: 11px; padding: 4px 8px; border-radius: 12px; display: flex; align-items: center; gap: 3px; backdrop-filter: blur(4px); }
.sq-like:hover { background: rgba(232,132,79,.85); }
.sq-info { padding: 9px 3px 4px; }
.sq-name { font-size: 13px; font-weight: 600; color: #2a2a2e; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq-author { font-size: 11px; color: #a5a19a; margin-top: 4px; display: flex; justify-content: space-between; }
.sq-play { color: #d17a45; }

/* 项目更多菜单 */
.proj-menu { position: fixed; z-index: 90; background: #fff; border: 1px solid #e8e5e0; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; min-width: 130px; }
.proj-menu button { display: block; width: 100%; text-align: left; font-size: 13px; color: #444; background: none; border: none; padding: 9px 12px; border-radius: 6px; cursor: pointer; }
.proj-menu button:hover { background: #f5f3ef; }
.proj-menu button.danger { color: #d04545; }

/* 作品预览弹窗 */
.sq-preview { position: fixed; inset: 0; z-index: 95; background: rgba(20,20,24,.72); display: grid; place-items: center; padding: 24px; backdrop-filter: blur(4px); }
.sq-preview[hidden] { display: none; }
.sq-preview-box { background: #fff; border-radius: 16px; width: min(720px, 96vw); max-height: 90vh; overflow: auto; box-shadow: 0 24px 70px rgba(0,0,0,.3); }
.sq-preview-media { background: #111; display: grid; place-items: center; max-height: 52vh; overflow: hidden; border-radius: 16px 16px 0 0; }
.sq-preview-media img, .sq-preview-media video { max-width: 100%; max-height: 52vh; object-fit: contain; }
.sq-preview-body { padding: 18px 22px 22px; }
.sq-preview-body h3 { margin: 0 0 8px; font-size: 17px; }
.sq-preview-body p { margin: 0 0 14px; font-size: 13px; line-height: 1.7; color: #666; white-space: pre-wrap; }
.sq-preview-meta { font-size: 12px; color: #999; display: flex; gap: 14px; margin-bottom: 16px; }
.sq-preview-foot { display: flex; gap: 10px; }
.sq-preview-foot button { flex: 1; padding: 10px; border-radius: 9px; font-size: 13px; cursor: pointer; border: 1px solid #e2ded8; background: #fff; color: #444; }
.sq-preview-foot .primary { background: #e8844f; color: #fff; border-color: #e8844f; }
