/* 画布样式:复用主应用 CSS 变量(--primary/--surface/--ink/--line/--shadow 等),
   视觉与主应用统一,并自动适配 theme-dark / theme-sky 主题。带 wf- 前缀避免冲突。 */

/* 画布全屏:tab 激活时 fixed 填满右侧区域(视口减左侧 260px 侧边栏),不受 main padding 限制 */
/* 左侧栏收起:腾出空间给画布等 */
.wf-sidebar-toggle {
  position: fixed; top: 14px; left: 268px; z-index: 60;
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 15px; line-height: 1; cursor: pointer; box-shadow: var(--shadow);
  transition: left .18s;
}
.wf-sidebar-toggle:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }
body.wf-sidebar-collapsed .wf-sidebar-toggle { left: 10px; }
body.wf-sidebar-collapsed .app { grid-template-columns: 0 minmax(0, 1fr); }
body.wf-sidebar-collapsed .sidebar { display: none; }
body.wf-sidebar-collapsed #workflowTab.active,
body.wf-sidebar-collapsed #promptsTab.active { left: 0; }

#workflowTab.active { position: fixed; left: 260px; top: 0; right: 0; bottom: 0; z-index: 5; margin: 0; padding: 0; }
#workflowRoot { width: 100%; height: 100%; }
/* 提示词库标签页:满区域 */
#promptsTab.active { position: fixed; left: 260px; top: 0; right: 0; bottom: 0; z-index: 5; margin: 0; padding: 0; overflow: auto; }
#promptLibRoot { width: 100%; min-height: 100%; }

/* 提示词管理 */
.wf-pm { display: flex; flex-direction: column; min-height: 100%; }
.wf-pm-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 2; }
.wf-pm-new { height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: var(--button-shadow); }
.wf-pm-new:hover { background: var(--primary-dark); }
.wf-pm-search { height: 32px; min-width: 200px; flex: 1; max-width: 360px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--ink); font: inherit; font-size: 13px; }
.wf-pm-hint { color: var(--faint); font-size: 11px; }
.wf-pm-grid { padding: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; align-content: start; }
.wf-pm-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.wf-pm-thumb { width: 100%; aspect-ratio: 1 / 1; background: var(--surface-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.wf-pm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wf-pm-noimg { color: var(--faint); font-size: 13px; display: flex; align-items: center; justify-content: center; }
.wf-pm-body { padding: 10px 12px 6px; flex: 1; min-height: 0; }
.wf-pm-title { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-pm-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.wf-pm-tag { font-size: 10.5px; font-weight: 600; color: var(--primary-dark); background: var(--primary-soft); padding: 1px 7px; border-radius: 10px; }
.wf-pm-content { font-size: 12px; line-height: 1.6; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.wf-pm-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 12px; }
.wf-pm-actions button { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.wf-pm-actions button:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }
.wf-pm-actions button:disabled { opacity: .6; cursor: default; }
.wf-pm-actions .wf-pm-del:hover { background: var(--bad-soft, #fff5f4); border-color: var(--bad-border, #f3c0bc); color: var(--bad, #c3352b); }
.wf-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: clip;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle, rgba(36, 84, 214, 0.10) 1px, transparent 1.4px) 0 0 / 24px 24px,
    var(--surface-soft, #f8fbff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  cursor: grab;
  outline: none;
  user-select: none; -webkit-user-select: none; -ms-user-select: none;
  touch-action: none;
}
.wf-canvas:active { cursor: grabbing; }
/* 仅在表单控件里恢复可选中/可滚动,其余画布不许拖拽选字(否则拖动会触发原生选择,吞掉 pointerup) */
.wf-canvas input, .wf-canvas textarea, .wf-canvas select { user-select: text; -webkit-user-select: text; -ms-user-select: text; touch-action: auto; }

/* 顶部浮动工具栏 */
.wf-toolbar {
  position: absolute;
  top: 10px; right: 10px; left: auto;
  z-index: 30;
  display: flex; align-items: center; gap: 4px;
  flex-wrap: nowrap;                              /* 始终一排 */
  max-width: calc(100% - 20px);                   /* 不超出画布宽度:靠下拉收缩来塞进一排 */
  padding: 4px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  box-shadow: var(--shadow);
}
.wf-toolbar button {
  height: 26px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--ink);
  font-size: 12px; font-weight: 600; cursor: pointer;
  box-shadow: var(--button-shadow);
  transition: background .12s, border-color .12s, color .12s;
}
.wf-toolbar button:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }
.wf-toolbar .wf-run-all { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.wf-toolbar .wf-run-all:hover { background: var(--primary-dark); color: #fff; }
.wf-toolbar .wf-run-all:disabled { opacity: .7; cursor: default; }
.wf-cr-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wf-cr-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.wf-cr-status { font-size: 12.5px; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.wf-cr-tip { font-size: 11px; color: var(--faint); line-height: 1.6; }
.wf-toolbar .wf-sep { width: 1px; height: 16px; background: var(--line); margin: 0 2px; }
/* 选择器:不被按钮挤压(否则名字被压窄) + 明确文字/背景对比(否则深底深字,稀疏的"画布 1"看不清) */
.wf-toolbar .wf-project-select,
.wf-toolbar .wf-canvas-select {
  height: 26px; flex: 1 1 64px; min-width: 52px; max-width: 150px; font-size: 12px; text-overflow: ellipsis;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px;
}
.wf-toolbar .wf-project-select option,
.wf-toolbar .wf-canvas-select option { color: var(--ink); background: var(--surface); }
.wf-toolbar button { flex: 0 0 auto; white-space: nowrap; }
.wf-toolbar .wf-canvas-btn { padding: 0 8px; }


/* 世界层与节点/连线层 */
.wf-world { position: absolute; left: 0; top: 0; width: 8000px; height: 8000px; transform-origin: 0 0; }
.wf-edges { position: absolute; left: 0; top: 0; width: 8000px; height: 8000px; overflow: visible; pointer-events: none; z-index: 1; }
.wf-nodes { position: absolute; left: 0; top: 0; z-index: 2; }

/* 连线 */
.wf-edge { fill: none; stroke: var(--line-strong, #94a3b8); stroke-width: 2.5; filter: drop-shadow(0 1px 2px rgba(16,24,40,0.10)); }
.wf-edge.selected { stroke: var(--primary); stroke-width: 3.5; }
.wf-edge.temp { stroke: var(--warn); stroke-dasharray: 6 6; }
/* 流水动画:数据正流向待生成节点 */
.wf-edge.flowing {
  stroke: var(--primary);
  stroke-width: 3;
  stroke-dasharray: 9 7;
  filter: drop-shadow(0 0 3px var(--primary-soft));
  animation: wf-edge-flow .55s linear infinite;
}
@keyframes wf-edge-flow { to { stroke-dashoffset: -16; } }
.wf-edge-hit { fill: none; stroke: transparent; stroke-width: 18; pointer-events: stroke; cursor: pointer; }

/* 节点卡片 */
.wf-node {
  position: absolute;
  left: var(--x); top: var(--y);
  width: var(--w); min-height: var(--h);
  display: grid; grid-template-rows: auto 1fr; gap: 0;
  border: 1px solid var(--workflow-node-border, var(--line-strong, #d0d5dd));
  border-top: 3px solid var(--primary);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  pointer-events: auto; cursor: grab; user-select: none;
  transition: box-shadow .15s, border-color .15s;
}
.wf-node:hover { box-shadow: 0 14px 34px rgba(16,24,40,0.16); }
/* 节点内媒体不参与原生拖拽。视频把指针交给节点(可拖节点);图片可点击放大(zoom-in) */
.wf-node video { -webkit-user-drag: none; user-select: none; pointer-events: none; }
.wf-node img { -webkit-user-drag: none; user-select: none; pointer-events: auto; cursor: zoom-in; }
.wf-node.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft), 0 14px 34px rgba(36,84,214,0.22); }
.wf-node.dragging { opacity: .94; cursor: grabbing; z-index: 50; box-shadow: 0 22px 48px rgba(36,84,214,0.30); }
/* 选中连线时,两端节点高亮 */
.wf-node.edge-linked { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft), 0 12px 30px rgba(36,84,214,0.18); }

/* 类型色条 */
.wf-node.tone-prompt { border-top-color: #7c3aed; }
.wf-node.tone-ai     { border-top-color: #0ea5e9; }
.wf-node.tone-asset  { border-top-color: #10b981; }
.wf-node.tone-note   { border-top-color: var(--warn, #f59e0b); }
.wf-node.tone-character  { border-top-color: #ec4899; }
.wf-node.tone-scene      { border-top-color: #14b8a6; }
.wf-node.tone-generate   { border-top-color: var(--primary); }
.wf-node.tone-reference  { border-top-color: #8b5cf6; }
.wf-node.tone-storyboard { border-top-color: #f97316; }
.wf-node.tone-shot       { border-top-color: #6366f1; }
.wf-node.tone-review     { border-top-color: var(--bad, #c3352b); }
.wf-node.tone-locator    { border-top-color: #64748b; }

/* select 复用输入框样式 */
select.wf-node-input { height: 32px; cursor: pointer; font-size: 12px; font-weight: 400; padding: 0 8px; }
/* 视频缩略 */
.wf-node-asset video { max-width: 100%; max-height: 200px; border-radius: 8px; }
/* 生成节点的执行按钮 */
.wf-node-run {
  width: 100%; height: 36px;
  border: 0; border-radius: 8px;
  background: var(--primary); color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: var(--button-shadow);
  transition: background .12s;
}
.wf-node-run:hover { background: var(--primary-dark); }

.wf-node-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px 6px;
}
.wf-node-type { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.wf-node-del {
  width: 22px; height: 22px; border: 0; border-radius: 6px;
  background: transparent; color: var(--faint); font-size: 17px; line-height: 1; cursor: pointer;
  transition: background .12s, color .12s;
}
.wf-node-del:hover { background: var(--bad-soft, #fff5f4); color: var(--bad, #c3352b); }

.wf-node-body { padding: 0 12px 12px; }

/* 数据流摘要条:节点收到的上游四类数据 */
.wf-node-flow {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 0 12px 10px; padding: 5px 8px;
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: 7px;
  font-size: 11px; color: var(--muted);
}
.wf-node-flow .wf-flow-arrow { color: var(--faint); }
.wf-node-flow span { font-weight: 600; }
.wf-node-flow .wf-flow-p { color: #7c3aed; }
.wf-node-flow .wf-flow-i { color: #10b981; }
.wf-node-flow .wf-flow-v { color: var(--primary); }
.wf-node-flow .wf-flow-a { color: #f59e0b; }
.wf-flow-view {
  margin-left: auto; padding: 2px 7px;
  border: 1px solid var(--line); border-radius: 5px;
  background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer;
}
.wf-flow-view:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }

/* 全屏数据阅读器 */
.wf-viewer-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(16, 24, 40, 0.55); backdrop-filter: blur(2px);
}
.wf-viewer {
  width: min(960px, 92vw); max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.wf-viewer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.wf-viewer-head strong { font-size: 15px; color: var(--ink); }
.wf-viewer-sub { margin-left: 8px; font-size: 12px; color: var(--muted); }
.wf-viewer-close {
  width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--muted); font-size: 18px; cursor: pointer;
}
.wf-viewer-close:hover { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-border); }
.wf-viewer-body { padding: 16px 18px; overflow-y: auto; display: grid; gap: 18px; }
.wf-viewer-section h3 { margin: 0 0 8px; font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.wf-viewer-section h3 em { font-style: normal; min-width: 20px; padding: 1px 7px; border-radius: 10px; background: var(--primary-soft); color: var(--primary-dark); font-size: 11px; text-align: center; }
.wf-viewer-empty { color: var(--faint); font-size: 12px; padding: 4px 2px; }
.wf-viewer-prompts { display: grid; gap: 8px; }
.wf-viewer-prompt { display: flex; gap: 10px; padding: 10px 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; }
.wf-viewer-idx { flex-shrink: 0; color: var(--faint); font-size: 12px; font-weight: 700; }
.wf-viewer-prompt pre { margin: 0; flex: 1; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 13px; line-height: 1.6; color: var(--ink); }
.wf-text-edit {
  width: 100%; box-sizing: border-box; min-height: 56vh; resize: vertical;
  font-family: ui-sans-serif, -apple-system, "PingFang SC", "Microsoft YaHei", "Source Han Sans CN", "Noto Sans CJK SC", sans-serif;
  font-size: 14.5px; line-height: 1.85; letter-spacing: .015em;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 16px 18px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  caret-color: var(--primary, #4f7cff);
  tab-size: 4;
  transition: border-color .12s, box-shadow .12s;
}
.wf-text-edit:focus { outline: none; border-color: var(--primary-border); box-shadow: 0 0 0 3px rgba(79, 124, 255, .14); }
.wf-viewer-head-btns { display: flex; align-items: center; gap: 6px; }
.wf-viewer-pick {
  padding: 6px 11px; border: 1px solid var(--primary-border); border-radius: 8px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.wf-viewer-pick:hover { background: var(--primary, #4f7cff); color: #fff; border-color: var(--primary, #4f7cff); }
.wf-viewer-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.wf-viewer-asset { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-soft); }
.wf-viewer-asset img, .wf-viewer-asset video { width: 100%; height: 120px; object-fit: cover; display: block; }
.wf-viewer-asset audio { width: 100%; }
.wf-viewer-asset-ph { height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--faint); font-size: 12px; }
.wf-viewer-asset figcaption { padding: 6px 8px; font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.wf-viewer-role { padding: 1px 5px; border-radius: 4px; background: var(--primary-soft); color: var(--primary-dark); font-size: 10px; }
.wf-node-input {
  width: 100%; box-sizing: border-box; resize: none;
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px;
  font: inherit; font-size: 13px; line-height: 1.5; color: var(--ink); background: var(--surface-soft, #f8fbff);
  transition: border-color .12s, background .12s;
}
.wf-node-input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: 0 0 0 3px var(--primary-soft); }
.wf-node-asset { display: flex; align-items: center; justify-content: center; min-height: 120px; background: var(--surface-soft); border: 1px dashed var(--line); border-radius: 8px; color: var(--faint); font-size: 13px; }
.wf-node-asset img { max-width: 100%; max-height: 220px; border-radius: 8px; object-fit: contain; }

/* 图片节点:大图主体 + 右上角换图(参考其它软件) */
.wf-img-wrap { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-soft); }
.wf-img-full { display: block; width: 100%; height: auto; max-height: 420px; object-fit: contain; }
.wf-img-replace {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px;
  border: 0; border-radius: 8px; background: rgba(16,24,40,0.55); color: #fff;
  font-size: 16px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(2px); transition: background .12s;
}
.wf-img-replace:hover { background: var(--primary); }

/* 待生成:转圈 spinner */
.wf-node-asset.wf-pending { flex-direction: column; gap: 10px; border-style: solid; border-color: var(--primary-border, var(--primary)); color: var(--primary-dark); }
.wf-spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--primary-soft); border-top-color: var(--primary);
  animation: wf-spin .8s linear infinite;
}
@keyframes wf-spin { to { transform: rotate(360deg); } }
.wf-pending-txt { font-size: 12px; font-weight: 600; }
.wf-asset-error { color: var(--bad, #c3352b); line-height: 1.5; text-align: center; }

/* 生成前核对弹窗 */
.wf-review { width: min(720px, 92vw); }
.wf-rv-refs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.wf-rv-ref { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-soft); }
.wf-rv-del { position: absolute; top: 4px; right: 4px; z-index: 2; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(16,24,40,.62); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; }
.wf-rv-del:hover { background: #e5484d; }
.wf-rv-ref img, .wf-rv-ref video { width: 100%; height: 110px; object-fit: cover; display: block; cursor: zoom-in; }
.wf-rv-audio { display: flex; flex-direction: column; }
.wf-rv-audio audio { width: 100%; height: 40px; }
.wf-rv-tip { margin-left: 8px; font-size: 11px; font-weight: 400; color: var(--faint); }
.wf-viewer-section h3 .wf-flow-view { margin-left: auto; }
.wf-viewer-section h3 { display: flex; align-items: center; gap: 6px; }
.wf-dur-fixed { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border: 1px dashed var(--primary-border, var(--line)); border-radius: 8px; background: var(--primary-soft); color: var(--primary-dark); font-size: 12px; font-weight: 600; white-space: nowrap; }
/* 图片池 */
.wf-pool-head { font-size: 11.5px; color: var(--muted); margin: 2px 0 8px; }
/* 选项卡分页:图太多时按页切换 */
.wf-pool-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.wf-pool-tab { min-width: 26px; height: 24px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-soft); color: var(--muted); font-size: 12px; cursor: pointer; }
.wf-pool-tab:hover { border-color: var(--primary); color: var(--primary); }
.wf-pool-tab.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
/* align-items:start 防止 grid 默认拉伸把行高塞坏(绝对定位的图无流内高度时会塌成 0 而重叠) */
.wf-pool-grid { display: grid; grid-template-columns: repeat(3, 1fr); align-items: start; gap: 6px; margin-bottom: 8px; max-height: 340px; overflow-y: auto; overflow-x: hidden; box-sizing: border-box; width: 100%; scrollbar-gutter: stable; }
.wf-pool-cell { position: relative; min-width: 0; margin: 0; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-soft); cursor: pointer; aspect-ratio: 1/1; }
.wf-pool-idx { position: absolute; left: 4px; bottom: 4px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: rgba(16,24,40,.6); color: #fff; font-size: 11px; line-height: 16px; text-align: center; }
/* 图绝对定位、移出文档流:单元格高度只由 aspect-ratio 决定,宽扁原图也强制成正方形格子 */
.wf-pool-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* 选中态用向内描边(inset),不向外扩,避免最右列光晕顶出节点边界 */
.wf-pool-cell.on { border-color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary-soft); }
.wf-pool-ph { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); font-size: 13px; }
.wf-pool-check { position: absolute; left: 4px; top: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; font-weight: 900; display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.wf-pool-del { position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; border: 0; border-radius: 50%; background: rgba(16,24,40,.6); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; padding: 0; }
.wf-pool-del:hover { background: #e5484d; }
.wf-rv-ph { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 28px; color: var(--faint); }
.wf-rv-ref figcaption { padding: 6px 8px; font-size: 11px; font-weight: 600; color: var(--primary-dark); background: var(--primary-soft); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-rv-prompt { margin: 0; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 13px; line-height: 1.7; color: var(--ink); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; max-height: 260px; overflow-y: auto; }
.wf-review-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); }
.wf-review-warn { margin-right: auto; color: var(--bad, #c3352b); font-size: 12px; }
.wf-rv-autoopt { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; cursor: pointer; user-select: none; }
.wf-rv-autoopt input { accent-color: var(--primary, #4f7cff); }
.wf-review-go.optimized { background: linear-gradient(180deg, #16a34a, #15803d); border-color: #15803d; box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.wf-review-cancel { height: 36px; padding: 0 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; }
.wf-review-cancel:hover { background: var(--surface-soft); }
.wf-review-go { height: 36px; padding: 0 20px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: var(--button-shadow); }
.wf-review-go:hover { background: var(--primary-dark); }
.wf-review-go:disabled { opacity: .5; cursor: default; }

/* 人物节点:大图 + 名字/声音在下 */
.wf-char { display: flex; flex-direction: column; gap: 8px; padding: 2px 0 8px; }
.wf-char-img-wrap { width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-soft); }
.wf-char-img-wrap.empty { height: 180px; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 13px; border-style: dashed; }
.wf-char-img { width: 100%; max-height: 280px; object-fit: contain; display: block; }
.wf-char-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.wf-char-name { font-size: 15px; font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; min-width: 0; }
.wf-char-stage { font-size: 11px; font-weight: 600; color: var(--primary-dark); background: var(--primary-soft); padding: 1px 7px; border-radius: 10px; }
/* 人物选择器:阶段分组 / 返回 / 仅声音 */
.wf-char-sec { margin-bottom: 14px; }
.wf-char-sec-label { font-size: 12px; font-weight: 700; color: var(--muted); margin: 4px 2px 8px; }
.wf-picker-grid-inline { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.wf-char-back { height: 28px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12.5px; cursor: pointer; }
.wf-char-back:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }
.wf-char-voiceonly { height: 32px; padding: 0 14px; border: 1px dashed var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.wf-char-voiceonly:hover { border-color: var(--primary); color: var(--primary-dark); }
.wf-char-voice { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; }
.wf-char-voice input { cursor: pointer; }
.wf-char-novoice { font-size: 12px; color: var(--faint); }
.wf-char-mode-tag { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(16,24,40,.62); border-radius: 8px; padding: 2px 8px; }
/* 超级智能体面板(右侧抽屉) */
.wf-agent { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 96vw); z-index: 80; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 28px rgba(16,24,40,.18); }
.wf-agent-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line); }
.wf-agent-head strong { font-size: 15px; font-weight: 700; color: var(--ink); }
.wf-agent-x { width: 30px; height: 30px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.wf-agent-x:hover { background: var(--surface-soft); color: var(--ink); }
.wf-agent-tools { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.wf-agent-tools button { height: 28px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: 12px; white-space: nowrap; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.wf-agent-tools button:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }
.wf-agent-tools button[data-act="storyboards"] { border-color: var(--primary-border); background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.wf-agent-tools button[data-act="storyboards"]:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.wf-agent-tools button[data-act="clear"] { color: #dc2626; }
.wf-agent-tools button[data-act="clear"]:hover { background: #fee2e2; border-color: #fecaca; color: #dc2626; }
.wf-agent-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.wf-agent-empty { color: var(--muted); font-size: 13px; line-height: 1.7; }
.wf-agent-msg { display: flex; }
.wf-agent-msg.user { justify-content: flex-end; }
.wf-agent-bubble { max-width: 86%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.wf-agent-msg.user .wf-agent-bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.wf-agent-msg.ai .wf-agent-bubble { background: var(--surface-soft); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.wf-agent-msg.ai { flex-direction: column; align-items: flex-start; }
.wf-agent-think { max-width: 86%; margin-bottom: 4px; }
.wf-agent-think > summary { cursor: pointer; color: var(--muted); user-select: none; list-style: none; padding: 3px 9px; font-size: 12px; background: var(--surface-soft); border: 1px dashed var(--line); border-radius: 8px; display: inline-block; }
.wf-agent-think > summary::-webkit-details-marker { display: none; }
.wf-agent-think > summary:hover { color: var(--primary-dark); }
.wf-agent-think[open] > summary { margin-bottom: 4px; }
.wf-agent-think-body { white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.6; color: var(--muted); background: var(--surface-soft); border-left: 3px solid var(--primary); border-radius: 0 8px 8px 0; padding: 8px 10px; max-height: 220px; overflow-y: auto; }
.wf-agent-actions { align-self: stretch; display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px dashed var(--primary); border-radius: 10px; background: var(--primary-soft); }
.wf-agent-actions-tip { font-size: 11.5px; color: var(--primary-dark); }
.wf-agent-act { text-align: left; padding: 7px 10px; border: 1px solid var(--primary); border-radius: 8px; background: var(--surface); color: var(--primary-dark); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.wf-agent-act:hover { background: var(--primary); color: #fff; }
.wf-agent-imgcard { align-self: stretch; display: flex; flex-direction: column; gap: 7px; padding: 9px; border: 1px solid var(--primary-border); border-radius: 10px; background: var(--surface-soft); }
.wf-agent-imgcard-tip { font-size: 12px; font-weight: 700; color: var(--primary-dark); }
.wf-agent-imgprompt { width: 100%; resize: vertical; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; font-size: 12px; line-height: 1.5; color: var(--ink); background: var(--surface); box-sizing: border-box; }
.wf-agent-imgrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.wf-agent-imgprov, .wf-agent-imgmodel, .wf-agent-imgratio { flex: 1 1 30%; min-width: 92px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12px; padding: 0 6px; }
.wf-agent-imggen { width: 100%; }
.wf-agent-imgmodel[hidden] { display: none; }
.wf-agent-imggen { flex: 0 0 auto; padding: 0 14px; height: 32px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.wf-agent-imggen:hover { background: var(--primary-dark); }
.wf-agent-imgout { display: flex; flex-wrap: wrap; gap: 8px; }
.wf-agent-imgout:empty { display: none; }
.wf-agent-imgitem { display: flex; flex-direction: column; gap: 4px; }
.wf-agent-imgitem img { max-width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.wf-agent-imgmeta { font-size: 11px; color: var(--muted); }
.wf-agent-imgsave { padding: 5px 9px; border: 1px solid var(--primary-border); border-radius: 7px; background: var(--surface); color: var(--primary-dark); font-size: 12px; font-weight: 700; cursor: pointer; }
.wf-agent-imgsave:hover { background: var(--primary-soft); }
.wf-agent-imgsave:disabled { opacity: .7; cursor: default; color: var(--muted); }
.wf-agent-note { padding: 0 14px; font-size: 11.5px; color: var(--primary-dark); max-height: 0; overflow: hidden; transition: max-height .2s, padding .2s; }
.wf-agent-note.on { max-height: 60px; padding: 6px 14px; }
.wf-agent-input { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.wf-agent-input textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; color: var(--ink); background: var(--surface); }
.wf-agent-send { padding: 0 16px; border: 0; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 700; cursor: pointer; }
.wf-agent-send:disabled { opacity: .6; cursor: default; }
.wf-toolbar .wf-agent-toggle { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); font-weight: 700; }

/* 画板 */
.wf-draw { width: min(960px, 96vw); max-height: 94vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.wf-draw-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink); }
.wf-draw-tools label { display: inline-flex; align-items: center; gap: 6px; }
.wf-draw-tools input[type=color] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; cursor: pointer; }
.wf-draw-tools input[type=range] { width: 120px; }
.wf-draw-tools button { height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-size: 12.5px; cursor: pointer; }
.wf-draw-tools button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.wf-draw-tip { color: var(--muted); margin-left: auto; }
.wf-draw-stage { flex: 1; min-height: 0; overflow: auto; display: grid; place-items: center; padding: 14px; background: repeating-conic-gradient(#0000 0% 25%, rgba(127,127,127,.12) 0% 50%) 0 0 / 22px 22px, var(--surface-soft); }
.wf-draw-stage canvas { max-width: 100%; max-height: 72vh; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: crosshair; touch-action: none; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.wf-char-src-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wf-char-src-row > span { font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.wf-char-src { flex: 1; min-width: 0; }

/* 图生图节点专用布局 */
.wf-i2i-imgs {
  display: flex; gap: 5px; flex-wrap: wrap; align-items: center;
  padding: 7px; min-height: 64px; margin-bottom: 8px;
  background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px;
}
.wf-i2i-imgs img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.wf-i2i-noimg { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 6px; background: var(--surface); color: var(--faint); font-size: 12px; border: 1px dashed var(--line); }
.wf-i2i-more { font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 4px; }
.wf-i2i-ref { position: relative; margin: 0; width: 50px; height: 50px; }
.wf-i2i-ref img { width: 50px; height: 50px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.wf-i2i-ref.off img, .wf-i2i-ref.off .wf-i2i-noimg { opacity: .32; filter: grayscale(1); }
.wf-i2i-ref-x { position: absolute; top: -5px; right: -5px; width: 18px; height: 18px; border: 0; border-radius: 50%; background: rgba(16,24,40,.7); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; padding: 0; display: grid; place-items: center; }
.wf-i2i-ref-x:hover { background: #e5484d; }
.wf-i2i-ref.off .wf-i2i-ref-x { background: var(--primary); }
.wf-i2i-names { font-size: 11px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 8px; padding: 4px 8px; margin-bottom: 8px; }
.wf-i2i-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.wf-i2i-row label { flex: 1 1 calc(50% - 4px); min-width: 108px; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.wf-i2i-row-full { flex: 1; display: flex; align-items: center; gap: 6px; margin: 8px 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.wf-i2i-row select, .wf-i2i-row-full select { flex: 1; height: 30px; }

/* 分段剧情(按时间逐段写) */
.wf-seg-tip { font-size: 11px; color: var(--primary-dark); background: var(--primary-soft); border-radius: 8px; padding: 4px 8px; margin-bottom: 8px; line-height: 1.5; }
.wf-seg { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin-bottom: 8px; background: var(--surface-soft); }
.wf-seg-head { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; font-size: 12px; color: var(--muted); font-weight: 700; }
.wf-seg-no { color: var(--primary-dark); }
.wf-seg-time { font-size: 11px; color: var(--muted); opacity: .7; font-weight: 600; }
.wf-seg-durlab { display: inline-flex; align-items: center; gap: 3px; margin-left: auto; font-size: 11px; font-weight: 600; }
.wf-seg-dur { width: 42px; height: 26px; text-align: center; padding: 0 2px; }
.wf-seg-del { width: 22px; height: 22px; border: 0; border-radius: 6px; background: var(--surface); color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.wf-seg-del:hover { background: #fee2e2; color: #dc2626; }
.wf-seg-refresh { width: 30px; height: 30px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 14px; }
.wf-seg-refresh:hover { background: var(--surface-soft); }

/* 端口 */
.wf-port {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; border-radius: 50%;
  border: 2.5px solid var(--surface); background: var(--primary); cursor: crosshair; padding: 0; z-index: 3;
  box-shadow: 0 1px 3px rgba(16,24,40,0.25);
  transition: transform .12s;
}
.wf-port-in { left: -8px; background: var(--muted); }
.wf-port-out { right: -8px; }
.wf-port:hover { transform: translateY(-50%) scale(1.3); }

/* 右键上下文菜单(加节点面板) */
.wf-context {
  position: fixed; z-index: 200;
  width: 288px; padding: 11px 11px 9px;
  background: var(--surface);
  background-image: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,0) 64%);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06);
  font-family: inherit; font-size: 13px;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  animation: wf-context-in .12s ease-out;
}
@keyframes wf-context-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.wf-context-group-label {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 2px 7px; font-size: 11px; font-weight: 700; letter-spacing: .14em;
  color: var(--faint);
}
.wf-context-group-label::before {
  content: ""; width: 3px; height: 11px; border-radius: 2px;
  background: var(--primary, #4f7cff); opacity: .85;
}
.wf-context > .wf-context-group-label:first-child { padding-top: 2px; }
.wf-context-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 2px; }
.wf-context button {
  text-align: center;
  padding: 6px 6px; border: 1px solid var(--line); border-radius: 8px;
  background-color: var(--surface-soft);
  background-image: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0));
  color: var(--ink); font-size: 11.5px; font-weight: 600; letter-spacing: .01em; cursor: pointer;
  transition: transform .12s ease, background-color .12s, border-color .12s, color .12s, box-shadow .12s;
}
.wf-context button:hover {
  background-color: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark);
  transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.22);
}
.wf-context button:active { transform: translateY(0); box-shadow: none; }

/* 工具栏项目选择器 */
.wf-project-select {
  height: 30px; max-width: 180px;
  padding: 0 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; cursor: pointer;
}
.wf-project-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* 素材名称输入(提交时变成 图片N=名称) */
.wf-node-label { margin-top: 8px; height: 30px; font-size: 12px; }
/* 首尾帧节点 */
.wf-fe-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.wf-fe-btn { height: 30px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: background .12s, border-color .12s, color .12s; }
.wf-fe-btn:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }
.wf-fe-btn:disabled { opacity: .6; cursor: default; }
.wf-fe-thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.wf-fe-cell { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface-soft); width: 96px; }
.wf-fe-cell img { width: 100%; height: 60px; object-fit: cover; display: block; }
.wf-fe-del { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border: 0; border-radius: 50%; background: rgba(16,24,40,.6); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; padding: 0; z-index: 2; }
.wf-fe-del:hover { background: var(--bad, #c3352b); }
.wf-fe-name { width: 100%; box-sizing: border-box; border: 0; border-top: 1px solid var(--line); padding: 3px 6px; font: inherit; font-size: 10.5px; color: var(--ink); background: var(--surface); }
.wf-fe-name:focus { outline: none; background: var(--primary-soft); }
.wf-fe-cap-row { margin-top: 8px; font-size: 12px; color: var(--muted); min-height: 18px; }

/* 故事版:模板行 */
.wf-sb-tpl { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 2px; font-size: 12px; color: var(--muted); }
.wf-sb-tpl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 故事版模板管理弹窗 */
.wf-sbt { width: min(880px, 94vw); }
.wf-sbt-body { display: grid; grid-template-columns: 220px 1fr; gap: 0; min-height: 360px; max-height: 66vh; }
.wf-sbt-list { border-right: 1px solid var(--line); padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.wf-sbt-item { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--ink); font-size: 13px; cursor: pointer; text-align: left; }
.wf-sbt-item.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.wf-sbt-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-sbt-badge { font-size: 10px; font-weight: 700; color: var(--primary-dark); background: var(--primary-soft); padding: 1px 6px; border-radius: 8px; }
.wf-sbt-badge.alt { color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.wf-sbt-new { margin-top: 4px; height: 32px; border: 1px dashed var(--line); border-radius: 8px; background: transparent; color: var(--primary-dark); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.wf-sbt-edit { padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.wf-sbt-vars { font-size: 11px; line-height: 1.6; color: var(--faint); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.wf-sbt-content { resize: vertical; min-height: 240px; font-size: 12.5px; line-height: 1.6; }
.wf-sbt-row { display: flex; justify-content: flex-end; }
.wf-sbt-del { height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--bad, #c3352b); font-size: 12px; cursor: pointer; }
.wf-sbt-del:disabled { opacity: .5; cursor: default; color: var(--faint); }

/* 故事版合成结果预览 */
.wf-sb-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.wf-sb-out { margin: 0 0 8px; white-space: pre-wrap; word-break: break-word; font: inherit; font-size: 11px; line-height: 1.6; color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; max-height: 150px; overflow-y: auto; }
/* 节点内"选择素材"按钮 */
.wf-node-pick {
  width: 100%; margin-top: 8px; height: 32px;
  border: 1px dashed var(--primary-border, var(--line)); border-radius: 8px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.wf-node-pick:hover { background: var(--surface); border-color: var(--primary); }

/* 生成节点:状态徽标 / 结果缩略 / 动作行 */
.wf-gen-status {
  display: inline-block; margin-bottom: 8px; padding: 2px 9px; border-radius: 10px;
  font-size: 11px; font-weight: 700;
  background: var(--surface-soft); color: var(--muted);
}
.wf-gen-status.running, .wf-gen-status.submitted { background: var(--warn-soft, #fff7e6); color: var(--warn, #b45309); }
.wf-gen-status.done { background: #e7f8ef; color: #0f7a44; }
.wf-gen-status.failed { background: var(--bad-soft, #fff5f4); color: var(--bad, #c3352b); }
.wf-gen-results {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 8px;
}
.wf-gen-results img, .wf-gen-results video {
  width: 100%; height: 80px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; cursor: zoom-in;
}
/* 节点内的视频:点了弹播放窗,不在小窗里播 */
.wf-node video { cursor: zoom-in; pointer-events: auto; }
.wf-node-asset video { width: 100%; cursor: zoom-in; }
.wf-gen-ratio { margin: 2px 0 8px; font-size: 11px; color: var(--muted); }
.wf-ovr { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; font-size: 11px; color: var(--warn, #b45309); background: var(--warn-soft, #fff7e6); border: 1px solid var(--warn-border, #f0d9a8); border-radius: 8px; padding: 5px 8px; }
.wf-ovr-clear { height: 24px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 11px; font-weight: 600; cursor: pointer; }
.wf-ovr-clear:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }
.wf-gen-actions { display: flex; gap: 6px; }
.wf-gen-actions .wf-node-run { flex: 1; }
.wf-node-run:disabled { opacity: .6; cursor: default; }
.wf-node-refresh {
  flex-shrink: 0; height: 36px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.wf-node-refresh:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }

/* 素材选择器(复用 .wf-viewer-overlay 遮罩) */
.wf-picker {
  width: min(880px, 92vw); max-height: 84vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.wf-picker-confirm {
  height: 30px; padding: 0 14px; border: 0; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.wf-picker-confirm:hover { background: var(--primary-dark); }
/* 分类筛选(下拉框) */
.wf-picker-filter {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
}
.wf-picker-filter-label { font-size: 12px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.wf-picker-select {
  height: 32px; min-width: 160px; max-width: 280px;
  padding: 0 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; cursor: pointer;
}
.wf-picker-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.wf-picker-grid {
  padding: 16px 18px; overflow-y: auto;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px;
}
/* 懒加载占位:未加载时给出固定高度,避免滚动布局跳动 */
.wf-picker-item .wf-lazy { background: var(--surface-soft); min-height: 110px; }
.wf-picker-item img.wf-lazy:not([src]), .wf-picker-item video.wf-lazy:not([src]) { opacity: 0; }
.wf-picker-item img.wf-lazy, .wf-picker-item video.wf-lazy { transition: opacity .2s; }
.wf-picker-item {
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
  border: 2px solid var(--line); border-radius: 10px; background: var(--surface-soft);
  cursor: pointer; text-align: left; transition: border-color .12s, box-shadow .12s;
}
.wf-picker-item:hover { border-color: var(--primary-border, var(--primary)); }
.wf-picker-item.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.wf-picker-item img, .wf-picker-item video { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; display: block; }
.wf-picker-ph { height: 110px; display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 12px; }
.wf-picker-name { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 提示词库选择器:正文摘要 */
.wf-pp-item { align-items: stretch; text-align: left; }
.wf-pp-content { font-size: 10.5px; line-height: 1.5; color: var(--faint); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* 深色主题:变量已自动适配,仅微调网格 */
html.theme-dark .wf-canvas {
  background:
    radial-gradient(circle, rgba(120,160,255,0.10) 1px, transparent 1.4px) 0 0 / 24px 24px,
    var(--surface-soft, #0f1626);
  box-shadow: none;
}

/* ─── 超级智能体 · 主导航 tab(对话 / 素材) ─── */
.wf-agent-mainnav { display: flex; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.wf-agent-mainnav button { flex: 1; padding: 9px 12px; border: 0; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent; }
.wf-agent-mainnav button:hover { color: var(--ink); }
.wf-agent-mainnav button.active { color: var(--primary-dark, var(--ink)); border-bottom-color: var(--primary); font-weight: 600; background: var(--surface); }
.wf-agent-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wf-agent-pane[hidden] { display: none; }

/* ─── 素材选卡 ─── */
.wf-mat-cats { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.wf-mat-cat { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; cursor: pointer; }
.wf-mat-cat:hover { background: var(--primary-soft); color: var(--primary-dark); }
.wf-mat-cat.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.wf-mat-cat b { font-weight: 600; opacity: 0.85; }

.wf-mat-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.wf-mat-status { font-size: 12px; color: var(--muted); margin-left: auto; }
.wf-mat-btn { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 12.5px; cursor: pointer; }
.wf-mat-btn:hover:not(:disabled) { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }
.wf-mat-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.wf-mat-btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.wf-mat-btn.primary:hover { background: var(--primary-dark, var(--primary)); }
.wf-mat-btn.small { padding: 3px 8px; font-size: 11.5px; }

.wf-mat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; align-content: start; }
.wf-mat-empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 12px; font-size: 12.5px; }

.wf-mat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: grab; transition: border-color .12s, box-shadow .12s; display: flex; flex-direction: column; }
.wf-mat-card:hover { border-color: var(--primary-border); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.wf-mat-card:hover .wf-mat-del { opacity: 1; }
.wf-mat-card:active { cursor: grabbing; }
.wf-mat-thumb { position: relative; flex: 0 0 150px; height: 150px; width: 100%; background: #111827; display: grid; place-items: center; overflow: hidden; }
.wf-mat-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
.wf-mat-name { font-size: 11px; font-weight: 500; color: var(--ink); line-height: 1.3; padding: 5px 6px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-mat-btn.xs { padding: 3px 6px; font-size: 10.5px; margin: 4px 6px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); cursor: pointer; }
.wf-mat-btn.xs:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }
.wf-mat-del { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(220, 38, 38, .85); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s, background .15s; font-size: 11px; display: flex; align-items: center; justify-content: center; padding: 0; }
.wf-mat-del:hover { background: #dc2626; opacity: 1 !important; }
.wf-mat-del:disabled { opacity: 0.5; cursor: wait; }

/* 目标选择小弹窗(选哪个人物/场景/镜头) */
.wf-mat-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; z-index: 95; }
.wf-mat-mask.in-panel { position: absolute; inset: 0; background: rgba(15, 23, 42, .35); padding: 12px; z-index: 50; }
.wf-mat-picker { width: 360px; max-width: 90vw; max-height: 70vh; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.in-panel .wf-mat-picker { width: 100%; max-width: 100%; max-height: 100%; }
.wf-mat-picker header { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.wf-mat-picker header strong { font-size: 14px; }
.wf-mat-picker header button { background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--muted); }
.wf-mat-picker-list { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.wf-mat-picker-item { padding: 9px 12px; text-align: left; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; }
.wf-mat-picker-item:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }

/* ─── 引擎选择对话框(engine-picker.js) ─── */
.director-ep-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); display: flex; align-items: center; justify-content: center; z-index: 96; }
/* 嵌入超级智能体面板内部:不影响画布操作 */
.director-ep-mask.in-panel { position: absolute; inset: 0; background: rgba(15, 23, 42, .35); padding: 12px; z-index: 50; }
.director-ep { width: 460px; max-width: 92vw; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.in-panel .director-ep { width: 100%; max-width: 100%; max-height: 100%; overflow-y: auto; padding: 12px 14px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.in-panel .director-ep-rec { font-size: 11.5px; padding: 6px 10px; }
.in-panel .director-ep-hint { font-size: 11.5px; }
.director-ep-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.director-ep-head strong { font-size: 14.5px; }
.director-ep-head button { background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--muted); }
.director-ep-rec { background: var(--primary-soft); border-left: 3px solid var(--primary); padding: 7px 11px; border-radius: 4px; font-size: 12px; color: var(--ink); margin-bottom: 10px; line-height: 1.6; }
.director-ep-rec b { color: var(--primary-dark, var(--ink)); }
.director-ep-hint { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.director-ep-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.director-ep-row label { width: 44px; font-size: 12px; color: var(--muted); }
.director-ep-row select, .director-ep-row input { flex: 1; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: 6px 9px; font: inherit; font-size: 12.5px; }
.director-ep-error { background: #fee2e2; border: 1px solid #fecaca; color: #b91c1c; padding: 7px 11px; border-radius: 5px; font-size: 12px; margin: 8px 0; }
.director-ep-foot { display: flex; justify-content: flex-end; gap: 7px; margin-top: 12px; }
.director-ep-foot button { background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: 6px 14px; border-radius: 6px; cursor: pointer; font: inherit; font-size: 12.5px; }
.director-ep-foot button:hover:not(:disabled) { background: var(--surface-soft); }
.director-ep-foot button.primary { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.director-ep-foot button.primary:hover:not(:disabled) { background: var(--primary-dark, var(--primary)); }

/* 通用小转圈 */
.wf-spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: wf-spin-anim .7s linear infinite; vertical-align: middle; margin-right: 5px; }
@keyframes wf-spin-anim { to { transform: rotate(360deg); } }

/* 对话气泡里出图的按钮组 */
.wf-agent-imgbtns { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.wf-agent-imgbtns button { flex: 1; min-width: 0; padding: 4px 7px; font-size: 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--ink); cursor: pointer; }
.wf-agent-imgbtns button:hover { background: var(--primary-soft); border-color: var(--primary-border); color: var(--primary-dark); }
.wf-agent-imgitem { cursor: grab; }
.wf-agent-imgitem:active { cursor: grabbing; }

/* 对话输入框上方的附件条:拖图进来后显示参考图缩略图 */
.wf-agent-attach { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px; border-top: 1px dashed var(--primary-border, var(--line)); background: var(--primary-soft); align-items: center; }
.wf-agent-att-tip { width: 100%; font-size: 11.5px; color: var(--primary-dark); margin-bottom: 2px; }
.wf-agent-att-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--surface); border: 1px solid var(--primary-border); border-radius: 999px; padding: 3px 6px 3px 3px; font-size: 11px; color: var(--ink); max-width: 200px; }
.wf-agent-att-chip img { width: 30px; height: 30px; object-fit: cover; border-radius: 50%; flex: 0 0 auto; }
.wf-agent-att-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wf-agent-att-chip button { width: 18px; height: 18px; border: 0; background: rgba(0,0,0,.08); border-radius: 50%; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; flex: 0 0 auto; }
.wf-agent-att-chip button:hover { background: rgba(220, 38, 38, .15); color: #dc2626; }

/* 输入框拖入高亮 */
.wf-agent-input { position: relative; }
.wf-agent-input.drop-active { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.wf-agent-input.drop-active textarea { background: transparent; }
.wf-agent-input.drop-active::after { content: "📎 松开 → 把这张图加为改图参考"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--primary-dark); font-size: 13px; font-weight: 600; pointer-events: none; background: rgba(255,255,255,0.7); backdrop-filter: blur(1px); }

/* 改图模式发送按钮 */
.wf-agent-send.remix { background: linear-gradient(135deg, #f59e0b, #d97706); border-color: #d97706; color: #fff; font-weight: 700; }
.wf-agent-send.remix:hover { background: linear-gradient(135deg, #d97706, #b45309); }

/* 对话里的用户改图请求:气泡上方显示参考图缩略图 */
.wf-agent-att-preview { display: flex; gap: 4px; max-width: 86%; margin-bottom: 4px; flex-wrap: wrap; justify-content: flex-end; }
.wf-agent-att-preview img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.wf-agent-msg.user { flex-direction: column; align-items: flex-end; }

/* 批量出图任务标题:N 张图时显示在所有 imgcard 之前 */
.wf-agent-imgcard-batch-tip { font-size: 12px; color: var(--primary-dark); background: var(--primary-soft); border-left: 3px solid var(--primary); padding: 6px 10px; border-radius: 4px; margin: 6px 0 4px; font-weight: 600; }

/* 出图卡片锁定状态:点了生成图片之后到返回之前,整张卡片半透明 + 禁止点击,防误操作 */
.wf-agent-imgcard.locked { opacity: 0.7; position: relative; }
.wf-agent-imgcard.locked textarea,
.wf-agent-imgcard.locked select { background: var(--surface-soft); cursor: not-allowed; }
.wf-agent-imgcard.locked .wf-agent-imggen { cursor: wait; background: var(--surface-soft); color: var(--muted); }

/* 🎞 剧情分镜选图弹窗 */
.wf-sbref { width: 100%; max-width: 100%; max-height: 100%; overflow-y: auto; }
.wf-sbref-label { font-size: 12px; color: var(--muted); margin: 6px 0 4px; }
.wf-sbref-label b { color: var(--primary-dark); }
.wf-sbref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; max-height: 180px; overflow-y: auto; padding: 4px; background: var(--surface-soft); border-radius: 6px; }
.wf-sbref-cell { position: relative; aspect-ratio: 1/1; border-radius: 5px; overflow: hidden; cursor: pointer; border: 2px solid transparent; }
.wf-sbref-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wf-sbref-cell .wf-sbref-check { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; display: none; align-items: center; justify-content: center; }
.wf-sbref-cell.picked { border-color: var(--primary); }
.wf-sbref-cell.picked .wf-sbref-check { display: flex; }
.wf-sbref-brief { width: 100%; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; font: inherit; font-size: 12.5px; resize: vertical; margin-bottom: 8px; }

/* 出图卡片里的"自动带人物参考"芯片行 */
.wf-agent-imgchars { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: 4px 0; }
.wf-agent-imgchar { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); border: 1px solid var(--primary-border); font-size: 11px; font-weight: 600; }
.wf-agent-imgchars-tip { font-size: 10.5px; color: var(--muted); margin-left: 4px; }

/* 对话里的"改图任务卡片":嵌在 AI 气泡里的选平台 + 进度 + 结果 */
.wf-agent-bubble.wf-agent-task { background: var(--surface); border: 1px solid var(--primary-border); padding: 10px 12px; max-width: 100%; }
.wf-agent-task-rec { font-size: 11.5px; color: var(--primary-dark); background: var(--primary-soft); border-left: 3px solid var(--primary); padding: 5px 9px; border-radius: 4px; margin-bottom: 8px; line-height: 1.5; }
.wf-agent-task-rec b { color: var(--ink); }
.wf-agent-task-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.wf-agent-task-row label { width: 36px; font-size: 11.5px; color: var(--muted); }
.wf-agent-task-row select { flex: 1; padding: 5px 8px; font: inherit; font-size: 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; }
.wf-agent-task-btns { display: flex; gap: 6px; justify-content: flex-end; margin-top: 8px; }
.wf-agent-task-btns button { padding: 5px 12px; border-radius: 5px; font-size: 12px; cursor: pointer; }
.wf-agent-task-cancel { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.wf-agent-task-cancel:hover { color: #dc2626; border-color: #fecaca; }
.wf-agent-task-start { background: var(--primary); color: #fff; border: 1px solid var(--primary); font-weight: 600; }
.wf-agent-task-start:hover { background: var(--primary-dark, var(--primary)); }
.wf-agent-task-running { background: var(--primary-soft); border: 1px dashed var(--primary-border); color: var(--primary-dark); font-size: 12.5px; line-height: 1.6; }

/* 素材选卡 hint(替代旧的"让 AI 改"按钮) */
.wf-mat-hint { font-size: 10.5px; color: var(--muted); padding: 0 6px; align-self: center; flex: 1; text-align: right; }

/* ─── 共享灯箱:点图片放大 ─── */
.wf-lightbox-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .88); z-index: 200; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.wf-lightbox-x { position: absolute; top: 16px; right: 20px; width: 38px; height: 38px; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 50%; font-size: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.wf-lightbox-x:hover { background: rgba(255, 255, 255, .22); }
.wf-lightbox-stage { max-width: 92vw; max-height: 90vh; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: default; }
.wf-lightbox-img { max-width: 92vw; max-height: 80vh; object-fit: contain; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.6); }
.wf-lightbox-cap { color: #d6dae6; font-size: 13px; padding: 4px 12px; background: rgba(255,255,255,.06); border-radius: 4px; max-width: 90vw; text-align: center; }
.wf-lightbox-bar { display: flex; gap: 12px; }
.wf-lightbox-link { color: #c0d4ff; font-size: 12px; text-decoration: none; padding: 5px 12px; border-radius: 6px; background: rgba(255,255,255,.08); }
.wf-lightbox-link:hover { background: rgba(255,255,255,.16); color: #fff; }
img[data-lightbox] { cursor: zoom-in; }
