/* ============================================================
   智能体协作工作台 · 旗舰级设计系统（Alabaster Light / Obsidian Dark）
   融合 frontend-design / ui-ux-pro-max / impeccable 设计原则：
   · 克制的建筑感黑白主轴 + 沉静深蓝语义强调（告别廉价亮蓝 SaaS 模板）
   · 旗舰级排版尺度和留白节奏、细发丝边与顶缘高光、顺滑微动效
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root,
:root[data-theme="light"] {
  color-scheme: light;

  /* 建筑画廊浅色层次：温润雪花石膏底 + 纯瓷白浮层 */
  --bg: #f5f4f0;
  --bg-glow: radial-gradient(ellipse 80% 42% at 50% -10%, rgba(17, 18, 22, 0.04), transparent 72%);
  --bg-subtle: #eceae4;
  --rail-bg: #faf9f7;
  --topbar-bg: rgba(255, 255, 255, 0.82);
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --surface-3: #f0eee9;
  --surface-hover: #eeece6;
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.9);

  /* 发丝线边框 */
  --line: rgba(17, 18, 22, 0.075);
  --line-2: rgba(17, 18, 22, 0.13);
  --line-3: rgba(17, 18, 22, 0.22);

  /* 文字层级 */
  --text: #111216;
  --text-2: #2f333d;
  --muted: #5d6472;
  --dim: #7f8794;

  /* 主按钮：曜石黑（高级克制，苹果 / Linear / Vercel 质感） */
  --primary: #14161b;
  --primary-hover: #272b35;
  --primary-text: #ffffff;

  /* 语义强调色：沉静深钴蓝（仅用于焦点、激活态、进度与链接） */
  --accent: #2c4ea3;
  --accent-2: #213e87;
  --accent-soft: rgba(44, 78, 163, 0.08);
  --accent-ring: rgba(44, 78, 163, 0.16);
  --accent-border: rgba(44, 78, 163, 0.24);

  /* 用户聊天气泡：沉稳曜石卡片 */
  --user-bubble: #17191f;
  --user-bubble-text: #f8f9fb;

  /* 状态色 */
  --ok: #0c7a56;
  --ok-soft: rgba(12, 122, 86, 0.09);
  --ok-border: rgba(12, 122, 86, 0.24);
  --good: #0c7a56;

  --warn: #b45d09;
  --warn-soft: rgba(180, 93, 9, 0.09);
  --warn-border: rgba(180, 93, 9, 0.25);

  --danger: #c0263c;
  --danger-soft: rgba(192, 38, 60, 0.08);
  --danger-border: rgba(192, 38, 60, 0.24);

  /* 遮罩、点阵与终端 */
  --mask: rgba(15, 17, 22, 0.42);
  --grid-dot: rgba(17, 18, 22, 0.14);
  --edge-idle: rgba(17, 18, 22, 0.22);
  --console-bg: #111318;
  --console-head: #0c0e13;
  --console-line: rgba(255, 255, 255, 0.07);

  /* 字体体系 */
  --display: "Inter", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", -apple-system, sans-serif;
  --sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
    -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "IBM Plex Mono", Menlo, Consolas, monospace;

  /* 间距与圆角 */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;

  /* 立体环境光影 */
  --shadow-xs: 0 1px 2px rgba(17, 18, 22, 0.04);
  --shadow-sm: 0 1px 2px rgba(17, 18, 22, 0.05), 0 4px 12px -4px rgba(17, 18, 22, 0.06);
  --shadow-md: 0 2px 4px rgba(17, 18, 22, 0.04), 0 14px 36px -14px rgba(17, 18, 22, 0.14);
  --shadow-lg: 0 8px 20px -6px rgba(17, 18, 22, 0.12), 0 32px 72px -18px rgba(17, 18, 22, 0.26);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  /* 曜石演播室暗色层次（Linear Pro / Runway / Arc 质感） */
  --bg: #08090c;
  --bg-glow: radial-gradient(ellipse 72% 40% at 50% -10%, rgba(255, 255, 255, 0.05), transparent 68%);
  --bg-subtle: #0f1117;
  --rail-bg: #0c0e13;
  --topbar-bg: rgba(14, 16, 22, 0.80);
  --surface: #12151c;
  --surface-2: #171b24;
  --surface-3: #1e232f;
  --surface-hover: #242a38;
  --specular: inset 0 1px 0 rgba(255, 255, 255, 0.065);

  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.13);
  --line-3: rgba(255, 255, 255, 0.24);

  --text: #f3f5f8;
  --text-2: #cdd4e0;
  --muted: #8f99aa;
  --dim: #697385;

  /* 暗色主按钮：象牙瓷白 + 曜石字（极致奢华对比） */
  --primary: #f4f5f7;
  --primary-hover: #ffffff;
  --primary-text: #0b0c10;

  /* 语义强调：冰晶蓝灰 */
  --accent: #6c96f5;
  --accent-2: #92b4ff;
  --accent-soft: rgba(108, 150, 245, 0.13);
  --accent-ring: rgba(108, 150, 245, 0.24);
  --accent-border: rgba(146, 180, 255, 0.30);

  /* 暗色用户气泡：高级烟熏玻璃 */
  --user-bubble: #1e2433;
  --user-bubble-text: #f3f5f8;

  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.12);
  --ok-border: rgba(52, 211, 153, 0.28);
  --good: #34d399;

  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.12);
  --warn-border: rgba(251, 191, 36, 0.28);

  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.13);
  --danger-border: rgba(248, 113, 113, 0.30);

  --mask: rgba(0, 0, 0, 0.72);
  --grid-dot: rgba(255, 255, 255, 0.11);
  --edge-idle: rgba(255, 255, 255, 0.20);
  --console-bg: #080a0e;
  --console-head: #0c0f15;
  --console-line: rgba(255, 255, 255, 0.07);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.42);
  --shadow-md: 0 12px 34px -10px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 28px 80px -16px rgba(0, 0, 0, 0.82);
}

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, select, textarea, input { font-family: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
a { color: var(--accent-2); }

::selection { background: var(--accent-ring); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--line-3); background-clip: content-box; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

[hidden] { display: none !important; }

/* ============================================================
   全局外壳：左侧 74px 建筑级导轨 + 毛玻璃顶栏
   ============================================================ */

.app-shell {
  display: flex;
  height: 100%;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

.app-rail {
  width: 74px;
  flex: 0 0 74px;
  background: var(--rail-bg);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px 14px;
  gap: 8px;
  z-index: 30;
  user-select: none;
}

.rail-brand {
  display: grid;
  place-items: center;
  padding-bottom: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--primary-text);
  background: var(--primary);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.brand-mark:hover { transform: scale(1.04); box-shadow: var(--shadow-md); }
.brand-mark svg { width: 19px; height: 19px; display: block; }

.rail-nav,
.rail-tools,
.rail-foot {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.rail-foot { margin-top: auto; }

.rail-sep {
  width: 26px;
  height: 1px;
  background: var(--line);
  margin: 6px 0;
}

.rail-btn {
  position: relative;
  width: 56px;
  min-height: 52px;
  padding: 7px 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease), transform 0.15s var(--ease);
}
.rail-btn::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background: var(--text);
  transition: transform 0.22s var(--ease);
}
.rail-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}
.rail-btn.on {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--text);
  box-shadow: var(--shadow-xs), var(--specular);
}
.rail-btn.on::before { transform: translateY(-50%) scaleY(1); }
.rail-ico { display: grid; place-items: center; }
.rail-ico svg { width: 19px; height: 19px; display: block; }
.rail-label { font-size: 11px; font-weight: 500; line-height: 1.1; white-space: nowrap; letter-spacing: 0.01em; }

.rail-badge {
  position: absolute;
  top: 4px;
  right: 5px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--primary);
  color: var(--primary-text);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
  line-height: 1;
}

:root[data-theme="light"] .rail-theme .ico-sun { display: none; }
:root[data-theme="dark"] .rail-theme .ico-moon { display: none; }

.app-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

/* ============================================================
   毛玻璃上下文顶栏（60px 单行，永不折行遮挡）
   ============================================================ */

.topbar {
  height: 60px;
  flex: 0 0 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  padding: 0 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.topbar-heading h1 {
  font-family: var(--display);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.topbar-sub {
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: var(--shadow-xs);
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); border-color: var(--line-3); }
.icon-btn svg { width: 16px; height: 16px; display: block; }

body:not([data-view="chat"]) .mobile-side-toggle { display: none; }
body:not([data-view="video"]) .video-side-toggle { display: none; }

.scenario {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  flex: 0 0 auto;
}
.scenario-key { font-size: 12px; color: var(--muted); white-space: nowrap; }
.scenario select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 0 12px;
  height: 34px;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s;
}
.scenario select:hover { border-color: var(--line-3); }
.scenario em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--dim);
  font-family: var(--mono);
  white-space: nowrap;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.run-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 13px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  white-space: nowrap;
}
.run-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); flex: 0 0 auto; }
.run-state[data-state="running"] { color: var(--accent-2); border-color: var(--accent-border); background: var(--accent-soft); }
.run-state[data-state="running"] i { background: var(--accent); animation: blink 1.2s ease-in-out infinite; }
.run-state[data-state="done"] { color: var(--ok); border-color: var(--ok-border); background: var(--ok-soft); }
.run-state[data-state="done"] i { background: var(--ok); }
.run-state[data-state="paused"] { color: var(--warn); border-color: var(--warn-border); background: var(--warn-soft); }
.run-state[data-state="paused"] i { background: var(--warn); }
.run-state[data-state="failed"] { color: var(--danger); border-color: var(--danger-border); background: var(--danger-soft); }
.run-state[data-state="failed"] i { background: var(--danger); }

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.28; } }

.controls { display: flex; align-items: center; gap: 8px; }

/* 旗舰级按钮体系：克制的曜石/瓷白主按钮 + 高精发丝次按钮 */
.btn {
  height: 36px;
  padding: 0 15px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: var(--shadow-xs), var(--specular);
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease), transform 0.12s var(--ease), box-shadow 0.16s var(--ease);
}
.btn:hover { background: var(--surface-hover); border-color: var(--line-3); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none; }
.btn .ico { display: inline-flex; align-items: center; justify-content: center; }
.btn .ico svg { width: 14px; height: 14px; display: block; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--primary-text);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); border-color: var(--line); }

.btn-warn {
  background: var(--warn-soft);
  border-color: var(--warn-border);
  color: var(--warn);
  box-shadow: none;
}
.btn-warn:hover { background: var(--warn); border-color: var(--warn); color: #fff; }

.btn-danger-ghost {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
  box-shadow: none;
}
.btn-danger-ghost:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

.btn-block { width: 100%; height: 38px; justify-content: center; }

.composer-ctrl { height: 34px; padding: 0 14px; border-radius: 99px; font-size: 12.5px; }
.composer-ctrl svg { width: 13px; height: 13px; }

.speed {
  display: flex;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  overflow: hidden;
  height: 36px;
  background: var(--surface);
}
.speed button { width: 34px; border: 0; background: transparent; color: var(--dim); font-size: 11px; font-family: var(--mono); }
.speed button.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }

/* 视图路由显隐 */
#chatView, #videoView, #studioView { display: none; }
body[data-view="chat"] #chatView { display: flex; }
body[data-view="studio"] #studioView { display: grid; }
body[data-view="video"] #videoView { display: block; }

body[data-view="chat"] .scenario,
body[data-view="chat"] #btnPlay,
body[data-view="chat"] #btnStep,
body[data-view="chat"] #btnReset,
body[data-view="chat"] #speed,
body[data-view="video"] .scenario,
body[data-view="video"] #runState,
body[data-view="video"] #btnPlay,
body[data-view="video"] #btnStep,
body[data-view="video"] #btnReset,
body[data-view="video"] #speed { display: none; }

/* ============================================================
   视图 1：对话工作台（旗舰级编辑质感 + 悬浮命令栏）
   ============================================================ */

.chat-view {
  flex: 1;
  min-height: 0;
  display: flex;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

.chat-side {
  width: 280px;
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px 14px;
  background: var(--rail-bg);
  border-right: 1px solid var(--line);
  transition: width 0.22s var(--ease), flex-basis 0.22s var(--ease), padding 0.22s var(--ease), opacity 0.18s ease;
  overflow: hidden;
}

.chat-side.collapsed {
  width: 0;
  flex-basis: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-width: 0;
  opacity: 0;
  pointer-events: none;
}

.chat-side-top { display: flex; flex-direction: column; gap: 10px; }

.chat-search-wrap { position: relative; }
.chat-search-ico {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--dim);
  pointer-events: none;
}
.chat-search {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.16s, box-shadow 0.16s;
}
.chat-search:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-ring); }

.chat-side-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 4px 6px 0;
}

.chat-history {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ch-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: var(--r-sm);
  padding: 10px 11px;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.ch-item-main { flex: 1; min-width: 0; }
.ch-item b {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ch-item small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--dim);
  font-family: var(--mono);
}
.ch-item:hover { background: var(--surface-hover); }
.ch-item.on {
  background: var(--surface);
  border-color: var(--line-2);
  box-shadow: var(--shadow-xs);
}
.ch-item.on b { color: var(--text); font-weight: 600; }

.ch-del {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}
.ch-item:hover .ch-del,
.ch-item:focus-within .ch-del { opacity: 1; }
.ch-del:hover { background: var(--danger-soft); color: var(--danger); }

.ch-empty { font-size: 12.5px; color: var(--dim); text-align: center; padding: 32px 12px; }

.chat-side-foot {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.side-quick-links { display: flex; flex-direction: column; gap: 6px; }
.side-pill {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.side-pill:hover { background: var(--surface-hover); color: var(--text); border-color: var(--line-2); }

.chat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  background-image: var(--bg-glow);
  position: relative;
}

/* ChatGPT / Claude 式居中空态 → 输入后丝滑落底 */
.chat-main.is-empty {
  justify-content: center;
}
.chat-main.is-empty .chat-scroll {
  flex: 0 0 auto;
  overflow: visible;
  padding: 0 28px 26px;
}
.chat-main.is-empty .chat-msgs { display: none; }
.chat-main.is-empty .chat-composer-wrap {
  padding: 0 28px 64px;
  background: none;
}
.chat-main:not(.is-empty) .hero-modes { display: none; }

.chat-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 36px 28px 28px;
  display: flex;
  flex-direction: column;
}

/* 居中欢迎头 */
.chat-hero {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
  padding: 0;
  animation: heroIn 0.34s var(--ease);
}
@keyframes heroIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  box-shadow: var(--shadow-xs);
  margin-bottom: 18px;
}

.hero-mark {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: var(--primary-text);
  background: var(--primary);
  box-shadow: var(--shadow-md);
}
.hero-mark svg { width: 25px; height: 25px; display: block; }

.chat-hero h2 {
  margin: 18px 0 8px;
  font-family: var(--display);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--text);
}
.chat-hero p {
  max-width: 520px;
  margin: 0 auto;
  font-size: 14px;
  line-height: 1.75;
  color: var(--muted);
}

/* 输入框下方的 3 个精致模式切换胶囊 */
.hero-modes {
  width: 100%;
  max-width: 820px;
  margin: 16px auto 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-xs), var(--specular);
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease), transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.mode-pill svg { width: 15px; height: 15px; color: var(--muted); flex: 0 0 auto; transition: color 0.16s; }
.mode-pill:hover {
  border-color: var(--line-3);
  color: var(--text);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm), var(--specular);
}
.mode-pill:hover svg { color: var(--text); }
.mode-pill.on {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
  box-shadow: var(--shadow-sm);
}
.mode-pill.on svg { color: var(--primary-text); }

/* 消息流（宽敞阅读列） */
.chat-msgs {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.msg { display: flex; gap: 14px; animation: logIn 0.24s var(--ease); }
.msg.user { justify-content: flex-end; }

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--primary-text);
  background: var(--primary);
  box-shadow: var(--shadow-xs);
  flex: 0 0 auto;
  margin-top: 2px;
}
.msg-avatar svg { width: 17px; height: 17px; display: block; }

.msg-body {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
  box-shadow: var(--shadow-sm), var(--specular);
  min-width: 0;
}

.msg.user .msg-body {
  background: var(--user-bubble);
  border-color: var(--line-2);
  color: var(--user-bubble-text);
  border-bottom-right-radius: 6px;
  max-width: 74%;
  padding: 12px 18px;
  box-shadow: var(--shadow-sm);
}
.msg.agent .msg-body { flex: 1; }
.msg-body:empty { display: none; }
.msg-body p { margin-bottom: 10px; }
.msg-body p:last-child { margin-bottom: 0; }

/* 实时执行步进卡片 */
.run-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.rs {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--dim);
}
.rs i {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-style: normal;
  font-family: var(--mono);
  border: 1px solid var(--line-2);
  background: var(--surface);
  flex: 0 0 auto;
}
.rs.run { color: var(--accent-2); border-color: var(--accent-border); background: var(--accent-soft); }
.rs.run i { border-color: var(--accent); background: var(--accent); color: #fff; animation: blink 1.2s ease-in-out infinite; }
.rs.done { color: var(--ok); border-color: var(--ok-border); background: var(--ok-soft); }
.rs.done i { border-color: var(--ok); background: var(--ok); color: #fff; }

.rs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.rs-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rs-note { font-size: 12.5px; color: var(--muted); }
.rs-note.paused { color: var(--warn); font-weight: 500; }
.rs-note.cancelled { color: var(--muted); }

/* 交付卡片（高质感文档画板） */
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.result-head b {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.result-head span {
  font-size: 11.5px;
  color: var(--muted);
  font-family: var(--mono);
}
.result-summary { margin-top: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.65; }

.result-article {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px 26px;
  background: var(--surface-2);
  overflow-wrap: anywhere;
}
.result-article:empty { display: none; }

.empty-note { color: var(--dim); font-size: 13px; }
.shot-row { cursor: pointer; transition: background 0.14s; }
.shot-row:hover td { background: var(--accent-soft); }

.chat-copy { white-space: normal; line-height: 1.85; }
.chat-copy p { margin: 0 0 10px; }
.chat-copy p:last-child { margin-bottom: 0; }
.chat-copy strong { color: var(--text); font-weight: 600; }
.chat-copy h5 { margin: 14px 0 6px; font-size: 14.5px; font-weight: 600; color: var(--text); }
.chat-copy ul, .chat-copy ol { margin: 6px 0 10px 22px; padding: 0; }
.chat-copy li { margin: 4px 0; }
.chat-copy code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.88em;
}
.chat-copy a { color: var(--accent-2); text-decoration: underline; }

.edit-diff {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
}
.edit-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 24px minmax(0, 1fr);
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.edit-row:last-child { border-bottom: 0; }
.edit-row code { color: var(--accent-2); font-family: var(--mono); font-size: 11px; }
.edit-before { color: var(--muted); text-decoration: line-through; overflow-wrap: anywhere; }
.edit-arrow { color: var(--dim); text-align: center; }
.edit-after { color: var(--ok); overflow-wrap: anywhere; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.title-list { margin: 8px 0 0; padding-left: 20px; }
.title-list li { margin-bottom: 7px; font-size: 13.5px; line-height: 1.7; }

/* 底部悬浮命令舱输入框 */
.chat-composer-wrap {
  flex: 0 0 auto;
  padding: 12px 28px 22px;
  background: linear-gradient(to top, var(--bg) 82%, transparent);
}

.chat-input {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md), var(--specular);
  padding: 15px 18px 12px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.chat-input:focus-within {
  border-color: var(--line-3);
  box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow-md), var(--specular);
}

.chat-input textarea {
  width: 100%;
  min-height: 48px;
  max-height: 190px;
  resize: none;
  border: 0;
  padding: 0;
  font-size: 14.5px;
  line-height: 1.65;
  outline: none;
  background: transparent;
  color: var(--text);
}
.chat-input textarea::placeholder { color: var(--dim); }

.composer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.format-pills {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.fmt-pill {
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  transition: background 0.16s var(--ease), color 0.16s var(--ease);
}
.fmt-pill:hover { color: var(--text); }
.fmt-pill.on {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.composer-right { display: flex; align-items: center; gap: 10px; }
.composer-hint { font-size: 11.5px; color: var(--dim); }
.composer-send { height: 36px; padding: 0 18px; border-radius: 99px; font-weight: 600; }
.composer-send svg { width: 14px; height: 14px; }

/* ============================================================
   视图 2：工作流编排画布（Dify Pro / Linear Graph 质感）
   ============================================================ */

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr) 400px;
  gap: 14px;
  padding: 14px;
  background: var(--bg);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-sm), var(--specular);
}

.panel-head {
  flex: 0 0 auto;
  height: 50px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { font-size: 13.5px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }

.tag {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px 8px;
  background: var(--surface-2);
  font-variant-numeric: tabular-nums;
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px;
}

.req-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px;
}
.req-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.req-card textarea {
  width: 100%;
  height: 90px;
  resize: none;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.65;
  padding: 9px 11px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.req-card textarea:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-ring); }

.req-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 12px; }
.req-meta span {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 2px 9px;
  font-family: var(--mono);
}

.sub-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; margin: 18px 0 10px; }
.sub-head h2 { font-size: 13px; font-weight: 600; color: var(--text); }

.roster { display: flex; flex-direction: column; gap: 5px; }
.roster-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: var(--surface-2);
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}
.roster-item:hover { background: var(--surface-hover); border-color: var(--line-2); }
.roster-item.sel { background: var(--surface); border-color: var(--line-3); box-shadow: var(--shadow-xs); }

.ri-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-3); flex: 0 0 auto; }
.roster-item[data-status="running"] .ri-dot { background: var(--accent); animation: blink 1.2s ease-in-out infinite; }
.roster-item[data-status="done"] .ri-dot { background: var(--ok); }
.roster-item[data-status="queued"] .ri-dot { background: var(--accent); opacity: 0.55; }
.roster-item[data-status="warn"] .ri-dot,
.roster-item[data-status="failed"] .ri-dot { background: var(--danger); }
.roster-item[data-status="rework"] .ri-dot { background: var(--warn); animation: blink 1s ease-in-out infinite; }
.roster-item[data-status="skipped"] { opacity: 0.58; }

.ri-main { flex: 1; min-width: 0; }
.ri-main b { display: block; font-size: 13px; font-weight: 500; color: var(--text); }
.ri-main small { display: block; font-size: 10.5px; color: var(--dim); margin-top: 1px; font-family: var(--mono); }
.ri-stat { font-size: 11px; color: var(--dim); font-family: var(--mono); white-space: nowrap; }
.roster-item[data-status="running"] .ri-stat { color: var(--accent-2); }
.roster-item[data-status="done"] .ri-stat { color: var(--ok); }
.roster-item[data-status="warn"] .ri-stat,
.roster-item[data-status="failed"] .ri-stat { color: var(--danger); }
.roster-item[data-status="rework"] .ri-stat { color: var(--warn); }

.panel-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding: 12px 14px;
  background: var(--surface-2);
}

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  box-shadow: var(--shadow-xs);
}
.metric b { display: block; font-family: var(--mono); font-size: 16px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.metric span { font-size: 11px; color: var(--dim); }
.metric.hl b { color: var(--accent-2); }

/* 点阵画布 */
.legend { display: flex; gap: 14px; align-items: center; }
.legend span { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.lg-pending { background: var(--line-3); }
.lg-running { background: var(--accent); }
.lg-done { background: var(--ok); }
.lg-reject { background: var(--danger); }

.stage-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background-color: var(--bg);
  background-image: radial-gradient(var(--grid-dot) 1px, transparent 1px);
  background-size: 22px 22px;
  cursor: grab;
  touch-action: none;
}
.stage-wrap.panning { cursor: grabbing; }

.stage-tools {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 5px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line-2);
  border-radius: 99px;
  box-shadow: var(--shadow-md);
  z-index: 8;
}
.stage-tools button {
  min-width: 30px;
  height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s, color 0.14s;
}
.stage-tools button:hover { background: var(--surface-hover); color: var(--text); }
.stage-tools .st-text { font-size: 12px; font-weight: 500; }

.zoom-label { min-width: 46px; text-align: center; font-family: var(--mono); font-size: 11.5px; color: var(--muted); }

.stage-hint {
  position: absolute;
  left: 16px;
  bottom: 20px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 99px;
  pointer-events: none;
  z-index: 5;
}

body.canvas-expanded { overflow: hidden; }
body.canvas-expanded .stage-wrap { position: fixed; inset: 0; z-index: 200; }

.stage { position: absolute; width: 860px; height: 700px; transform-origin: top left; }
.edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.edge { fill: none; stroke: var(--edge-idle); stroke-width: 1.5; transition: stroke 0.25s; }
.edge.on { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 6 6; animation: flow 0.85s linear infinite; }
.edge.passed { stroke: var(--ok); stroke-opacity: 0.6; }
.edge-reject { stroke: var(--danger); stroke-opacity: 0.3; stroke-dasharray: 4 5; }
.edge-reject.on { stroke: var(--danger); stroke-opacity: 1; stroke-width: 2; animation: flow 0.7s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -24; } }

.node {
  position: absolute;
  width: 180px;
  height: 92px;
  border-radius: var(--r-md);
  padding: 11px 13px 10px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-sm), var(--specular);
  display: flex;
  flex-direction: column;
  z-index: 2;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.18s var(--ease);
  overflow: hidden;
}
.node:hover { transform: translateY(-2px); border-color: var(--line-3); box-shadow: var(--shadow-md), var(--specular); }
.node::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--c, var(--accent)); opacity: 0.75; }
.node-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.node-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: var(--c, var(--accent));
  background: var(--surface-2);
  border: 1px solid var(--line);
  flex: 0 0 auto;
}
.node-icon svg { width: 13px; height: 13px; display: block; }
.node-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-role { font-size: 10px; color: var(--dim); font-family: var(--mono); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.node-state { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); }
.node-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-3); }
.node-state em { font-style: normal; }
.node-metric { font-size: 10px; font-family: var(--mono); color: var(--dim); }
.node-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2.5px; background: var(--surface-3); }
.node-bar b { display: block; height: 100%; width: 0; background: var(--c, var(--accent)); transition: width 0.35s linear; }

.node[data-status="queued"] { border-style: dashed; border-color: var(--accent-border); }
.node[data-status="queued"] .node-state em { color: var(--accent-2); }
.node[data-status="queued"] .node-state i { background: var(--accent); opacity: 0.6; }
.node[data-status="running"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow-md); }
.node[data-status="running"] .node-state em { color: var(--accent-2); font-weight: 600; }
.node[data-status="running"] .node-state i { background: var(--accent); animation: blink 1.2s ease-in-out infinite; }
.node[data-status="running"] .node-bar b { width: 35% !important; background: var(--accent); animation: live-progress 1.3s ease-in-out infinite; }
.node[data-status="done"] { border-color: var(--ok-border); }
.node[data-status="done"] .node-state em { color: var(--ok); }
.node[data-status="done"] .node-state i { background: var(--ok); }
.node[data-status="done"] .node-bar b { background: var(--ok); }
.node[data-status="warn"], .node[data-status="failed"] { border-color: var(--danger-border); box-shadow: 0 0 0 3px var(--danger-soft), var(--shadow-md); }
.node[data-status="warn"] .node-state em, .node[data-status="failed"] .node-state em { color: var(--danger); }
.node[data-status="warn"] .node-state i, .node[data-status="failed"] .node-state i { background: var(--danger); }
.node[data-status="rework"] { border-color: var(--warn-border); box-shadow: 0 0 0 3px var(--warn-soft), var(--shadow-md); }
.node[data-status="rework"] .node-state em { color: var(--warn); }
.node[data-status="rework"] .node-state i { background: var(--warn); animation: blink 1s ease-in-out infinite; }
.node[data-status="skipped"] { opacity: 0.6; }
.node.sel { border-color: var(--text); box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow-md); }
.node[data-id="orchestrator"] { width: 200px; height: 96px; }
.node.ping { animation: nodePing 0.9s ease-out 2; }
@keyframes nodePing { 0% { box-shadow: 0 0 0 0 var(--accent-ring); } 70% { box-shadow: 0 0 0 14px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes live-progress { from { transform: translateX(-110%); } to { transform: translateX(310%); } }

/* 可折叠终端 */
.console {
  flex: 0 0 176px;
  border-top: 1px solid var(--console-line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--console-bg);
  transition: flex-basis 0.22s var(--ease);
}
.console.collapsed { flex: 0 0 36px; }
.console.collapsed .console-body { display: none; }
.console-head {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 16px;
  border-bottom: 1px solid var(--console-line);
  flex: 0 0 auto;
  background: var(--console-head);
}
.dot-row { display: flex; gap: 6px; }
.dot-row i { width: 7px; height: 7px; border-radius: 50%; }
.dot-row i:nth-child(1) { background: #ef4444; opacity: 0.72; }
.dot-row i:nth-child(2) { background: #f59e0b; opacity: 0.72; }
.dot-row i:nth-child(3) { background: #10b981; opacity: 0.72; }
.console-title { font-family: var(--mono); font-size: 11px; color: #94a3b8; }
.console-hint { margin-left: auto; font-family: var(--mono); font-size: 11px; color: #64748b; }
.console-toggle { border: 1px solid rgba(255,255,255,0.12); border-radius: 99px; background: rgba(255,255,255,0.06); color: #cbd5e1; font-size: 11px; padding: 2px 10px; }
.console-toggle:hover { background: rgba(255,255,255,0.14); }
.console-body { flex: 1; overflow-y: auto; padding: 10px 16px 14px; font-family: var(--mono); font-size: 11.5px; line-height: 1.9; color: #cbd5e1; }
.console-body:empty::after { content: "工作台已就绪，等待启动协作。"; color: #64748b; font-style: italic; }
.log-line { display: flex; gap: 10px; align-items: flex-start; animation: logIn 0.2s var(--ease); }
@keyframes logIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.log-line .lt { color: #64748b; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.log-line .la { flex: 0 0 auto; min-width: 56px; font-weight: 500; }
.log-line .lx { color: #cbd5e1; word-break: break-word; }
.log-line.strong .lx { color: #f8fafc; font-weight: 500; }
.log-line.reject .lx { color: #fca5a5; }
.log-line.ok .lx { color: #6ee7b7; }
.log-line.sys .lx { color: #94a3b8; font-style: italic; }

/* 右栏详情 */
.right-tabs { display: flex; gap: 22px; padding: 10px 18px 0; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.right-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 0 0 11px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.right-tabs button.on { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.right-tabs button:hover { color: var(--text); }
.right-body { padding: 16px 18px 22px; }

.art-head { margin-bottom: 14px; }
.art-kicker { font-size: 10px; font-family: var(--mono); letter-spacing: 0.1em; color: var(--dim); }
.art-head h3 { margin-top: 4px; font-size: 16px; font-weight: 600; color: var(--text); }
.art-head p { margin-top: 5px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.art-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-family: var(--mono); padding: 2px 8px; border-radius: 99px; margin-top: 8px; }
.art-badge.blue { color: var(--accent-2); background: var(--accent-soft); }
.art-badge.green { color: var(--ok); background: var(--ok-soft); }
.art-badge.red { color: var(--danger); background: var(--danger-soft); }
.art-badge.amber { color: var(--warn); background: var(--warn-soft); }

.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font-weight: 600; font-size: 11.5px; color: var(--muted); padding: 0 0 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--text-2); }
.tbl td:first-child { font-family: var(--mono); color: var(--dim); font-size: 11px; width: 26px; }
.tbl tr:last-child td { border-bottom: 0; }

.chip { display: inline-block; font-size: 10.5px; padding: 2px 7px; border-radius: 99px; font-family: var(--mono); }
.c-orch, .c-wr { color: var(--accent-2); background: var(--accent-soft); }
.c-kb, .c-sm { color: var(--ok); background: var(--ok-soft); }
.c-re { color: var(--warn); background: var(--warn-soft); }
.c-cm { color: var(--danger); background: var(--danger-soft); }

.note { margin-top: 12px; padding: 11px 14px; border-radius: var(--r-sm); background: var(--surface-2); border-left: 3px solid var(--accent); font-size: 12.5px; color: var(--text-2); line-height: 1.75; }
.sub-title { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--dim); margin: 18px 0 10px; display: flex; align-items: center; gap: 10px; }
.sub-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.hit-list { display: flex; flex-direction: column; gap: 7px; }
.hit { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; transition: border-color 0.14s, background 0.14s; }
.hit:hover { border-color: var(--line-2); background: var(--surface-hover); }
.hit-t { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.hit-m { display: flex; justify-content: space-between; margin-top: 4px; font-size: 11px; color: var(--dim); font-family: var(--mono); }
.hit-m b { color: var(--ok); font-weight: 500; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-row > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px; text-align: center; }
.stat-row b { display: block; font-family: var(--mono); font-size: 16px; font-weight: 600; color: var(--text); }
.stat-row span { font-size: 11px; color: var(--dim); }

.bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.bullets li { font-size: 13px; color: var(--text-2); line-height: 1.65; padding-left: 14px; position: relative; }
.bullets li::before { content: ""; position: absolute; left: 0; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

.bar-item { margin-bottom: 10px; }
.bar-item-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.bar-track { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar-track i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

.article { font-size: 14px; line-height: 1.9; color: var(--text-2); }
.article .sign { color: var(--dim); font-size: 12px; margin-top: 12px; }

mark.risk { background: var(--danger-soft); color: var(--danger); border-bottom: 1px dashed var(--danger); padding: 0 3px; border-radius: 3px; }
mark.warnm { background: var(--warn-soft); color: var(--warn); border-bottom: 1px dashed var(--warn); padding: 0 3px; border-radius: 3px; }
mark.fix { background: var(--ok-soft); color: var(--ok); padding: 0 3px; border-radius: 3px; }

.risk-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.risk-card { border: 1px solid var(--danger-border); background: var(--danger-soft); border-radius: var(--r-sm); padding: 11px 14px; }
.risk-card[data-level="中"] { border-color: var(--warn-border); background: var(--warn-soft); }
.risk-card[data-level="中"] .rc-head { color: var(--warn); }
.risk-card[data-level="低"] { border-color: var(--line-2); background: var(--surface-2); }
.risk-card[data-level="低"] .rc-head { color: var(--muted); }
.risk-card .rc-head { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--danger); font-family: var(--mono); margin-bottom: 5px; flex-wrap: wrap; }
.risk-card .rc-head b { font-size: 10px; padding: 1px 7px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
.risk-card .rc-count { margin-left: auto; font-size: 10.5px; padding: 1px 7px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.risk-card .rc-body { font-size: 13px; color: var(--text-2); line-height: 1.7; }
.risk-card .rc-fix { margin-top: 6px; font-size: 12px; color: var(--muted); }
.risk-card .rc-fix em { font-style: normal; color: var(--ok); }

.risk-collapse { margin-top: 8px; }
.risk-toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.risk-toggle::-webkit-details-marker { display: none; }
.risk-toggle:hover { background: var(--surface-hover); border-color: var(--line-3); color: var(--text); }
.risk-toggle::after { content: "▾"; font-size: 11px; color: var(--muted); transition: transform 0.18s var(--ease); }
.risk-collapse[open] .risk-toggle::after { transform: rotate(180deg); }
.risk-collapse .rt-close { display: none; }
.risk-collapse[open] .rt-open { display: none; }
.risk-collapse[open] .rt-close { display: inline; }
.risk-more-list { margin-top: 8px; }

.score-wrap { display: flex; align-items: center; gap: 18px; margin: 14px 0; padding: 14px 16px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.score-ring { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; position: relative; flex: 0 0 auto; }
.score-ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface-2); }
.score-ring b { position: relative; font-family: var(--mono); font-size: 20px; font-weight: 700; }
.score-ring small { position: relative; font-size: 10px; color: var(--dim); display: block; text-align: center; margin-top: -2px; }
.score-meta { flex: 1; }
.score-meta .sm-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; color: var(--muted); }
.score-meta .sm-row b { font-family: var(--mono); font-weight: 600; color: var(--text-2); }
.score-meta .sm-row b.g { color: var(--ok); }
.score-meta .sm-row b.r { color: var(--danger); }
.score-meta .sm-row b.a { color: var(--warn); }

.check-list { display: flex; flex-direction: column; gap: 7px; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.65; padding: 9px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.check i { color: var(--ok); font-style: normal; flex: 0 0 auto; margin-top: 1px; }
.check.warn i { color: var(--warn); }
.check.warn { background: var(--warn-soft); border-color: var(--warn-border); }

.deliver-item { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); margin-bottom: 7px; }
.deliver-item .di-no { font-family: var(--mono); font-size: 10.5px; color: var(--dim); width: 20px; }
.deliver-item .di-main { flex: 1; min-width: 0; }
.deliver-item .di-main b { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); }
.deliver-item .di-main small { display: block; font-size: 11px; color: var(--dim); margin-top: 2px; }
.deliver-item .di-state { font-family: var(--mono); font-size: 10.5px; color: var(--ok); }

.empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--dim); text-align: center; padding: 48px 24px; }
.empty .em-icon { width: 52px; height: 52px; border-radius: var(--r-md); display: grid; place-items: center; font-size: 20px; border: 1px dashed var(--line-3); color: var(--dim); background: var(--surface-2); }
.empty p { font-size: 13px; line-height: 1.75; max-width: 240px; }

.agent-hero { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.agent-avatar { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface-2); }
.agent-avatar svg { width: 20px; height: 20px; display: block; }
.agent-hero-t b { display: block; font-size: 15px; font-weight: 600; color: var(--text); }
.agent-hero-t small { display: block; font-size: 11px; color: var(--dim); font-family: var(--mono); margin-top: 2px; }
.agent-cfg-cta { margin-top: 16px; }
.kv { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; }
.kv span { color: var(--dim); }
.kv b { font-weight: 500; color: var(--text-2); font-family: var(--mono); font-size: 12.5px; }
.skill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.skill { font-size: 11.5px; padding: 4px 10px; border-radius: 99px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); }

/* ============================================================
   视图 3：抖音视频拆解与 AI 成片工坊（Runway / OpenMotion 质感）
   ============================================================ */

.video-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 26px 56px;
  background: var(--bg);
  background-image: var(--bg-glow);
}

.video-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 326px) minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  max-width: 1520px;
  margin-inline: auto;
  transition: grid-template-columns 0.22s var(--ease);
}
.video-workspace.side-collapsed {
  grid-template-columns: minmax(0, 1fr);
}
.video-workspace.side-collapsed .video-import {
  display: none;
}

/* 顶部工作台视图切换与 4 步进度条 */
.video-workspace[data-vtab="breakdown"] #videoScriptArea { display: none !important; }
.video-workspace[data-vtab="remake"] #videoResult { display: none !important; }
.video-workspace[data-vtab="remake"] #videoScriptJump { display: none !important; }
.video-workspace[data-vtab="remake"] #videoScriptArea { margin-top: 12px; }

.video-workspace-heading {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px 18px;
  box-shadow: var(--shadow-sm), var(--specular);
}

.video-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.video-heading-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.video-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.vtab {
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 14px;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.vtab:hover { color: var(--text); }
.vtab.on {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.video-stepper { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.video-stepper li button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  transition: all 0.16s var(--ease);
}
.video-stepper li button:hover { border-color: var(--line-3); color: var(--text); }
.video-stepper li button span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.video-stepper li.is-active button { border-color: var(--primary); background: var(--primary); color: var(--primary-text); box-shadow: var(--shadow-xs); }
.video-stepper li.is-active button span { background: rgba(128,128,128,0.28); color: var(--primary-text); }
.video-stepper li.is-done button { border-color: var(--ok-border); background: var(--ok-soft); color: var(--ok); }
.video-stepper li.is-done button span { background: var(--ok); color: #fff; }

.card-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.video-import,
.video-output {
  min-width: 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm), var(--specular);
}

.video-import h3, .video-output h2 { font-size: 16px; font-weight: 600; color: var(--text); letter-spacing: -0.015em; }
.video-output-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.video-output-title-group { min-width: 0; flex: 1; }
.video-output-actions { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.video-output-actions:not(:has(> :not([hidden]))) { display: none; }
#videoMusicHistoryStatus:not(:empty) { margin-top: 8px; color: var(--muted); }
.video-output-actions .btn:disabled { opacity: 0.6; cursor: wait; }
.video-script-jump { color: var(--accent-2); border-color: var(--accent-border); background: var(--accent-soft); }
#videoStatus, .video-import small { color: var(--muted); }

.video-import form { display: grid; gap: 12px; margin-top: 14px; }
.video-import label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.video-import textarea,
.video-script-form textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  resize: vertical;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  outline: none;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}
.video-import textarea:focus,
.video-script-form textarea:focus {
  border-color: var(--accent-border);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

/* 精致自定义视频拖拽上传卡 */
.video-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 18px 14px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), transform 0.14s var(--ease);
}
.video-upload:hover,
.video-upload.drag-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.video-upload-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.video-upload-ico svg { width: 17px; height: 17px; }
.video-upload strong { font-size: 13px; font-weight: 600; color: var(--text); }
.video-upload small { font-size: 11.5px; color: var(--muted); }
.video-file-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.video-form-actions { display: grid; gap: 8px; }
.video-import .btn:disabled { opacity: 0.6; cursor: wait; }

.video-report-history { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
#videoReportHistoryStatus:not(:empty) { margin-top: 8px; color: var(--muted); font-size: 12px; }
#videoReportHistoryList { display: grid; gap: 7px; max-height: 320px; overflow-y: auto; margin: 10px 0 0; padding: 0; list-style: none; }
#videoReportHistoryList:empty { display: none; }
.video-saved-report {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  text-align: left;
  overflow-wrap: anywhere;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.video-saved-report > strong { font-size: 13px; color: var(--text); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.video-saved-report > small { font-size: 11px; color: var(--dim); font-family: var(--mono); }
.video-saved-report[aria-current="true"],
.video-saved-report:hover:not(:disabled) { border-color: var(--line-3); background: var(--surface); box-shadow: var(--shadow-xs); }
.video-saved-report:disabled { opacity: 0.55; cursor: default; }

#videoStatus[data-state="error"], .video-warning { color: var(--warn); }
#videoStatus[data-state="done"] { color: var(--ok); }
#videoStatus:not(:empty) { margin-top: 4px; font-size: 12.5px; }
#videoResult { margin-top: 16px; overflow-wrap: anywhere; }
#videoResult > :empty { display: none; }

.video-source { padding: 14px 18px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.video-source h4 { font-size: 15.5px; font-weight: 600; color: var(--text); }
.video-source a { color: var(--accent-2); text-decoration: none; }
.video-source a:hover { text-decoration: underline; }
.video-source > p { color: var(--muted); margin-top: 4px; font-size: 12.5px; }
.video-warning { margin-top: 8px; }

.video-report-section { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 14px; }
.video-report-section > summary { font-weight: 600; font-size: 14px; color: var(--text); cursor: pointer; }
.video-report-section > :not(summary) { margin-top: 12px; }

.video-cues, .video-scenes { list-style: none; padding: 0; margin: 0; }
.video-cues > li { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; }
.video-cues:not(.video-scene-cues) > li { padding: 9px 0; border-bottom: 1px solid var(--line); }

/* 可折叠分镜时间轴与视图密度切换 */
.video-timeline { margin-top: 20px; }
.video-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.video-section-title { display: flex; align-items: center; gap: 8px; }
.video-section-title h4 { font-size: 15.5px; font-weight: 600; color: var(--text); }
.video-count-pill {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-2);
}
.video-section-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.video-density-pills {
  display: inline-flex;
  padding: 2px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.vdp-btn {
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
}
.vdp-btn.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-xs); }
.video-timeline-sub { margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.video-timeline.is-collapsed .video-scenes,
.video-timeline.is-collapsed .video-timeline-sub { display: none; }

.video-scenes { display: grid; gap: 14px; margin-top: 14px; }
/* 网格胶片模式：每行 2–3 镜，紧凑高颜值 */
.video-scenes.is-grid {
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.video-scenes.is-grid .video-scene-card {
  display: flex;
  flex-direction: column;
  padding: 14px;
}
.video-scenes.is-grid .video-scene-layout {
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.video-scenes.is-grid .video-shot img {
  max-height: 240px;
}
.video-scenes.is-grid .video-scene-subtitles {
  padding: 9px 11px;
  max-height: 150px;
  overflow-y: auto;
}
.video-scenes.is-grid .video-fields {
  font-size: 12.5px;
  gap: 4px 10px;
}

.video-scene-card {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  transition: border-color 0.16s, box-shadow 0.16s, transform 0.16s var(--ease);
}
.video-scene-card:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.video-scene-card > h5 {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-2);
  font-weight: 600;
}

.video-scene-layout { display: grid; grid-template-columns: minmax(0, 230px) minmax(0, 1fr); align-items: start; gap: 20px; }
.video-shot { margin: 0; }
.video-shot img { display: block; width: 100%; max-height: 310px; object-fit: contain; border-radius: var(--r-sm); background: #0c0e13; border: 1px solid var(--line); cursor: zoom-in; }
.video-shot figcaption { margin-top: 6px; color: var(--muted); font-size: 11px; }
.video-time { font: 11.5px var(--mono); color: var(--accent-2); white-space: nowrap; }

.video-scene-subtitles { padding: 12px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); }
.video-scene-lane:not([hidden]) + .video-scene-lane:not([hidden]) { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.video-scene-lane > strong { color: var(--muted); font-size: 11.5px; }
.video-scene-cues { margin-top: 4px; }
.video-scene-cues > li { padding: 2px 0; align-items: baseline; font-size: 12.5px; }
.video-scene-no-caption { color: var(--dim); font-size: 12px; }
.video-scene-subtitles:not([hidden]) + .video-scene-notes { margin-top: 12px; }
.video-scene-notes h6 { margin: 0; font-size: 12.5px; color: var(--text); }

.video-fields { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 8px 0 0; font-size: 13px; }
.video-fields dt { color: var(--muted); font-weight: 500; }
.video-fields dd { margin: 0; color: var(--text-2); }
.video-takeaways { padding-left: 1.4em; color: var(--text-2); }
.video-takeaways li { margin: 5px 0; }

.video-bgm-panel { padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.video-bgm-state { display: inline-block; margin-inline-start: 8px; padding: 2px 9px; border-radius: 99px; background: var(--surface-3); color: var(--muted); font-size: 12px; }
.video-bgm-state:empty { display: none; }
.video-bgm-panel[data-match-state="pending"] .video-bgm-state { background: var(--accent-soft); color: var(--accent-2); }
.video-bgm-panel[data-match-state="matched"] .video-bgm-state { background: var(--ok-soft); color: var(--ok); }
.video-bgm-body { display: grid; gap: 6px; }
.video-bgm-body > :is(dl, ul) { margin: 0; }
.video-bgm-local { color: var(--muted); font-size: 12.5px; }
.video-bgm-times { display: flex; flex-wrap: wrap; gap: 6px 12px; list-style: none; padding: 0; }
.video-bgm-matches { list-style: none; padding: 0; }
.video-bgm-matches li + li { margin-top: 8px; }
.video-bgm-matches strong { font-size: 14px; }

/* 复刻选题与可折叠分镜脚本 */
#videoScriptArea { margin-top: 24px; scroll-margin-block: 16px; overflow-wrap: anywhere; }
.video-script-panel {
  padding: 24px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.video-script-panel > h2 { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.video-script-panel > h3 { font-size: 15px; margin-top: 8px; color: var(--text); }
.video-script-panel > p { color: var(--muted); margin-top: 6px; font-size: 13px; }

.video-script-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.video-script-card-head h4 { font-size: 17px; font-weight: 700; color: var(--text); }
.video-script-angle { margin-top: 4px; font-size: 13px; color: var(--muted); }
.video-script-shots-hint { margin-top: 12px; font-size: 12px; color: var(--dim); }
.video-shots-collapsible.is-collapsed { display: none; }

.video-topic-suggestions { margin-top: 16px; }
.video-topic-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; padding: 0; margin: 12px 0; list-style: none; }
.video-topic-list:empty { display: none; }
.video-topic-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.video-topic-num { font-style: normal; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--dim); padding: 2px 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); }
.video-topic-check { font-size: 11px; font-weight: 500; color: var(--muted); }
.video-topic-choice[aria-pressed="true"] .video-topic-num { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.video-topic-choice[aria-pressed="true"] .video-topic-check { color: var(--ok); font-weight: 600; }
.video-topic-choice {
  display: grid;
  align-content: start;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  color: inherit;
  text-align: left;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.15s var(--ease);
}
.video-topic-choice:hover { border-color: var(--line-3); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.video-topic-choice[aria-pressed="true"] { border-color: var(--text); background: var(--surface); box-shadow: 0 0 0 2px var(--accent-ring), var(--shadow-sm); }
.video-topic-choice[aria-pressed="true"] strong { color: var(--accent-2); }
.video-topic-choice span { color: var(--muted); font-size: 12.5px; line-height: 1.6; }

.video-script-form { display: grid; gap: 12px; margin-top: 16px; }
.video-script-form > label { font-weight: 600; font-size: 13px; }
.video-script-form textarea { background: var(--surface); }
.video-script-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.video-script-actions > label { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-2); }
.video-script-actions select { min-height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--text); }

.video-script-status { color: var(--muted); font-size: 13px; }
.video-script-status[data-state="error"] { color: var(--danger); }
.video-script-status[data-state="paused"] { color: var(--warn); }
.video-script-status[data-state="done"] { color: var(--ok); }
.video-script-status[data-state="working"] { color: var(--accent-2); }

.video-script-output:not(:empty) { margin-top: 18px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-xs); }
.video-script-output > h4 { font-size: 16.5px; font-weight: 700; color: var(--text); }
.video-script-output > p { margin-top: 6px; color: var(--muted); }

.video-script-shots-hint { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }
.video-script-shots { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
.video-script-shots > li { position: relative; border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; background: var(--surface-2); cursor: pointer; transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease; }
.video-script-shots > li:hover { border-color: var(--accent-2); background: var(--surface); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.10); }
.video-script-shots > li.is-selected { border-color: var(--accent-2); background: var(--surface); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14); transform: none; cursor: default; }
.video-script-shots h5 { font-size: 13.5px; color: var(--text); }
.video-shot-refine-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.video-shot-refine-label { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--accent-2); transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease; }
.video-script-shots > li:hover .video-shot-refine-label,
.video-script-shots > li.is-selected .video-shot-refine-label { background: var(--accent-2); color: #fff; border-color: var(--accent-2); }
.video-shot-refine { cursor: auto; margin-top: 12px; }

.video-script-tools { margin: 18px 0 10px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.video-script-tools h4 { margin: 0 0 8px; font-size: 14px; color: var(--text); }
.video-script-tools textarea { width: 100%; resize: vertical; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 11px 13px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.video-script-tool-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* AI 成片控制台与分镜审片室 */
.video-production { display: grid; gap: 16px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.video-production > h4 { font-size: 16.5px; font-weight: 700; color: var(--text); }

.production-deck { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.production-style { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.production-style select { height: 36px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 11px; background: var(--surface); font: inherit; font-weight: 400; color: var(--text); }
.production-music { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.production-music-player { display: block; max-width: 100%; width: 340px; }
.production-music-info { color: var(--muted); font-size: 12.5px; }

.production-references { display: grid; width: 100%; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.production-reference-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.production-ref-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 12px; border: 1.5px dashed var(--line-2); border-radius: var(--r-md); background: var(--surface); transition: border-color 0.16s; }
.production-ref-card:hover, .production-ref-card.has-file { border-style: solid; border-color: var(--line-3); }
.production-ref-card > span { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.production-ref-preview { width: 100%; height: 120px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); background: #0c0e13; }
.production-ref-card input[type="file"] { width: 100%; font-size: 11.5px; }

.video-production textarea { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font-size: 13px; line-height: 1.6; }
.video-production small { color: var(--muted); font-size: 12px; }
.video-production progress { width: min(100%, 28rem); height: 8px; border-radius: 99px; overflow: hidden; accent-color: var(--accent); }
.video-production .video-script-status:empty, .video-production-preview:empty { display: none; }
.production-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.production-frame-grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 16px; }
.production-frame-grid:empty { display: none; }
.production-frame { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); transition: border-color 0.16s, box-shadow 0.16s; }
.production-frame:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.production-frame h5 { font-size: 13.5px; font-weight: 600; color: var(--text); }

.production-frame-state { align-self: flex-start; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--surface-3); }
.production-frame-state[data-review="pass"] { color: var(--ok); background: var(--ok-soft); }
.production-frame-state[data-review="manual"] { color: var(--warn); background: var(--warn-soft); }

.production-frame-image { display: block; width: 100%; text-align: center; background: #0c0e13; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; cursor: zoom-in; }
.production-frame-image img { display: block; width: 100%; max-height: 300px; aspect-ratio: 9 / 16; object-fit: contain; }

.production-frame-ai { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.65; }
.production-frame-ai > span { display: block; margin-top: 4px; color: var(--muted); }
.production-frame-ai:is([data-result="mismatch"], [data-result="deferred"]) { border-color: var(--warn-border); }
.production-frame-ai:is([data-result="mismatch"], [data-result="deferred"]) > strong { color: var(--warn); }
.production-frame-ai[data-result="pass"] > strong { color: var(--ok); }

.production-frame-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.production-frame-edit { display: grid; justify-items: start; gap: 7px; padding: 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.production-frame-edit > label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.production-speech-mode { display: grid; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.production-speech-mode select { height: 34px; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 10px; background: var(--surface); color: var(--text); }

.video-production-preview { display: grid; gap: 12px; justify-items: start; width: min(100%, 25rem); padding: 16px; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface-2); box-shadow: var(--shadow-sm); }
.video-production video { width: 100%; max-height: 540px; background: #08090c; border-radius: var(--r-md); border: 1px solid var(--line); }

/* ============================================================
   右上角悬浮交付 Toast（毛玻璃卡片）
   ============================================================ */

.toast {
  position: fixed;
  top: 72px;
  right: 22px;
  width: 360px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--ok-border);
  box-shadow: var(--shadow-lg), var(--specular);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease);
  z-index: 60;
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; cursor: pointer; }
.toast-head { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.toast-check { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--ok-soft); color: var(--ok); flex: 0 0 auto; }
.toast-close { margin-left: auto; width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--dim); display: grid; place-items: center; }
.toast-close:hover { background: var(--surface-hover); color: var(--text); }
.toast-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.toast-grid > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 6px; text-align: center; }
.toast-grid b { display: block; font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--ok); }
.toast-grid span { font-size: 10.5px; color: var(--dim); }
.toast p { margin-top: 10px; font-size: 12px; color: var(--muted); line-height: 1.65; }

/* ============================================================
   弹窗、抽屉、资源中心、方案答疑与图片灯箱
   ============================================================ */

.sheet, .drawer, .lightbox { position: fixed; inset: 0; z-index: 80; }
.sheet { display: flex; align-items: center; justify-content: center; padding: 28px; opacity: 0; visibility: hidden; transition: opacity 0.22s var(--ease), visibility 0.22s var(--ease); }
.sheet.show { opacity: 1; visibility: visible; }
.sheet-mask, .drawer-mask, .lightbox-mask { position: absolute; inset: 0; background: var(--mask); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

.sheet-panel {
  position: relative;
  width: min(1120px, 100%);
  height: min(800px, 90vh);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--specular);
  transform: translateY(12px) scale(0.99);
  transition: transform 0.26s var(--ease);
}
.sheet.show .sheet-panel { transform: none; }

.sheet-head { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.sheet-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--dim); }
.sheet-head h2 { margin-top: 4px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }

.sheet-close { width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); display: grid; place-items: center; }
.sheet-close:hover { color: var(--text); border-color: var(--line-3); background: var(--surface-hover); }

.sheet-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sheet-nav { border-right: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; background: var(--surface-2); }
.sheet-nav button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 1px solid transparent; background: transparent; color: var(--muted); font-size: 13px; padding: 10px 12px; border-radius: var(--r-sm); }
.sheet-nav button span { font-family: var(--mono); font-size: 10px; color: var(--dim); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; background: var(--surface); }
.sheet-nav button:hover { background: var(--surface-hover); color: var(--text); }
.sheet-nav button.on { background: var(--surface); border-color: var(--line-2); color: var(--text); font-weight: 600; box-shadow: var(--shadow-xs); }
.sheet-content { overflow-y: auto; padding: 26px 32px 40px; }

/* 方案答疑 */
.pb-tag { font-size: 11px; font-family: var(--mono); letter-spacing: 0.08em; color: var(--accent-2); }
.pb-q { margin-top: 6px; font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.pb-headline { margin: 14px 0 22px; padding-left: 14px; border-left: 3px solid var(--accent); font-size: 14px; line-height: 1.85; color: var(--text-2); }
.pb-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.pb-step { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.pb-step b { font-family: var(--mono); font-size: 12px; color: var(--accent-2); }
.pb-step h4 { margin: 8px 0 6px; font-size: 14.5px; color: var(--text); }
.pb-step p { font-size: 13px; line-height: 1.75; color: var(--muted); }
.pb-step em { display: inline-block; margin-top: 8px; font-style: normal; font-size: 11px; font-family: var(--mono); color: var(--ok); background: var(--ok-soft); border-radius: 99px; padding: 2px 8px; }
.pb-note { margin-top: 16px; padding: 13px 16px; border-radius: var(--r-sm); background: var(--surface-2); border-left: 3px solid var(--accent); font-size: 13px; line-height: 1.8; color: var(--text-2); }
.pb-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.pb-facts > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.pb-facts b { display: block; font-family: var(--mono); font-size: 17px; color: var(--accent-2); }
.pb-facts span { font-size: 11px; color: var(--dim); }
.pb-ladder { display: flex; flex-direction: column; gap: 9px; }
.pb-rung { display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); }
.pb-rung > span { flex: 0 0 auto; font-family: var(--mono); font-size: 11px; color: var(--dim); border: 1px solid var(--line-2); border-radius: 5px; padding: 2px 7px; background: var(--surface); }
.pb-rung > div { flex: 1; min-width: 0; }
.pb-rung b { font-size: 13.5px; color: var(--text); }
.pb-rung p { margin-top: 3px; font-size: 12px; color: var(--muted); }
.pb-rung em { font-style: normal; font-size: 11px; font-family: var(--mono); white-space: nowrap; }
.pb-rung em.bad { color: var(--danger); }
.pb-rung em.mid { color: var(--warn); }
.pb-rung em.good { color: var(--ok); }
.pb-rung.active { border-color: var(--accent-border); background: var(--accent-soft); }
.pb-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.pb-three > div { padding: 14px; border-radius: var(--r-sm); border: 1px solid var(--danger-border); background: var(--danger-soft); }
.pb-three b { display: block; font-size: 13px; color: var(--danger); }
.pb-three p { margin-top: 5px; font-size: 12px; color: var(--muted); }
.pb-matrix { display: grid; grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: 1fr auto; gap: 8px; }
.mx-ylabel { grid-column: 1; grid-row: 1; align-self: center; font-size: 10.5px; color: var(--dim); writing-mode: vertical-rl; transform: rotate(180deg); }
.mx-grid { grid-column: 2; grid-row: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 220px; }
.mx-xlabel { grid-column: 2; grid-row: 2; text-align: center; font-size: 10.5px; color: var(--dim); }
.mx-cell { display: flex; flex-direction: column; padding: 14px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface-2); }
.mx-cell.best { background: var(--ok-soft); border-color: var(--ok-border); }
.mx-cell.best b { color: var(--ok); }
.mx-cell.guard { background: var(--warn-soft); border-color: var(--warn-border); }
.mx-cell.guard b { color: var(--warn); }
.mx-cell.assist { background: var(--accent-soft); border-color: var(--accent-border); }
.mx-cell.assist b { color: var(--accent-2); }
.mx-cell.human { background: var(--danger-soft); border-color: var(--danger-border); }
.mx-cell.human b { color: var(--danger); }
.mx-cell p { margin-top: 5px; font-size: 12px; color: var(--muted); }
.mx-cell em { margin-top: auto; padding-top: 8px; font-style: normal; font-size: 11px; color: var(--dim); }
.pb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pb-table th { text-align: left; font-size: 11.5px; color: var(--dim); padding: 0 8px 9px 0; border-bottom: 1px solid var(--line); }
.pb-table td { padding: 11px 8px 11px 0; border-bottom: 1px solid var(--line); color: var(--text-2); }
.pb-table tr.total td { border-top: 1px solid var(--line-2); border-bottom: 0; font-weight: 600; color: var(--text); }
.pb-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cmp-col { padding: 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.cmp-col.bad { background: var(--danger-soft); border-color: var(--danger-border); }
.cmp-col.good { background: var(--ok-soft); border-color: var(--ok-border); }
.cmp-head { margin-bottom: 9px; font-weight: 600; }
.cmp-col.bad .cmp-head { color: var(--danger); }
.cmp-col.good .cmp-head { color: var(--ok); }
.cmp-col ul { margin: 0; padding-left: 18px; }
.cmp-col li { font-size: 12.5px; color: var(--text-2); margin: 5px 0; }
.cmp-foot { margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.pb-link { margin-top: 20px; background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent-2); }

/* 资源中心 */
.res-panel { width: min(1100px, 100%); height: min(830px, 92vh); }
.res-tabs { display: flex; gap: 24px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.res-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 500; padding: 13px 0; }
.res-tabs button.on { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }
.res-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 24px 28px; }

.res-msg { margin-bottom: 14px; padding: 10px 14px; border-radius: var(--r-sm); font-size: 12.5px; background: var(--accent-soft); border-left: 3px solid var(--accent); color: var(--accent-2); }
.res-msg.warn { background: var(--warn-soft); border-left-color: var(--warn); color: var(--warn); }
.res-msg.error { background: var(--danger-soft); border-left-color: var(--danger); color: var(--danger); }

.res-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.res-stats { display: flex; gap: 9px; flex-wrap: wrap; }
.res-stats > div { min-width: 90px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.res-stats b { display: block; font-family: var(--mono); font-size: 17px; font-weight: 600; color: var(--text); }
.res-stats span { font-size: 11px; color: var(--dim); }
.res-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.res-role { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.res-role select { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 0 10px; height: 34px; font-size: 12.5px; color: var(--text); }

.api-badge { font-size: 11px; font-family: var(--mono); padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--dim); }
.api-badge.on { color: var(--ok); background: var(--ok-soft); border-color: var(--ok-border); }
.api-badge.off { color: var(--warn); background: var(--warn-soft); border-color: var(--warn-border); }

.drop-zone { position: relative; padding: 26px 18px; border: 1.5px dashed var(--line-3); border-radius: var(--r-md); background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color 0.16s, background 0.16s; }
.drop-zone:hover, .drop-zone.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone.disabled { opacity: 0.55; cursor: not-allowed; }
.dz-icon { width: 42px; height: 42px; margin: 0 auto 10px; border-radius: 10px; display: grid; place-items: center; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-xs); }
.drop-zone b { display: block; font-size: 13.5px; color: var(--text); }
.drop-zone p { margin-top: 5px; font-size: 12px; color: var(--muted); }
.drop-zone .dz-note { color: var(--dim); font-family: var(--mono); font-size: 11px; }

.res-sub { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; font-size: 12px; font-weight: 600; color: var(--dim); }
.res-sub::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.res-sub span { font-family: var(--mono); font-size: 10.5px; color: var(--accent-2); background: var(--accent-soft); border-radius: 99px; padding: 1px 8px; }

.doc-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); margin-bottom: 7px; }
.doc-row:hover { border-color: var(--line-2); background: var(--surface-2); }
.doc-ext { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 9px; display: grid; place-items: center; font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--accent-2); background: var(--accent-soft); border: 1px solid var(--accent-border); }
.doc-main { flex: 1; min-width: 0; }
.doc-main b { display: block; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-main b .ver { font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--accent-2); border: 1px solid var(--accent-border); border-radius: 4px; padding: 0 4px; margin-left: 6px; }
.doc-main small { display: block; margin-top: 2px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.doc-main .doc-err { display: block; margin-top: 3px; font-style: normal; font-size: 11.5px; color: var(--danger); }
.doc-state { font-size: 10.5px; font-family: var(--mono); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.doc-state.ok { color: var(--ok); background: var(--ok-soft); }
.doc-state.pending { color: var(--warn); background: var(--warn-soft); }
.doc-state.error { color: var(--danger); background: var(--danger-soft); }
.doc-state.dup { color: var(--muted); background: var(--surface-3); }

.mini {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 11px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.mini:hover { background: var(--surface-hover); border-color: var(--line-3); color: var(--text); }
.mini.danger { color: var(--danger); border-color: var(--danger-border); }
.mini.danger:hover { background: var(--danger-soft); }

.kb-search { display: flex; gap: 8px; margin: 0 0 14px; }
.kb-search input { flex: 1; height: 36px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font-size: 13px; padding: 0 13px; outline: none; }
.kb-search input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-ring); }
.kb-hit { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); padding: 11px 14px; margin-bottom: 8px; }
.kb-hit .kh-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.kb-hit .kh-head b { font-size: 13px; color: var(--text); }
.kb-hit .kh-head span { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.kb-hit p { font-size: 12.5px; line-height: 1.7; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.kb-hit p mark, .hit-snip mark { background: var(--warn-soft); color: var(--warn); border-radius: 2px; padding: 0 2px; }
.kb-loading { color: var(--dim); margin-left: 8px; }
.kb-chunk-no { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.hit-snip { font-size: 12px; color: var(--dim); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.res-empty { padding: 28px 18px; text-align: center; font-size: 12.5px; color: var(--dim); border: 1px dashed var(--line-2); border-radius: var(--r-md); background: var(--surface-2); }
.res-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.res-foot-note { font-size: 11.5px; color: var(--dim); }
.foot-btns { display: flex; gap: 7px; flex-wrap: wrap; }

.col-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.col-head-main h3 { font-size: 14.5px; font-weight: 600; color: var(--text); }
.col-head-main p { margin-top: 3px; font-size: 12px; color: var(--dim); }
.col-empty { margin-top: 18px; padding: 44px 18px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r-md); background: var(--surface-2); }
.col-empty-icon { width: 44px; height: 44px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--accent-2); }
.col-empty-icon svg { width: 20px; height: 20px; }
.col-empty b { display: block; font-size: 13.5px; color: var(--text); }
.col-empty p { margin-top: 5px; font-size: 12px; color: var(--dim); }

.pt-list { display: flex; flex-wrap: wrap; gap: 8px; }
.pt { height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-size: 12.5px; }
.pt:hover { border-color: var(--line-3); color: var(--text); }
.pt.on { color: var(--primary-text); border-color: var(--primary); background: var(--primary); font-weight: 600; }

.col-stages { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; padding: 13px 15px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.col-stages .stage { position: static; width: auto; height: auto; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--dim); }
.st-mark { width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-family: var(--mono); border: 1px solid var(--line-2); background: var(--surface); }
.col-stages .stage.run { color: var(--accent-2); }
.col-stages .stage.run .st-mark { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent-2); }
.col-stages .stage.done { color: var(--ok); }
.col-stages .stage.done .st-mark { border-color: var(--ok-border); background: var(--ok-soft); color: var(--ok); }
.stage-line { flex: 1; min-width: 12px; height: 1px; background: var(--line-2); }
.stage-line.on { background: var(--ok); }

.col-summary { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.col-summary > div { padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.col-summary b { display: block; font-family: var(--mono); font-size: 17px; color: var(--text); }
.col-summary span { font-size: 11px; color: var(--dim); }
.col-brief { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--line); overflow: hidden; }
.col-brief > div { padding: 11px 13px; background: var(--surface); }
.col-brief span { display: block; font-size: 11px; color: var(--dim); }
.col-brief b { display: block; margin-top: 3px; font-size: 12.5px; color: var(--text-2); }

.hit-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.hit-row:hover { border-color: var(--line-2); background: var(--surface-2); }
.hit-rank { width: 22px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.hit-plat { font-size: 10.5px; padding: 2px 8px; border-radius: 99px; color: var(--accent-2); background: var(--accent-soft); border: 1px solid var(--accent-border); white-space: nowrap; }
.hit-main { flex: 1; min-width: 0; }
.hit-main b { display: block; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hit-main small { display: block; margin-top: 2px; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.hit-score { font-family: var(--mono); font-size: 13.5px; font-weight: 600; color: var(--accent-2); }

/* 节点配置抽屉 */
.drawer { opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s; }
.drawer.show { opacity: 1; visibility: visible; }
.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(500px, 94vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  transform: translateX(22px);
  transition: transform 0.25s var(--ease);
}
.drawer.show .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.drawer-kicker { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; color: var(--dim); }
.drawer-head h3 { margin-top: 4px; font-size: 18px; font-weight: 700; color: var(--text); }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 26px; }
.drawer-foot { display: flex; justify-content: space-between; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }

.cfg-desc { margin-bottom: 16px; font-size: 13px; line-height: 1.75; color: var(--muted); }
.cfg-block { margin-bottom: 14px; padding: 15px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.cfg-title { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.cfg-title span { font-family: var(--mono); font-size: 11px; color: var(--accent-2); }
.cfg-flag { font-size: 10.5px; color: var(--ok); background: var(--ok-soft); border-radius: 99px; padding: 2px 8px; font-family: var(--mono); }
.cfg-docs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-height: 180px; overflow-y: auto; }
.cfg-doc { padding: 9px 11px; border-radius: var(--r-xs); background: var(--surface); border: 1px solid var(--line); }
.cfg-doc b { display: block; font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfg-doc small { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }
.cfg-empty { font-size: 12.5px; color: var(--dim); padding: 12px; text-align: center; border: 1px dashed var(--line-2); border-radius: var(--r-sm); margin-bottom: 10px; }
.cfg-label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.cfg-input { width: 100%; height: 36px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); padding: 0 11px; font-size: 13px; color: var(--text); outline: none; }
.cfg-input:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-ring); }
.cfg-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
.cfg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cfg-grid > div:nth-child(3) { grid-column: 1 / -1; }
.cfg-prompt { width: 100%; min-height: 160px; resize: vertical; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); padding: 12px 13px; font-size: 13px; line-height: 1.75; color: var(--text); outline: none; }
.cfg-prompt:focus { border-color: var(--accent-border); box-shadow: 0 0 0 3px var(--accent-ring); }
.cfg-hint { margin-top: 8px; font-size: 11.5px; color: var(--dim); line-height: 1.65; }
.cfg-toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 10px); background: var(--primary); color: var(--primary-text); font-size: 13px; font-weight: 500; padding: 10px 20px; border-radius: 99px; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity 0.2s, transform 0.2s; z-index: 95; pointer-events: none; }
.cfg-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 重新生成反馈弹窗 */
.regen-mask { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--mask); backdrop-filter: blur(8px); }
.regen-panel { width: min(560px, 92vw); border: 1px solid var(--line-2); border-radius: var(--r-xl); background: var(--surface); padding: 24px; box-shadow: var(--shadow-lg), var(--specular); }
.regen-head b { display: block; font-size: 17px; color: var(--text); }
.regen-head span { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.regen-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 14px; }
.regen-opt { border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface-2); padding: 7px 14px; font-size: 13px; color: var(--text-2); transition: 0.15s; }
.regen-opt:hover { border-color: var(--line-3); color: var(--text); }
.regen-opt.on { border-color: var(--primary); background: var(--primary); color: var(--primary-text); }
.regen-text { width: 100%; border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 11px 13px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 13.5px; resize: vertical; }
.regen-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* 全局图片灯箱 */
.lightbox { display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 1300; }
.lightbox-dialog { position: relative; width: min(1060px, 96vw); max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); overflow: hidden; }
.lightbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.lightbox-head h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.lightbox-actions { display: flex; align-items: center; gap: 8px; }
.lightbox-body { flex: 1; min-height: 0; overflow: auto; padding: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; align-items: center; justify-items: center; background: var(--bg); }
.lightbox-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 9px; width: 100%; }
.lightbox-figure img { max-width: 100%; max-height: 74vh; border-radius: var(--r-md); border: 1px solid var(--line); background: #08090c; object-fit: contain; }
.lightbox-figure figcaption { font-size: 12.5px; color: var(--muted); }

/* ============================================================
   生成文章 & 短视频脚本精美编辑排版
   ============================================================ */

.article-doc {
  font-size: 14.5px;
  line-height: 1.9;
  color: var(--text-2);
}
.article-doc > :first-child { margin-top: 0; }
.article-doc > :last-child { margin-bottom: 0; }
.article-doc h3 {
  margin: 22px 0 12px;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.38;
}
.article-doc h4 {
  margin: 20px 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--text);
}
.article-doc h5 {
  margin: 18px 0 9px;
  padding-left: 11px;
  border-left: 3px solid var(--accent);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}
.article-doc p { margin: 0 0 12px; }
.article-doc strong { color: var(--text); font-weight: 600; }
.article-doc em { color: var(--text-2); }
.article-doc code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.88em;
  color: var(--accent-2);
}
.article-doc a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }

.doc-quote {
  margin: 14px 0;
  padding: 13px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

.doc-list {
  margin: 8px 0 14px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.doc-list li { line-height: 1.8; color: var(--text-2); }
.doc-list li::marker { color: var(--accent-2); font-weight: 600; }

.doc-hr { border: 0; height: 1px; background: var(--line); margin: 18px 0; }

.doc-code {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: var(--console-bg);
  color: #e2e8f0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  overflow-x: auto;
}
.doc-code code { padding: 0; border: 0; background: transparent; color: inherit; font-size: inherit; }

.doc-table-wrap {
  margin: 12px 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow-x: auto;
}
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc-table th { padding: 10px 14px; background: var(--surface-3); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; }
.doc-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: top; }
.doc-table tr:last-child td { border-bottom: 0; }

/* 短视频脚本专属卡片布局 */
.script-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.script-pill { font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent-2); }

.script-header-block { margin: 16px 0 14px; }
.script-title { font-size: 19px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; line-height: 1.4; }
.script-hook-card { margin-top: 12px; padding: 13px 16px; border-radius: var(--r-md); border: 1px solid var(--accent-border); background: var(--accent-soft); }
.script-hook-tag { display: inline-block; font-size: 11px; font-weight: 600; color: var(--accent-2); margin-bottom: 4px; }
.script-hook-card p { margin: 0; font-size: 13.5px; color: var(--text); font-weight: 500; line-height: 1.7; }

.script-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 10px; }
.script-section-head h5 { margin: 0; padding-left: 10px; border-left: 3px solid var(--accent); font-size: 14px; font-weight: 600; color: var(--text); }
.script-edit-tip { font-size: 11.5px; color: var(--dim); }

.script-meta { margin: -2px 0 12px; font-size: 11.5px; color: var(--dim); font-family: var(--mono); }
.tags { margin-top: 8px; font-size: 12px; line-height: 1.8; color: var(--accent-2); font-family: var(--mono); }
.script-table { width: 100%; table-layout: fixed; font-size: 13px; margin: 0; }
.script-table th { padding: 10px 14px; background: var(--surface-3); border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.script-table td { padding: 11px 14px; vertical-align: top; white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.7; color: var(--text-2); }
.script-table td:first-child { width: 18%; white-space: nowrap; }
.script-shot-time { display: inline-block; padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-2); font-family: var(--mono); font-size: 11.5px; font-weight: 600; }

.script-voice-card { padding: 16px 20px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.script-cta-box { margin-top: 14px; padding: 12px 16px; border-radius: var(--r-sm); border: 1px solid var(--ok-border); background: var(--ok-soft); display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--text); }
.script-cta-box b { font-size: 12px; color: var(--ok); white-space: nowrap; }

.script-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.script-tag-pill { font-size: 12px; font-family: var(--mono); padding: 3px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line-2); color: var(--accent-2); }
.script-notes { margin-top: 12px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); line-height: 1.7; }

.script-research-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.script-research-card { padding: 14px 16px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); }
.script-research-card b { display: block; font-size: 13px; color: var(--text); margin-bottom: 6px; }
.script-research-card .doc-list { margin: 0; padding-left: 18px; font-size: 12.5px; }
.script-sources { font-size: 12.5px; }

.score-inline { display: flex; align-items: baseline; gap: 6px; margin: 6px 0 10px; }
.score-inline b { font-family: var(--mono); font-size: 24px; font-weight: 600; color: var(--ok); }
.score-inline b.warn { color: var(--warn); }
.score-inline span { font-size: 11.5px; color: var(--dim); }

.gen-note { margin-top: 12px; padding: 10px 13px; border-radius: var(--r-sm); background: var(--warn-soft); border-left: 3px solid var(--warn); font-size: 12px; line-height: 1.7; color: var(--warn); }
.gen-note.real { background: var(--ok-soft); border-left-color: var(--ok); color: var(--ok); }

/* ============================================================
   响应式与无障碍
   ============================================================ */

@media (min-width: 961px) and (min-height: 680px) {
  .video-import { position: sticky; top: 0; }
}

@media (max-width: 1380px) {
  .layout { grid-template-columns: 280px minmax(0, 1fr) 356px; }
  .scenario em, .topbar-sub { display: none; }
}

@media (max-width: 1120px) {
  .layout { grid-template-columns: 1fr; overflow-y: auto; }
  .panel-left, .panel-center, .panel-right { min-height: 440px; }
  .stage-wrap { flex: 0 0 480px; }
  .stage-hint { display: none; }
  .hero-chips { grid-template-columns: 1fr; }
  .video-workspace { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .chat-side {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 25;
    box-shadow: var(--shadow-lg);
    transform: translateX(0);
    transition: transform 0.22s var(--ease), opacity 0.18s ease;
  }
  .chat-side.collapsed {
    width: 280px;
    padding: 16px 14px 14px;
    transform: translateX(-105%);
    opacity: 0;
    pointer-events: none;
  }
  .sheet { padding: 12px; }
  .sheet-panel { height: 92vh; }
  .sheet-main { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .sheet-nav { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .sheet-nav button { width: auto; white-space: nowrap; }
  .pb-steps, .pb-three, .pb-facts, .pb-compare { grid-template-columns: 1fr; }
  .col-summary { grid-template-columns: repeat(3, 1fr); }
  .col-brief { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .app-shell { flex-direction: column-reverse; }
  .app-rail {
    width: 100%;
    height: 62px;
    flex: 0 0 62px;
    flex-direction: row;
    justify-content: space-around;
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: 4px 8px;
  }
  .rail-brand, .rail-sep { display: none; }
  .rail-btn::before { display: none; }
  .rail-nav, .rail-tools, .rail-foot { width: auto; flex-direction: row; margin: 0; gap: 4px; }
  .rail-btn { width: auto; min-width: 48px; min-height: 46px; padding: 4px 8px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .scenario-key { display: none; }
  .chat-scroll { padding: 18px 14px; }
  .chat-composer-wrap { padding: 8px 14px 14px; }
  .composer-hint { display: none; }
  .video-view { padding: 14px; }
  .video-scene-layout { grid-template-columns: 1fr; }
  .toast { left: 12px; right: 12px; width: auto; top: 66px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}


/* ============================================================
   账号登录门禁 & 账号/邀请码/数据迁移面板
   ============================================================ */
body.auth-locked .app-shell {
  filter: blur(6px);
  pointer-events: none;
  user-select: none;
}

.rail-account {
  position: relative;
}

.rail-avatar {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

.rail-dot {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--warn);
  box-shadow: 0 0 0 2px var(--rail-bg);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
}

.auth-gate[hidden] {
  display: none !important;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), var(--specular);
  padding: 28px 26px 24px;
}

.auth-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.auth-brand .brand-mark {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.auth-brand h2 {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.02em;
}

.auth-brand p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  margin-bottom: 18px;
}

.auth-tabs[hidden] {
  display: none !important;
}

.auth-tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.auth-tabs button.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.auth-reg-fields {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.auth-reg-fields[hidden],
.auth-field[hidden] {
  display: none !important;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-2);
}

.auth-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), background 0.16s var(--ease);
}

.auth-field input:focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.auth-error {
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--danger-soft);
  border: 1px solid var(--danger-border);
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.45;
}

.auth-submit {
  width: 100%;
  height: 42px;
  margin-top: 4px;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.account-sheet {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  height: auto;
  max-height: 86vh;
}

.account-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-flash {
  padding: 10px 13px;
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.45;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-2);
}

.auth-flash.ok {
  background: var(--ok-soft);
  border-color: var(--ok-border);
  color: var(--ok);
}

.auth-flash.err {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger);
}

.acc-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
}

.acc-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.acc-avatar-lg {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 17px;
  font-weight: 650;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.acc-profile-info {
  flex: 1;
  min-width: 0;
}

.acc-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.acc-name-row strong {
  font-size: 15px;
  color: var(--text);
}

.acc-role {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
}

.acc-role.admin {
  background: var(--accent-soft);
  color: var(--accent);
}

.acc-sub {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}

.acc-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.acc-card-head h4 {
  margin: 0 0 3px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.acc-card-head p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.acc-invite-form,
.acc-pw-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.acc-invite-form input,
.acc-pw-form input {
  flex: 1;
  min-width: 140px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
}

.acc-invite-form input[type="number"] {
  flex: 0 0 82px;
  min-width: 72px;
}

.acc-invite-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.acc-invite-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
}

.acc-invite-row.is-off {
  opacity: 0.55;
}

.acc-invite-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.acc-code {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.acc-inv-meta {
  font-size: 11.5px;
  color: var(--muted);
}

.acc-invite-ops {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.acc-empty {
  font-size: 12.5px;
  color: var(--muted);
  padding: 8px 2px;
}
