:root {
  --canvas-bg: #0d0d0d;
  /* 悬浮控制条（左侧栏 / 底部工具）统一的中性面、描边与图标灰，取代原来的灰蓝调 */
  --canvas-chrome: rgba(16, 16, 16, .92);
  --canvas-chrome-border: rgba(255, 255, 255, .07);
  --canvas-chrome-hover: rgba(255, 255, 255, .075);
  --canvas-chrome-icon: #dcdcdf;
  --canvas-chrome-text: #a5a5a8;
  /* 分组底衬：中性白叠加，替换原来的灰蓝 (148,155,168) */
  --canvas-group-bg: rgba(255, 255, 255, .05);
  --canvas-group-border: rgba(255, 255, 255, .07);
  --canvas-text: #f4f5f6;
  --canvas-purple: #ff2d68;
  --canvas-panel-bg: #262626;
  --canvas-panel-border: rgba(255, 255, 255, .08);
  /* 工具条上常驻控件（模型 / 参数配置 / 语言）的描边：比面板描边稍微明显一点 */
  --vcp-control-border: rgba(255, 255, 255, .10);
  /* 画布卡片预览区描边：默认只留一圈很轻的轮廓 */
  --canvas-card-border: rgba(255, 255, 255, .09);
  /* 配置项 / 分段控件内部描边，比卡片再轻一点 */
  --canvas-control-border: rgba(255, 255, 255, .06);
  --canvas-earth: #262626;
  --canvas-earth-soft: #303030;
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--canvas-bg);
  color: var(--canvas-text);
  font-family: Inter, "PingFang SC", system-ui, -apple-system, "Segoe UI", sans-serif;
}

button,
input { font: inherit; }

/* Shared topbar: only the left project slot is canvas-specific. */
.canvas-topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  height: 68px;
  padding: 0 20px;
  background: transparent;
  border-bottom: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.canvas-topbar .center-nav { display: none; }
.canvas-topbar .left-nav { gap: 0; }
.canvas-topbar .right-nav { gap: 10px; }
.canvas-topbar .member-btn,
.canvas-topbar .assets-btn { height: 34px; }
.canvas-topbar .user-trigger { height: 34px; }

.canvas-brand-area {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.canvas-brand {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
}

.canvas-brand img,
.canvas-brand-back {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.canvas-brand-back { display: none; fill: none; stroke: #fff; color: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.canvas-brand:hover .canvas-brand-logo,
.canvas-brand:focus-visible .canvas-brand-logo { display: none; }
.canvas-brand:hover .canvas-brand-back,
.canvas-brand:focus-visible .canvas-brand-back { display: block; }

.canvas-divider {
  width: 1px;
  height: 25px;
  background: rgba(255, 255, 255, .13);
}

.project-title-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.project-title-wrap input {
  width: 190px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  background: transparent;
  color: var(--canvas-text);
  font-size: 17px;
  font-weight: 680;
}

.project-title-wrap input:hover,
.project-title-wrap input:focus {
  border-color: rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .06);
}

/* Infinite workspace surface: HTML owns every control and the workflow stage. */
.canvas-page { min-height: 100%; background: var(--canvas-bg); }

/* Canvas surface and project initialization state. */
.canvas-workspace {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background-color: var(--canvas-bg);
}
/* 画布点阵：常显，不随缩放隐藏。 */
.canvas-workspace::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .075) .8px, transparent .8px);
  background-size: 16px 16px;
  opacity: 1;
  transition: opacity .24s ease;
}
.canvas-workspace.is-dots-hidden::before { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .canvas-workspace::before { transition: none; }
}

.workflow-create-loading {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  background: rgba(10, 12, 15, .5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  color: #f4f5f6;
  text-align: center;
  pointer-events: auto;
}
.workflow-create-loading[hidden] { display: none; }
html.is-project-loading .node-board,
html.is-project-loading .workflow-layer { visibility: hidden; }
html.is-project-loading .workflow-create-loading[hidden] { display: grid; }
.workflow-create-loading strong { font-size: 16px; font-weight: 750; }
.workflow-create-loading span { color: #9ea5af; font-size: 12px; }
.workflow-create-loader {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255,255,255,.16);
  border-top-color: #ff8ab2;
  border-right-color: #76c9ed;
  border-radius: 50%;
  animation: workflow-create-spin .8s linear infinite;
  box-shadow: 0 0 20px rgba(255,45,104,.22);
}
@keyframes workflow-create-spin { to { transform: rotate(360deg); } }

/* Vertical creation rail: a floating icon strip that reveals item labels on hover. */
.workflow-add-toolbar {
  position: absolute;
  left: 20px;
  top: 50%;
  z-index: 12;
  transform: translateY(-50%);
  pointer-events: auto;
}
.workflow-add-toolbar[hidden] { display: none; }
.workflow-add-rail {
  position: relative;
  width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, .075);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* One continuous hover surface across the rail and the popped-out labels.
   Once the pointer is anywhere inside it, the labels stay open and clickable. */
.workflow-add-rail::after {
  content: '';
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: -5px;
  right: -110px;
  z-index: 0;
  pointer-events: none;
}
.workflow-add-toolbar:hover .workflow-add-rail::after,
.workflow-add-toolbar:focus-within .workflow-add-rail::after { pointer-events: auto; }
.workflow-add-item {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--canvas-chrome-icon);
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.workflow-add-item:hover,
.workflow-add-item:focus-visible {
  background: rgba(255, 255, 255, .10);
  color: #fff;
  outline: none;
}
.workflow-add-icon { display: grid; place-items: center; }
.workflow-add-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.workflow-add-label {
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  min-width: 96px;
  padding: 7px 12px 7px 16px;
  border-radius: 10px;
  transform: translate(-5px, -50%);
  color: #c3c4ca;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  text-align: left;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .6);
  transition: opacity .18s ease, transform .18s ease, color .18s ease, background .18s ease;
}
/* Reveal every label while the pointer is anywhere in the expanded hover area. */
.workflow-add-toolbar:hover .workflow-add-label,
.workflow-add-toolbar:focus-within .workflow-add-label {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%);
}
/* The hovered row gets a wider, connected background that is easy to click. */
.workflow-add-item:hover .workflow-add-label,
.workflow-add-item:focus-visible .workflow-add-label {
  color: #fff;
  background: rgba(255, 255, 255, .08);
}
.workflow-add-divider {
  width: 26px;
  height: 1px;
  margin: 3px 0;
  background: rgba(255, 255, 255, .06);
}
.workflow-add-empty { padding: 14px 6px; color: #8e98a4; font-size: 12px; line-height: 1.5; text-align: center; }
/* Touch devices cannot hover, so keep the labels visible there. */
@media (hover: none) {
  .workflow-add-label { opacity: 1; pointer-events: auto; transform: translate(0, -50%); }
}
@media (prefers-reduced-motion: reduce) {
  .workflow-add-item, .workflow-add-label { transition: none; }
}

/* Starter node board shown before a workflow is opened. */
.node-board {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 56px 24px 48px;
  pointer-events: none;
}

.node-board-panel {
  width: min(980px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: auto;
}

.node-tabs {
  display: inline-flex;
  align-self: center;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.node-tab {
  position: relative;
  min-width: 112px;
  height: 34px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(235,239,244,.48);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.node-tab:hover,
.node-tab:focus-visible { color: #f5f7fa; outline: none; }

.node-tab:disabled {
  color: rgba(235,239,244,.34);
  cursor: not-allowed;
  opacity: .72;
}

.node-tab-soon {
  position: absolute;
  top: -8px;
  right: -10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffb3c9, #ff8ab2);
  color: #1a1510;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .02em;
  box-shadow: 0 4px 10px rgba(0,0,0,.28);
}

.node-tab.is-active {
  color: #f8fbff;
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.04);
  box-shadow: none;
}

.node-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: 100%;
}

.node-group[hidden] { display: none; }

.node-tab-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.node-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  pointer-events: auto;
}

/* 图片生成入口卡比视频卡更紧凑 */
.image-nodes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}
.image-nodes .node-card {
  flex: 0 1 200px;
  width: 200px;
  min-height: 40px;
  padding: 4px 8px 4px 4px;
  gap: 6px;
}
.image-nodes .node-card-media {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}
.image-nodes .node-name { font-size: 13px; }
.image-nodes .node-card-soon {
  padding: 1px 6px;
  font-size: 9px;
}

.node-card {
  position: relative;
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(28,30,34,.48);
  color: var(--canvas-text);
  font-family: inherit;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.node-card:hover {
  background: rgba(38,41,48,.76);
  box-shadow: none;
}
.node-card.is-loading { cursor: wait; border-color: rgba(255,45,104,.6); box-shadow: 0 0 0 1px rgba(255,45,104,.2), 0 14px 30px rgba(0,0,0,.28); }
.node-card.is-loading .node-name::after { content: ''; display: inline-block; width: 11px; height: 11px; margin-left: 8px; vertical-align: -1px; border: 2px solid rgba(255,255,255,.25); border-top-color: #ff8ab2; border-radius: 50%; animation: upload-spin .75s linear infinite; }

.node-card:focus-visible {
  outline: 2px solid rgba(255,45,104,.85);
  outline-offset: 3px;
}

.node-card.is-selected {
  border-color: var(--canvas-purple);
  background: rgba(255,255,255,.1);
  box-shadow: none;
}

.node-card-media {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  overflow: hidden;
  background: #25282d;
  box-shadow: none;
}
.node-card-media svg { display: none; }
.node-card-media img { width: 100%; height: 100%; display: block; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.node-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 0; }
.node-name { min-width: 0; overflow: visible; color: #f1f3f5; font-size: 14.4px; font-weight: 650; line-height: 1.25; letter-spacing: -.01em; white-space: normal; overflow-wrap: anywhere; }
.node-card-badge { position: absolute; top: 0; right: 10px; z-index: 1; padding: 2px 6px; border: 1px solid rgba(255, 171, 177, .44); border-radius: 999px; background: linear-gradient(135deg, #ff6f78, #e74761); color: #fff7f8; font-size: 10.8px; font-weight: 800; line-height: 1.2; letter-spacing: .08em; box-shadow: 0 3px 9px rgba(231, 71, 97, .28); transform: translateY(-50%); pointer-events: none; }
.node-card-skeleton { pointer-events: none; cursor: wait; }
.node-card.is-coming-soon {
  cursor: not-allowed;
  color: rgba(235,239,244,.55);
  border-color: rgba(255,255,255,.08);
  background: rgba(28,30,34,.28);
  opacity: 1;
}
.node-card.is-coming-soon:hover {
  transform: none;
  border-color: rgba(255,255,255,.08);
  background: rgba(28,30,34,.28);
  box-shadow: none;
}
.node-card.is-coming-soon .node-card-media { opacity: .5; filter: saturate(.65); }
.node-card.is-coming-soon .node-name { color: rgba(235,239,244,.55); }
.node-card-soon {
  flex: none;
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  color: rgba(235,239,244,.62);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .02em;
  white-space: nowrap;
}
.node-card-skeleton .node-card-media { background: rgba(255,255,255,.06); }
.node-skeleton-line {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255,255,255,.07) 20%, rgba(255,255,255,.16) 42%, rgba(255,255,255,.07) 64%);
  background-size: 220% 100%;
  animation: node-skeleton-shimmer 1.35s ease-in-out infinite;
}
.node-skeleton-title { width: 112px; height: 10px; }
@keyframes node-skeleton-shimmer { 0% { background-position: 180% 0; } 100% { background-position: -40% 0; } }

/* Viewport controls and optional minimap. */
.canvas-tools {
  position: absolute;
  left: 62px;
  bottom: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--canvas-chrome-border);
  border-radius: 10px;
  background: var(--canvas-chrome);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .32);
}
.canvas-tools[hidden] { display: none; }
.canvas-bottom-left { position: absolute; left: 18px; bottom: 18px; z-index: 20; display: flex; align-items: center; gap: 8px; }
.canvas-bottom-left[hidden] { display: none; }
.canvas-bottom-left .canvas-tools { position: static; left: auto; bottom: auto; z-index: auto; }
.canvas-bottom-left .workflow-minimap-toggle { position: static; left: auto; bottom: auto; z-index: auto; width: 40px; height: 40px; }
.canvas-minimap-anchor { position: relative; display: flex; align-items: center; height: 40px; }
.canvas-minimap-anchor .workflow-minimap { left: 0; bottom: calc(100% + 8px); }
.canvas-mode-toggle { display: flex; align-items: center; gap: 2px; box-sizing: border-box; height: 40px; padding: 5px; border: 1px solid var(--canvas-chrome-border); border-radius: 10px; background: var(--canvas-chrome); box-shadow: 0 8px 22px rgba(0,0,0,.32); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.canvas-mode-toggle button { display: inline-flex; align-items: center; gap: 5px; height: 28px; min-width: 50px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--canvas-chrome-text); font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s ease, color .15s ease; }
.canvas-mode-toggle button svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.canvas-mode-toggle button:hover { background: var(--canvas-chrome-hover); color: #fff; }
.canvas-mode-toggle button.is-active { background: rgba(255,255,255,.085); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }

.canvas-tools button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--canvas-chrome-icon);
  font-size: 18px;
  cursor: pointer;
}

.canvas-tools button:hover { background: var(--canvas-chrome-hover); }
.canvas-tools span { min-width: 48px; color: var(--canvas-chrome-text); font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.workflow-minimap-toggle {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 21;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--canvas-chrome-border);
  border-radius: 10px;
  background: var(--canvas-chrome);
  color: var(--canvas-chrome-icon);
  box-shadow: 0 8px 22px rgba(0,0,0,.32);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.workflow-minimap-toggle[hidden] { display: none; }
.workflow-minimap-toggle:hover,
.workflow-minimap-toggle:focus-visible,
.workflow-minimap-toggle[aria-expanded="true"] { border-color: rgba(255,255,255,.16); background: #1c1c1e; color: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.32); outline: none; }
.workflow-minimap-toggle:active { transform: translateY(1px); }
.workflow-minimap-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.workflow-minimap-toggle::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 2;
  padding: 6px 9px;
  border: 1px solid var(--canvas-chrome-border);
  border-radius: 7px;
  background: #1c1c1e;
  box-shadow: 0 8px 20px rgba(0,0,0,.28);
  color: #eef1f5;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .15s ease, transform .15s ease;
}
.workflow-minimap-toggle:hover::after,
.workflow-minimap-toggle:focus-visible::after { opacity: 1; transform: translateY(0); }

.workflow-minimap {
  position: absolute;
  left: 18px;
  bottom: 64px;
  z-index: 20;
  width: 156px;
  padding: 0;
}
.workflow-minimap[hidden] { display: none; }
.workflow-minimap-viewport { position: relative; height: 88px; overflow: hidden; border: 1px solid rgba(255,255,255,.07); border-radius: 9px; background: #101010; box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.workflow-minimap-nodes { position: absolute; inset: 0; }
.workflow-minimap-frame { position: absolute; z-index: 3; min-width: 18px; min-height: 14px; border: 1px solid rgba(255,255,255,.85); border-radius: 15px; background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); cursor: move; touch-action: none; transition: background .15s ease, border-color .15s ease; }
.workflow-minimap-frame:hover, .workflow-minimap-frame:focus-visible, .workflow-minimap-frame.is-dragging { border-color: #fff; background: rgba(255,255,255,.1); outline: none; }
.workflow-minimap-node { position: absolute; min-width: 0; min-height: 0; box-sizing: border-box; padding: 0; border: 1px solid rgba(255,255,255,.32); border-radius: 3px; background: rgba(255,255,255,.14); cursor: pointer; transform-origin: center; transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.workflow-minimap-node.image { border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.14); }
.workflow-minimap-node.text { border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.14); }
.workflow-minimap-node:hover, .workflow-minimap-node.is-selected { z-index: 1; border-color: #fff; background: rgba(255,255,255,.62); transform: scale(1.08); }

/* Workflow cards, ports, connections, and selection state. */
.workflow-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  overflow: hidden;
  cursor: default;
  padding: 0;
  touch-action: none;
  overscroll-behavior: none;
}
.workflow-layer.is-panning { cursor: grabbing; }
.workflow-layer.is-hand-mode { cursor: grab; }
.workflow-layer.is-hand-mode.is-panning { cursor: grabbing; }
.workflow-layer.is-dragging-node { cursor: grabbing; }
.workflow-layer.is-group-hover { cursor: move; }
.workflow-selection-box { position: absolute; z-index: 18; pointer-events: none; border: 1px solid rgba(255,255,255,.55); border-radius: 4px; background: rgba(255,255,255,.05); }

/* 画布分组：灰色底衬 + 顶部操作条。底衬在缩放层内，随节点一起缩放。 */
.workflow-groups { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.workflow-group-box { position: absolute; box-sizing: border-box; border: 1px solid var(--canvas-group-border); border-radius: 220px; background: var(--canvas-group-bg); pointer-events: none; }
.workflow-group-box.is-active { background: rgba(255,255,255,.065); border-color: rgba(255,255,255,.10); }
.workflow-group-box-label { position: absolute; left: 110px; top: -170px; color: rgba(255,255,255,.42); font-size: 108px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; }
.workflow-group-bar { position: absolute; top: 0; left: 0; z-index: 22; display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 8px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(28,29,33,.94); box-shadow: 0 12px 30px rgba(0,0,0,.42); color: #eceef2; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); will-change: left, top; }
.workflow-group-bar[hidden] { display: none; }
.workflow-group-bar-title { padding: 0 10px 0 12px; color: rgba(236,239,244,.58); font-size: 12px; font-weight: 600; white-space: nowrap; }
.workflow-group-bar-btn { height: 30px; padding: 0 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: rgba(255,255,255,.06); color: #e9ebef; font-size: 12px; font-weight: 600; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.workflow-group-bar-btn[hidden] { display: none; }
.workflow-group-bar-btn:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); }
.workflow-group-bar-btn[data-group-action="run"] { border: 0; outline: none; background: linear-gradient(135deg,#ff2d68,#ff4d9b); color: #fff; }
.workflow-group-bar-btn[data-group-action="run"]:focus,
.workflow-group-bar-btn[data-group-action="run"]:focus-visible { outline: none; box-shadow: none; }
.workflow-group-bar-btn[data-group-action="run"]:hover { filter: brightness(1.08); }
.workflow-group-bar-btn:disabled { opacity: .55; cursor: wait; }
.workflow-selection-box[hidden] { display: none; }
/* Group backdrop for a finished marquee. It sits behind the cards so the whole
   selection reads as one region, and doubles as the drag handle for the group. */
/* 未打组的多选只是临时选区：底色压到很淡，把"实底衬"留给真正的分组。
   分组底衬（.workflow-group-box）才是常驻的那一层灰。 */
.workflow-selection-region { position: absolute; z-index: 0; border: 1px solid rgba(255,255,255,.32); border-radius: 10px; background: rgba(255,255,255,.035); box-shadow: none; }
.workflow-selection-region.is-canvas-group { border-color: transparent; background: transparent; box-shadow: none; }
.workflow-selection-region[hidden] { display: none; }
.workflow-selection-region.is-dragging { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.06); }
/* 拖拽卡片时的对齐参考线：放在缩放层外面，1px 虚线不会被 10% 的画布缩放吃掉。 */
.workflow-align-guides { position: absolute; inset: 0; z-index: 19; pointer-events: none; }
.workflow-align-guides[hidden] { display: none; }
.workflow-align-guide { position: absolute; height: 0; border-top: 1px dashed rgba(255,255,255,.34); }
.workflow-align-guide[hidden] { display: none; }
.workflow-align-guide::before,
.workflow-align-guide::after { content: ""; position: absolute; top: -3px; width: 1px; height: 7px; background: rgba(255,255,255,.34); }
.workflow-align-guide::before { left: 0; }
.workflow-align-guide::after { right: 0; }
.canvas-context-menu { position: absolute; z-index: 40; min-width: 190px; max-width: min(260px, calc(100vw - 16px)); padding: 6px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; background: #262626; box-shadow: 0 16px 38px rgba(0,0,0,.42); color: #e8e8e8; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.canvas-context-menu[hidden] { display: none; }
.canvas-context-menu-title { padding: 7px 10px 6px; color: #89939f; font-size: 11px; line-height: 1.2; }
.canvas-context-menu button { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 34px; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: #e9edf2; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.canvas-context-menu button:hover, .canvas-context-menu button:focus-visible { background: rgba(255,255,255,.1); color: #fff; outline: none; }
.canvas-context-menu button[data-tone="danger"] { color: #ffb1b1; }
.canvas-context-menu button[data-tone="danger"]:hover, .canvas-context-menu button[data-tone="danger"]:focus-visible { background: rgba(255,108,108,.12); color: #ffd6d6; }
.canvas-context-menu-icon { width: 18px; color: #9fd7ff; text-align: center; font-size: 14px; }
.canvas-context-menu button[data-tone="danger"] .canvas-context-menu-icon { color: currentColor; }
.canvas-context-menu-separator { height: 1px; margin: 5px 4px; background: rgba(255,255,255,.1); }
.workflow-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 12000px;
  height: 4300px;
  transform-origin: 0 0;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

.workflow-connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  overflow: visible;
  /* 画布整体由 CSS transform 缩放，non-scaling-stroke 在这层缩放下不生效；
     连线宽度存的是世界坐标，由 JS 按 zoom 反算，屏幕上始终固定 1.5px。 */
  --workflow-conn-w: 15px; /* 10% 缩放下的 1.5px 屏幕宽度 */
  --workflow-hit-w: 180px; /* 10% 缩放下的 18px 命中区 */
  /* 光晕模糊半径由 JS 按当前缩放反算（世界坐标），屏幕上恒定约 2~3px。 */
  --workflow-flow-blur: 22px;
  --workflow-flow-blur-active: 28px;
}

.workflow-connections path {
  fill: none;
  stroke: #707d8a;
  stroke-width: 1px;
  stroke-linecap: round;
  filter: none;
}
/* 连线宽度、命中区域、光流宽度都按世界坐标换算，避免被画布缩放二次缩小。 */
.workflow-connections path.workflow-connection-hit {
  fill: none;
  stroke: transparent;
  stroke-width: var(--workflow-hit-w);
  stroke-linecap: round;
  pointer-events: stroke;
  cursor: pointer;
}
.workflow-connections path.workflow-connection {
  stroke: #7d8a97;
  stroke-width: var(--workflow-conn-w);
  pointer-events: stroke;
  cursor: pointer;
  transition: stroke .16s ease, stroke-width .16s ease, opacity .16s ease;
  opacity: .8;
}
/* 连线光流：一条略粗于连线的白色亮核贴着连线缓慢流过；光晕分成两层，越靠中间
   越宽、越亮，两端自然收尖，不会在两头留下圆鼓的粗端。三层共用同一套 dash 相位，
   选中节点或任务运行时整体更亮、更快。
   注意：这里的 5.6s / 2.4s 与 canvas.js 里 FLOW_DURATION_* 常量一一对应，
   重绘连线时 JS 会用全局相位补上负延迟，保证动画不从头播放。 */
.workflow-connections path.workflow-connection-flow-halo,
.workflow-connections path.workflow-connection-flow-glow,
.workflow-connections path.workflow-connection-flow {
  fill: none;
  stroke-linecap: butt;
  stroke-dashoffset: 0;
  pointer-events: none;
  animation: workflow-connection-flow 5.6s linear infinite;
}
.workflow-connections path.workflow-connection-flow-halo {
  stroke: #8fcfff;
  stroke-width: calc(var(--workflow-conn-w) * 2);
  opacity: .38;
  stroke-dasharray: 0 60 140 800;
  filter: blur(var(--workflow-flow-blur));
}
.workflow-connections path.workflow-connection-flow-glow {
  stroke: #cfeaff;
  stroke-width: calc(var(--workflow-conn-w) * 1.55);
  opacity: .52;
  stroke-dasharray: 0 30 200 770;
  filter: blur(var(--workflow-flow-blur));
}
.workflow-connections path.workflow-connection-flow {
  stroke: #ffffff;
  stroke-width: calc(var(--workflow-conn-w) * 1.08);
  opacity: .96;
  stroke-linecap: round;
  stroke-dasharray: 260 740;
}
.workflow-connections path.workflow-connection-flow-halo.is-active {
  stroke-width: calc(var(--workflow-conn-w) * 2.15);
  opacity: .5;
  animation-duration: 2.8s;
  filter: blur(var(--workflow-flow-blur-active));
}
.workflow-connections path.workflow-connection-flow-glow.is-active {
  stroke-width: calc(var(--workflow-conn-w) * 1.7);
  opacity: .66;
  animation-duration: 2.8s;
  filter: blur(var(--workflow-flow-blur-active));
}
.workflow-connections path.workflow-connection-flow.is-active {
  opacity: 1;
  stroke-width: calc(var(--workflow-conn-w) * 1.25);
  animation-duration: 2.8s;
}
.workflow-connections path.workflow-connection-preview {
  fill: none;
  stroke: #cfd4d9;
  stroke-width: calc(var(--workflow-conn-w) * 1.05);
  stroke-linecap: round;
  opacity: .92;
  pointer-events: none;
}
.workflow-connections path.workflow-connection:hover { stroke: #9aa6b2; stroke-width: calc(var(--workflow-conn-w) * 1.12); opacity: .95; }
.workflow-connections path.workflow-connection.is-selected { stroke: #d0d8df; stroke-width: calc(var(--workflow-conn-w) * 1.2); opacity: 1; }
.workflow-connections path.workflow-connection.is-active,
.workflow-connections path.workflow-connection.is-active.is-selected {
  stroke: #d7dde3;
  stroke-width: calc(var(--workflow-conn-w) * 1.22);
  opacity: 1;
}
.workflow-connections path.workflow-connection.is-active.is-selected { stroke-width: calc(var(--workflow-conn-w) * 1.28); }
.workflow-edge .workflow-connection-remove { opacity: 0; pointer-events: none; transition: opacity .16s ease, transform .16s ease; }
.workflow-edge:hover .workflow-connection-remove,
.workflow-edge:focus-within .workflow-connection-remove { opacity: 1; pointer-events: all; }
.workflow-connection-remove { cursor: pointer; }
.workflow-connection-remove circle { fill: #262626; stroke: rgba(255, 255, 255, .16); stroke-width: 7px; transition: fill .16s ease, stroke .16s ease, transform .16s ease; pointer-events: all; }
.workflow-connections .workflow-connection-remove path { fill: none; stroke: #e8e8e8; stroke-width: 15px; stroke-linecap: round; pointer-events: none; }
.workflow-connection-remove:hover circle,
.workflow-connection-remove:focus circle { fill: #303030; stroke: rgba(255, 255, 255, .32); transform: scale(1.08); }
@keyframes workflow-connection-flow {
  0% { stroke-dashoffset: 1000px; }
  100% { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .workflow-connections path.workflow-connection-flow,
  .workflow-connections path.workflow-connection-flow-glow,
  .workflow-connections path.workflow-connection-flow-halo { animation: none; opacity: 0; }
}

.workflow-node {
  position: absolute;
  width: 340px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: grab;
  user-select: none;
  transition: box-shadow .18s ease, border-color .18s ease, background .18s ease, filter .18s ease;
}
.workflow-node:active { cursor: grabbing; }
.workflow-node.is-dragging { filter: drop-shadow(0 18px 36px rgba(0,0,0,.45)); }
/* 拖动时卡片会加 drop-shadow，子树里的 <video> 每帧重新栅格化就会闪；
   拖动期间把视频提升成独立合成层，避免跟着重绘。 */
.workflow-layer.is-dragging-node .workflow-video-preview,
.workflow-layer.is-dragging-node .workflow-video-blur,
.workflow-layer.is-dragging-node .vcp-ref video { transform: translateZ(0); backface-visibility: hidden; }
.workflow-node:hover .workflow-image-preview,
.workflow-node:hover .video-preview-placeholder,
.workflow-node:hover .workflow-generic-preview,
.workflow-output-card:hover .workflow-output-preview {
  border-color: rgba(255,255,255,.34);
}
.workflow-node.is-selected,
.workflow-output-card.is-selected {
  filter: drop-shadow(0 0 12px rgba(255,255,255,.10));
}
.workflow-node.is-selected .workflow-image-preview,
.workflow-node.is-selected .video-preview-placeholder,
.workflow-node.is-selected .workflow-generic-preview,
.workflow-output-card.is-selected .workflow-output-preview { border-color: rgba(255,255,255,.66); }
/* 整组执行失败：把停下来时的那张卡标红，方便一眼看到是谁失败的。 */
.workflow-node.is-run-failed .workflow-image-preview,
.workflow-node.is-run-failed .video-preview-placeholder,
.workflow-node.is-run-failed .workflow-generic-preview,
.workflow-output-card.is-run-failed .workflow-output-preview { border-color: rgba(255,96,96,.78); }
.workflow-node.is-run-failed,
.workflow-output-card.is-run-failed { filter: drop-shadow(0 0 14px rgba(255,72,72,.3)); }
.workflow-node[hidden],
.workflow-output-card[hidden] { display: none; }
.workflow-node:hover,
.workflow-output-card:hover { filter: brightness(1.04); }

/* 执行图片节点优先使用 canvas_layout 的宽高，预览区填满剩余高度。 */
.workflow-node.has-custom-layout {
  display: flex;
  flex-direction: column;
}
.workflow-node.has-custom-layout .workflow-node-header { flex: none; }
.workflow-node.has-custom-layout .workflow-image-preview,
.workflow-node.has-custom-layout .workflow-generic-preview,
.workflow-node.has-custom-layout .video-preview-placeholder {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto !important;
}
/* 删除节点：先变暗表示「正在删除」，再缩放淡出，连接到它的线一起淡出。 */
.workflow-node.is-deleting,
.workflow-output-card.is-deleting { pointer-events: none; opacity: .5; filter: brightness(.72) saturate(.65); transition: opacity .2s ease, filter .2s ease; }
.workflow-node.is-removing,
.workflow-output-card.is-removing { pointer-events: none; transform-origin: center; will-change: transform, opacity; animation: workflow-node-out .34s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes workflow-node-out {
  0% { opacity: 1; transform: scale(1); }
  30% { opacity: .88; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(.86); }
}
.workflow-edge.is-removing { animation: workflow-edge-out .3s ease forwards; }
@keyframes workflow-edge-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .workflow-node.is-removing,
  .workflow-output-card.is-removing { animation: none; opacity: 0; }
  .workflow-edge.is-removing { animation: none; opacity: 0; }
}

.image-workflow-node { left: 220px; top: 0; width: 2287px; }
.video-workflow-node { left: 3900px; top: 100px; width: 3960px; }
.generated-workflow-node { width: 2287px; }
/* 图片、视频上传卡使用完全相同的固定 16:9 尺寸。
   上传不同比例的素材只改变预览内容，不再改变节点外框。 */
.workflow-node[data-execution="false"].image-workflow-node[data-node-key="source_image"],
.workflow-node[data-execution="false"].video-workflow-node[data-node-key="source_video"] { width: 3461px; }
.workflow-node[data-execution="true"].video-workflow-node { width: 4356px; }
.workflow-node[data-execution="true"].image-workflow-node { width: 2928px; }
.workflow-node[data-execution="true"].text-workflow-node { width: 4792px; }
.workflow-node[data-execution="true"].video-workflow-node[data-video-ratio="9:16"] { width: 2635px; }
.workflow-node[data-execution="true"].video-workflow-node[data-video-ratio="16:9"] { width: 4792px; }
.workflow-node[data-execution="true"].video-workflow-node[data-video-ratio="1:1"] { width: 3461px; }
/* Product-image cards use the same ratio dimensions as theUGC 带货视频 card.
   The preview aspect-ratio and card width therefore change together. */
.workflow-node[data-execution="true"].image-workflow-node[data-image-ratio="9:16"] { width: 2635px; }
.workflow-node[data-execution="true"].image-workflow-node[data-image-ratio="16:9"] { width: 4792px; }
.workflow-node[data-execution="true"].image-workflow-node[data-image-ratio="1:1"] { width: 3461px; }
.workflow-node[data-execution="true"].image-workflow-node[data-image-ratio="3:2"] { width: 4392px; }
.workflow-node[data-execution="true"].image-workflow-node[data-image-ratio="2:3"] { width: 2928px; }
.workflow-node-header,
.workflow-output-label {
  display: flex;
  align-items: center;
  gap: 42px;
}

.workflow-node-header { min-height: 210px; gap: 24px; padding: 0 12px; flex-wrap: wrap; }
.workflow-node-title { color: #f3f4f6; font-size: calc(150px * min(var(--wf-type-scale, 1), 1.25)); font-weight: 750; }
.workflow-node-kind { display: inline-flex; align-items: center; gap: 20px; padding: 18px 0; border: 0; border-radius: 0; background: transparent; color: #aeb4bd; font-size: calc(92px * min(var(--wf-type-scale, 1), 1.45)); font-weight: 700; line-height: 1.1; }
.node-kind-icon { width: 1.5em; height: 1.5em; flex: 0 0 1.5em; display: grid; place-items: center; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; font-size: 1em; line-height: 1; opacity: .92; }
.node-kind-icon svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: inherit; stroke-linecap: inherit; stroke-linejoin: inherit; }
.workflow-node-kind .workflow-node-title { color: inherit; font-size: inherit; line-height: inherit; }
.workflow-image-preview,
.video-preview-placeholder,
.workflow-output-preview {
  position: relative;
  overflow: hidden;
  margin-top: 34px;
  border-radius: 44px;
  background: #262626;
}
.workflow-generic-preview { position: relative; aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 56px; border: 8px solid var(--canvas-card-border); border-radius: 44px; background: #262626; color: #a5a5a5; font-size: calc(118px * min(var(--wf-type-scale, 1), 1.45)); }
/* 上传视频卡默认 16:9，和 UGC 带货视频卡片一致。 */
.workflow-generic-preview.video { aspect-ratio: var(--video-preview-ratio, 16 / 9); }
.workflow-node[data-execution="false"].video-workflow-node .workflow-generic-preview { margin-top: 34px; font-size: 138px; }
.workflow-generic-preview.has-upload .image-upload { background: rgba(8,10,14,.72); border-color: rgba(255,255,255,.72); color: #fff; box-shadow: 0 0 0 12px rgba(0,0,0,.24), 0 12px 32px rgba(0,0,0,.34); }
.workflow-generic-preview.has-upload > .generic-preview-icon,
.workflow-generic-preview.has-upload > span:last-child { display: none; }
.workflow-generic-preview.text { align-items: flex-start; padding: 0 120px; box-sizing: border-box; }
.workflow-node[data-node-kind="text"][data-execution="true"] .workflow-generic-preview.text { display: flex; align-items: center; justify-content: center; gap: 108px; margin-top: 34px; padding: 0 120px; text-align: center; aspect-ratio: 16 / 9; }
.workflow-node[data-node-kind="text"][data-execution="true"] .workflow-generic-preview.text .generic-preview-icon { color: #aeb4bd; font-size: 301px; line-height: 1; }
.workflow-node[data-node-kind="text"][data-execution="true"] .workflow-generic-preview.text > span:last-child { font-size: 1em; line-height: 1.55; }
.workflow-generic-preview.text.has-text-output { display: block; padding: 0; overflow: hidden; text-align: left; }
.workflow-generic-preview.text.has-text-output > .generic-preview-icon,
.workflow-generic-preview.text.has-text-output > span { display: none; }
.workflow-text-output-scroll {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 90px 100px;
  overflow: auto;
  user-select: text;
  -webkit-user-select: text;
}
.workflow-text-output {
  width: 100%;
  margin: 0;
  color: #e9edf3;
  font-size: 1em;
  line-height: 1.55;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}
.workflow-copy-output { width: 300px; height: 300px; opacity: .72; pointer-events: auto; }
.workflow-node:hover .workflow-copy-output,
.workflow-copy-output:focus-visible { opacity: 1; }
.workflow-copy-output .copy-icon { width: 140px; height: 140px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.generic-preview-icon { color: #aeb4bd; font-size: calc(210px * min(var(--wf-type-scale, 1), 1.45)); line-height: 1; }
.generic-preview-icon svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.workflow-node[data-execution="false"].video-workflow-node .workflow-generic-preview .generic-preview-icon { font-size: 138px; }
.workflow-node[data-execution="false"].video-workflow-node .workflow-generic-preview > span:nth-of-type(2) { font-size: 138px; }
.workflow-source-textarea { width: 100%; height: 100%; min-height: 5em; box-sizing: border-box; resize: none; border: 0; outline: 0; background: transparent; color: #edf2f7; font: inherit; font-size: .72em; line-height: 1.25; }
.workflow-source-textarea::placeholder { color: #727b87; }

.workflow-image-preview { aspect-ratio: 9 / 16; border: 8px solid var(--canvas-card-border); }

/* 上传图片比例和卡片不一致时，空白区域用同一张图的模糊副本填充。 */
.workflow-image-preview.has-blur-bg::before {
  content: "";
  position: absolute;
  inset: -120px;
  z-index: 0;
  background-image: var(--image-blur-url);
  background-position: center;
  background-size: cover;
  filter: blur(110px) brightness(.52) saturate(1.12);
  transform: scale(1.08);
  pointer-events: none;
}
.workflow-image-preview.has-blur-bg > img {
  position: relative;
  z-index: 1;
  background: transparent !important;
}
/* 上传卡始终使用固定 16:9 画框；素材按 contain 完整展示，由模糊副本填充留白。 */
.workflow-node[data-execution="false"].image-workflow-node[data-node-key="source_image"] .workflow-image-preview,
.workflow-node[data-execution="false"].video-workflow-node[data-node-key="source_video"] .workflow-generic-preview.video { aspect-ratio: 16 / 9 !important; }
.workflow-image-preview img:not([src]),
.workflow-image-preview img[src=""] { display: none; }
.workflow-image-preview img,
.workflow-output-preview img { width: 100%; height: 100%; display: block; object-fit: cover; -webkit-user-drag: none; user-select: none; }
/* 上传来源图不裁切：任意 9:16 / 16:9 / 非标准比例都完整展示。 */
.workflow-node[data-execution="false"].image-workflow-node .workflow-image-preview img { object-fit: contain; background: #0e1014; }
.workflow-image-thumbnails { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; width: 100%; margin-top: 0; overflow: visible; padding: 24px; border: 1px solid var(--canvas-panel-border); border-radius: 28px; background: rgba(255,255,255,.06); box-shadow: 0 18px 36px rgba(0,0,0,.22); }
.workflow-image-thumbnails[hidden] { display: none; }
.workflow-image-thumbnails .image-card { position: relative; min-width: 0; aspect-ratio: 1 / 1; overflow: visible; border: 4px solid transparent; border-radius: 24px; background: #262626; cursor: pointer; box-shadow: 0 12px 24px rgba(0,0,0,.24); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.workflow-image-thumbnails .image-card:hover { box-shadow: 0 18px 34px rgba(0,0,0,.32); }
.workflow-image-thumbnails .image-card.is-active { border-color: #ff8ab2; box-shadow: 0 0 0 4px rgba(255,45,104,.24), 0 18px 34px rgba(0,0,0,.3); }
.workflow-image-thumbnails .image-card img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 20px; }
.image-card-remove { position: absolute; top: 0; right: 0; z-index: 3; width: 240px; height: 240px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 0; background: transparent; color: #fff; cursor: pointer; pointer-events: auto; opacity: 0; transform: translateY(-3px); box-shadow: none; transition: opacity .16s ease, transform .16s ease, color .16s ease; }
.image-card-remove svg { width: 128px; height: 128px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 5px 10px rgba(0,0,0,.78)); }
.image-card:hover .image-card-remove,
.image-card:focus-within .image-card-remove,
.image-card-remove:hover,
.image-card-remove:focus-visible { opacity: 1; transform: none; }
.image-card-remove:hover { color: #ff7a84; background: transparent; }
.workflow-image-preview.has-multiple .image-upload { width: 180px; height: 180px; border-radius: 24px !important; }
.workflow-image-preview.has-multiple .image-upload .upload-icon { width: 84px; height: 84px; }
.workflow-image-preview.has-image .image-material-label { display: none; }
.workflow-image-preview.has-image .image-upload { background: rgba(8,10,14,.72); border-color: rgba(255,255,255,.72); color: #fff; box-shadow: 0 0 0 12px rgba(0,0,0,.24), 0 12px 32px rgba(0,0,0,.34); }
.workflow-image-preview.has-image .upload-icon { opacity: 1; }
.workflow-image-preview.has-image .upload-status,
.workflow-image-preview.has-image .upload-retry { background: rgba(8,10,14,.84); }
.workflow-video-preview { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; display: block; object-fit: cover; background: #000; }

/* 视频上传：完整画面 contain，空白区域用同一视频的模糊层填充，和图片上传一致。 */
.workflow-video-blur {
  position: absolute;
  inset: -120px;
  z-index: 0;
  width: calc(100% + 240px);
  height: calc(100% + 240px);
  object-fit: cover;
  filter: blur(110px) brightness(.52) saturate(1.12);
  transform: scale(1.06);
  pointer-events: none;
}
.workflow-node[data-execution="false"] .workflow-video-preview {
  z-index: 1;
  object-fit: contain;
  background: transparent;
}
.workflow-generic-preview.has-video .generic-preview-icon,
.workflow-generic-preview.has-video > span { display: none; }
.video-preview-placeholder.has-video > span { display: none; }
.workflow-generic-preview.has-video { overflow: hidden; }
.workflow-running-dots {
  display: inline-flex;
  align-items: center;
  gap: .32em;
  color: rgba(255, 255, 255, .82);
}
.workflow-running-dots i {
  width: .48em;
  height: .48em;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 .16em rgba(255, 255, 255, .58);
  animation: workflow-running-dot 1.2s ease-in-out infinite;
}
.workflow-running-status { display: inline-flex; flex-direction: column; align-items: center; gap: .26em; }
.workflow-running-eta {
  font-size: .8em;
  font-weight: 500;
  line-height: 1;
  letter-spacing: .05em;
  color: rgba(255, 255, 255, .45);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  animation: workflow-running-eta-in .45s ease both;
}
@keyframes workflow-running-eta-in { from { opacity: 0; } to { opacity: 1; } }
.workflow-running-dots i:nth-child(1) { animation-delay: 0s; }
.workflow-running-dots i:nth-child(2) { animation-delay: .14s; }
.workflow-running-dots i:nth-child(3) { animation-delay: .28s; }
@keyframes workflow-running-dot {
  0%, 100% { opacity: .25; transform: scale(.72); }
  50% { opacity: 1; transform: scale(1); }
}
.workflow-video-controlbar { position: absolute; left: 36px; right: 36px; bottom: 36px; z-index: 3; height: 384px; display: flex; align-items: center; gap: 36px; padding: 0 38px; border: 0; border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.workflow-video-btn { width: 235px; height: 235px; flex: 0 0 235px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; background: rgba(255,255,255,.08); color: rgba(255,255,255,.9); cursor: pointer; transition: background .16s ease, transform .16s ease, border-color .16s ease; }
.workflow-video-btn:hover { border-color: rgba(255,255,255,.20); background: rgba(255,255,255,.14); transform: scale(1.03); }
.workflow-video-btn:active { transform: scale(.97); }
.workflow-video-btn svg { width: 120px; height: 120px; fill: currentColor; }
.workflow-video-btn.is-mute svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.workflow-video-btn .pause-shape { display: none; }
.workflow-video-btn.is-playing .play-shape { display: none; }
.workflow-video-btn.is-playing .pause-shape { display: block; }
.workflow-video-btn .mute-shape { display: none; }
.workflow-video-btn.is-muted .sound-wave { display: none; }
.workflow-video-btn.is-muted .mute-shape { display: block; }
.workflow-video-range { flex: 1; min-width: 0; height: 36px; -webkit-appearance: none; appearance: none; border-radius: 999px; background: rgba(255,255,255,.13); outline: none; cursor: pointer; }
.workflow-video-range::-webkit-slider-runnable-track { height: 36px; border-radius: 999px; background: rgba(255,255,255,.13); }
.workflow-video-range::-webkit-slider-thumb { -webkit-appearance: none; width: 50px; height: 50px; margin-top: -7px; border: 2px solid rgba(255,255,255,.82); border-radius: 50%; background: #eef1f5; box-shadow: 0 4px 10px rgba(0,0,0,.22); transition: transform .16s ease, background .16s ease; }
.workflow-video-range::-webkit-slider-thumb:hover { transform: scale(1.08); background: #ffffff; }
.workflow-video-range::-moz-range-track { height: 36px; border-radius: 999px; background: rgba(255,255,255,.13); }
.workflow-video-range::-moz-range-thumb { width: 50px; height: 50px; border: 2px solid rgba(255,255,255,.82); border-radius: 50%; background: #eef1f5; }
.workflow-video-time { flex: 0 0 auto; min-width: 252px; color: #d9dee6; font-size: 79px; font-weight: 650; line-height: 1; letter-spacing: .02em; text-align: right; font-variant-numeric: tabular-nums; }
.image-material-label { position: absolute; left: 50%; top: 59%; display: inline-flex; flex-direction: column; align-items: center; gap: 30px; transform: translate(-50%, -50%); color: #7c838d; font-size: calc(138px * min(var(--wf-type-scale, 1), 1.4)); font-weight: 650; line-height: 1; letter-spacing: 0; white-space: nowrap; pointer-events: none; }
/* 源图片卡片和视频上传卡对齐：中间是图标 + 「图片上传」，和视频卡同样大小。 */
.workflow-node[data-execution="false"].image-workflow-node .image-material-label { gap: 56px; top: 50%; color: #a5a5a5; font-size: 138px; font-weight: 500; }
.image-material-icon { width: 1em; height: 1em; flex: 0 0 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
/* Match generated image placeholders to the same visual rhythm as video/text cards. */
.workflow-node[data-execution="true"] .image-material-label { top: 50%; gap: 108px; font-size: 138px; }
.workflow-node[data-execution="true"] .image-material-icon { width: 301px; height: 301px; flex-basis: 301px; }
/* 图片工具只在点击图片时出现，悬浮在卡片上方的轻量操作条。 */
/* 图片工具：参考顶部操作条的扁平深色长条，图标 + 文字，不做彩色图标块。 */
/* 图片工具：参考浅色悬浮工具条，缩小、圆润、无多余描边。 */
.workflow-image-capabilities {
  position: absolute;
  left: 0;
  right: auto;
  bottom: calc(100% + 80px);
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: stretch;
  gap: 4px;
  width: 4200px;
  box-sizing: border-box;
  padding: 40px;
  border: 0;
  border-radius: 100px;
  background: rgba(250,250,251,.98);
  box-shadow: 0 8px 24px rgba(0,0,0,.16);
  pointer-events: auto;
}
.workflow-node.has-image.is-tools-open .workflow-image-capabilities { display: flex; }
.workflow-node.is-generating .workflow-image-capabilities { display: none !important; }
.workflow-image-tool {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 300px;
  padding: 0 8px;
  border: 0;
  border-radius: 100px;
  background: transparent;
  color: #3a3d42;
  font: inherit;
  font-size: 110px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
.workflow-image-tool:hover {
  background: rgba(18,20,24,.06);
  color: #111317;
}
.workflow-image-tool:focus-visible { outline: 1px solid rgba(20,22,26,.5); outline-offset: 2px; }
.workflow-image-tool:disabled,
.workflow-image-tool.is-busy { opacity: .5; cursor: wait; }
.workflow-image-tool-icon {
  width: 180px;
  height: 180px;
  flex: 0 0 180px;
  display: grid;
  place-items: center;
  color: #4b4f55;
}
.workflow-image-tool-icon svg {
  width: 180px;
  height: 180px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.workflow-image-tool-name {
  font-size: 110px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
/* 图片结果节点生成中：复用视频卡片的三点进度，不改变卡片原色。 */
.workflow-image-progress {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.workflow-image-progress .workflow-running-dots {
  /* 与视频生成卡片上的三个点完全一致：字号、间距、颜色、动画都复用同一套。 */
  font-size: 118px;
  gap: .32em;
}
.workflow-node.is-generating .workflow-image-preview .image-material-label,
.workflow-node.is-generating .workflow-image-preview .image-upload {
  display: none;
}
.workflow-node.is-tool-busy .workflow-image-capabilities { display: none !important; }
.image-upload { position: absolute; left: auto; right: 42px; top: 42px; z-index: 2; width: 260px; height: 260px; box-sizing: border-box; padding: 0; border: 2px solid rgba(255,255,255,.10); border-radius: 30px !important; outline: 0; appearance: none; -webkit-appearance: none; overflow: hidden; background: rgba(255,255,255,.08); color: #f1f3f6; cursor: pointer; display: grid; place-items: center; transform: none; transition: background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease; }
.image-upload:hover { color: #fff; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.20); box-shadow: 0 8px 18px rgba(0,0,0,.18); transform: scale(1.02); }
.image-upload:disabled { cursor: wait; opacity: .9; }
.image-upload.image-download {
  right: var(--wf-download-offset, 42px);
  top: var(--wf-download-offset, 42px);
  width: var(--wf-download-size, 260px);
  height: var(--wf-download-size, 260px);
  border: 0;
  border-radius: 0 !important;
  overflow: visible;
  background: transparent;
  box-shadow: none;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-3px);
}
.image-upload.image-download::before {
  content: "";
  position: absolute;
  inset: 0;
  width: var(--wf-download-visual-size, 260px);
  height: var(--wf-download-visual-size, 260px);
  margin: auto;
  z-index: 0;
  border: var(--wf-download-border-width, 2px) solid rgba(255,255,255,.28);
  border-radius: var(--wf-download-radius, 30px);
  background: rgba(18,20,24,.34);
  box-shadow: 0 3px 10px rgba(0,0,0,.18);
  pointer-events: none;
}
.workflow-node:hover .image-upload.image-download,
.image-upload.image-download:focus-visible,
.image-upload.image-download.is-downloading,
.image-upload.image-download.is-download-success,
.image-upload.image-download.is-download-error { opacity: 1; pointer-events: auto; transform: none; }
/* 生成完成后下载入口常驻，不再要求先 hover 卡片再准确移到角落。 */
.video-preview-placeholder.has-video > .image-upload.image-download,
.workflow-generic-preview.has-video > .image-upload.image-download,
.workflow-image-preview.has-image > .image-upload.image-download {
  opacity: 1;
  pointer-events: auto;
  transform: none;
  touch-action: manipulation;
}
.video-preview-placeholder.has-video > .image-upload.image-download:hover,
.workflow-generic-preview.has-video > .image-upload.image-download:hover,
.workflow-image-preview.has-image > .image-upload.image-download:hover {
  transform: scale(1.04);
}
.video-preview-placeholder.has-video > .image-upload.image-download:hover::before,
.workflow-generic-preview.has-video > .image-upload.image-download:hover::before,
.workflow-image-preview.has-image > .image-upload.image-download:hover::before {
  background: rgba(18,20,24,.5);
  border-color: rgba(255,255,255,.48);
}
.video-preview-placeholder.has-video > .image-upload.image-download:active,
.workflow-generic-preview.has-video > .image-upload.image-download:active,
.workflow-image-preview.has-image > .image-upload.image-download:active {
  transform: scale(.96);
}
.upload-icon { width: 120px; height: 120px; padding: 0; border: 0; border-radius: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .94; background: transparent; }
.download-icon { position: relative; z-index: 1; width: var(--wf-download-icon-size, 120px); height: var(--wf-download-icon-size, 120px); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.image-upload.image-download.is-downloading .download-icon,
.image-upload.image-download.is-download-success .download-icon,
.image-upload.image-download.is-download-error .download-icon { display: none; }
.image-upload.image-download.is-downloading::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 2;
  width: var(--wf-download-spinner-size, 88px);
  height: var(--wf-download-spinner-size, 88px);
  border: var(--wf-download-spinner-border, 10px) solid rgba(255,255,255,.2);
  border-top-color: #ff8ab2;
  border-radius: 50%;
  animation: upload-spin .72s linear infinite;
}
.image-upload.image-download.is-download-success {
  color: #dffff0;
}
.image-upload.image-download.is-download-success::before {
  border-color: rgba(113,226,172,.46);
  background: rgba(27,113,76,.44);
}
.image-upload.image-download.is-download-success::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 2;
  width: var(--wf-download-state-size, 118px);
  height: var(--wf-download-state-size, 118px);
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12.5l5 5L20 6.5' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: download-success-pop .34s cubic-bezier(.2,.8,.2,1) both;
}
.image-upload.image-download.is-download-error {
  color: #ffe1e1;
  animation: download-error-shake .34s ease-in-out;
}
.image-upload.image-download.is-download-error::before {
  border-color: rgba(255,126,126,.46);
  background: rgba(122,35,45,.46);
}
.image-upload.image-download.is-download-error::after {
  content: "!";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  z-index: 2;
  color: #ffd1d1;
  font-size: var(--wf-download-state-size, 116px);
  font-weight: 800;
  line-height: 1;
  text-align: center;
}
@keyframes download-success-pop {
  0% { opacity: 0; transform: scale(.55); }
  70% { opacity: 1; transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes download-error-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(calc(var(--wf-download-visual-size, 260px) * -.08)); }
  50% { transform: translateX(calc(var(--wf-download-visual-size, 260px) * .07)); }
  75% { transform: translateX(calc(var(--wf-download-visual-size, 260px) * -.045)); }
}
.upload-spinner { display: none; width: 90px; height: 90px; border: 10px solid rgba(255,255,255,.26); border-top-color: #ff8ab2; border-radius: 50%; animation: upload-spin .75s linear infinite; }
.image-upload.is-uploading .upload-icon { display: none; }
.image-upload.is-uploading .upload-spinner { display: block; }
.upload-status { position: absolute; left: 77px; bottom: 69px; padding: 31px 62px; border-radius: 999px; background: rgba(12,14,18,.75); color: #aeb4bd; font-size: 96px; opacity: 0; transform: translateY(31px); transition: .2s ease; }
.upload-status:not(:empty) { opacity: 1; transform: translateY(0); }
.upload-status.is-success { color: #8fe1bd; }
.upload-status.is-error { color: #ff9d9d; }
.upload-retry { position: absolute; right: 77px; bottom: 69px; display: none; padding: 31px 62px; border: 0; border-radius: 999px; background: rgba(12,14,18,.75); color: #ff8ab2; font-size: 96px; cursor: pointer; }
.upload-retry:hover { background: rgba(255,45,104,.92); color: #ffffff; }
.upload-status.is-error ~ .upload-retry { display: block; }
@keyframes upload-spin { to { transform: rotate(360deg); } }

/* ---------- 图片素材卡片：右上角上传入口 + hover 三类上传 ---------- */
/* 上传入口和视频上传一致，固定在卡片右上角；hover / 键盘聚焦时展开三类上传方式。 */
.canvas-media-upload {
  position: absolute;
  top: 42px;
  right: 42px;
  z-index: 5;
  width: 260px;
  height: 260px;
}
.canvas-media-upload .canvas-media-trigger {
  position: relative;
  top: auto;
  right: auto;
  left: auto;
}
.canvas-media-menu {
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-sizing: border-box;
  width: 1320px;
  padding: 50px;
  border: 10px solid rgba(255,255,255,.07);
  border-radius: 120px;
  background: rgba(22,23,26,.98);
  box-shadow: 0 180px 400px rgba(0,0,0,.5);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity .14s ease, transform .14s ease;
}
/* 悬浮桥：从按钮移到菜单时不会因为中间 16px 间隙丢掉 hover。 */
.canvas-media-menu::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -16px;
  height: 16px;
}
.canvas-media-upload:hover .canvas-media-menu,
.canvas-media-upload:focus-within .canvas-media-menu {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}
.canvas-media-menu-item {
  display: flex;
  align-items: center;
  gap: 70px;
  width: 100%;
  min-height: 280px;
  padding: 0 90px;
  border: 0;
  border-radius: 80px;
  background: transparent;
  color: #dfe2e7;
  font: inherit;
  font-size: 120px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-align: left;
  cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.canvas-media-menu-item svg {
  width: 130px;
  height: 130px;
  flex: 0 0 130px;
  fill: none;
  stroke: #8f959d;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .14s ease;
}
.canvas-media-menu-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.canvas-media-menu-item:hover svg { stroke: #fff; }
/* 上传图片后入口隐藏，只保留右上角 hover 出现的删除按钮。 */
.workflow-image-preview.has-image .canvas-media-upload { display: none; }
/* 视频上传卡同理：有视频后只保留 hover 删除按钮。 */
.workflow-generic-preview.has-upload .canvas-media-upload--video { display: none; }
/* 上传状态/重试浮在悬停遮罩和三个入口之上，保持可见。 */
.workflow-image-preview .upload-status,
.workflow-image-preview .upload-retry { z-index: 4; }
/* 单张图片/视频右上角的移除按钮：有素材时出现，点击同时清节点引用和 TOS。 */
.workflow-media-remove {
  position: absolute;
  top: 60px;
  right: 60px;
  z-index: 5;
  width: 240px;
  height: 240px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 4px solid rgba(255,120,130,.3);
  border-radius: 50%;
  background: rgba(42,12,15,.72);
  color: #ff9aa0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 22px rgba(0,0,0,.28);
  transition: opacity .16s ease, background .16s ease, border-color .16s ease, transform .16s ease;
}
.workflow-media-remove svg {
  width: 120px;
  height: 120px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.workflow-media-remove:hover {
  background: rgba(158,32,42,.9);
  border-color: rgba(255,130,138,.7);
  color: #fff;
  transform: scale(1.06);
}
.workflow-image-preview.has-image:hover .workflow-media-remove,
.workflow-image-preview.has-image:focus-within .workflow-media-remove,
.workflow-generic-preview.has-upload:hover .workflow-media-remove,
.workflow-generic-preview.has-upload:focus-within .workflow-media-remove {
  opacity: 1;
  pointer-events: auto;
}
/* 视频上传后隐藏替换入口，只能先删再重新上传，和图片卡片一致。 */
.workflow-generic-preview.has-upload .workflow-node-upload { display: none; }

.video-preview-placeholder { aspect-ratio: var(--video-preview-ratio, 16 / 9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 108px; color: #a5a5a5; font-size: 138px; border: 8px solid var(--canvas-card-border); }
.video-play-mark { color: #8b8f94; font-size: 301px; line-height: 1; }
.node-port { --port-lure-x: 0px; --port-lure-y: 0px; position: absolute; z-index: 3; width: 190px; height: 190px; display: grid; place-items: center; padding: 0; border: 4px solid rgba(255, 255, 255, .5); border-radius: 50%; background: #15171a; color: #e8e8e8; font-size: 116px; line-height: 1; cursor: pointer; opacity: 0; pointer-events: none; transform: translate3d(var(--port-lure-x), var(--port-lure-y), 0) scale(1); box-shadow: 0 0 0 19px rgba(14,16,19,.92), 0 19px 56px rgba(0,0,0,.3); transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease, opacity .16s ease; }
.workflow-node:hover .node-port,
.workflow-output-card:hover .node-port,
.workflow-node.is-approached .node-port,
.workflow-output-card.is-approached .node-port,
.node-port.is-connecting,
.node-port.is-drop-target,
.node-port.is-drop-target-invalid,
.node-port.is-port-magnet { opacity: 1; pointer-events: auto; }
.node-port.is-port-magnet { transition: none; }
.workflow-node.is-approached .node-port:not(.is-drop-target):not(.is-drop-target-invalid),
.workflow-output-card.is-approached .node-port:not(.is-drop-target):not(.is-drop-target-invalid) { transform: translate3d(var(--port-lure-x), var(--port-lure-y), 0) scale(1.08); }
.node-port:hover,
.node-port:focus-visible { transform: translate3d(var(--port-lure-x), var(--port-lure-y), 0) scale(1.14); border-color: #fff; background: #1a1c1e; box-shadow: 0 0 0 22px rgba(14,16,19,.92); outline: none; }
.node-port.is-connecting { border-color: #fff; background: #262626; box-shadow: 0 0 0 22px rgba(14,16,19,.92); }
.node-port.is-drop-target { transform: translate3d(var(--port-lure-x), var(--port-lure-y), 0) scale(1.38); border-color: #fff; background: #2e2e2e; color: #fff; box-shadow: 0 0 0 22px rgba(14,16,19,.92); }
.node-port.is-drop-target-invalid { transform: translate3d(var(--port-lure-x), var(--port-lure-y), 0) scale(1.16); border-color: rgba(255, 255, 255, .35); background: #15171a; color: #9aa0a6; box-shadow: 0 0 0 22px rgba(14,16,19,.92); }
.node-port-out { right: -190px; top: calc(50% - 95px); }
.node-port-in { left: -190px; top: calc(50% - 95px); }
.workflow-output-list { position: absolute; left: 900px; top: 1450px; display: flex; gap: 108px; }
.workflow-output-card { position: relative; width: 2038px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; cursor: grab; user-select: none; transition: filter .18s ease; }
.workflow-output-label { color: #e8eaed; font-size: 110px; font-weight: 650; }
.workflow-output-preview { height: auto; aspect-ratio: var(--video-preview-ratio, 16 / 9); }
.workflow-output-card[data-video-ratio="9:16"] { width: 2396px; }
.workflow-output-card[data-video-ratio="16:9"] { width: 4356px; }
.workflow-output-card[data-video-ratio="1:1"] { width: 3146px; }
.workflow-output-preview .video-play-mark { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.85); font-size: 236px; }
.workflow-child-menu { position: absolute; z-index: 16; width: 172px; min-width: 172px; padding: 6px; border: 1px solid var(--canvas-panel-border); border-radius: 9px; background: rgba(38,38,38,.96); box-shadow: 0 12px 28px rgba(0,0,0,.48), inset 0 0 0 1px rgba(255,255,255,.03); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transform-origin: left center; }
.workflow-child-menu[hidden] { display: none; }
.workflow-child-menu-subtitle { margin: 1px 0 3px; padding: 0 7px; color: #858d97; font-size: 10px; line-height: 1.2; }
.workflow-child-menu button { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 30px; padding: 5px 6px; border: 0; border-radius: 6px; background: transparent; color: #eef1f5; font: inherit; font-size: 12px; line-height: 1; text-align: left; cursor: pointer; transition: background .12s ease, color .12s ease; }
.workflow-child-menu button:hover, .workflow-child-menu button:focus-visible { background: rgba(255,255,255,.1); color: #fff; outline: none; }
.workflow-child-menu button[disabled] { color: #7f8995; cursor: default; }
.workflow-child-menu button[disabled]:hover { background: transparent; color: #7f8995; }
.workflow-child-menu-icon { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: rgba(255,255,255,.06); color: #c2c7ce; font-size: 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04); }

/* Video config: floating prompt composer shown below the selected video node. */
.video-config-panel {
  position: absolute;
  left: 3000px;
  top: 2660px;
  z-index: 14;
  width: 6581px;
  min-height: 1780px;
  padding: 1.05em 1.15em .95em;
  border: 1px solid var(--canvas-panel-border);
  border-radius: 1.05em;
  background: var(--canvas-panel-bg);
  box-shadow: 0 20px 44px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  font-size: 132px;
  color: #e8eaed;
  cursor: grab;
  /* 反向缩放：画布放大/缩小时，已打开的配置面板保持 10% 基准下的屏幕尺寸。 */
  transform: scale(var(--vcp-zoom-scale, 1));
  transform-origin: top center;
}
.video-config-panel[hidden] { display: none; }
/* 右上角展开/收起：面板高度按当前高度翻倍，提示语能一次看到更多。 */
.video-config-panel.is-expanded { min-height: 2670px; }
.vcp-expand-btn { position: absolute; top: .55em; right: .55em; z-index: 20; display: grid; place-items: center; width: 2.4em; height: 2.4em; padding: 0; border: .075em solid var(--vcp-control-border); border-radius: .55em; background: #262626; color: #d9d9d9; cursor: pointer; transition: background .15s ease, border-color .15s ease, color .15s ease; }
.vcp-expand-btn:hover { background: #343434; border-color: rgba(255,255,255,.18); color: #fff; }
.vcp-expand-btn:focus-visible { outline: 1px solid rgba(255,255,255,.5); outline-offset: 2px; }
.vcp-expand-btn svg { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .18s ease; }
.video-config-panel.is-expanded .vcp-expand-btn svg { transform: rotate(180deg); }
/* 面板空白处可以拖动平移画布；表单控件保持自己的光标。 */
.video-config-panel button,
.video-config-panel a,
.video-config-panel label { cursor: pointer; }
.video-config-panel textarea,
.video-config-panel input,
.video-config-panel select { cursor: text; }
.workflow-layer.is-panning .video-config-panel { cursor: grabbing; }
/* 复刻方式：参考风格 / 高度复刻 两枚小胶囊，只有复刻节点显示 */
/* 位置在工具条右侧、积分前面；字号和高度对齐「参数配置」那颗下拉按钮 */
.vcp-clone-mode { display: inline-flex; align-items: center; gap: .26em; height: 2.4em; margin: 0; padding: .16em; border: .075em solid var(--canvas-control-border); border-radius: .5em; background: rgba(255, 255, 255, .05); font-size: .9em; }
.vcp-clone-mode[hidden] { display: none; }
.vcp-clone-mode-btn { position: relative; padding: .28em .62em; border: .075em solid transparent; border-radius: .38em; background: transparent; color: #cbd1d9; font: inherit; font-size: .9em; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.vcp-clone-mode-btn:hover { background: rgba(255, 255, 255, .06); color: #fff; }
/* 选中只做中性底色的分段控件效果，不用品牌黄 */
.vcp-clone-mode-btn.is-active { border-color: rgba(255, 255, 255, .09); background: rgba(255, 255, 255, .08); color: #fff; }
/* 复刻方式：鼠标悬停 / 键盘聚焦时，用 data-tooltip 给出对应解释 */
.vcp-clone-mode-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + .5em);
  z-index: 6;
  width: max-content;
  max-width: 20em;
  padding: .5em .7em;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: .5em;
  background: rgba(27, 30, 36, .97);
  box-shadow: 0 .5em 1.3em rgba(0, 0, 0, .34);
  color: #eef1f5;
  font-size: .74em;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, .3em);
  transition: opacity .15s ease, transform .15s ease;
}
.vcp-clone-mode-btn[data-tooltip]:hover::after,
.vcp-clone-mode-btn[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.vcp-refs { display: flex; flex-wrap: wrap; gap: .5em; margin-top: .85em; }
.vcp-refs[hidden] { display: none; }
/* 上游素材添加卡：固定在引用区最左侧，和预览素材用竖线隔开。 */
.vcp-material-add { flex: 0 0 auto; display: inline-flex; align-items: center; gap: .5em; }
.vcp-ref.vcp-add-material { display: grid; place-items: center; width: 2.6em; height: 2.6em; flex: 0 0 2.6em; padding: 0; border: .06em solid var(--canvas-control-border); border-radius: .42em; background: rgba(255,255,255,.055); color: #c7ccd4; cursor: pointer; transition: border-color .15s ease, background .15s ease, color .15s ease; }
.vcp-ref.vcp-add-material:hover { border-color: rgba(255,255,255,.14); background: rgba(255,255,255,.09); color: #fff; }
.vcp-add-material:disabled, .vcp-add-material.is-loading { opacity: .55; cursor: wait; }
.vcp-add-material-plus { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.vcp-add-material-kind { position: absolute; right: .14em; bottom: .14em; width: .68em; height: .68em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: #8b929c; }
.vcp-ref.vcp-add-material:hover .vcp-add-material-kind { color: #c7ccd4; }
.vcp-ref-divider { flex: 0 0 auto; width: .1em; height: 2.2em; align-self: center; border-radius: 999px; background: rgba(255,255,255,.12); }
.video-config-panel.has-refs .vcp-refs { margin-top: .2em; margin-bottom: .75em; padding: 0; border: 0; border-radius: 0; background: transparent; }
.vcp-ref { position: relative; width: 2.6em; height: 2.6em; padding: 0; overflow: hidden; border: 0; border-radius: .42em; background: #15171a; cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.vcp-ref:hover { box-shadow: 0 0 0 2px rgba(255,255,255,.32); }
.vcp-ref img { width: 100%; height: 100%; display: block; object-fit: cover; }
.vcp-ref video { width: 100%; height: 100%; display: block; object-fit: cover; }
/* 上游没有素材时的默认引用卡：只做展示，不承载任何素材。 */
.vcp-ref-placeholder { display: grid; place-items: center; border: .07em dashed rgba(255,255,255,.10); background: rgba(255,255,255,.04); color: #7b828c; cursor: default; pointer-events: none; }
.vcp-ref-placeholder:hover { box-shadow: none; transform: none; }
.vcp-ref-placeholder svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.video-config-panel.has-refs textarea#video-prompt { margin-top: .4em; }
.video-config-panel textarea#video-prompt { width: 100%; min-height: 5em; max-height: 9.5em; padding-right: 3.2em; overflow-y: auto; overscroll-behavior: auto; scrollbar-color: rgba(174,183,197,.5) transparent; border: 0; outline: none; resize: none; background: transparent; color: #f3f4f6; font-family: inherit; font-size: 1em; line-height: 1.1; touch-action: pan-y; -webkit-overflow-scrolling: touch; transition: min-height .2s ease; }
.video-config-panel.is-expanded textarea#video-prompt { max-height: 12.5em; }
.video-config-panel textarea#video-prompt::placeholder { color: #62676f; }
.vcp-toolbar { display: flex; align-items: center; gap: .5em; margin-top: auto; padding-top: .8em; font-size: 1.1em; }
.vcp-actions { margin-left: auto; display: flex; align-items: center; gap: .5em; }
.vcp-dropdown { position: relative; }
/* 模型 / 参数配置 / 语言：常驻的三个选择胶囊给一圈描边，默认就能看出是可点的控件 */
.vcp-dropdown-btn { display: inline-flex; align-items: center; gap: .42em; height: 2.4em; padding: 0 .8em; border: .075em solid var(--vcp-control-border); border-radius: .55em; background: #262626; color: #d9d9d9; font-size: .9em; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.vcp-dropdown-btn:hover { background: #343434; border-color: rgba(255, 255, 255, .18); }
.vcp-dropdown-btn[aria-expanded="true"] { background: #3a3a3a; border-color: rgba(255, 255, 255, .24); }
.vcp-dropdown-btn > #video-language-label { max-width: 8em; overflow: hidden; text-overflow: ellipsis; }
#video-language-dropdown .vcp-menu { width: 13em; }
.vcp-menu-options.vcp-menu-options--simple button { display: flex; align-items: center; gap: .55em; grid-template-columns: none; }
.vcp-menu-options.vcp-menu-options--simple button > .vcp-menu-option-label { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcp-menu-options.vcp-menu-options--simple button:hover { transform: none; }
.vcp-menu-empty { padding: .8em .6em; color: #8f959d; font-size: .9em; text-align: center; }
#video-model-dropdown .vcp-caret,
.vcp-dropdown#video-params-dropdown .vcp-caret { display: none; }
.vcp-dropdown-btn > .vcp-model-brand { width: 1.34em; height: 1.34em; flex: 0 0 1.34em; border-radius: .38em; font-size: .8em; }
.vcp-caret { font-size: .78em; opacity: .55; }
/* 提示语输入框 */
.vcp-prompt-field { position: relative; display: block; }
.vcp-clear-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.4em; height: 2.4em; margin-left: 0; padding: 0; border: 0; border-radius: .55em; background: #262626; color: #d9d9d9; cursor: pointer; transition: background .15s ease, color .15s ease; }
.vcp-clear-btn:hover { background: #343434; color: #fff; }
.vcp-clear-btn[hidden] { display: none; }
.vcp-clear-btn svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* 画布整体按 10% 起步缩放，1px 描边会缩到 0.1px 看不见，所以弹层描边用 em。 */
.vcp-menu { position: absolute; z-index: 30; bottom: calc(100% + .55em); left: 0; width: 24em; max-width: none; overflow: visible; padding: .38em; border: .07em solid rgba(255,255,255,.06); border-radius: .9em; background: var(--canvas-panel-bg); box-shadow: 0 20px 44px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04); }
/* 模型卡片弹出层加宽：模型名、说明与算力徽标一行排开，语言下拉保持原宽度 */
#video-model-dropdown .vcp-menu { width: 30em; }
.vcp-menu-options { max-height: 22em; overflow: auto; display: grid; gap: .14em; padding: .08em; scrollbar-color: rgba(174,183,197,.42) transparent; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.vcp-menu-group { display: grid; gap: .14em; }
.vcp-menu-group + .vcp-menu-group { margin-top: .34em; padding-top: .38em; border-top: .07em solid rgba(255,255,255,.09); }
.vcp-menu-group-head { display: flex; align-items: center; gap: .48em; min-height: 2.1em; padding: .12em .48em .18em; color: rgba(255,255,255,.48); font-size: .78em; font-weight: 650; letter-spacing: .035em; }
.vcp-menu-group-letter { display: grid; place-items: center; width: 1.65em; height: 1.65em; border: .07em solid rgba(255,255,255,.1); border-radius: .42em; background: rgba(255,255,255,.035); color: rgba(255,255,255,.66); font-size: .9em; line-height: 1; }
.vcp-menu-group-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcp-menu-group-count { margin-left: auto; color: rgba(255,255,255,.3); font-weight: 500; white-space: nowrap; }
.vcp-menu-options button { display: grid; grid-template-columns: 1.25em 1.8em minmax(0,1fr) auto; align-items: center; gap: .55em; width: 100%; min-height: 3.35em; padding: .38em .48em; border: .075em solid transparent; border-radius: .62em; background: transparent; color: #cfd4db; font-size: .95em; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease; }
.vcp-menu-options button:hover { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.08); color: #fff; transform: translateX(2px); }
.vcp-menu-options button[aria-selected="true"] { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.vcp-menu-options button > .vcp-model-brand { width: 1.5em; height: 1.5em; flex: 0 0 1.5em; border-radius: .42em; font-size: .9em; box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 .12em .28em rgba(0,0,0,.14); }
.vcp-menu-check { width: 1.25em; height: 1.25em; border-radius: 50%; display: grid; place-items: center; flex: none; border: .075em solid rgba(255,255,255,.10); color: #121316; }
.vcp-menu-check svg { width: .6em; height: .6em; }
.vcp-menu-options button[aria-selected="true"] .vcp-menu-check { background: #ff2d68; border-color: #ff8ab2; }
.vcp-model-side { display: inline-flex; align-items: center; gap: .5em; justify-self: end; }
.vcp-model-copy { min-width: 0; display: grid; gap: .18em; }
.vcp-model-copy strong { overflow: hidden; color: inherit; font-size: 1em; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.vcp-model-credits { display: inline-flex; align-items: center; padding: 0; border: 0; border-radius: 0; background: none; color: rgba(255,255,255,.42); font-size: .72em; font-weight: 500; line-height: 1.6; letter-spacing: .01em; white-space: nowrap; }
.vcp-model-copy small { display: -webkit-box; overflow: hidden; color: #98a2b3; font-size: .78em; line-height: 1.3; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* 统一底片 + image/model_icons 下的品牌 PNG logo。 */
.vcp-model-brand { --brand-logo: none; position: relative; width: 2.25em; height: 2.25em; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.06); border-radius: .58em; background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.04)); color: #edf0f5; box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 .18em .4em rgba(0,0,0,.22); font-size: .9em; font-weight: 700; line-height: 1; }
.vcp-model-brand::after { content: ""; position: absolute; inset: 10%; pointer-events: none; background: var(--brand-logo) center / contain no-repeat; filter:none;}
.vcp-model-brand--seedance { --brand-logo: url("../image/model_icons/seedance.png"); }
.vcp-model-brand--seedream { --brand-logo: url("../image/model_icons/seedream.png"); }
.vcp-model-brand--wan { --brand-logo: url("../image/model_icons/wan.png"); }
.vcp-model-brand--kling { --brand-logo: url("../image/model_icons/kling.png"); }
.vcp-model-brand--openai { --brand-logo: url("../image/model_icons/open-ai.png"); }
/* OpenAI 官方标是纯黑，深色底上反色成白色 */
.vcp-model-brand--openai::after { filter: invert(1) brightness(1.05); }
.vcp-model-brand--google { --brand-logo: url("../image/model_icons/gemini.png"); }
.vcp-model-brand--nano-banana { --brand-logo: url("../image/model_icons/Banana.png"); }
.vcp-model-brand--default { color: #edf0f5; }
.vcp-pop { position: absolute; z-index: 30; bottom: calc(100% + .65em); left: 50%; transform: translateX(-50%); display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 1.2em; width: 34.1em; min-height: 18.8em; max-width: none; box-sizing: border-box; padding: .8em 1.25em 1.5em; border: .07em solid rgba(255,255,255,.06); border-radius: 1.05em; background: var(--canvas-panel-bg); box-shadow: 0 20px 44px rgba(0,0,0,.5), 0 0 0 1px rgba(255,255,255,.04); }
.vcp-pop[hidden] { display: none; }
/* 关闭样式对齐 set_image 页面的“套图类别”弹层：标题行 + 右侧小方块关闭按钮。 */
/* 画布整体按 scale 缩放（默认 10%），1px 的线会缩到 0.1px 看不见，所以这里用 em 宽度让分割线随面板一起缩放。 */
.vcp-pop-head { display: flex; align-items: center; justify-content: space-between; gap: .6em; margin: 0 0 -.35em; padding: 0 .1em .7em; border-bottom: .08em solid rgba(255,255,255,.07); }
.vcp-pop-body { display: grid; gap: 1.2em; align-content: stretch; min-height: 0; }
.vcp-pop-title { color: #99a0a8; font-size: .72em; font-weight: 700; letter-spacing: .02em; }
.vcp-close { position: static; z-index: 2; display: grid; place-items: center; flex: none; width: 1.55em; height: 1.55em; padding: 0; border: 0; border-radius: .5em; background: transparent; color: #8d939b; font: inherit; font-size: 1.02em; line-height: 1; cursor: pointer; transition: background .15s ease, color .15s ease; }
.vcp-close:hover { background: rgba(255,255,255,.1); color: #fff; }
.vcp-close:focus-visible { outline: 2px solid rgba(145,164,255,.82); outline-offset: 2px; }
.vcp-field { display: grid; grid-template-columns: 5.2em minmax(0, 1fr); align-items: center; gap: .85em; color: #bcc4d0; font-size: .84em; white-space: nowrap; }
.vcp-field > span { color: #d0d6e0; font-weight: 700; letter-spacing: .01em; }
.vcp-native-select { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
.vcp-choice-list { display: flex; flex-wrap: wrap; gap: .45em; min-width: 0; }
.vcp-choice-list--clarity,
.vcp-choice-list--duration,
.vcp-choice-list--count,
.vcp-choice-list--platform,
.vcp-choice-list--ratio { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.5em, 1fr)); gap: .2em; padding: .22em; border: .075em solid var(--canvas-control-border); border-radius: .8em; background: rgba(255,255,255,.04); box-shadow: inset 0 1px 0 rgba(255,255,255,.015); }
.vcp-choice-list--platform { grid-template-columns: repeat(auto-fit, minmax(6.4em, 1fr)); }
.vcp-choice-list--clarity .vcp-choice,
.vcp-choice-list--duration .vcp-choice,
.vcp-choice-list--count .vcp-choice,
.vcp-choice-list--platform .vcp-choice { min-width: 0; width: 100%; min-height: 2.65em; border-color: transparent; border-radius: .62em; background: transparent; color: #c4cad4; }
.vcp-choice-list--clarity .vcp-choice.is-selected,
.vcp-choice-list--duration .vcp-choice.is-selected,
.vcp-choice-list--count .vcp-choice.is-selected,
.vcp-choice-list--platform .vcp-choice.is-selected { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.10); color: #fff; box-shadow: 0 .3em .8em rgba(0,0,0,.22); }
.vcp-choice.is-disabled,
.vcp-choice:disabled { opacity: .44; color: #aeb7c5; cursor: not-allowed; transform: none !important; }
.vcp-choice.is-disabled:hover,
.vcp-choice:disabled:hover { border-color: transparent; background: transparent; color: #aeb7c5; }
.vcp-choice-list--ratio { grid-template-columns: repeat(auto-fit, minmax(4.8em, 1fr)); gap: .45em; }
.vcp-choice { min-width: 0; min-height: 2.35em; overflow: hidden; padding: .15em .8em; border: .075em solid var(--canvas-control-border); border-radius: .58em; background: #262626; color: #c4cad4; font: inherit; font-size: .94em; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease; }
.vcp-choice:hover { border-color: rgba(255,255,255,.12); background: #343434; color: #fff; transform: translateY(-1px); }
.vcp-choice.is-selected { border-color: rgba(255,255,255,.18); background: #3a3a3a; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), 0 5px 16px rgba(0,0,0,.2); }
.vcp-choice-list--ratio .vcp-choice { display: grid; justify-items: center; align-content: start; gap: .28em; min-height: 4.8em; padding: .55em .35em .45em; border-color: transparent; background: transparent; }
.vcp-choice-list--ratio .vcp-choice.is-selected { border-color: rgba(255,255,255,.18); background: #343434; }
.vcp-choice-list--ratio .vcp-choice.is-disabled,
.vcp-choice-list--ratio .vcp-choice:disabled { opacity: .44; color: #aeb7c5; cursor: not-allowed; }
.vcp-ratio-mark { width: 2.2em; height: 2.2em; display: grid; place-items: center; opacity: .8; }
.vcp-ratio-mark::after { content: ''; display: block; width: 1.5em; height: 1.5em; border: 2px solid currentColor; border-radius: .28em; }
.vcp-choice-list--ratio .vcp-choice[data-choice-value="16:9"] .vcp-ratio-mark::after { width: 1.85em; height: 1.05em; }
.vcp-choice-list--ratio .vcp-choice[data-choice-value="9:16"] .vcp-ratio-mark::after { width: 1.05em; height: 1.85em; }
.vcp-choice-list--ratio .vcp-choice[data-choice-value="1:1"] .vcp-ratio-mark::after { width: 1.45em; height: 1.45em; }
.vcp-choice-list--ratio .vcp-choice[data-choice-value="3:2"] .vcp-ratio-mark::after { width: 1.75em; height: 1.2em; }
.vcp-choice-list--ratio .vcp-choice[data-choice-value="2:3"] .vcp-ratio-mark::after { width: 1.2em; height: 1.75em; }
.vcp-cost { margin-left: 0; display: inline-flex; align-items: center; gap: .28em; color: #979da6; font-size: .84em; font-weight: 600; font-variant-numeric: tabular-nums; }
.vcp-cost svg { width: 1em; height: 1em; color: #f4f5f6; }
.vcp-submit { width: 1.75em; height: 1.75em; display: grid; place-items: center; border: 0; border-radius: 50%; background: linear-gradient(180deg, #ffffff, #e4e7eb); color: #141518; cursor: pointer; box-shadow: none; transition: filter .16s ease, opacity .16s ease; }
.vcp-submit:hover { filter: brightness(.94); }
.vcp-submit:active { filter: brightness(.88); }
.vcp-submit:disabled { opacity: .6; cursor: wait; filter: none; }
.vcp-submit svg { width: 1em; height: 1em; }
.vcp-submit.is-loading svg { display: none; }
.vcp-submit.is-loading {
  opacity: .88;
  box-shadow: none;
}
.vcp-submit.is-loading::after {
  content: '';
  width: .62em;
  height: .62em;
  border: 20px solid rgba(20, 21, 24, .24);
  border-top-color: #141518;
  border-radius: 50%;
  animation: upload-spin .8s linear infinite;
}
.video-config-panel.is-generating { opacity: .92; }
.video-config-panel.is-generating .vcp-dropdown-btn,
.video-config-panel.is-generating textarea { pointer-events: none; opacity: .65; }

@media (max-width: 900px) {
  .canvas-topbar { height: 60px; padding: 0 12px; }
  .canvas-topbar .project-title-wrap input { width: 130px; font-size: 15px; }
  .canvas-topbar .right-nav .member-btn,
  .canvas-topbar .right-nav .assets-btn { display: none; }
  .canvas-workspace { inset: 0; }
  .workflow-add-toolbar { left: 12px; }
  .node-board { justify-content: center; overflow: auto; padding: 72px 20px 80px; gap: 0; }
  .node-board-panel { width: min(540px, 100%); }
  .node-group { width: 100%; align-items: stretch; }
  .node-row { width: 100%; grid-template-columns: repeat(2, minmax(170px, 1fr)); }
  .node-card { min-height: 46px; padding: 5px 10px 5px 5px; }
  .workflow-stage { width: 5200px; }
}

@media (max-width: 520px) {
  .canvas-topbar .canvas-brand { width: 34px; height: 34px; }
  .canvas-topbar .project-title-wrap input { width: 120px; }
  .node-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .node-board { align-items: stretch; justify-content: center; padding: 68px 12px 72px; }
  .node-board-panel { width: 100%; gap: 14px; }
  .node-tab-panel { padding: 0; border-radius: 0; }
  .node-tab { min-width: 104px; height: 29px; padding: 0 13px; font-size: 11px; }
  .node-group { width: 100%; }
  .node-card { min-height: 42px; gap: 6px; padding: 4px 7px 4px 4px; }
  .node-card-media { width: 32px; height: 32px; flex-basis: 32px; }
  .node-name { font-size: 13.2px; }
  .node-card-badge { top: 0; right: 8px; padding: 2px 5px; font-size: 9.6px; }
  .canvas-bottom-left { left: 52px; bottom: 10px; }
  .workflow-minimap-toggle { left: 10px; bottom: 10px; width: 34px; height: 34px; }
  .workflow-minimap { left: 10px; bottom: 54px; width: 136px; }
  .workflow-minimap-viewport { height: 78px; }
  .workflow-add-toolbar { left: 10px; }
  .workflow-add-rail { width: 44px; padding: 3px; gap: 2px; border-radius: 14px; }
  .workflow-add-item { width: 38px; height: 38px; border-radius: 10px; }
  .workflow-add-icon svg { width: 17px; height: 17px; }
  .workflow-add-label { left: calc(100% + 6px); min-width: 92px; padding: 6px 10px 6px 14px; font-size: 12.5px; }
}

/* 语言选项的国旗（与工具页参数卡片同一份 SVG 数据）：
   画布整体按 scale 缩放，所以尺寸用 em，跟着节点面板一起缩放。 */
.vcp-lang-flag { flex: 0 0 auto; width: 1.16em; height: .87em; border-radius: .18em; overflow: hidden; box-shadow: inset 0 0 0 .04em rgba(255, 255, 255, .16); }
.vcp-lang-flag--fallback { color: #9aa1aa; box-shadow: none; }
.vcp-lang-flag-slot { display: inline-flex; align-items: center; }
.vcp-lang-flag-slot:empty { display: none; }
