/* ideafolia — 全局样式 */
/* 浅色主题 + 点阵背景 */

/* ============================================================
   CSS Variables
   ============================================================ */
:root {
  /* Colors */
  --color-bg: #fafafa;
  --color-surface: #ffffff;
  --color-surface-2: #f5f5f5;
  --color-border: #e5e5e5;
  --color-border-hover: #d0d0d0;
  --color-text: #111111;
  --color-text-2: #555555;
  --color-text-3: #999999;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-accent-light: #eff6ff;
  --color-danger: #ef4444;
  --color-danger-light: #fef2f2;
  --color-success: #22c55e;
  --color-success-light: #f0fdf4;
  --color-warning: #f59e0b;
  --color-warning-light: #fffbeb;

  /* Node colors — violet/indigo palette */
  --node-seed-bg: linear-gradient(135deg, #6d28d9 0%, #4f46e5 100%);
  --node-seed-text: #ffffff;
  --node-seed-border: #5b21b6;
  --node-seed-shadow: 0 4px 16px rgba(79,70,229,0.35);
  --node-selected-bg: #ffffff;
  --node-selected-border: #7c3aed;
  --node-selected-shadow: 0 0 0 2.5px rgba(124,58,237,0.20);
  --node-candidate-bg: #f5f3ff;
  --node-candidate-border: #a78bfa;
  --node-candidate-text: #5b21b6;
  --node-candidate-shadow: 0 2px 8px rgba(139,92,246,0.12);
  --node-manual-bg: #ffffff;
  --node-manual-border: #e4e4e7;
  --node-connect-bg: #fffbeb;
  --node-connect-border: #fcd34d;
  --node-connect-text: #78350f;

  /* Edge colors */
  --edge-branch: #c4b5fd;
  --edge-connect: #fbbf24;

  /* Canvas */
  --canvas-bg: #f8f7ff;
  --dot-color: #ddd6fe;
  --dot-size: 1.5px;
  --dot-gap: 24px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', monospace;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;

  /* Radius */
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);

  /* Transitions */
  --transition: 150ms ease;
  --transition-slow: 250ms ease;

  /* Layout */
  --sidebar-width: 240px;
  --toolbar-width: 56px;
  --topbar-height: 48px;
}

/* ============================================================
   Reset
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
input, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
#app { height: 100%; display: flex; flex-direction: column; }

/* ============================================================
   Utility
   ============================================================ */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* ============================================================
   Button
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 0 var(--space-4); height: 36px; border-radius: var(--radius);
  font-size: var(--text-sm); font-weight: 500;
  transition: background var(--transition), color var(--transition), opacity var(--transition);
  white-space: nowrap; user-select: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--color-text); color: #fff; }
.btn-primary:hover:not(:disabled) { background: #333; }
.btn-secondary { background: var(--color-surface-2); color: var(--color-text); border: 1px solid var(--color-border); }
.btn-secondary:hover:not(:disabled) { background: var(--color-border); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-ghost { color: var(--color-text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--color-surface-2); color: var(--color-text); }
.btn-sm { height: 28px; padding: 0 var(--space-3); font-size: var(--text-xs); }
.btn-icon { width: 32px; height: 32px; padding: 0; border-radius: var(--radius-sm); }

/* ============================================================
   Input
   ============================================================ */
.input {
  width: 100%; height: 40px; padding: 0 var(--space-3);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  background: var(--color-surface); font-size: var(--text-base);
  outline: none; transition: border-color var(--transition), box-shadow var(--transition);
}
.input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.input::placeholder { color: var(--color-text-3); }
.input-error { border-color: var(--color-danger); }
.input-error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }
.textarea { min-height: 80px; height: auto; padding: var(--space-3); resize: vertical; }

/* ============================================================
   Form
   ============================================================ */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label { font-size: var(--text-sm); font-weight: 500; color: var(--color-text-2); }
.form-error { font-size: var(--text-xs); color: var(--color-danger); }
.form-hint { font-size: var(--text-xs); color: var(--color-text-3); }

/* ============================================================
   Auth Pages
   ============================================================ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--color-bg); padding: var(--space-4);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-xl);
  padding: var(--space-8); box-shadow: var(--shadow-md);
}
.auth-logo { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-8); }
.auth-logo-text { font-size: var(--text-lg); font-weight: 700; letter-spacing: -0.02em; }
.auth-title { font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-2); letter-spacing: -0.02em; }
.auth-subtitle { font-size: var(--text-sm); color: var(--color-text-2); margin-bottom: var(--space-6); }
.auth-form { display: flex; flex-direction: column; gap: var(--space-4); }
.auth-divider { text-align: center; font-size: var(--text-sm); color: var(--color-text-3); margin: var(--space-4) 0; }
.auth-footer { margin-top: var(--space-6); text-align: center; font-size: var(--text-sm); color: var(--color-text-2); }
.auth-footer a { color: var(--color-accent); font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }
.auth-alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius); font-size: var(--text-sm); margin-bottom: var(--space-4); }
.auth-alert-error { background: var(--color-danger-light); color: var(--color-danger); }
.auth-alert-success { background: var(--color-success-light); color: #166534; }
.auth-forgot-link { display: block; margin-top: var(--space-2); text-align: right; font-size: var(--text-xs); color: var(--color-accent); }
.auth-forgot-link:hover { text-decoration: underline; }

/* ============================================================
   App Shell (Projects + Canvas)
   ============================================================ */
.app-shell { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width); flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--color-surface); border-right: 1px solid var(--color-border);
  overflow: hidden;
}
.sidebar-header {
  height: var(--topbar-height); display: flex; align-items: center;
  padding: 0 var(--space-4); border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.sidebar-logo { font-size: var(--text-md); font-weight: 700; letter-spacing: -0.02em; flex: 1; }
.sidebar-body { flex: 1; overflow-y: auto; padding: var(--space-3); }
.sidebar-footer { padding: var(--space-3); border-top: 1px solid var(--color-border); }

/* Sidebar Nav */
.sidebar-section { margin-bottom: var(--space-4); }
.sidebar-section-title { font-size: var(--text-xs); font-weight: 600; color: var(--color-text-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 var(--space-2); margin-bottom: var(--space-2); }
.sidebar-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-2); border-radius: var(--radius-sm);
  font-size: var(--text-sm); color: var(--color-text-2); cursor: pointer;
  transition: background var(--transition), color var(--transition);
  user-select: none;
}
.sidebar-item:hover { background: var(--color-surface-2); color: var(--color-text); }
.sidebar-item.active { background: var(--color-accent-light); color: var(--color-accent); font-weight: 500; }
.sidebar-item svg { flex-shrink: 0; opacity: 0.7; }
.sidebar-item.active svg { opacity: 1; }

/* ============================================================
   Projects Page
   ============================================================ */
.projects-page { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.projects-topbar {
  height: var(--topbar-height); display: flex; align-items: center;
  padding: 0 var(--space-6); border-bottom: 1px solid var(--color-border);
  gap: var(--space-3); flex-shrink: 0;
}
.projects-title { font-size: var(--text-md); font-weight: 600; flex: 1; }
.projects-body { flex: 1; overflow-y: auto; padding: var(--space-6); }
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}
.project-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  position: relative;
}
.project-card:hover { border-color: var(--color-border-hover); box-shadow: var(--shadow); }
.project-card-thumb {
  width: 100%; aspect-ratio: 16/9; background: var(--color-surface-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.project-card-thumb svg { color: var(--color-border-hover); }
.project-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-card-body { padding: var(--space-3) var(--space-4); }
.project-card-name { font-size: var(--text-sm); font-weight: 500; margin-bottom: var(--space-1); }
.project-card-meta { font-size: var(--text-xs); color: var(--color-text-3); }
.project-card .project-card-menu { position: absolute; top: var(--space-2); right: var(--space-2); z-index: 10; display: inline-flex; }
.project-card-menu .btn-icon { background: var(--color-surface); box-shadow: var(--shadow-sm); }
/* dropdown 菜单展开时浮在最上层，避免被 sidebar / 相邻卡片遮挡 */
.project-card-menu .dropdown-menu { z-index: 1000; }

/* Folder */
.folder-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  cursor: pointer; user-select: none;
  transition: background var(--transition);
}
.folder-item:hover { background: var(--color-surface-2); }
.folder-item.active { background: var(--color-accent-light); }
.folder-name { font-size: var(--text-sm); flex: 1; }

/* ============================================================
   Canvas Shell
   ============================================================ */
.canvas-shell { flex: 1; display: flex; flex-direction: column; overflow: hidden; position: relative; }

/* Canvas Topbar */
.canvas-topbar {
  height: var(--topbar-height); display: flex; align-items: center;
  padding: 0 var(--space-4); border-bottom: 1px solid var(--color-border);
  background: var(--color-surface); gap: var(--space-3); flex-shrink: 0; z-index: 10;
}
.canvas-topbar-title {
  font-size: var(--text-sm); font-weight: 500; flex: 1;
  cursor: text; padding: var(--space-1) var(--space-2); border-radius: var(--radius-sm);
  border: 1px solid transparent; outline: none;
  transition: border-color var(--transition);
}
.canvas-topbar-title:hover { border-color: var(--color-border); }
.canvas-topbar-title:focus { border-color: var(--color-accent); }

/* Save status */
.save-status { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); color: var(--color-text-3); }
.save-status-dot { width: 6px; height: 6px; border-radius: var(--radius-full); background: var(--color-success); }
.save-status-dot.saving { background: var(--color-warning); animation: pulse 1s infinite; }
.save-status-dot.unsaved { background: var(--color-warning); }
.save-status-dot.error { background: var(--color-danger); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Canvas Viewport */
.canvas-viewport {
  flex: 1; overflow: hidden; position: relative;
  background-color: var(--canvas-bg);
  background-image: radial-gradient(circle, var(--dot-color) var(--dot-size), transparent var(--dot-size));
  background-size: var(--dot-gap) var(--dot-gap);
  cursor: default;
}
.canvas-viewport.panning { cursor: grabbing; }
.canvas-world {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
  will-change: transform;
  z-index: 2;   /* 节点层永远在连线/流光之上：避免流光渗进节点框、连线遮挡节点按钮 */
}

/* Canvas Controls */
.canvas-controls {
  position: absolute; bottom: var(--space-4); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: var(--space-1);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-1); box-shadow: var(--shadow);
  z-index: 10;
}
.canvas-zoom-label { font-size: var(--text-xs); color: var(--color-text-2); padding: 0 var(--space-2); min-width: 44px; text-align: center; }

/* 撤销/回滚（上一步）按钮：固定在画布视口左上角，不受画布平移/缩放影响 */
.canvas-undo {
  position: absolute; top: var(--space-4); left: var(--space-4);
  display: flex; align-items: center;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-1); box-shadow: var(--shadow);
  z-index: 10;
}
.canvas-undo button:disabled { opacity: 0.35; cursor: default; pointer-events: none; }

/* SVG Edge layer */
.canvas-edges {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: visible;
}
.canvas-edges.interactive { pointer-events: all; }

/* ============================================================
   Nodes
   ============================================================ */
.node {
  position: absolute; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  user-select: none; transition: box-shadow var(--transition);
  cursor: pointer;
}
.node:focus { outline: none; }

/* Seed node — 与用户创建的文本节点风格一致（白底） */
.node-seed {
  background: var(--node-manual-bg); color: var(--color-text);
  border: 1.5px solid var(--node-manual-border);
  min-width: 140px; min-height: 56px; padding: var(--space-3) var(--space-4);
  font-weight: 600; font-size: var(--text-md); letter-spacing: -0.01em;
  box-shadow: var(--shadow-sm);
}

/* AI Candidate node — keep in sync with .canvas-node.node-candidate */
.node-candidate {
  background: var(--node-candidate-bg); color: var(--node-candidate-text);
  border: 1.5px solid var(--node-candidate-border);
  min-width: 100px; min-height: 44px; padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm); font-weight: 500;
  box-shadow: var(--node-candidate-shadow); opacity: 0.9;
  transition: all var(--transition);
}
.node-candidate:hover { opacity: 1; border-color: #7c3aed; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(124,58,237,0.18); }

/* Selected / Manual node */
.node-selected, .node-manual {
  background: var(--node-selected-bg); color: var(--color-text);
  border: 1.5px solid var(--node-selected-border);
  min-width: 120px; min-height: 48px; padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm); font-weight: 500;
  box-shadow: var(--node-selected-shadow);
}

/* Connect node */
.node-connect {
  background: var(--node-connect-bg); color: var(--node-connect-text);
  border: 1.5px solid var(--node-connect-border);
  min-width: 160px; min-height: 60px; padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm); line-height: 1.5;
  box-shadow: var(--shadow-sm); border-radius: var(--radius-lg);
}

/* Image / Video node */
.node-image, .node-video {
  background: var(--color-surface); border: 1.5px solid var(--color-border);
  min-width: 200px; min-height: 150px; border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
  flex-direction: column; align-items: stretch;
}
.node-media-content { flex: 1; overflow: hidden; position: relative; }
.node-media-content img, .node-media-content video { width: 100%; height: 100%; object-fit: cover; }
.node-media-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--space-2);
  background: var(--color-surface-2); color: var(--color-text-3); font-size: var(--text-sm);
}
.node-media-footer { padding: var(--space-2) var(--space-3); font-size: var(--text-xs); color: var(--color-text-3); border-top: 1px solid var(--color-border); }

/* Selected state */
.node.selected { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Node action buttons */
.node-actions {
  position: absolute; top: -32px; left: 50%; transform: translateX(-50%);
  display: none; align-items: center; gap: var(--space-1);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: var(--space-1); box-shadow: var(--shadow);
  white-space: nowrap; z-index: 20;
}
.node.selected .node-actions { display: flex; }

/* Expand/Collapse toggle */
.node-toggle {
  position: absolute; top: -10px; right: -10px;
  width: 20px; height: 20px; border-radius: var(--radius-full);
  background: var(--color-accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow-sm); z-index: 5;
  transition: background var(--transition), transform var(--transition);
}
.node-toggle:hover { background: var(--color-accent-hover); transform: scale(1.1); }

/* Connection points */
.conn-point {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 10px; height: 10px; border-radius: var(--radius-full);
  background: var(--color-surface); border: 2px solid var(--color-accent);
  cursor: crosshair; opacity: 0; transition: opacity var(--transition);
  z-index: 10;
}
.node:hover .conn-point, .node.selected .conn-point { opacity: 1; }
.conn-point.left { left: -6px; }
.conn-point.right { right: -6px; }
.conn-point:hover { background: var(--color-accent); transform: translateY(-50%) scale(1.2); }

/* Node editing */
.node-edit-input {
  width: 100%; background: transparent; border: none; outline: none;
  font: inherit; color: inherit; text-align: center; resize: none;
  min-width: 80px;
}

/* ============================================================
   Edge (SVG)
   ============================================================ */
.edge-branch { stroke: var(--edge-branch); stroke-width: 1.5; fill: none; stroke-linecap: round; }
.edge-connect { stroke: var(--edge-connect); stroke-width: 2; fill: none; stroke-dasharray: 6 3; stroke-linecap: round; }
.edge-drawing { stroke: var(--color-accent); stroke-width: 1.5; fill: none; stroke-dasharray: 4 2; stroke-linecap: round; }

/* ============================================================
   Right Toolbar
   ============================================================ */
.right-toolbar {
  position: absolute; right: var(--space-4); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: var(--space-2);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); padding: var(--space-2); box-shadow: var(--shadow-md);
  z-index: 10;
}
.toolbar-tool {
  width: 44px; height: 44px; border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  cursor: grab; color: var(--color-text-2); font-size: 10px; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  user-select: none;
}
.toolbar-tool:hover { background: var(--color-surface-2); color: var(--color-text); }
.toolbar-tool.dragging { cursor: grabbing; background: var(--color-accent-light); color: var(--color-accent); }
.toolbar-divider { height: 1px; background: var(--color-border); margin: var(--space-1) 0; }

/* Drag ghost */
.drag-ghost {
  position: fixed; pointer-events: none; z-index: 9999;
  background: var(--color-surface); border: 1.5px dashed var(--color-accent);
  border-radius: var(--radius); padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm); color: var(--color-accent); box-shadow: var(--shadow-md);
  transform: rotate(2deg);
}

/* ============================================================
   Selection Box
   ============================================================ */
.selection-box {
  position: absolute; border: 1.5px solid var(--color-accent);
  background: rgba(37,99,235,0.05); pointer-events: none; z-index: 5;
  border-radius: var(--radius-sm);
}

/* ============================================================
   Modal / Dialog
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: var(--space-4);
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--color-surface); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 480px;
  border: 1px solid var(--color-border); overflow: hidden;
}
.modal-header { padding: var(--space-5) var(--space-6) var(--space-4); border-bottom: 1px solid var(--color-border); }
.modal-title { font-size: var(--text-md); font-weight: 600; }
.modal-body { padding: var(--space-5) var(--space-6); }
.modal-footer { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--color-border); display: flex; justify-content: flex-end; gap: var(--space-2); }

/* Radio group (used by platform-member create / change-role modals) */
.radio-group { display: flex; flex-direction: column; gap: var(--space-2); }
.radio-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.radio-row:hover { background: var(--color-surface-2); }
.radio-row:has(input:checked) { border-color: var(--color-primary, #2563EB); background: var(--color-surface-2); }
.radio-row input[type="radio"] { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--color-primary, #2563EB); }
.radio-row-main { display: flex; flex-direction: column; gap: 2px; }
.radio-row-title { font-size: var(--text-sm); font-weight: 500; color: var(--color-text); }
.radio-row-sub { font-size: 11px; color: var(--color-text-2); font-family: monospace; }
.form-hint { margin-top: var(--space-2); line-height: 1.5; }

/* Prompt confirm modal */
.prompt-preview {
  background: var(--color-surface-2); border-radius: var(--radius);
  padding: var(--space-3); font-size: var(--text-sm); line-height: 1.6;
  color: var(--color-text-2); margin-bottom: var(--space-4); min-height: 80px;
  border: 1px solid var(--color-border);
}
.prompt-edit { width: 100%; }

/* ============================================================
   Credits Badge
   ============================================================ */
.credits-badge {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-3); border-radius: var(--radius-full);
  background: var(--color-surface-2); border: 1px solid var(--color-border);
  font-size: var(--text-xs); font-weight: 500; cursor: pointer;
  transition: background var(--transition);
}
.credits-badge:hover { background: var(--color-border); }
.credits-badge-value { font-weight: 600; }
.credits-badge-low { border-color: var(--color-warning); background: var(--color-warning-light); color: #92400e; }

/* ============================================================
   Admin Layout
   ============================================================ */
.admin-shell { display: flex; height: 100vh; overflow: hidden; }
.admin-sidebar {
  width: 200px; flex-shrink: 0; background: #111; color: #fff;
  display: flex; flex-direction: column; padding: var(--space-4);
}
.admin-logo { font-size: var(--text-md); font-weight: 700; margin-bottom: var(--space-6); opacity: 0.9; }
.admin-logo span { opacity: 0.5; font-weight: 400; }
.admin-nav { flex: 1; display: flex; flex-direction: column; gap: var(--space-1); }
.admin-nav-item {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  font-size: var(--text-sm); color: rgba(255,255,255,0.6); cursor: pointer;
  transition: background var(--transition), color var(--transition);
  display: flex; align-items: center; gap: var(--space-2);
}
.admin-nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.admin-nav-item.active { background: rgba(255,255,255,0.12); color: #fff; font-weight: 500; }
.admin-main { flex: 1; overflow-y: auto; background: var(--color-bg); }
.admin-page { padding: var(--space-6); max-width: 1200px; }
.admin-page-title { font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-6); letter-spacing: -0.02em; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-6); }
.stat-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); }
.stat-label { font-size: var(--text-xs); color: var(--color-text-3); font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-2); }
.stat-value { font-size: var(--text-2xl); font-weight: 700; letter-spacing: -0.02em; }
.stat-sub { font-size: var(--text-xs); color: var(--color-text-3); margin-top: var(--space-1); }

/* Table */
.table-wrap { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: var(--space-3) var(--space-4); text-align: left; font-size: var(--text-xs); font-weight: 600; color: var(--color-text-3); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--color-border); background: var(--color-surface-2); }
.table td { padding: var(--space-3) var(--space-4); font-size: var(--text-sm); border-bottom: 1px solid var(--color-border); }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--color-surface-2); }

/* Badge */
.badge { display: inline-flex; align-items: center; padding: 2px var(--space-2); border-radius: var(--radius-full); font-size: 11px; font-weight: 500; }
.badge-green { background: var(--color-success-light); color: #166534; }
.badge-red { background: var(--color-danger-light); color: #991b1b; }
.badge-yellow { background: var(--color-warning-light); color: #92400e; }
.badge-blue { background: var(--color-accent-light); color: #1e40af; }
.badge-gray { background: var(--color-surface-2); color: var(--color-text-2); }

/* Pagination */
.pagination { display: flex; align-items: center; gap: var(--space-2); padding: var(--space-4); border-top: 1px solid var(--color-border); justify-content: center; }
.pagination-info { font-size: var(--text-sm); color: var(--color-text-3); }

/* ============================================================
   Loading Spinner
   ============================================================ */
.spinner {
  width: 18px; height: 18px; border: 2px solid var(--color-border);
  border-top-color: var(--color-accent); border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite; display: inline-block;
}
.spinner-sm { width: 14px; height: 14px; border-width: 1.5px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Toast notifications
   ============================================================ */
.toast-container { position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: var(--space-2); pointer-events: none; }
.toast {
  background: #111; color: #fff; padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg); font-size: var(--text-sm); box-shadow: var(--shadow-lg);
  pointer-events: all; animation: toast-in 0.2s ease; max-width: 320px; text-align: center;
}
.toast-success { background: #166534; }
.toast-error { background: var(--color-danger); }
.toast-warning { background: #92400e; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============================================================
   Context Menu
   ============================================================ */
.context-menu {
  position: fixed; z-index: 500; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: var(--space-1); min-width: 160px;
}
.context-item {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  font-size: var(--text-sm); cursor: pointer; display: flex; align-items: center; gap: var(--space-2);
  transition: background var(--transition);
}
.context-item:hover { background: var(--color-surface-2); }
.context-item.danger { color: var(--color-danger); }
.context-item.danger:hover { background: var(--color-danger-light); }
.context-sep { height: 1px; background: var(--color-border); margin: var(--space-1) 0; }

/* ============================================================
   Dropdown
   ============================================================ */
.dropdown { position: relative; display: inline-flex; }
.dropdown-menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: 100;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); min-width: 160px; padding: var(--space-1);
}
.dropdown-item { padding: var(--space-2) var(--space-3); font-size: var(--text-sm); cursor: pointer; border-radius: var(--radius-sm); display: flex; align-items: center; gap: var(--space-2); transition: background var(--transition); }
.dropdown-item:hover { background: var(--color-surface-2); }
.dropdown-item.danger { color: var(--color-danger); }
.dropdown-item.danger:hover { background: var(--color-danger-light); }

/* ============================================================
   Notifications（站内信：信封 + 活动）
   ============================================================ */
.sidebar-divider { height: 1px; background: var(--color-border); margin: var(--space-2) 0; }
/* 未读小红点（纯红点无数字） */
.notif-dot {
  position: absolute; top: 6px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-danger, #ef4444);
  box-shadow: 0 0 0 2px var(--color-surface);
}
/* 通知浮层面板 */
.notif-panel {
  position: absolute; z-index: 1200;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 320px; max-height: 420px; display: flex; flex-direction: column;
  overflow: hidden;
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm); font-weight: 600;
}
.notif-panel-head .notif-mark-all {
  font-size: var(--text-xs); color: var(--color-accent); cursor: pointer; font-weight: 500;
}
.notif-panel-body { overflow-y: auto; flex: 1; }
.notif-item {
  padding: var(--space-3); border-bottom: 1px solid var(--color-border);
  cursor: pointer; transition: background var(--transition);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--color-surface-2); }
.notif-item.unread { background: var(--color-accent-light); }
.notif-item-title { font-size: var(--text-sm); font-weight: 500; margin-bottom: 2px; }
.notif-item-body { font-size: var(--text-xs); color: var(--color-text-3); line-height: 1.4; }
.notif-item-time { font-size: var(--text-xs); color: var(--color-text-3); margin-top: 4px; opacity: 0.7; }
.notif-empty { padding: var(--space-6) var(--space-3); text-align: center; font-size: var(--text-sm); color: var(--color-text-3); }

/* ============================================================
   Animations
   ============================================================ */
.fade-in { animation: fadeIn 0.15s ease; }
.scale-in { animation: scaleIn 0.15s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* Candidate nodes expand animation */
@keyframes nodeExpand {
  from { opacity: 0; transform: scale(0.65); }
  to   { opacity: 1; transform: scale(1); }
}
.node-candidate.entering { animation: nodeExpand 0.22s cubic-bezier(0.34,1.56,0.64,1) forwards; }
@keyframes nodeCollapse { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(0.65); } }
.node-candidate.leaving { animation: nodeCollapse 0.15s ease forwards; }

/* ============================================================
   Responsive (canvas is desktop-only)
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .auth-card { padding: var(--space-6); }
}

/* ============================================================
   Canvas Engine — Node Anchors
   ============================================================ */
.node-anchor {
  position: absolute; top: 50%; width: 10px; height: 10px;
  background: var(--color-accent); border: 2px solid white;
  border-radius: 50%; transform: translateY(-50%);
  opacity: 0; transition: opacity 0.15s; cursor: crosshair; z-index: 10;
}
.canvas-node:hover .node-anchor { opacity: 1; }
.node-anchor-left  { left:  -6px; }
.node-anchor-right { right: -6px; }
.connecting .node-anchor { opacity: 1 !important; cursor: crosshair; }

/* ============================================================
   Canvas Engine — SVG Edges
   ============================================================ */
/* 连线层沉到节点下方（z-index:1 < .canvas-world 的 2）：
   ① 流光/连线不再渗进节点框、不再压住节点按钮；
   ② 被节点盖住的连线段自然点不到（也不该点到），节点空白区的连线仍可点删除。 */
.canvas-edge-svg { pointer-events: none; z-index: 1; }
/* 只有基础连线可点（删除菜单）；流光/临时连线不参与命中 */
.canvas-edge-svg path.edge { pointer-events: stroke; }
.canvas-edge-svg .edge-flow-glow,
.canvas-edge-svg .edge-flow-core,
.canvas-edge-svg line.edge-connecting { pointer-events: none; }

path.edge, line.edge {
  fill: none; stroke: #c4b5fd; stroke-width: 1.5;
  stroke-linecap: round; cursor: pointer;
  transition: stroke 0.15s, stroke-width 0.15s;
}
path.edge:hover { stroke: #7c3aed; stroke-width: 2; }
path.edge-expand { stroke: #a78bfa; stroke-width: 1.5; opacity: 0.85; }
path.edge-connect { stroke: #fbbf24; stroke-width: 2; stroke-dasharray: 5 3; }
line.edge-connecting {
  stroke: #7c3aed; stroke-width: 1.5; stroke-dasharray: 6 4;
  pointer-events: none;
}

/* ============================================================
   链路流光 — 蓝青柔光双层流动（悬停 / 选中触发）
   配色：光晕 #38bdf8（蓝青之间）+ 白芯，节点高亮边框 #0ea5e9
   ============================================================ */
/* 双层流光：默认完全隐藏，仅链路上 .lit 时显现 */
.edge-flow-glow {
  fill: none;
  stroke: #38bdf8;
  stroke-width: 9;
  stroke-linecap: round;
  filter: url(#flow-blur);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.edge-flow-core {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
/* ---- 级别一：含选中节点的整条链路（旁支等）→ 淡蓝静态柔光 ----
   只显隐柔光晕，白芯保持隐藏（不流动），与主线区分。 */
.edge-flow-glow.lit {
  stroke: #7dd3fc;            /* 淡蓝 */
  stroke-width: 7;
  opacity: .5;
  animation: flowSoftPulseSoft 3.6s ease-in-out infinite;
}
/* 非主线的白芯：保持隐藏 */
.edge-flow-core.lit { opacity: 0; }

/* ---- 级别二：根 → 选中节点 的主线 → 更亮的蓝 + 白芯流光 ----
   柔光晕更亮更粗，白芯做缓慢流动（~1.6s 一拍），指明主线方向。 */
.edge-flow-glow.lit.mainline {
  stroke: #0ea5e9;            /* 亮蓝 */
  stroke-width: 10;
  animation: flowSoftPulseStrong 3.2s ease-in-out infinite;
}
.edge-flow-core.lit.mainline {
  stroke: #ffffff;
  stroke-width: 2.6;
  stroke-dasharray: 4 22;
  opacity: 1;
  animation: flowDrift 1.6s linear infinite, flowSoftPulseStrong 3.2s ease-in-out infinite;
}
/* 主线边的逻辑上游端 ≠ SVG 起点(source) 时，反向播放流光，
   保证流光始终「种子 → 下游节点」，不受手动连线拖拽方向影响。 */
.edge-flow-core.lit.mainline.flow-reverse {
  animation: flowDriftReverse 1.6s linear infinite, flowSoftPulseStrong 3.2s ease-in-out infinite;
}

/* 主线过多时的降级：保留亮蓝静态，停掉白芯流动，避免大量动画拖慢 */
.canvas-edge-svg.flow-reduced .edge-flow-core.lit.mainline {
  animation: none;
  opacity: .85;
}
.canvas-edge-svg.flow-reduced .edge-flow-glow.lit.mainline {
  animation: none;
  opacity: .9;
}

/* 无障碍：用户开启「减少动态效果」时，全部停掉流动/呼吸，仅保留静态配色 */
@media (prefers-reduced-motion: reduce) {
  .edge-flow-glow.lit,
  .edge-flow-glow.lit.mainline { animation: none !important; opacity: .85; }
  .edge-flow-core.lit.mainline { animation: none !important; }
}

@keyframes flowSoftPulse       { 0%,100% { opacity: .4;  } 50% { opacity: .9; } }
@keyframes flowSoftPulseSoft   { 0%,100% { opacity: .35; } 50% { opacity: .65; } }
@keyframes flowSoftPulseStrong { 0%,100% { opacity: .5;  } 50% { opacity: 1;  } }
@keyframes flowDrift           { to { stroke-dashoffset: -52; } }
@keyframes flowDriftReverse    { to { stroke-dashoffset:  52; } }

/* 链路内节点：呼吸高亮边框；其余节点淡化聚焦 */
.canvas-node.flow-lit {
  border-color: #0ea5e9 !important;
  animation: flowNodeBreathe 3.4s ease-in-out infinite;
  z-index: 5;
}
.canvas-node.flow-dim {
  opacity: 0.3;
  transition: opacity 0.25s ease;
}
@keyframes flowNodeBreathe {
  0%,100% { box-shadow: 0 0 0 2px rgba(56,189,248,.30); }
  50%     { box-shadow: 0 0 0 5px rgba(56,189,248,.08); }
}

/* ============================================================
   当前选中节点的独立标记（方案 D：对比色外环 + 微放大浮起）
   场景：选中节点时整条链路都会 flow-lit 点亮成蓝色呼吸边框，
   需要让"被点中的那一个"从链路里一眼可辨。
   注意：必须用 .canvas-node.selected（双类，优先级高于 .flow-lit 单类）
   并停掉 flowNodeBreathe 动画，否则琥珀外环/投影会被链路蓝盖住。
   ============================================================ */
.canvas-node.selected {
  outline: 3px solid #f59e0b;        /* 琥珀色外环，与链路蓝形成对比色 */
  outline-offset: 3px;
  border-color: #f59e0b !important;  /* 盖过 flow-lit 的蓝边 */
  transform: scale(1.06);            /* 轻微放大，浮起感 */
  box-shadow: 0 6px 18px rgba(245,158,11,.28) !important;
  animation: none !important;        /* 停掉链路呼吸动画，避免覆盖上面的投影 */
  z-index: 20 !important;            /* 浮到链路其他节点之上 */
}

/* 被连线的节点默认「常亮」：清爽蓝边 + 淡投影，一眼看出连接关系（不再是灰框）。
   优先级低于 .flow-lit（hover/select 呼吸高亮）与 .selected（琥珀选中），可被其覆盖。
   flow-dim 时（聚焦其它链路）不抢戏——下面用 :not(.flow-dim) 限定。 */
.canvas-node.edge-connected:not(.flow-dim):not(.selected):not(.flow-lit) {
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96,165,250,.18), var(--shadow-sm);
}

/* 新建的文本/图片/视频框：浮到普通节点之上，避免被已有的碰撞结果框盖住。
   低于 .selected(20) 的层级，保证选中节点仍能浮到最上。 */
.canvas-node.node-new { z-index: 15; }

/* 非链路连线淡化 */
path.edge.flow-dim { opacity: 0.18; transition: opacity 0.25s ease; }

/* ============================================================
   Canvas Engine — Node Variants
   ============================================================ */
.canvas-world {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0; will-change: transform;
}

.canvas-node {
  position: absolute; user-select: none;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  /* 未选中/未编辑态：整个节点悬浮显示「移动」光标（Windows 十字四箭头），提示可拖动。
     具体文字子元素默认继承 move，只有进入编辑态（textarea 去掉 is-readonly / :focus、
     或 inline-input）才恢复 text 光标（见各子元素规则）。 */
  cursor: move;
  /* 不过渡 transform，避免 selected(scale) 与 hover 之间发生缩放跳变/抽搐 */
  transition: box-shadow 0.15s, border-color 0.15s;
  min-width: 120px;
}
/* hover 仅改变投影与边框，不再做位移，避免与选中态 scale 冲突 */
.canvas-node:hover { box-shadow: var(--shadow-md); border-color: #c4b5fd; }
/* 选中态外观统一由「方案 D」规则负责（见上方 .canvas-node.selected 琥珀外环+放大）。
   选中且 hover 时显式维持 scale，防止 hover 规则覆盖掉 selected 的放大。 */
.canvas-node.selected:hover { transform: scale(1.06); }

/* Seed 节点：与文本节点一致的白底风格，无紫色、无悬浮白框 */
.canvas-node.node-seed {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1.5px solid var(--color-border);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
}
.canvas-node.node-seed:hover {
  box-shadow: var(--shadow-md);
  border-color: #c4b5fd;
}
.canvas-node.node-candidate {
  background: #f5f3ff !important;
  border: 1.5px solid #a78bfa !important;
  color: #5b21b6 !important;
  box-shadow: 0 2px 8px rgba(139,92,246,0.12);
  animation: nodeExpand 0.22s cubic-bezier(0.34,1.56,0.64,1);
}
.canvas-node.node-candidate:hover {
  border-color: #7c3aed;
  box-shadow: 0 4px 12px rgba(124,58,237,0.18);
}
.canvas-node.node-connect {
  background: var(--node-connect-bg);
  border-color: var(--node-connect-border);
  border-width: 1.5px;
  border-style: solid;
  color: var(--node-connect-text);
}
.canvas-node.node-image,
.canvas-node.node-video {
  background: var(--color-surface-2);
  border-style: solid;
  overflow: hidden;
}
/* 已生成媒体（左右布局）：节点宽度由左右两列自然撑开，不被 min-width:120px 挤压。
   编辑态（未生成）仍沿用默认窄宽度。已生成态用 :has() 检测填充布局是否存在。 */
.canvas-node.node-image:has(.node-body-media-filled),
.canvas-node.node-video:has(.node-body-media-filled) {
  width: fit-content;
  max-width: 600px;
}

.node-body {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); min-height: 44px;
}
.node-body-centered {
  justify-content: center; padding: var(--space-2) var(--space-4);
}
.node-body-manual { align-items: flex-start; padding: var(--space-2); }
/* connect 节点：高度随文本自适应，内容从顶部对齐，多行文字正常换行 */
.node-body-connect {
  gap: var(--space-2); font-size: var(--text-sm);
  align-items: flex-start; min-height: 44px;
}
.node-body-connect .node-label { white-space: pre-wrap; }
.node-body-connect .node-connect-badge { margin-top: 2px; }
.node-body-media { padding: 0; justify-content: center; align-items: center; }

/* story 节点：自适应高度的叙事文本，带故事图标徽标，文字可读可选 */
.node-body-story {
  display: flex; gap: var(--space-2); align-items: flex-start;
  font-size: var(--text-sm); line-height: 1.55; min-height: 44px;
}
.node-body-story .node-label { white-space: pre-wrap; flex: 1; }
.node-story-badge {
  flex: none; margin-top: 1px; color: #d97706;       /* 琥珀色，呼应故事主题 */
  display: inline-flex; align-items: center;
}
.node-body-story-loading { align-items: center; }
.node-story-loading {
  display: flex; align-items: center; gap: var(--space-2);
  color: var(--color-text-3); font-size: var(--text-sm);
}

/* ---- 脑洞方向节点（ideas）：AI 涌现的 2-3 个跨界故事方向 ---- */
.canvas-node.node-ideas { width: 300px; }
.node-body-ideas {
  display: flex; flex-direction: column; gap: var(--space-2);
  width: 100%; padding: var(--space-1);
}
.node-body-ideas-loading { align-items: center; min-height: 48px; justify-content: center; }
.node-ideas-loading {
  display: flex; align-items: center; gap: var(--space-2);
  color: var(--color-text-3); font-size: var(--text-sm);
}
.node-ideas-badge { flex: none; color: #d97706; display: inline-flex; align-items: center; }
.node-ideas-header {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-xs, 12px); font-weight: 600; color: var(--color-text-2);
  padding: 0 var(--space-1) var(--space-1);
  border-bottom: 1px dashed var(--color-border);
}
.node-ideas-list { display: flex; flex-direction: column; gap: var(--space-2); }
.node-idea-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: var(--space-2);
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.node-idea-card:hover { border-color: #fcd34d; box-shadow: var(--shadow-sm); }
.node-idea-card.is-expanded { opacity: 0.72; }
.node-idea-title { font-size: var(--text-sm); font-weight: 700; color: var(--color-text-1); line-height: 1.3; }
.node-idea-hook { font-size: var(--text-xs, 12px); color: var(--color-text-2); line-height: 1.5; }
.node-idea-crossover {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  font-size: 11px; color: #b45309; line-height: 1.4;
}
.node-idea-crossover-tag {
  display: inline-block; padding: 1px 6px; border-radius: 999px;
  background: #fef3c7; color: #b45309; font-weight: 600; font-size: 10px;
}
.node-idea-expand-btn {
  align-self: flex-start; margin-top: 2px;
  font-size: var(--text-xs, 12px); font-weight: 600;
  padding: 4px 12px; border-radius: var(--radius-sm);
  border: none; cursor: pointer;
  background: #d97706; color: #fff;
  transition: background var(--transition);
}
.node-idea-expand-btn:hover { background: #b45309; }
.node-idea-expand-btn:disabled { background: var(--color-border); color: var(--color-text-3); cursor: default; }
.spinner-sm {
  width: 14px; height: 14px; border: 2px solid var(--color-border);
  border-top-color: var(--color-accent); border-radius: 50%;
  display: inline-block; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.node-label {
  flex: 1; font-size: var(--text-sm); line-height: 1.35;
  word-break: break-word;
  /* 未选中/未编辑态统一显示「移动」光标（方案 A）。
     branch / candidate / connect 的文字用 <span class="node-label"> 展示，双击才 replaceWith
     成 .node-inline-input（textarea）进入编辑——编辑态由那个元素负责 text 光标+选字，
     所以此处 span 平时保持 move + user-select:none，避免出现「插入光标 I」。 */
  cursor: move;
  user-select: none; -webkit-user-select: none;
}
/* Centered body: label doesn't stretch, text is centered */
.node-body-centered .node-label {
  flex: unset; text-align: center; max-width: 100%;
}
/* 操作按钮：平时隐藏，hover / 选中 / JS 延迟控制时贴在节点上方外侧、水平居中 */
.node-actions-abs {
  position: absolute;
  bottom: 100%;            /* 紧贴节点顶部之上 */
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  margin-bottom: 6px;      /* 与节点之间留一点缝隙（由 ::after 桥接热区填补） */
  display: flex; gap: 2px; align-items: center;
  padding: 2px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transition: opacity 0.12s, transform 0.12s;
  z-index: 20;
}
/* 显示态：
   - .actions-visible 由 JS 控制（带消失延迟，避免鼠标穿过缝隙时瞬间消失）
   - .selected 选中态常驻显示，点空白才收起（方案 B）
   - 纯 CSS :hover 作为兜底，保证无 JS 时也能用 */
.canvas-node:hover .node-actions-abs,
.canvas-node.actions-visible .node-actions-abs,
.canvas-node.selected .node-actions-abs {
  opacity: 1; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
/* 透明桥接：填补按钮条与节点之间的缝隙（含两侧外扩），
   让鼠标从节点斜向移到按钮条时也始终处于 hover 热区，不会断连闪烁 */
.node-actions-abs::after {
  content: ''; position: absolute;
  left: -12px; right: -12px; top: 100%; height: 12px;
}

/* 可编辑节点（seed/manual）：水平垂直居中（任务2） */
/* 可编辑节点体：绝对定位填满整个节点，彻底消除节点四周的"死区"。
   （死区会落到 .canvas-node 上，按下即触发拖动而非选字。
    .canvas-node 需要 position:relative 作为定位上下文——已在 .canvas-node 设置 position:absolute，
    其子元素 absolute 即相对该节点定位。） */
.node-body-editable {
  display: block;
  position: absolute;
  inset: 0;                 /* top/right/bottom/left = 0，填满整个节点 */
  padding: 0;
  box-sizing: border-box;
}

.node-connect-badge {
  flex-shrink: 0; color: var(--color-warning);
  display: flex; align-items: center;
}

.node-textarea {
  width: 100%; border: none; outline: none; background: transparent;
  resize: none; font-size: var(--text-sm); line-height: 1.4;
  font-family: inherit; color: var(--color-text);
  padding: var(--space-2); min-height: 40px;
  box-sizing: border-box;
  overflow: hidden;
  /* 默认（未编辑）显示「移动」光标、禁止选字，与整个节点统一（方案 A）。
     进入编辑态后由 :focus 规则恢复 text 光标 + 可选字。 */
  cursor: move;
  user-select: none; -webkit-user-select: none;
}
/* 正在编辑（获得焦点）：恢复文本插入光标，允许选中/复制文字。 */
.node-textarea:focus {
  cursor: text;
  user-select: text; -webkit-user-select: text;
}
/* readonly 文本节点：单击=选中拖动，双击=编辑。
   与默认态一致（move + 禁选），双击去掉 is-readonly 并 focus 后由上面的 :focus 规则接管。 */
.node-textarea.is-readonly {
  cursor: move;
  user-select: none; -webkit-user-select: none;
}
/* 居中型 textarea：填满整个节点体，文字水平居中。
   textarea 不能用 display:flex（会破坏原生选择/光标），用 text-align 居中，
   并填满节点以消除可触发拖动的边缘死区。 */
.node-textarea-centered {
  text-align: center;
  width: 100%; height: 100%; min-height: 40px;
  box-sizing: border-box;
  resize: none;
  display: block;
}

.node-inline-input {
  flex: 1; width: 100%; box-sizing: border-box;
  border: none; border-bottom: 1px solid var(--color-accent);
  outline: none; background: transparent; font-size: var(--text-sm);
  font-family: inherit; color: var(--color-text); padding: 0;
  /* 多行编辑：自动换行、随内容撑高，避免长文本塌成横条 */
  line-height: 1.35; resize: none; overflow: hidden;
  white-space: pre-wrap; word-break: break-word;
  /* 行内编辑同样允许选字 */
  user-select: text; -webkit-user-select: text; cursor: text;
}

/* 注意：.node-image / .node-video 既是节点容器的类名（canvas-node node-image），
   也是已生成媒体 <img>/<video> 元素的类名。此处样式仅针对「媒体元素本身」，
   必须用 img./video. 限定，否则 max-height:360px 会误加到编辑态节点容器上，
   把长提示词下方的「生成」按钮裁掉（overflow:hidden）。 */
img.node-image { width: 100%; height: auto; max-height: 360px; object-fit: contain; display: block; }
video.node-video { width: 100%; height: auto; max-height: 360px; object-fit: contain; display: block; }
.node-media-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-2); padding: var(--space-4);
  color: var(--color-text-3); font-size: var(--text-xs); text-align: center;
  width: 100%; min-height: 120px;
}

/* ── 媒体节点：可编辑 prompt + 生成按钮（任务4）── */
/* 未生成态：图标 + 输入框 + 生成按钮，垂直布局 */
.node-body-media-edit {
  display: flex; flex-direction: column; align-items: stretch;
  gap: var(--space-2); padding: var(--space-3);
  width: 100%;
}
.node-media-edit-icon {
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-3); padding: var(--space-1) 0;
}
.node-media-prompt-input {
  width: 100%; border: 1px solid var(--color-border);
  border-radius: var(--radius-sm); background: var(--color-surface);
  resize: none; font-size: var(--text-sm); line-height: 1.5;
  font-family: inherit; color: var(--color-text);
  padding: var(--space-2); min-height: 48px; max-height: 260px;
  text-align: left; overflow-y: auto; box-sizing: border-box;
  /* 默认与其它节点统一为 move + 禁选，:focus 编辑态恢复 text（见下） */
  user-select: none; -webkit-user-select: none; cursor: move;
}
.node-media-prompt-input:focus {
  outline: none; border-color: var(--color-accent);
  cursor: text; user-select: text; -webkit-user-select: text;
}
.node-media-gen-btn {
  flex-shrink: 0; border: none; cursor: pointer;
  background: var(--color-accent, #6d28d9); color: #fff;
  border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm); font-weight: 600;
  transition: filter var(--transition);
}
.node-media-gen-btn:hover { filter: brightness(1.08); }
.node-media-gen-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

/* 「在此基础上修改」：次要按钮，全宽，放在生成按钮下方，视觉从属主操作 */
.node-media-remix-btn {
  margin-top: var(--space-2);
  width: 100%;
  border: 1px solid var(--color-border, #e5e7eb);
  background: transparent;
  color: var(--color-text-2, #4b5563);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.node-media-remix-btn:hover {
  background: var(--color-surface-2, #f3f4f6);
  border-color: var(--color-accent, #6d28d9);
  color: var(--color-accent, #6d28d9);
}

/* ---------------- 分镜（shot）节点 ---------------- */
.node-body-shot {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface, #fff);
  border-radius: var(--radius-md);
  width: 100%; box-sizing: border-box;
}
.node-shot-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-2);
}
.node-shot-no-badge {
  font-size: var(--text-xs); font-weight: 700;
  color: var(--color-accent, #6d28d9);
  background: color-mix(in srgb, var(--color-accent, #6d28d9) 12%, transparent);
  border-radius: var(--radius-sm); padding: 2px 8px; letter-spacing: 0.02em;
}
.node-shot-toggle {
  border: none; background: transparent; cursor: pointer;
  color: var(--color-text-secondary, #6b7280);
  display: inline-flex; align-items: center; padding: 2px; border-radius: var(--radius-sm);
}
.node-shot-toggle:hover { background: var(--color-hover, #f3f4f6); }
.node-shot-desc-collapsed {
  font-size: var(--text-sm); color: var(--color-text-secondary, #6b7280);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px;
}
.node-shot-field { display: flex; flex-direction: column; gap: 2px; }
.node-shot-label {
  font-size: var(--text-xs); font-weight: 600;
  color: var(--color-text-secondary, #6b7280);
}
.node-shot-desc-input, .node-shot-vo-input {
  width: 100%; box-sizing: border-box; resize: none;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2);
  font-size: var(--text-sm); line-height: 1.4; min-height: 34px;
  background: var(--color-bg, #fafafa);
}
.node-shot-desc-input.is-readonly, .node-shot-vo-input.is-readonly {
  cursor: grab; background: transparent; border-color: transparent;
}
.node-shot-meta { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.node-shot-meta-item { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 64px; }
.node-shot-select {
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-sm); padding: 2px 4px;
  font-size: var(--text-xs); background: #fff; cursor: pointer;
}
.node-shot-media { margin-top: var(--space-1); border-radius: var(--radius-sm); overflow: hidden; }
.node-shot-media .node-image, .node-shot-media .node-video { width: 100%; display: block; border-radius: var(--radius-sm); }
/* 视频为横版(16:9)：固定 16:9 画框 + contain，避免被竖版卡片拉伸成狭长条 */
.node-shot-media.is-video { aspect-ratio: 16 / 9; background: #000; }
.node-shot-media.is-video .node-video { width: 100%; height: 100%; object-fit: contain; border-radius: var(--radius-sm); }
.node-shot-actions { display: flex; gap: var(--space-2); margin-top: var(--space-1); }
.node-shot-gen-btn {
  flex: 1 1 0; border: none; cursor: pointer;
  background: var(--color-accent, #6d28d9); color: #fff;
  border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs); font-weight: 600;
  transition: filter var(--transition);
}
.node-shot-gen-btn-video { background: var(--color-text, #374151); }
/* 下载视频：次要按钮（描边），与「重新生成视频」的实心按钮区分 */
.node-shot-download-btn {
  background: var(--color-surface, #fff);
  color: var(--color-accent, #6d28d9);
  border: 1px solid var(--color-accent, #6d28d9);
}
.node-shot-download-btn:hover { filter: none; background: var(--color-accent-soft, #f3effe); }
.node-shot-gen-btn:hover { filter: brightness(1.08); }

/* 角色参考图角标：节点右上角浮动 */
.node-ref-badge {
  position: absolute; top: -8px; right: -8px; z-index: 4;
  width: 22px; height: 22px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border); border-radius: 50%;
  background: var(--color-surface); color: var(--color-text-3);
  cursor: pointer; box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.12));
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
  opacity: 0; pointer-events: none;
}
/* 默认隐藏，hover 节点或选中时显示；已挂图则常驻显示 */
.canvas-node:hover .node-ref-badge,
.canvas-node.selected .node-ref-badge,
.node-ref-badge.node-ref-badge-img {
  opacity: 1; pointer-events: auto;
}
.node-ref-badge:hover { color: var(--color-accent); border-color: var(--color-accent); transform: scale(1.08); }
.node-ref-badge-img {
  overflow: visible; padding: 0; width: 26px; height: 26px;
  border-color: var(--color-accent); position: relative;
}
.node-ref-badge-img img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }
.node-ref-badge-count {
  position: absolute; top: -6px; right: -6px; min-width: 15px; height: 15px;
  padding: 0 3px; box-sizing: border-box;
  border-radius: 8px; background: var(--color-accent); color: #fff;
  font-size: 10px; line-height: 15px; text-align: center; font-weight: 600;
  border: 1px solid var(--color-surface, #fff);
}

/* 参考图管理弹窗 */
.ref-image-modal { display: flex; flex-direction: column; gap: var(--space-3); align-items: center; }
.ref-image-preview {
  max-width: 100%; max-height: 260px; border-radius: var(--radius-md);
  border: 1px solid var(--color-border); object-fit: contain;
}
.ref-image-hint { font-size: var(--text-sm); color: var(--color-text-3); text-align: center; margin: 0; }
.ref-image-name-label { align-self: flex-start; font-size: var(--text-sm); font-weight: 600; color: var(--color-text-2); margin-top: var(--space-1); }
.ref-image-name-input { width: 100%; }

/* 图片节点自带参考图区域：prompt 框下方 */
.node-media-refs {
  display: flex; flex-direction: column; gap: var(--space-1);
  width: 100%;
}
.node-media-refs-label {
  font-size: var(--text-xs, 12px); color: var(--color-text-3);
}
.node-media-refs-list {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.node-media-ref-thumb {
  position: relative; width: 44px; height: 44px;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--color-border);
}
.node-media-ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.node-media-ref-del {
  position: absolute; top: -6px; right: -6px;
  width: 16px; height: 16px; line-height: 14px; padding: 0;
  border-radius: 50%; border: 1px solid var(--color-border);
  background: var(--color-surface); color: var(--color-text-2);
  font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.12));
}
.node-media-ref-del:hover { color: #ef4444; border-color: #ef4444; }
.node-media-ref-add {
  width: 36px; height: 36px; padding: 0;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--color-border); background: var(--color-surface-2, #f6f6f6);
  color: var(--color-text-3); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: color var(--transition), border-color var(--transition);
}
.node-media-ref-add:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* 角色缩略图名字标签（多角色：每张图记住是谁） */
.node-media-ref-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 1px 3px; font-size: 9px; line-height: 1.2;
  color: #fff; background: rgba(0,0,0,.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: center;
}
.node-media-ref-thumb.is-unnamed .node-media-ref-name { color: #ffd27a; }
.node-media-ref-sync {
  position: absolute; top: -6px; left: -6px;
  width: 16px; height: 16px; line-height: 14px; padding: 0;
  border-radius: 50%; border: 1px solid var(--color-border);
  background: var(--color-surface); color: var(--color-text-2);
  font-size: 11px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,.12));
}
.node-media-ref-sync:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* 📎 两选项弹层（从已有角色表选择 / 本地上传） */
.refpick-overlay {
  position: fixed; inset: 0; z-index: 3200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.28);
}
.refpick-menu {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 10px); box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,.2));
  padding: var(--space-2); min-width: 240px;
  display: flex; flex-direction: column; gap: 6px;
}
.refpick-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--color-surface-2, #f6f6f6); color: var(--color-text-1);
  cursor: pointer; font-size: var(--text-sm, 14px); text-align: left;
  transition: background var(--transition), border-color var(--transition);
}
.refpick-opt:hover { border-color: var(--color-accent); background: var(--color-surface); }
.refpick-opt-icon { display: flex; align-items: center; color: var(--color-text-2); }

/* 跨项目角色选择浮窗 */
.charsel-overlay {
  position: fixed; inset: 0; z-index: 3200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.35);
}
.charsel-panel {
  width: min(620px, 92vw); max-height: 80vh;
  display: flex; flex-direction: column;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 12px); box-shadow: var(--shadow-lg, 0 12px 40px rgba(0,0,0,.25));
  overflow: hidden;
}
.charsel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3); border-bottom: 1px solid var(--color-border);
}
.charsel-title { font-weight: 600; font-size: var(--text-md, 15px); }
.charsel-close {
  background: none; border: none; cursor: pointer; color: var(--color-text-2);
  display: flex; align-items: center; padding: 4px;
}
.charsel-close:hover { color: var(--color-text-1); }
.charsel-search-row { padding: var(--space-2) var(--space-3) 0; }
.charsel-search {
  width: 100%; padding: 8px 10px; box-sizing: border-box;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-text-1); font-size: var(--text-sm, 14px);
}
.charsel-hint {
  padding: 6px var(--space-3); font-size: var(--text-xs, 12px); color: var(--color-text-3);
}
.charsel-body {
  flex: 1; overflow-y: auto; padding: 0 var(--space-3) var(--space-2);
}
.charsel-loading, .charsel-empty {
  padding: 32px; text-align: center; color: var(--color-text-3); font-size: var(--text-sm, 14px);
}
.charsel-proj { border-bottom: 1px solid var(--color-border-2, #eee); }
.charsel-proj-head {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 10px 4px; background: none; border: none; cursor: pointer;
  color: var(--color-text-1); font-size: var(--text-sm, 14px); text-align: left;
}
.charsel-proj-head:hover { color: var(--color-accent); }
.charsel-proj-caret { width: 14px; color: var(--color-text-3); }
.charsel-proj-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.charsel-proj-count {
  font-size: var(--text-xs, 12px); color: var(--color-text-3);
  background: var(--color-surface-2, #f2f2f2); border-radius: 10px; padding: 1px 8px;
}
.charsel-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px; padding: 4px 4px 12px;
}
.charsel-card {
  border: 2px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; overflow: hidden; background: var(--color-surface-2, #f6f6f6);
  transition: border-color var(--transition);
}
.charsel-card:hover { border-color: var(--color-border); }
.charsel-card.is-selected { border-color: var(--color-accent); }
.charsel-card.is-dup { opacity: .45; cursor: not-allowed; }
.charsel-card-img {
  width: 100%; aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
  color: var(--color-text-3); background: var(--color-surface-2, #eee);
}
.charsel-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.charsel-card-name {
  padding: 4px 6px; font-size: var(--text-xs, 12px); color: var(--color-text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
}
.charsel-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3); border-top: 1px solid var(--color-border);
}
.charsel-count { font-size: var(--text-sm, 14px); color: var(--color-text-2); }
.charsel-footer-btns { display: flex; gap: 8px; }

/* 操作行：分辨率选择器 + 生成按钮 横排 */
.node-media-actions {
  display: flex; align-items: center; gap: var(--space-2);
  width: 100%; flex-wrap: wrap;
}
.node-media-size {
  display: flex; align-items: center; gap: var(--space-1);
  min-width: 0;
}
.node-media-size-label {
  font-size: var(--text-xs, 12px); color: var(--color-text-3);
  white-space: nowrap;
}
.node-media-size-select,
.node-media-vres-select,
.node-media-ratio-select {
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-text);
  font-size: var(--text-xs, 12px); font-family: inherit;
  padding: 2px 4px; cursor: pointer; max-width: 72px;
}
.node-media-size-select:focus,
.node-media-vres-select:focus,
.node-media-ratio-select:focus { outline: none; border-color: var(--color-accent); }
/* 生成按钮推到行尾，占满剩余宽度 */
.node-media-actions .node-media-gen-btn { margin-left: auto; }

/* AI 撰写提示词中：输入框位置显示 spinner + 文案 */
.node-media-prompt-loading {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: var(--space-2); min-height: 48px; padding: var(--space-2);
  border: 1px dashed var(--color-border); border-radius: var(--radius-sm);
  color: var(--color-text-3); font-size: var(--text-sm); text-align: center;
}
.node-spinner-sm { width: 16px; height: 16px; border-width: 2px; flex-shrink: 0; }

/* 已生成态：媒体在上，prompt + 重生成按钮在下 */
/* 生成后：左右布局 —— 左侧 prompt 编辑区 + 折叠按钮 + 右侧图片 */
.node-body-media-filled {
  display: flex; flex-direction: row; align-items: stretch;
  width: auto; position: relative;
}
/* 左侧 prompt 区：固定宽度 */
.node-media-left {
  display: flex; flex-direction: column; gap: var(--space-2); align-items: stretch;
  width: 220px; flex: 0 0 220px;
  padding: var(--space-2);
}
.node-media-left .node-media-prompt-input { min-height: 36px; }
/* 折叠按钮：夹在左右之间的"书脊" */
.node-media-collapse-btn {
  flex: 0 0 auto; width: 18px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-left: 1px solid var(--color-border);
  background: var(--color-surface-2, #f6f6f6); color: var(--color-text-3);
  cursor: pointer; transition: background var(--transition), color var(--transition);
}
.node-media-collapse-btn:hover { background: var(--color-accent-light, #ede9fe); color: var(--color-accent); }
/* 右侧图片区 */
.node-media-right {
  flex: 0 0 auto; width: 300px; min-width: 200px; max-width: 360px;
  display: flex; align-items: flex-start; justify-content: center;
  background: var(--color-surface-2, #f6f6f6);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  overflow: hidden;
}
/* 折叠态：右侧消失，节点缩回只剩左侧 */
.node-body-media-filled.is-collapsed { width: auto; }
.node-body-media-filled.is-collapsed .node-media-collapse-btn { border-left: none; border-right: 1px solid var(--color-border); }

.node-body-media-filled .node-image,
.node-body-media-filled .node-video {
  width: 100%; height: auto; max-height: 360px;
  object-fit: contain; display: block;
}
/* 图片可点击放大：hover 显示放大提示 */
.node-media-view { position: relative; width: 100%; cursor: zoom-in; display: block; }
.node-media-zoom-hint {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45); color: #fff;
  opacity: 0; transition: opacity var(--transition); pointer-events: none;
}
.node-media-view:hover .node-media-zoom-hint { opacity: 1; }

/* 兼容旧单列结构（如有遗留） */
.node-media-prompt {
  display: flex; flex-direction: column; gap: var(--space-2); align-items: stretch;
  padding: var(--space-2); border-top: 1px solid var(--color-border);
}
.node-media-prompt .node-media-prompt-input { min-height: 36px; }

/* ============================================================
   角色库面板（Character Library）：项目级 图片→角色名 映射
   ============================================================ */
.charlib-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.charlib-panel {
  width: 560px; max-width: 94vw; max-height: 86vh;
  background: var(--color-surface, #fff);
  border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  display: flex; flex-direction: column; overflow: hidden;
}
.charlib-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--color-border, #eee);
}
.charlib-title { font-size: 16px; font-weight: 700; color: var(--color-text, #111); }
.charlib-close {
  border: none; background: transparent; cursor: pointer;
  color: var(--color-text-secondary, #666); padding: 4px; border-radius: 6px;
  display: flex; align-items: center;
}
.charlib-close:hover { background: var(--color-bg-subtle, #f3f4f6); }
.charlib-hint {
  padding: 10px 18px; font-size: 12.5px; line-height: 1.5;
  color: var(--color-text-secondary, #6b7280); background: var(--color-bg-subtle, #f9fafb);
}
.charlib-list {
  padding: 12px 18px; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: 10px;
}
.charlib-empty {
  padding: 32px 12px; text-align: center;
  color: var(--color-text-secondary, #9ca3af); font-size: 13px;
}
.charlib-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border: 1px solid var(--color-border, #eee);
  border-radius: 10px; background: var(--color-surface, #fff);
}
.charlib-card-imgs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.charlib-thumb {
  position: relative; width: 44px; height: 44px; border-radius: 8px;
  overflow: hidden; background: var(--color-bg-subtle, #f3f4f6);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.charlib-thumb img { width: 100%; height: 100%; object-fit: cover; }
.charlib-thumb-empty { color: #bbb; font-size: 18px; }
.charlib-thumb-del {
  position: absolute; top: 1px; right: 1px; width: 16px; height: 16px;
  border: none; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff;
  font-size: 10px; line-height: 16px; cursor: pointer; padding: 0;
}
.charlib-thumb-add {
  border: 1px dashed var(--color-border, #d1d5db); background: transparent;
  color: var(--color-text-secondary, #9ca3af); font-size: 20px; cursor: pointer;
}
.charlib-thumb-add:hover { border-color: var(--color-primary, #6366f1); color: var(--color-primary, #6366f1); }
.charlib-name {
  flex: 1; min-width: 60px; padding: 7px 10px; font-size: 13px;
  border: 1px solid var(--color-border, #e5e7eb); border-radius: 8px;
  color: var(--color-text, #111); background: var(--color-surface, #fff);
}
.charlib-name:focus { outline: none; border-color: var(--color-primary, #6366f1); }
.charlib-card-del {
  border: none; background: transparent; cursor: pointer; padding: 6px;
  color: var(--color-text-secondary, #9ca3af); border-radius: 6px; flex: 0 0 auto;
}
.charlib-card-del:hover { background: #fee2e2; color: #dc2626; }
.charlib-actions {
  display: flex; gap: 10px; padding: 14px 18px;
  border-top: 1px solid var(--color-border, #eee);
}
.charlib-btn {
  flex: 1; padding: 9px 12px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--color-border, #d1d5db); border-radius: 9px;
  background: var(--color-surface, #fff); color: var(--color-text, #374151);
  cursor: pointer;
}
.charlib-btn:hover { background: var(--color-bg-subtle, #f3f4f6); }
.charlib-btn-primary {
  background: var(--color-primary, #6366f1); color: #fff; border-color: var(--color-primary, #6366f1);
}
.charlib-btn-primary:hover { filter: brightness(1.06); background: var(--color-primary, #6366f1); }

/* ============================================================
   媒体放大灯箱（Lightbox）：全屏置灰遮罩 + 大图 + 右上角关闭
   ============================================================ */
.media-lightbox-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.78);
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}
.media-lightbox-stage {
  max-width: 92vw; max-height: 92vh;
  display: flex; align-items: center; justify-content: center;
}
.media-lightbox-img, .media-lightbox-video {
  max-width: 92vw; max-height: 92vh;
  object-fit: contain; border-radius: var(--radius-md);
  box-shadow: 0 12px 48px rgba(0,0,0,.5);
  cursor: default;
}
.media-lightbox-close {
  position: fixed; top: 20px; right: 24px; z-index: 10000;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: none; background: rgba(255,255,255,.15); color: #fff;
  cursor: pointer; transition: background var(--transition);
}
.media-lightbox-close:hover { background: rgba(255,255,255,.3); }

/* 生成中 loading spinner */
.node-spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent, #6d28d9);
  animation: nodeSpin 0.8s linear infinite;
}
@keyframes nodeSpin { to { transform: rotate(360deg); } }

/* 媒体节点高度自适应（覆盖固定 h，按内容撑开） */
.canvas-node.node-image,
.canvas-node.node-video { height: auto !important; min-height: 150px; }

.node-actions {
  display: flex; gap: 2px; align-items: center;
  margin-left: auto; flex-shrink: 0;
  opacity: 0; transition: opacity 0.12s;
}
.canvas-node:hover .node-actions { opacity: 1; }

.node-btn {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border: none; background: transparent;
  border-radius: var(--radius-sm); cursor: pointer;
  color: var(--color-text-3); transition: all var(--transition);
}
.node-btn:hover { background: var(--color-surface-2); color: var(--color-text); }
.node-btn-select { color: var(--color-accent); }
.node-btn-select:hover { background: var(--color-accent-light); }
.node-seed .node-btn { color: var(--color-text-3); }
.node-seed .node-btn:hover { background: var(--color-surface-2); color: var(--color-text); }
.node-candidate .node-btn { color: #8b5cf6; }
.node-candidate .node-btn:hover { background: rgba(139,92,246,0.10); color: #6d28d9; }

/* Expand/collapse toggle button — color indicates current state */
/* candidates shown → grey ✦ (click to collapse) */
.node-btn-toggle-shown { color: var(--color-text-3) !important; }
.node-btn-toggle-shown:hover { background: var(--color-surface-2); color: var(--color-text-2) !important; }
/* candidates hidden → black ✦ (click to expand) */
.node-btn-toggle-hidden { color: var(--color-text) !important; }
.node-btn-toggle-hidden:hover { background: var(--color-surface-2); color: var(--color-text) !important; }
/* regenerate button */
.node-btn-regen { color: var(--color-accent); }
.node-btn-regen:hover { background: var(--color-accent-light); color: var(--color-accent); }

/* ============================================================
   Canvas Engine — Selection Box
   ============================================================ */
.selection-box {
  position: absolute; pointer-events: none; z-index: 999;
  border: 1.5px dashed var(--color-accent);
  background: rgba(37,99,235,0.05);
  border-radius: 2px;
}

/* ============================================================
   Canvas Engine — Save Indicator
   ============================================================ */
.save-indicator {
  display: flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); padding: 4px 8px;
  border-radius: var(--radius-sm); white-space: nowrap;
}
.save-indicator-saved  { color: var(--color-text-3); }
.save-indicator-saving { color: var(--color-text-3); }
.save-indicator-error  { color: var(--color-danger); }

/* ============================================================
   Canvas Engine — Controls
   ============================================================ */
.canvas-controls {
  position: absolute; bottom: var(--space-4); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: var(--space-1); z-index: 50;
}

/* ============================================================
   Canvas — Right Toolbar
   ============================================================ */
.right-toolbar {
  position: absolute; right: var(--space-4); top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-md);
  padding: var(--space-3) var(--space-2); z-index: 50;
}
.toolbar-tool {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: var(--space-2); border-radius: var(--radius-md); cursor: grab;
  color: var(--color-text-2); font-size: 10px; font-weight: 500;
  transition: all var(--transition); user-select: none; width: 52px;
}
.toolbar-tool:hover { background: var(--color-accent-light); color: var(--color-accent); }
.toolbar-tool:active { cursor: grabbing; }
.toolbar-divider { width: 28px; height: 1px; background: var(--color-border); margin: 2px 0; }

/* 「自由组合」切换按钮：状态用「图标字形」区分（链条↔散点，见 JS），
   而非依赖颜色。OFF=普通平置；ON=凹陷/按下态，让「已激活」更笃定。 */
.toolbar-toggle {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: var(--space-2); border-radius: var(--radius-md); cursor: pointer;
  color: var(--color-text-2); font-size: 10px; font-weight: 500;
  transition: all var(--transition); user-select: none; width: 52px;
  background: transparent; border: 1px solid transparent;
  font-family: inherit; line-height: 1.2; text-align: center;
}
.toolbar-toggle .toolbar-toggle-icon {
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--transition);
}
.toolbar-toggle:hover { background: var(--color-accent-light); color: var(--color-accent); }
.toolbar-toggle:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }

/* ON 态：凹陷（inset 阴影）+ 描边，纯形状/明暗表达激活，不改整体配色语言 */
.toolbar-toggle.is-on {
  color: var(--color-accent);
  background: var(--color-accent-light);
  border-color: var(--color-border);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.18);
}
.toolbar-toggle.is-on .toolbar-toggle-icon { transform: scale(0.92); }

/* 「整理」按钮：借用 .toolbar-tool 外观，但它是 <button> 且为点击动作（非拖拽） */
button.toolbar-tool {
  background: transparent; border: 1px solid transparent;
  font-family: inherit; line-height: 1.2; text-align: center; cursor: pointer;
}
#toolbar-tidy:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
#toolbar-tidy:active { transform: scale(0.94); }

/* ============================================================
   Context Menu — unified
   ============================================================ */
.context-menu-item {
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  font-size: var(--text-sm); cursor: pointer;
  transition: background var(--transition);
}
.context-menu-item:hover { background: var(--color-surface-2); }
.context-menu-item-danger { color: var(--color-danger); }
.context-menu-item-danger:hover { background: var(--color-danger-light); }
.context-menu-separator { height: 1px; background: var(--color-border); margin: var(--space-1) 0; }

/* ============================================================
   Spinner sizes
   ============================================================ */
.spinner-xs {
  display: inline-block; width: 10px; height: 10px;
  border: 1.5px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ============================================================
   Admin — Enhanced Layout
   ============================================================ */
.admin-layout {
  display: flex; height: 100vh; overflow: hidden;
  background: var(--color-bg);
}
.admin-sidebar {
  width: 220px; flex-shrink: 0; background: #18181b;
  color: #e4e4e7; display: flex; flex-direction: column;
  border-right: 1px solid #27272a; overflow-y: auto;
}
.admin-sidebar-logo {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-4); font-weight: 700; font-size: var(--text-sm);
  border-bottom: 1px solid #27272a; color: white;
}
.admin-nav { padding: var(--space-2); flex: 1; }
.admin-nav-footer { padding: var(--space-2); border-top: 1px solid #27272a; }
.admin-nav-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-md);
  font-size: var(--text-sm); color: #a1a1aa; text-decoration: none;
  transition: all var(--transition); cursor: pointer;
}
.admin-nav-item:hover { background: #27272a; color: white; }
.admin-nav-item.active { background: var(--color-accent); color: white; }

.admin-main {
  flex: 1; overflow-y: auto; padding: var(--space-6); background: var(--color-bg);
}
.admin-page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-6);
}
.admin-page-title { font-size: var(--text-xl); font-weight: 700; color: var(--color-text); }
.admin-toolbar {
  display: flex; gap: var(--space-2); align-items: center; margin-bottom: var(--space-4);
}

.admin-section-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin-top: var(--space-6);
}
.admin-chart-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-xl); padding: var(--space-4);
}
.admin-section-title { font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-3); color: var(--color-text-2); }

.admin-info-text { font-size: var(--text-sm); color: var(--color-text-2); margin-bottom: var(--space-4); }
.admin-empty { text-align: center; color: var(--color-text-3); padding: var(--space-8); }
.admin-error { display: flex; align-items: center; gap: var(--space-2); color: var(--color-danger); padding: var(--space-4); }
.admin-loading { display: flex; justify-content: center; padding: var(--space-8); }

/* Stats Grid */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.stat-card {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-xl); padding: var(--space-4);
  display: flex; align-items: center; gap: var(--space-3);
}
.stat-card-icon { flex-shrink: 0; }
.stat-card-value { font-size: var(--text-xl); font-weight: 700; color: var(--color-text); line-height: 1.2; }
.stat-card-label { font-size: var(--text-xs); color: var(--color-text-3); margin-top: 2px; }

/* Admin Table */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-xl); border: 1px solid var(--color-border); }
.admin-table { width: 100%; border-collapse: collapse; background: var(--color-surface); }
.admin-table th {
  padding: var(--space-3) var(--space-4); text-align: left;
  font-size: var(--text-xs); font-weight: 600; color: var(--color-text-2);
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--color-surface-2); border-bottom: 1px solid var(--color-border);
}
.admin-table td {
  padding: var(--space-3) var(--space-4); font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--color-surface-2); }
.admin-table-sm td, .admin-table-sm th { padding: var(--space-2) var(--space-3); }

/* Badge enhancements */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.badge-success { background: var(--color-success-light); color: #166534; }
.badge-warning { background: var(--color-warning-light); color: #92400e; }
.badge-danger  { background: var(--color-danger-light);  color: #991b1b; }
.badge-info    { background: var(--color-accent-light);   color: var(--color-accent); }
.badge-muted   { background: var(--color-surface-2);      color: var(--color-text-3); }
.badge-dark    { background: #374151;                     color: #f9fafb; }

/* Btn group */
.btn-group { display: flex; gap: 4px; }
.btn-xs { padding: 2px 8px; font-size: 11px; height: auto; }
.btn-success { background: var(--color-success); color: white; }
.btn-success:hover { background: #16a34a; }

/* Pagination */
.pagination { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-4); justify-content: center; }
.pagination-info { font-size: var(--text-sm); color: var(--color-text-3); }

/* Text utils */
.text-mono { font-family: ui-monospace, monospace; }
.text-xs    { font-size: var(--text-xs); }
.text-sm    { font-size: var(--text-sm); }
.text-error { color: var(--color-danger); }
.text-muted { color: var(--color-text-3); }
.text-center { text-align: center; }
.mb-2 { margin-bottom: var(--space-2); }

/* ============================================================
   Settings & Credits pages
   ============================================================ */
.settings-container { padding: var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.settings-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-5); }
.settings-card-title { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-2); margin-bottom: var(--space-4); text-transform: uppercase; letter-spacing: 0.04em; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: 1px solid var(--color-border); }
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: var(--text-sm); color: var(--color-text-2); }
.settings-row-hint { padding-top: 0; border-bottom: 1px solid var(--color-border); }
.settings-hint-text { font-size: var(--text-xs, 12px); color: var(--color-text-3, #999); line-height: 1.5; }
.settings-value { font-size: var(--text-sm); color: var(--color-text-1); font-weight: 500; }
.settings-select { font-size: var(--text-sm); padding: var(--space-1) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-text-1); min-width: 180px; cursor: pointer; }
.settings-select:focus { outline: none; border-color: var(--color-primary); }

.credits-total { text-align: center; padding: var(--space-4) 0 var(--space-5); }
.credits-total-value { display: block; font-size: 40px; font-weight: 700; color: var(--color-text-1); line-height: 1.1; }
.credits-total-label { font-size: var(--text-sm); color: var(--color-text-3); }
.credits-breakdown { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }
.credits-chip { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: var(--space-3) var(--space-4); background: var(--color-surface-2); border-radius: var(--radius-md); min-width: 100px; }
.credits-chip span { font-size: var(--text-xs); color: var(--color-text-3); }
.credits-chip b { font-size: var(--text-lg); color: var(--color-text-1); }
.credits-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.credits-table th { text-align: left; padding: var(--space-2) var(--space-3); color: var(--color-text-3); font-weight: 500; border-bottom: 1px solid var(--color-border); font-size: var(--text-xs); }
.credits-table td { padding: var(--space-3); border-bottom: 1px solid var(--color-border); color: var(--color-text-2); }
.credits-table tr:last-child td { border-bottom: none; }

/* ============================================================
   Landing Page (官网 / 未登录首页) — Apple 风 + 暖光金橙
   ============================================================ */
.lp {
  --lp-gold: #f5a623;
  --lp-gold-2: #ff8a3d;
  --lp-ink: #1d1d1f;
  --lp-ink-2: #6e6e73;
  --lp-gray: #f5f5f7;
  --lp-dark: #0b0b0d;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", var(--font-sans);
  color: var(--lp-ink);
  background: #fff;
  overflow-x: hidden;
}
.lp * { box-sizing: border-box; }

/* 滚动淡入 */
.lp .reveal { opacity: 0; transform: translateY(24px); transition: opacity .8s cubic-bezier(.22,.61,.36,1), transform .8s cubic-bezier(.22,.61,.36,1); }
.lp .reveal.is-visible { opacity: 1; transform: none; }

/* 通用按钮 */
.lp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 980px; padding: 12px 26px; font-size: 16px; font-weight: 500; text-decoration: none; cursor: pointer; transition: transform .2s ease, background .2s ease, box-shadow .2s ease; border: none; white-space: nowrap; }
.lp-btn-primary { background: linear-gradient(120deg, var(--lp-gold), var(--lp-gold-2)); color: #fff; box-shadow: 0 6px 22px rgba(245,166,35,.35); }
.lp-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(245,166,35,.45); }
.lp-btn-ghost { background: transparent; color: var(--lp-ink); border: 1px solid rgba(255,255,255,.5); }
.lp-hero .lp-btn-ghost { color: #fff; }
.lp-hero .lp-btn-ghost:hover { background: rgba(255,255,255,.12); }
.lp-btn-lg { padding: 15px 40px; font-size: 18px; }

/* ① 顶部导航 */
.lp-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 100; transition: background .3s ease, backdrop-filter .3s ease, box-shadow .3s ease; }
.lp-nav-inner { max-width: 1120px; margin: 0 auto; height: 56px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.lp-nav-scrolled { background: rgba(255,255,255,.72); backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px); box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.lp-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 18px; color: var(--lp-ink); text-decoration: none; letter-spacing: -.02em; }
.lp-nav:not(.lp-nav-scrolled) .lp-brand { color: #fff; }
.lp-nav-links { display: flex; gap: 26px; }
.lp-nav-link { font-size: 14px; color: var(--lp-ink-2); text-decoration: none; transition: color .2s; }
.lp-nav-link:hover { color: var(--lp-gold); }
.lp-nav:not(.lp-nav-scrolled) .lp-nav-link { color: rgba(255,255,255,.85); }
.lp-nav:not(.lp-nav-scrolled) .lp-nav-link:hover { color: #fff; }
.lp-nav-actions { display: flex; align-items: center; gap: 14px; }
.lp-lang-btn { background: transparent; border: 1px solid var(--color-border); border-radius: 980px; padding: 5px 12px; font-size: 12px; cursor: pointer; color: var(--lp-ink-2); }
.lp-nav:not(.lp-nav-scrolled) .lp-lang-btn { border-color: rgba(255,255,255,.4); color: #fff; }
.lp-nav-login { font-size: 14px; color: var(--lp-ink); text-decoration: none; }
.lp-nav:not(.lp-nav-scrolled) .lp-nav-login { color: #fff; }
.lp-nav-cta { background: linear-gradient(120deg, var(--lp-gold), var(--lp-gold-2)); color: #fff; text-decoration: none; border-radius: 980px; padding: 7px 16px; font-size: 14px; font-weight: 500; transition: transform .2s; }
.lp-nav-cta:hover { transform: translateY(-1px); }

/* ② Hero */
.lp-hero { position: relative; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; overflow: hidden; background: #000; }
.lp-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .9; }
.lp-hero-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, rgba(0,0,0,0) 0%, rgba(0,0,0,.35) 70%, rgba(0,0,0,.7) 100%); }
.lp-hero-content { position: relative; z-index: 2; padding: 0 20px; max-width: 820px; }
.lp-hero-title { font-size: clamp(64px, 12vw, 140px); font-weight: 600; letter-spacing: .04em; margin: 0; line-height: 1; text-shadow: 0 4px 40px rgba(245,166,35,.5); }
.lp-hero-en { font-size: clamp(18px, 3vw, 26px); font-weight: 300; letter-spacing: .35em; margin: 14px 0 0; text-transform: none; opacity: .92; padding-left: .35em; }
.lp-hero-sub { font-size: clamp(18px, 3vw, 24px); font-weight: 300; margin: 22px 0 0; opacity: .95; }
.lp-hero-actions { display: flex; gap: 16px; justify-content: center; margin-top: 38px; flex-wrap: wrap; }
.lp-hero-scroll { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); width: 24px; height: 38px; border: 2px solid rgba(255,255,255,.5); border-radius: 14px; z-index: 2; }
.lp-hero-scroll span { position: absolute; top: 7px; left: 50%; width: 3px; height: 7px; background: #fff; border-radius: 2px; transform: translateX(-50%); animation: lp-scroll 1.6s infinite; }
@keyframes lp-scroll { 0% { opacity: 0; transform: translate(-50%,0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,12px); } }

/* ③ 一句话介绍 */
.lp-intro { max-width: 900px; margin: 0 auto; padding: 110px 24px; text-align: center; }
.lp-intro-text { font-size: clamp(24px, 4vw, 40px); font-weight: 600; line-height: 1.4; letter-spacing: -.01em; color: var(--lp-ink); }
.lp-intro-line { display: block; text-align: center; }

/* ④ 场景叙事（深色区） */
.lp-story { background: var(--lp-dark); color: #fff; padding: 120px 24px; }
.lp-story-step { max-width: 760px; margin: 0 auto 90px; text-align: center; }
.lp-story-step:last-child { margin-bottom: 0; }
.lp-story-num { font-size: 14px; letter-spacing: .3em; color: var(--lp-gold); font-weight: 600; margin-bottom: 14px; }
.lp-story-title { font-size: clamp(30px, 5vw, 52px); font-weight: 600; margin: 0 0 18px; letter-spacing: -.01em; line-height: 1.1; }
.lp-story-desc { font-size: clamp(16px, 2.4vw, 21px); font-weight: 300; color: rgba(255,255,255,.7); line-height: 1.6; margin: 0; }
.lp-story-visual { max-width: 980px; margin: 0 auto 90px; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 80px rgba(245,166,35,.15); }
.lp-story-visual img { width: 100%; display: block; }

/* ⑤ 灵感程度专区 */
.lp-inspiration { padding: 120px 24px; background: #fff; }
.lp-section-head { max-width: 720px; margin: 0 auto 60px; text-align: center; }
.lp-eyebrow { font-size: 14px; letter-spacing: .25em; text-transform: uppercase; color: var(--lp-gold); font-weight: 600; margin: 0 0 14px; }
.lp-section-title { font-size: clamp(30px, 5vw, 52px); font-weight: 600; letter-spacing: -.01em; margin: 0 0 16px; line-height: 1.1; }
.lp-section-sub { font-size: clamp(16px, 2.4vw, 21px); font-weight: 300; color: var(--lp-ink-2); margin: 0; line-height: 1.6; }
/* 灵感程度：三方向 peek 轮播 + 悬浮展开故事 */
.lp-insp-stage { --insp-card: 84%; --insp-gap: 16px; --insp-step: calc(var(--insp-card) + var(--insp-gap)); position: relative; max-width: 1120px; margin: 0 auto; outline: none; }
.lp-insp-viewport { overflow: hidden; padding: 8px 0 8px; cursor: grab; }
.lp-insp-viewport:active { cursor: grabbing; }
.lp-insp-track { display: flex; gap: var(--insp-gap); transition: transform .6s cubic-bezier(.22,.61,.36,1); align-items: flex-start; }

/* 单张方向卡片 */
.lp-insp-card { flex: 0 0 var(--insp-card); border-radius: 24px; overflow: hidden; background: var(--lp-gray); box-shadow: 0 18px 50px rgba(0,0,0,.10); transition: opacity .4s, transform .4s; opacity: .5; transform: scale(.96); cursor: pointer; outline: none; }
.lp-insp-card.is-current { opacity: 1; transform: scale(1); }

/* 封面（默认态）：主图 + 方向介绍 */
.lp-insp-cover { position: relative; }
.lp-insp-cover-img { position: relative; aspect-ratio: 16 / 10; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; }
.lp-insp-normal  .lp-insp-cover-img { background-color: #dfe9f5; background-image: linear-gradient(145deg,#eaf1fa,#c9d9ee); }
.lp-insp-divergent .lp-insp-cover-img { background-color: #ffe3c4; background-image: linear-gradient(145deg,#fff3e0,#ffb877); }
.lp-insp-psychedelic .lp-insp-cover-img { background-color: #e7ccf5; background-image: linear-gradient(150deg,#3a1a56,#7b2f8f); }
.lp-insp-cover-info { padding: 22px 26px 26px; }
.lp-insp-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 980px; background: rgba(0,0,0,.06); color: var(--lp-ink-2); margin-bottom: 12px; }
.lp-insp-normal .lp-insp-tag { background: #e8f0fe; color: #2563eb; }
.lp-insp-divergent .lp-insp-tag { background: #fff1e0; color: #d97706; }
.lp-insp-psychedelic .lp-insp-tag { background: linear-gradient(120deg,#d946ef,#f472b6); color: #fff; }
.lp-insp-name { font-size: 24px; font-weight: 700; margin: 0 0 8px; color: var(--lp-ink); }
.lp-insp-desc { font-size: 16px; line-height: 1.6; color: var(--lp-ink-2); margin: 0 0 14px; }
.lp-insp-hint { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--lp-gold); opacity: .9; }

/* 占位大字（真图铺上后被盖住） */
.lp-insp-frame-ph { font-size: clamp(40px,8vw,110px); font-weight: 800; color: rgba(255,255,255,.5); text-shadow: 0 4px 20px rgba(0,0,0,.12); }
.lp-insp-psychedelic .lp-insp-frame-ph { color: rgba(255,255,255,.42); }

/* ---- 展开态：悬浮向右平铺该方向的小图（可横向滚动）---- */
.lp-insp-thumbs { display: flex; gap: 14px; padding: 0 20px; max-height: 0; opacity: 0; overflow-x: auto; overflow-y: hidden;
  transition: max-height .5s cubic-bezier(.22,.61,.36,1), opacity .4s ease, padding .4s ease;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.lp-insp-card.is-open .lp-insp-thumbs { max-height: 320px; opacity: 1; padding: 20px; }
.lp-insp-card.is-open .lp-insp-hint { opacity: 0; }

/* 单张小图：小一点尺寸，横向平铺 */
.lp-insp-thumb { flex: 0 0 auto; width: 240px; margin: 0; border-radius: 14px; overflow: hidden;
  background-size: cover; background-position: center; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  position: relative; display: flex; align-items: flex-end;
  opacity: 0; transform: translateX(20px); transition: opacity .4s ease, transform .4s ease; }
.lp-insp-thumb > .lp-insp-frame-ph { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.lp-insp-card.is-open .lp-insp-thumb { opacity: 1; transform: none; }
.lp-insp-card.is-open .lp-insp-thumb:nth-child(1) { transition-delay: .05s; }
.lp-insp-card.is-open .lp-insp-thumb:nth-child(2) { transition-delay: .11s; }
.lp-insp-card.is-open .lp-insp-thumb:nth-child(3) { transition-delay: .17s; }
.lp-insp-card.is-open .lp-insp-thumb:nth-child(4) { transition-delay: .23s; }
.lp-insp-card.is-open .lp-insp-thumb:nth-child(5) { transition-delay: .29s; }
.lp-insp-thumb::before { content: ""; position: absolute; inset: 0; aspect-ratio: 16 / 10; }
.lp-insp-normal .lp-insp-thumb { background-color: #dfe9f5; background-image: linear-gradient(145deg,#eaf1fa,#c9d9ee); }
.lp-insp-divergent .lp-insp-thumb { background-color: #ffe3c4; background-image: linear-gradient(145deg,#fff3e0,#ffb877); }
.lp-insp-psychedelic .lp-insp-thumb { background-color: #e7ccf5; background-image: linear-gradient(150deg,#3a1a56,#7b2f8f); }
.lp-insp-thumb { height: 150px; }
.lp-insp-thumb-cap { position: relative; z-index: 2; width: 100%; padding: 30px 14px 12px; margin: 0;
  font-size: 13px; line-height: 1.4; color: #fff; background: linear-gradient(to top, rgba(0,0,0,.66), rgba(0,0,0,0)); }

/* 圆点 */
.lp-insp-dots { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }
.lp-insp-dot { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: none; background: rgba(0,0,0,.18); cursor: pointer; transition: background .2s, width .2s; }
.lp-insp-dot.is-active { background: var(--lp-gold); width: 26px; border-radius: 980px; }

/* ⑥ 功能思维导图 · 节点环绕中心（Xmind 气质：off-white 大留白 + 虚线连接） */
.lp-features { padding: 120px 24px; background: #fafafa; }
.lp-section-eyebrow { display: inline-block; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--lp-gold-2); margin-bottom: 14px; padding: 5px 14px; border-radius: 980px; background: linear-gradient(135deg, rgba(245,166,35,.14), rgba(255,138,61,.14)); }

/* 画布 */
.lp-mindmap {
  position: relative;
  max-width: 1080px; margin: 56px auto 0;
  height: 620px;
}
/* 连线层 */
.lp-mindmap-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
/* 手绘风格：连线 + 指向中心的小箭头 */
.lp-line, .lp-arrow {
  fill: none; stroke: #cfc9c0; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: .85; transition: stroke .3s ease, opacity .3s ease, stroke-width .3s ease;
}
.lp-arrow { stroke-width: 1.8; }
.lp-line.is-active, .lp-arrow.is-active { stroke: var(--lp-gold); opacity: 1; stroke-width: 2.2; }
.lp-mindmap.is-hovering .lp-line-g:not(.is-active) .lp-line,
.lp-mindmap.is-hovering .lp-line-g:not(.is-active) .lp-arrow { opacity: .28; }

/* 中心节点：圆点精确居中在画布中心，标题绝对定位到圆点正下方 */
.lp-node-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 3; width: 78px; height: 78px;
}
.lp-node-center-dot {
  width: 78px; height: 78px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #fff, #fff7ec);
  color: var(--lp-gold-2);
  border: 1px solid rgba(245,166,35,.35);
  box-shadow: 0 12px 34px rgba(245,166,35,.20), 0 2px 8px rgba(0,0,0,.05);
  animation: lp-center-pulse 4s ease-in-out infinite;
}
.lp-node-center-label {
  position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%);
  white-space: nowrap;
  font-size: 15px; font-weight: 600; color: var(--lp-ink); background: #fff;
  padding: 4px 16px; border-radius: 980px; border: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
@keyframes lp-center-pulse { 0%,100% { box-shadow: 0 12px 34px rgba(245,166,35,.18), 0 2px 8px rgba(0,0,0,.05); } 50% { box-shadow: 0 12px 44px rgba(245,166,35,.34), 0 2px 8px rgba(0,0,0,.05); } }

/* 功能节点卡片
   外层 .lp-node 只负责绝对定位（不做动画）；
   内层 .lp-node-inner 承载浮动动画 + 悬浮偏转，避免 transform 冲突 */
.lp-node {
  position: absolute; z-index: 2;
  transform: translate(-50%, -50%);
  width: 232px;
  cursor: default; outline: none;
}
.lp-node-inner {
  position: relative;
  padding: 17px 19px;
  display: flex; gap: 13px; align-items: flex-start;
  background: #fff;
  border-radius: 16px; text-align: left;
  box-shadow: 0 6px 20px rgba(0,0,0,.05);
  transition: transform .4s cubic-bezier(.22,.61,.36,1), box-shadow .4s ease;
  /* 浮动动画用独立的 translate 属性，与 hover 的 transform 分离，避免互相覆盖 */
  animation: lp-node-float 6s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes lp-node-float { 0%,100% { translate: 0 0; } 50% { translate: 0 -7px; } }
.lp-node:hover .lp-node-inner,
.lp-node:focus-visible .lp-node-inner {
  transform: scale(1.05) rotate(var(--rot, 4deg));
  box-shadow: 0 22px 50px rgba(0,0,0,.13);
}

/* 手绘涂鸦边框（SVG，两遍复描抖动线，与箭头风格统一） */
.lp-node-sketch {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible; pointer-events: none; z-index: 0;
}
.lp-sketch-line {
  fill: none; stroke: #45403a; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: .78; transition: stroke .3s ease, opacity .3s ease;
}
.lp-sketch-line-2 { stroke-width: 1.2; opacity: .4; }
.lp-node:hover, .lp-node:focus-visible { z-index: 4; }
/* 悬浮某节点时其他节点轻微淡出 */
.lp-mindmap.is-hovering .lp-node:not(.is-active) { opacity: .5; }

.lp-node-icon {
  position: relative; z-index: 1;
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .35s ease;
}
.lp-node-text { position: relative; z-index: 1; }
.lp-node:hover .lp-node-icon { transform: scale(1.1) rotate(-4deg); }
.lp-node-title { font-size: 15.5px; font-weight: 600; margin: 1px 0 4px; letter-spacing: -.01em; }
.lp-node-desc { font-size: 12.5px; line-height: 1.5; color: var(--lp-ink-2); margin: 0; }

/* 节点色调（柔和 pastel，呼应无限画布的彩色节点） */
.lp-node-blue   .lp-node-icon { background: rgba(74,144,226,.14);  color: #3d7bc4; }
.lp-node-amber  .lp-node-icon { background: rgba(245,166,35,.16);  color: var(--lp-gold-2); }
.lp-node-green  .lp-node-icon { background: rgba(76,175,120,.15);  color: #3a9d6b; }
.lp-node-purple .lp-node-icon { background: rgba(150,110,220,.14); color: #7d5bc0; }
/* 悬浮：手绘边框整体变亮变金，呼应箭头高亮 */
.lp-node:hover .lp-sketch-line, .lp-node:focus-visible .lp-sketch-line { stroke: var(--lp-gold-2); opacity: .9; }
.lp-node:hover .lp-sketch-line-2, .lp-node:focus-visible .lp-sketch-line-2 { opacity: .5; }
.lp-node-blue:hover   .lp-sketch-line { stroke: #3d7bc4; }
.lp-node-green:hover  .lp-sketch-line { stroke: #3a9d6b; }
.lp-node-purple:hover .lp-sketch-line { stroke: #7d5bc0; }

/* 协作光标（小三角 + 呼吸），呼应多人实时 */
.lp-node-cursor { position: absolute; top: -12px; right: -10px; display: flex; filter: drop-shadow(0 1px 2px rgba(0,0,0,.15)); animation: lp-cursor-bob 3.4s ease-in-out infinite; }
@keyframes lp-cursor-bob { 0%,100% { transform: translate(0,0); } 50% { transform: translate(2px,-3px); } }
.lp-cursor-amber { color: #f5a623; }
.lp-cursor-green { color: #4caf78; }
.lp-cursor-blue  { color: #4a90e2; }

/* ⑦ 底部 CTA */
.lp-cta { position: relative; padding: 140px 24px; text-align: center; color: #fff; overflow: hidden; background: #000; }
.lp-cta-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .5; }
.lp-cta-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.35)); }
.lp-cta-content { position: relative; z-index: 2; max-width: 760px; margin: 0 auto; }
.lp-cta-title { font-size: clamp(32px, 6vw, 60px); font-weight: 600; margin: 0 0 18px; letter-spacing: -.01em; line-height: 1.1; }
.lp-cta-sub { font-size: clamp(17px, 2.6vw, 22px); font-weight: 300; opacity: .9; margin: 0 0 40px; }

/* ⑧ 页脚 */
.lp-footer { background: #fff; border-top: 1px solid var(--color-border); padding: 40px 24px; }
.lp-footer-inner { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lp-footer-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--lp-ink); }
.lp-footer-copy { font-size: 13px; color: var(--lp-ink-3, #999); margin: 0; }

/* 响应式 */
/* 中小屏：思维导图收拢为整齐竖排卡片（含中心节点在最上） */
@media (max-width: 820px) {
  .lp-mindmap {
    height: auto; max-width: 560px;
    display: flex; flex-direction: column; gap: 14px; align-items: stretch;
  }
  .lp-mindmap-lines { display: none; }
  .lp-node, .lp-node-center {
    position: static; transform: none; width: auto;
    animation: none; margin: 0;
  }
  .lp-node-inner { animation: none; translate: none; }
  .lp-node-center { flex-direction: row; justify-content: center; gap: 12px; margin-bottom: 6px; }
  .lp-node-center-dot { width: 52px; height: 52px; animation: none; }
  .lp-node:hover, .lp-node:focus-visible { transform: translateY(-3px) scale(1.01) rotate(var(--rot, 3deg)); }
  .lp-mindmap.is-hovering .lp-node:not(.is-active):not(.lp-node-center) { opacity: 1; }
  .lp-node-cursor { display: none; }
  .lp-insp-stage { --insp-card: 88%; --insp-gap: 12px; }
  .lp-insp-name { font-size: 21px; }
  .lp-insp-cover-info { padding: 18px 20px 22px; }
  .lp-nav-links { display: none; }
}
@media (max-width: 560px) {
  .lp-hero-actions { flex-direction: column; align-items: stretch; }
  .lp-nav-login { display: none; }
  .lp-intro, .lp-story, .lp-inspiration, .lp-features { padding-top: 80px; padding-bottom: 80px; }
}

/* ============================================================
   画布顶栏「灵感程度」胶囊按钮 + 下拉菜单
   ============================================================ */
.canvas-insp-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--radius-full); border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-2); font-size: var(--text-sm); cursor: pointer; transition: border-color .15s, color .15s, background .15s; white-space: nowrap; }
.canvas-insp-btn:hover { border-color: var(--color-border-hover); color: var(--color-text); }
.canvas-insp-btn .canvas-insp-icon { display: inline-flex; }
.canvas-insp-btn .canvas-insp-label { font-weight: 500; }
/* 档位色调 */
.canvas-insp-btn[data-level="divergent"] { color: #b45309; border-color: #fcd9a8; background: #fff8ef; }
.canvas-insp-btn[data-level="psychedelic"] { color: #a21caf; border-color: #f0abfc; background: #fdf4ff; }
.canvas-insp-btn[data-level="normal"] { color: var(--color-text-2); }

.canvas-insp-menu { z-index: 3000; width: 260px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgba(0,0,0,.16); padding: 6px; animation: lp-menu-in .16s ease; }
@keyframes lp-menu-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.canvas-insp-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 10px; border: none; background: transparent; border-radius: var(--radius); cursor: pointer; text-align: left; transition: background .12s; }
.canvas-insp-item:hover { background: var(--color-surface-2); }
.canvas-insp-item.is-active { background: var(--color-surface-2); }
.canvas-insp-item-icon { flex: none; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--color-surface-2); color: var(--color-text-2); }
.canvas-insp-item[data-level-tone="divergent"] .canvas-insp-item-icon { background: #fff1e0; color: #d97706; }
.canvas-insp-item[data-level-tone="psychedelic"] .canvas-insp-item-icon { background: #fae8ff; color: #c026d3; }
.canvas-insp-item-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.canvas-insp-item-name { font-size: var(--text-base); font-weight: 500; color: var(--color-text); }
.canvas-insp-item-desc { font-size: var(--text-xs); color: var(--color-text-3); }
.canvas-insp-item-check { flex: none; width: 16px; color: var(--color-accent); display: flex; align-items: center; justify-content: center; }

/* 底色（世界观）编辑面板 —— 从右侧工具栏「底色」按钮左侧展开 */
.canvas-worldview-panel { z-index: 3000; width: 340px; max-width: calc(100vw - 32px); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgba(0,0,0,.16); padding: 14px; animation: lp-menu-in .16s ease; }
.canvas-worldview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.canvas-worldview-title { font-size: var(--text-base); font-weight: 600; color: var(--color-text); }
.canvas-worldview-close { border: none; background: transparent; color: var(--color-text-3); cursor: pointer; display: flex; padding: 2px; border-radius: var(--radius-sm); }
.canvas-worldview-close:hover { color: var(--color-text); background: var(--color-surface-2); }
.canvas-worldview-desc { font-size: var(--text-xs); color: var(--color-text-3); line-height: 1.5; margin: 0 0 10px; }
.canvas-worldview-input { width: 100%; box-sizing: border-box; resize: vertical; min-height: 120px; padding: 10px; font-size: var(--text-sm); line-height: 1.6; color: var(--color-text); background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius); outline: none; transition: border-color .15s; font-family: inherit; }
.canvas-worldview-input:focus { border-color: var(--color-accent); }
.canvas-worldview-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* ============================================================
   团队管理页 / 接受邀请页
   ============================================================ */
.settings-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
  outline: none;
}
.settings-input:focus { border-color: var(--color-primary); }
.settings-desc {
  color: var(--color-text);
  opacity: 0.6;
  font-size: 13px;
  margin: 0 0 var(--space-3);
  line-height: 1.5;
}
.modal-label {
  display: block;
  font-size: 12px;
  opacity: 0.65;
  margin-bottom: 6px;
}

.team-loading { padding: 24px; opacity: 0.5; font-size: 14px; }

.team-tabs-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.team-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.team-tab {
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.team-tab:hover { background: var(--color-hover); }
.team-tab.is-active { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }

.team-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.team-my-role { display: block; font-size: 12px; opacity: 0.55; margin-top: 4px; }

.team-invite-row { display: flex; gap: 8px; align-items: center; }
.team-invite-row .settings-select { width: auto; min-width: 110px; }

.team-members-list { display: flex; flex-direction: column; }
.team-member-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; gap: var(--space-3);
  border-bottom: 1px solid var(--color-border);
}
.team-member-row:last-child { border-bottom: none; }
.team-member-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.team-member-email { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-member-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.team-role-select { width: auto; min-width: 100px; }
.team-role-tag {
  font-size: 12px; padding: 2px 10px; border-radius: var(--radius-full);
  background: var(--color-hover); color: var(--color-text); opacity: 0.75;
}

/* 通用小弹窗 */
.team-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.team-modal {
  background: var(--color-surface); border-radius: var(--radius-lg);
  width: 420px; max-width: calc(100vw - 32px); box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.team-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--color-border);
}
.team-modal-title { font-size: 15px; font-weight: 600; }
.team-modal-close { background: none; border: none; cursor: pointer; color: var(--color-text); opacity: 0.6; padding: 4px; line-height: 0; }
.team-modal-close:hover { opacity: 1; }
.team-modal-body { padding: 20px; }
.team-modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 20px; }

/* 接受邀请页 */
.accept-invite-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--color-bg); }
.accept-invite-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 40px 32px; width: 400px; max-width: 100%; text-align: center; }
.accept-title { font-size: 20px; font-weight: 600; margin: 0 0 12px; }
.accept-desc { font-size: 14px; opacity: 0.7; margin: 0 0 24px; line-height: 1.6; }
.accept-error { color: var(--color-danger); opacity: 1; }

/* ============================================================
   团队管理页（第一期）—— 复用现有 CSS 变量，无高亮色，风格统一
   ============================================================ */
.team-layout { display: flex; gap: var(--space-4); padding: var(--space-4); align-items: flex-start; }
.team-list { flex: 0 0 220px; display: flex; flex-direction: column; gap: var(--space-1); }
.team-list-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 10px 12px; border: 1px solid var(--color-border); border-radius: 8px;
  background: var(--color-surface); cursor: pointer; text-align: left; width: 100%;
  transition: background 0.12s, border-color 0.12s;
}
.team-list-item:hover { background: var(--color-surface-2, #f5f5f5); }
.team-list-item.active { border-color: var(--color-text-3, #999); background: var(--color-surface-2, #f5f5f5); }
.team-list-name { font-size: var(--text-sm); font-weight: 500; color: var(--color-text-1); }
.team-list-role { font-size: 11px; color: var(--color-text-3); }
.team-detail { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.team-detail-empty { padding: var(--space-6); color: var(--color-text-3); font-size: var(--text-sm); text-align: center; }
.team-detail-head { display: flex; align-items: center; justify-content: space-between; }
.team-detail-title { font-size: 20px; font-weight: 600; color: var(--color-text-1); margin: 0; }
.team-detail-role { font-size: 12px; color: var(--color-text-3); }
.team-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-2); }
.team-empty { font-size: var(--text-sm); color: var(--color-text-3); text-align: center; padding: var(--space-4); }
.team-members-table { width: 100%; border-collapse: collapse; }
.team-members-table td { padding: 10px 8px; border-bottom: 1px solid var(--color-border); font-size: var(--text-sm); color: var(--color-text-1); vertical-align: middle; }
.team-members-table tr:last-child td { border-bottom: none; }
.team-role-select { padding: 4px 8px; border: 1px solid var(--color-border); border-radius: 6px; background: var(--color-surface); font-size: var(--text-sm); color: var(--color-text-1); }
/* 接受邀请页 */
.accept-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.accept-card { max-width: 420px; width: 100%; padding: var(--space-6); border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); text-align: center; display: flex; flex-direction: column; gap: var(--space-3); align-items: center; }
.accept-logo { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 16px; color: var(--color-text-1); margin-bottom: var(--space-2); }
.accept-line { font-size: var(--text-sm); color: var(--color-text-1); margin: 0; }
.accept-email { font-size: 13px; color: var(--color-text-3); margin: 0; }

/* ============================================================
   项目独占编辑锁（团队一期）—— 只读遮罩 + 顶栏锁状态条
   ============================================================ */

/* 只读态：禁用画布内节点的指针交互（拖拽/双击编辑/连线/右键菜单全部失效），
   仅保留 viewport 层的平移与滚轮缩放（查看无写副作用）。 */
.canvas-viewport.canvas-readonly .canvas-world {
  pointer-events: none;
}
/* 只读态给一个极淡的斜纹提示（非侵入，不影响看内容） */
.canvas-viewport.canvas-readonly::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.25);
  z-index: 5;
}

/* 顶栏锁状态条：紧凑胶囊，颜色随状态区分 */
.canvas-lock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  white-space: nowrap;
  margin-left: 10px;
}
/* 只读：他人正在编辑 */
.canvas-lock-bar.lock-readonly {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border: 1px solid rgba(37, 99, 235, 0.25);
}
/* 有人申请编辑（持有者视角，提醒色） */
.canvas-lock-bar.lock-request {
  background: var(--color-warning-light);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.canvas-lock-bar .lock-readonly-text,
.canvas-lock-bar .lock-request-text {
  font-weight: 500;
}
/* 状态条里的小按钮 */
.canvas-lock-bar .btn.btn-sm {
  padding: 2px 10px;
  font-size: 12px;
  line-height: 1.6;
  height: auto;
}
.canvas-lock-bar .lock-request-btn {
  background: var(--color-accent);
  color: #fff;
  border: none;
}
.canvas-lock-bar .lock-request-btn:hover { background: var(--color-accent-hover); }
.canvas-lock-bar .lock-reject-btn {
  background: transparent;
  color: var(--color-text-2);
  border: 1px solid var(--color-border);
}

/* ══════════════════════════════════════════════════════════════
   视频生成中：沉浸式加载态（进度环 + 阶段文案 + 预估 + 取消）
   ────────────────────────────────────────────────────────────── */
.node-video-loading {
  position: relative;
  width: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px 16px;
  border-radius: inherit;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(135deg, #1e1b2e 0%, #2d2450 60%, #1e1b2e 100%);
}
/* 微光扫过 */
.node-video-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(167,139,250,0.20) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: nvl-shimmer 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes nvl-shimmer {
  0%   { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}
/* 呼吸光点氛围 */
.node-video-loading::after {
  content: "";
  position: absolute;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.32), transparent 70%);
  top: -38px; right: -38px;
  filter: blur(8px);
  animation: nvl-breathe 3.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes nvl-breathe {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50%      { opacity: 0.9; transform: scale(1.15); }
}

/* 进度环 */
.video-ring-wrap { position: relative; width: 72px; height: 72px; z-index: 2; }
.video-ring-wrap svg { transform: rotate(-90deg); display: block; }
.video-ring-bg { fill: none; stroke: rgba(255,255,255,0.15); stroke-width: 6; }
.video-ring-fg {
  fill: none; stroke-width: 6; stroke-linecap: round;
  transition: stroke-dashoffset 0.3s ease;
}
.video-ring-pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; letter-spacing: 0.5px;
}

/* 阶段文案 / 预估 */
.video-loading-phase {
  z-index: 2; font-size: 13px; font-weight: 600; letter-spacing: 0.3px; text-align: center;
}
.video-loading-eta {
  z-index: 2; font-size: 11px; color: rgba(255,255,255,0.6); margin-top: -6px; text-align: center;
}

/* 取消按钮 */
.video-loading-cancel {
  z-index: 2; margin-top: 4px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.85);
  padding: 5px 18px; border-radius: 20px;
  font-size: 12px; cursor: pointer;
  transition: all 0.15s;
}
.video-loading-cancel:hover {
  background: rgba(239,68,68,0.85);
  border-color: transparent; color: #fff;
}

/* ============================================================
   分享弹窗 (Share Modal — Phase 2)
   ============================================================ */
.share-modal { display: flex; flex-direction: column; gap: var(--space-4); min-width: 380px; max-width: 440px; }
.share-field { display: flex; flex-direction: column; gap: var(--space-2); }
.share-field > label:first-child,
.share-field-label { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-2); }

/* 权限切换（只看 / 可编辑） */
.share-role-toggle { display: flex; gap: var(--space-2); }
.share-role-toggle label {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border);
  border-radius: var(--radius); font-size: var(--text-sm); cursor: pointer;
  transition: all 0.15s; color: var(--color-text-2);
}
.share-role-toggle label:hover { border-color: var(--color-border-hover); }
.share-role-toggle input { accent-color: var(--color-accent); }

/* 分享方式 (公开 / 邮箱 / 组内) */
.share-method {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) 0; font-size: var(--text-sm); color: var(--color-text);
  cursor: pointer;
}
.share-method input { accent-color: var(--color-accent); }
.share-sub { margin: var(--space-1) 0 var(--space-2) var(--space-5); width: calc(100% - var(--space-5)); }

/* 生成结果 */
.share-result { display: flex; flex-direction: column; gap: var(--space-3); }
.share-link-row { display: flex; gap: var(--space-2); align-items: center; }
.share-link-row .input { flex: 1; font-size: var(--text-xs); }
.share-hr { border: none; border-top: 1px solid var(--color-border); margin: var(--space-2) 0; }

/* 现有分享列表 */
.share-existing-title { font-size: var(--text-sm); font-weight: 600; color: var(--color-text-2); }
.share-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-2) 0; border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
}
.share-item:last-child { border-bottom: none; }
.share-item-main { flex: 1; color: var(--color-text-2); word-break: break-all; }
.share-revoke-btn, .share-remove-btn {
  flex-shrink: 0; background: none; border: 1px solid var(--color-border);
  color: var(--color-danger); font-size: var(--text-xs); padding: 3px 10px;
  border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s;
}
.share-revoke-btn:hover, .share-remove-btn:hover {
  background: var(--color-danger-light); border-color: var(--color-danger);
}

/* 领取页附加文案 */
.accept-line { font-size: var(--text-base); color: var(--color-text-2); line-height: 1.6; margin: var(--space-4) 0 var(--space-6); }

/* ============================================================
   画布只读模式 (Canvas Readonly — Phase 2 viewer 权限)
   ============================================================ */
.canvas-readonly-hint {
  display: flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-warning-light); color: var(--color-warning);
  font-size: var(--text-sm); font-weight: 500;
  border-bottom: 1px solid var(--color-border);
}
/* 只读时隐藏所有编辑/AI 控件，禁用画布交互（前端防护层；后端写门已拦截） */
.canvas-readonly #canvas-insp-btn,
.canvas-readonly #canvas-toolbar,
.canvas-readonly .right-toolbar,
.canvas-readonly #canvas-undo { display: none !important; }
.canvas-readonly #canvas-world { cursor: default; }

/* ==================================================================
   资产库（Assets）——第一期：只读浏览 / 下载 / 链路溯源
   ================================================================== */
.assets-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.assets-panel {
  position: relative;
  width: 960px; max-width: 96vw; height: 82vh; max-height: 86vh;
  background: var(--color-surface, #fff);
  border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
  display: flex; flex-direction: column; overflow: hidden;
}
.assets-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--color-border, #eee);
  flex: 0 0 auto;
}
.assets-title { font-size: 16px; font-weight: 700; color: var(--color-text, #111); }
.assets-header-actions { display: flex; align-items: center; gap: 8px; }
.assets-close {
  border: none; background: transparent; cursor: pointer;
  color: var(--color-text-secondary, #666); padding: 4px; border-radius: 6px;
  display: flex; align-items: center; font-size: 16px; line-height: 1;
}
.assets-close:hover { background: var(--color-bg-subtle, #f3f4f6); }
.assets-btn {
  border: 1px solid var(--color-border, #e5e7eb); background: var(--color-surface, #fff);
  color: var(--color-text, #111); font-size: 13px; cursor: pointer;
  padding: 6px 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 6px;
}
.assets-btn:hover { background: var(--color-bg-subtle, #f3f4f6); border-color: var(--color-primary, #6366f1); }
.assets-body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 16px 18px;
  display: flex; flex-direction: column;
}

/* —— tabs —— */
.assets-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex: 0 0 auto; }
.assets-tab {
  border: 1px solid var(--color-border, #e5e7eb); background: var(--color-surface, #fff);
  color: var(--color-text-secondary, #6b7280); font-size: 13.5px; font-weight: 600;
  cursor: pointer; padding: 7px 16px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
}
.assets-tab:hover { border-color: var(--color-primary, #6366f1); }
.assets-tab.is-active {
  background: var(--color-primary, #6366f1); border-color: var(--color-primary, #6366f1); color: #fff;
}
.assets-tab-count {
  font-size: 11px; min-width: 18px; padding: 0 5px; height: 18px; line-height: 18px;
  border-radius: 999px; background: rgba(0,0,0,.08); text-align: center;
}
.assets-tab.is-active .assets-tab-count { background: rgba(255,255,255,.25); }

/* —— 响应式网格：随容器宽度决定每行数量（≈ 用户屏幕分辨率） —— */
.assets-grid {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  align-content: start;
}
.assets-grid-inline { flex: none; margin-top: 10px; }

.assets-card {
  border: 1px solid var(--color-border, #eee); border-radius: 10px; overflow: hidden;
  background: var(--color-surface, #fff); cursor: pointer;
  transition: box-shadow .15s, transform .15s;
  display: flex; flex-direction: column;
}
.assets-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.14); transform: translateY(-2px); }
.assets-thumb {
  position: relative; width: 100%; aspect-ratio: 4 / 3;
  background: var(--color-bg-subtle, #f3f4f6);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.assets-thumb-media { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 下载按钮：固定右上角，与中心 ▶ 播放标记错开，绝不遮挡预览触发 */
.assets-dl {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 30px; height: 30px; border: none; border-radius: 8px;
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
  opacity: 0; transition: opacity .15s;
}
.assets-card:hover .assets-dl { opacity: 1; }
.assets-dl:hover { background: rgba(0,0,0,.8); }
.assets-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  pointer-events: none;
}
.assets-card-cap {
  padding: 7px 9px; font-size: 12px; color: var(--color-text-secondary, #6b7280);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* —— 翻页 —— */
.assets-pager {
  flex: 0 0 auto; margin-top: 14px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 13px; color: var(--color-text-secondary, #6b7280);
}
.assets-page-btn {
  border: 1px solid var(--color-border, #e5e7eb); background: var(--color-surface, #fff);
  color: var(--color-text, #111); cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; font-size: 16px; line-height: 1;
}
.assets-page-btn:hover:not(:disabled) { border-color: var(--color-primary, #6366f1); }
.assets-page-btn:disabled { opacity: .4; cursor: not-allowed; }
.assets-page-info { font-weight: 600; color: var(--color-text, #111); }
.assets-page-total { margin-left: 6px; }

.assets-loading, .assets-empty {
  grid-column: 1 / -1; width: 100%;
  padding: 48px 12px; text-align: center;
  color: var(--color-text-secondary, #9ca3af); font-size: 13.5px;
}

/* —— 预览层：覆盖在 panel 内部，顶部工具条独立，不遮挡媒体 —— */
.assets-preview {
  position: absolute; inset: 0; z-index: 5;
  background: rgba(0,0,0,.92);
  display: flex; flex-direction: column;
}
.assets-preview-bar {
  flex: 0 0 auto; height: 52px; padding: 0 14px;
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  background: rgba(0,0,0,.4);
}
.assets-preview-bar .assets-btn {
  background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff;
}
.assets-preview-bar .assets-btn:hover { background: rgba(255,255,255,.22); }
.assets-preview-bar .assets-close { color: #fff; }
.assets-preview-bar .assets-close:hover { background: rgba(255,255,255,.18); }
.assets-preview-stage {
  flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow: hidden;
}
.assets-preview-media {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border-radius: 8px; background: #000;
}

/* —— 详情：折叠式链路溯源 —— */
.assets-detail { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.assets-lineage {
  border: 1px solid var(--color-border, #eee); border-radius: 10px; overflow: hidden;
  background: var(--color-surface, #fff);
}
.assets-lineage-head {
  width: 100%; border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 12px 14px; font-size: 13.5px; color: var(--color-text, #111);
}
.assets-lineage-head:hover { background: var(--color-bg-subtle, #f9fafb); }
.assets-lineage-caret { color: var(--color-text-secondary, #9ca3af); transition: transform .15s; flex: 0 0 auto; }
.assets-lineage.is-open .assets-lineage-caret { transform: rotate(90deg); }
.assets-lineage-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.assets-lineage-badge { flex: 0 0 auto; font-size: 12px; color: var(--color-primary, #6366f1); font-weight: 600; }
.assets-lineage-body { padding: 0 14px 14px; border-top: 1px solid var(--color-border, #f1f1f1); }
.assets-lineage-path {
  font-size: 12.5px; line-height: 1.6; color: var(--color-text-secondary, #6b7280);
  padding: 10px 0; word-break: break-word;
}
.assets-lineage-path-label { font-weight: 600; color: var(--color-text, #111); }
.assets-detail-foot {
  flex: 0 0 auto; margin-top: 12px; text-align: center;
  font-size: 12.5px; color: var(--color-text-secondary, #9ca3af);
}

/* ==================================================================
   资产 · 链路溯源独立页 /canvas/:id/assets（方案X：详情独立路由）
   ================================================================== */
.assets-page {
  position: relative;               /* 预览层 .assets-preview 覆盖整页的定位基准 */
  min-height: 100vh; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--color-bg, #f7f7f8);
}
.assets-page-topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px;
  height: 56px; padding: 0 20px;
  background: var(--color-surface, #fff);
  border-bottom: 1px solid var(--color-border, #eee);
}
.assets-page-back {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--color-border, #e5e7eb); background: var(--color-surface, #fff);
  color: var(--color-text, #111); font-size: 13.5px; cursor: pointer;
  padding: 7px 14px; border-radius: 8px;
}
.assets-page-back:hover { background: var(--color-bg-subtle, #f3f4f6); border-color: var(--color-primary, #6366f1); }
.assets-page-title { font-size: 16px; font-weight: 700; color: var(--color-text, #111); }
.assets-page-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 20px 24px;
  max-width: 1080px; width: 100%; margin: 0 auto;
}
/* 整页内的链路列表间距略放大 */
.assets-page-body .assets-detail { gap: 12px; }

/* 资产图标：SVG 化后（原 FontAwesome <i> 未加载导致视频中心显示为空心圆），
   确保 SVG 在圆形/方形按钮内正确居中显示 */
.assets-play svg, .assets-dl svg, .assets-lineage-caret svg { display: block; }
/* 实心播放三角视觉重心偏左，右移 1px 让它在圆内看起来居中 */
.assets-play svg { margin-left: 2px; }
.assets-lineage-caret { display: inline-flex; align-items: center; }
