.generation-canvas-v2__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  background:
    radial-gradient(circle, var(--nomi-ink-20) 1px, transparent 1.2px),
    var(--nomi-bg);
  background-size: 24px 24px;
}

.generation-canvas-v2__stage[data-panning] {
  cursor: grabbing;
}

.generation-canvas-v2__canvas {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
}

.generation-canvas-v2__edges,
.generation-canvas-v2__nodes {
  position: absolute;
  top: 0;
  left: 0;
  width: 4000px;
  height: 3000px;
}

.generation-canvas-v2__edges {
  pointer-events: none;
  overflow: visible;
}

.generation-canvas-v2__nodes {
  pointer-events: none;
}

.generation-canvas-v2-node {
  position: absolute;
  z-index: 2;
  pointer-events: auto;
}

.generation-canvas-v2-node[data-focus-flash='true'] .generation-canvas-v2-node__preview {
  animation: generation-canvas-v2-focus-pulse 1.35s ease-out;
  outline: 3px solid color-mix(in srgb, var(--nomi-accent) 72%, white);
  outline-offset: 5px;
}

@keyframes generation-canvas-v2-focus-pulse {
  0% {
    filter: drop-shadow(0 0 0 rgba(80, 112, 255, 0));
    transform: scale(1);
  }
  18% {
    filter: drop-shadow(0 0 24px rgba(80, 112, 255, 0.42));
    transform: scale(1.018);
  }
  100% {
    filter: drop-shadow(0 0 0 rgba(80, 112, 255, 0));
    transform: scale(1);
  }
}

.generation-canvas-v2-node__derived-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--nomi-accent);
  font: inherit;
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(18, 24, 38, 0.1);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.generation-canvas-v2-node__derived-badge:hover:not(:disabled) {
  background: white;
  color: var(--nomi-ink);
}

.generation-canvas-v2-node__derived-badge:disabled {
  color: var(--nomi-ink-40);
  cursor: not-allowed;
  opacity: 0.72;
}

.generation-canvas-v2__group-boxes {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.generation-canvas-v2__group-box {
  position: absolute;
  border: 1.5px solid color-mix(in srgb, var(--nomi-accent) 55%, transparent);
  border-radius: 18px;
  background: color-mix(in srgb, var(--nomi-accent) 8%, transparent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58), 0 14px 34px rgba(18, 24, 38, 0.055);
  cursor: grab;
  pointer-events: auto;
  user-select: none;
}

.generation-canvas-v2__group-box:active {
  cursor: grabbing;
}

.generation-canvas-v2__group-box-label {
  position: absolute;
  top: 8px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  min-height: 22px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--nomi-accent);
  color: var(--nomi-paper);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  box-shadow: 0 8px 18px rgba(18, 24, 38, 0.12);
  cursor: grab;
  pointer-events: auto;
  user-select: none;
}

.generation-canvas-v2__group-box-label:active {
  cursor: grabbing;
}

.generation-canvas-v2__group-box-label span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.generation-canvas-v2__group-box-label span:last-child {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  font-size: 10px;
}

.generation-canvas-v2__edge-path {
  fill: none;
  stroke: var(--nomi-ink-30);
  stroke-dasharray: 3 3;
  stroke-width: 1.2;
  pointer-events: none;
}

.generation-canvas-v2__edge-hit {
  fill: none;
  stroke: rgba(18, 24, 38, 0.001);
  stroke-width: 30;
  pointer-events: stroke;
  cursor: pointer;
}

.generation-canvas-v2__edge-hit:focus,
.generation-canvas-v2__edge-hit:focus-visible {
  outline: none;
}

.generation-canvas-v2__edge[data-active='true'] .generation-canvas-v2__edge-path {
  stroke-width: 2;
  filter: drop-shadow(0 0 4px rgba(18, 24, 38, 0.14));
}

.generation-canvas-v2__edge-cut-object {
  overflow: visible;
  pointer-events: all;
}

.generation-canvas-v2__edge-preview {
  fill: none;
  stroke: oklch(0.6 0.14 250);
  stroke-width: 2;
  stroke-dasharray: 6 4;
  pointer-events: none;
}

.generation-canvas-v2__edge[data-mode='first_frame'] .generation-canvas-v2__edge-path,
.generation-canvas-v2__edge[data-mode='last_frame'] .generation-canvas-v2__edge-path {
  stroke: var(--nomi-accent);
  stroke-dasharray: none;
}

.generation-canvas-v2__edge[data-mode='style_ref'] .generation-canvas-v2__edge-path {
  stroke: oklch(0.58 0.12 155);
}

.generation-canvas-v2__edge[data-mode='character_ref'] .generation-canvas-v2__edge-path {
  stroke: oklch(0.56 0.12 35);
}

.generation-canvas-v2__edge[data-mode='composition_ref'] .generation-canvas-v2__edge-path {
  stroke: oklch(0.54 0.09 290);
}

.generation-canvas-v2__edge-cut-wrap {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  pointer-events: auto;
}

.generation-canvas-v2__edge-cut {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--nomi-paper);
  color: var(--workbench-danger);
  box-shadow: 0 8px 24px rgba(18, 24, 38, 0.18), 0 0 0 1px rgba(18, 24, 38, 0.08);
  cursor: pointer;
}

.generation-canvas-v2__edge-cut:hover {
  background: var(--workbench-danger);
  color: var(--nomi-paper);
}

.generation-canvas-v2-node__handle {
  pointer-events: auto;
}

.generation-canvas-v2-node__handle-dot {
  width: 14px;
  height: 14px;
  border: 2px solid var(--workbench-surface-solid);
  border-radius: 999px;
  background: var(--workbench-muted-soft);
  box-shadow: 0 4px 12px rgba(18, 24, 38, 0.14);
  transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}

.generation-canvas-v2-node__handle:hover .generation-canvas-v2-node__handle-dot,
.generation-canvas-v2-node__handle[data-active='true'] .generation-canvas-v2-node__handle-dot {
  background: var(--workbench-accent);
  transform: scale(1.08);
}

/* 布局/折叠态已迁到组件 Tailwind className（flex flex-col / data-collapsed 分支），
   旧的 display:grid + grid-template-rows:auto minmax(0,1fr) auto 是给 3 子布局写的，
   4 子（头/工具条/消息/composer）后工具条落进 1fr 行吃掉 ~120px 空白——删旧（R1/R10）。 */

.generation-canvas-v2-assistant__launcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--nomi-line);
  border-radius: 999px;
  background: var(--nomi-paper);
  color: var(--nomi-ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--nomi-shadow-sm);
  cursor: pointer;
}

.generation-canvas-v2-assistant__launcher:hover {
  box-shadow: var(--nomi-shadow-md);
  transform: translateY(-1px);
}

.generation-canvas-v2-assistant__subtitle {
  margin: 0;
  color: var(--nomi-ink-40);
  font-size: 11px;
}

.generation-canvas-v2-assistant__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 53px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--nomi-line-soft);
  background: var(--nomi-paper);
}

.generation-canvas-v2-assistant__header-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  margin-left: auto;
}

.generation-canvas-v2-assistant__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.generation-canvas-v2-assistant__header p {
  margin: 0;
}

.generation-canvas-v2-assistant__header-action,
.generation-canvas-v2-assistant__collapse {
  min-width: 26px;
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--nomi-radius-sm);
  background: transparent;
  color: var(--nomi-ink-60);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.generation-canvas-v2-assistant__header-action:hover,
.generation-canvas-v2-assistant__collapse:hover {
  background: var(--nomi-ink-05);
  color: var(--nomi-ink);
}

.generation-canvas-v2-assistant__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 16px;
}

.generation-canvas-v2-assistant__empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 240px;
  margin: auto;
  padding: 24px 12px;
  text-align: center;
}

.generation-canvas-v2-assistant__empty-title {
  color: var(--nomi-ink);
  font-family: Fraunces, Inter, serif;
  font-size: 17px;
  font-weight: 500;
}

.generation-canvas-v2-assistant__empty-sub {
  color: var(--nomi-ink-60);
  font-size: 13px;
  line-height: 1.55;
}

.generation-canvas-v2-assistant__suggestions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
}

.generation-canvas-v2-assistant__suggestion {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--nomi-radius);
  background: var(--nomi-ink-05);
  color: var(--nomi-ink-80);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.generation-canvas-v2-assistant__suggestion:hover {
  border-color: var(--nomi-line);
  background: var(--nomi-paper);
  color: var(--nomi-ink);
}

.generation-canvas-v2-assistant__message {
  position: relative;
  max-width: 90%;
  padding: 10px 14px;
  border-radius: var(--nomi-radius);
  background: var(--nomi-ink-05);
  color: var(--nomi-ink);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.generation-canvas-v2-assistant__message[data-role='user'] {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: var(--nomi-ink);
  color: var(--nomi-paper);
}

.generation-canvas-v2-assistant__message[data-role='assistant'] {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.generation-canvas-v2-assistant__message[data-role='tool'] {
  align-self: flex-start;
  background: var(--nomi-accent-soft);
  color: var(--nomi-accent);
}

.generation-canvas-v2-assistant__confirm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--workbench-accent) 32%, var(--workbench-border));
  border-radius: 8px;
  padding: 10px;
  background: var(--workbench-surface-solid);
  font-size: 12px;
}

.generation-canvas-v2-assistant__confirm button {
  min-height: 28px;
  border: 1px solid var(--workbench-border);
  border-radius: var(--workbench-control-radius);
  background: var(--workbench-surface-soft);
  color: var(--workbench-ink);
  font: inherit;
  font-size: 12px;
}

.generation-canvas-v2-assistant__composer {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-top: 1px solid var(--nomi-line-soft);
  background: var(--nomi-paper);
}

.generation-canvas-v2-assistant__input {
  width: 100%;
  min-height: 40px;
  padding: 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--nomi-ink);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.45;
}

.generation-canvas-v2-assistant__input::placeholder {
  color: var(--nomi-ink-40);
}

.generation-canvas-v2-assistant__composer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.generation-canvas-v2-assistant__mode {
  display: flex;
  align-items: center;
  gap: 6px;
}

.generation-canvas-v2-assistant__mode span {
  color: var(--nomi-ink-40);
  font-size: 11.5px;
}

.generation-canvas-v2-assistant__mode select {
  height: 25px;
  padding: 3px 6px;
  border: 1px solid var(--nomi-line-soft);
  border-radius: var(--nomi-radius-sm);
  outline: 0;
  background: var(--nomi-ink-05);
  color: var(--nomi-ink-80);
  font: inherit;
  font-size: 12px;
}

.generation-canvas-v2-assistant__send {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--nomi-ink);
  color: var(--nomi-paper);
  cursor: pointer;
}

.generation-canvas-v2-assistant__send:hover:not(:disabled) {
  background: var(--nomi-accent);
}

.generation-canvas-v2-assistant__send:disabled {
  background: var(--nomi-ink-20);
  color: var(--nomi-ink-40);
  cursor: not-allowed;
}

/* 窄屏响应也已迁到组件 max-[900px]:* Tailwind className（逐项等价），删旧 media（R10）。 */
