/* 潜牛文案 前端样式（一期）——浅色简洁，原生 CSS，无外部依赖 */

:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1f2329;
  --muted: #8a919f;
  --line: #e5e7eb;
  --accent: #2f6bdf;
  --accent-weak: #eef3fe;
  --ok: #2e9e5b;
  --ok-weak: #e8f7ee;
  --err: #d9484d;
  --err-weak: #fdeeee;
  --run: #d97a06;
  --run-weak: #fdf3e3;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(31, 35, 41, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.7 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- 顶栏（工作台页沿用） ---------- */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.brand { font-size: 18px; margin: 0; letter-spacing: 0.5px; }
.brand-sub { color: var(--muted); font-size: 13px; }
.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-meta { color: var(--muted); font-size: 13px; }
.topbar .btn-ghost { margin-left: auto; }

/* ---------- WB 三栏布局（SPEC §12） ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 232px;
  flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  transition: width 0.15s;
  overflow: hidden;
}
.sidebar.collapsed { width: 56px; }
.sidebar.collapsed .brand-wrap,
.sidebar.collapsed .nav-item,
.sidebar.collapsed .nav-list-label,
.sidebar.collapsed .nav-divider,
.sidebar.collapsed .project-list-wrap,
.sidebar.collapsed .user-meta,
.sidebar.collapsed .nav-extra { display: none; }
.sidebar.collapsed .nav-collapse { width: 100%; text-align: center; }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 12px 8px; }
.sidebar-brand {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-collapse { padding: 4px 8px; font-size: 15px; border: none; background: transparent; cursor: pointer; color: var(--muted); }
.nav-collapse:hover { color: var(--accent); }
.brand-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sidebar-nav {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}
.nav-item {
  text-align: left;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s;
  white-space: nowrap;
}
.nav-item:hover { background: var(--bg); }
.nav-item.active {
  background: var(--accent-weak);
  color: var(--accent);
  font-weight: 600;
}
.nav-divider { border-top: 1px solid var(--line); margin: 8px 4px; }
.nav-list-label {
  font-size: 12px;
  color: var(--muted);
  padding: 2px 14px 6px;
  white-space: nowrap;
}
.project-list-wrap { display: flex; flex-direction: column; gap: 2px; }
.side-group-title {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 14px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-project {
  text-align: left;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  padding: 7px 14px 7px 22px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
}
.side-project:hover { background: var(--bg); }
.side-project.active { background: var(--accent-weak); color: var(--accent); font-weight: 600; }
.side-project .side-status {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--muted);
  vertical-align: 1px;
}
.side-project .side-status.is-done { background: var(--ok); }
.side-project .side-status.is-running { background: var(--run); }
.side-project .side-status.is-error { background: var(--err); }
.empty-hint.small { padding: 14px 10px; font-size: 12.5px; }
.sidebar-foot {
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.nav-extra {
  margin: 10px 16px 0;
  font-size: 12.5px;
  padding: 5px 10px;
  align-self: flex-start;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.sidebar-user:hover { background: var(--bg); }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-weak);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.user-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user.has-user .user-name { color: var(--ink); }
.user-org {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* ---------- 中栏 ---------- */
.main-area {
  flex: 1.1;
  min-width: 0;
  padding: 16px 18px 12px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: 100vh;
  position: sticky;
  top: 0;
}
.scene-panel { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.scene-panel.hidden { display: none; }
.scene-panel .panel { margin-bottom: 0; }
.workbench-flow { display: flex; flex-direction: column; min-height: 0; }
.flow-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.flow-timeline {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
  padding: 6px 10px;
  overflow-y: auto;
  min-height: 64px;
  max-height: 260px;
  flex: 0 0 auto;
}
/* 步骤进行中：标签红字「运行中……」（Owner 2026-11-14：状态栏已删，运行状态上标签） */
.step[data-state="running"] .step-status { color: #b3392b; font-weight: 700; }
.chat-msg { margin: 4px 0; font-size: 14px; line-height: 1.65; word-break: break-word; }
.chat-msg .chat-role { font-weight: 600; margin-right: 6px; }
.chat-user .chat-role { color: var(--accent); }
.chat-sys { color: var(--muted); }
.chat-sys.chat-ok { color: var(--ok); }
.chat-sys.chat-err { color: var(--err); }
.chat-msg .chat-detail {
  display: block;
  color: var(--err);
  font-size: 13px;
  margin: 2px 0 4px 46px;
}
.chat-input { display: flex; gap: 10px; margin-top: 12px; }
.chat-input textarea { flex: 1; resize: vertical; min-height: 140px; max-height: 260px; font: inherit; line-height: 1.55; padding: 8px 10px; }
/* ---------- 右栏 ---------- */
.result-area {
  width: 46%;
  min-width: 380px;
  flex-shrink: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.result-panel { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.result-panel.hidden { display: none; }
.result-head {
  font-size: 14.5px;
  font-weight: 600;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
}
.result-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  padding: 0 8px;
}
.rtab {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  padding: 12px 14px 10px;
  cursor: pointer;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.rtab:hover { color: var(--ink); }
.rtab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.result-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  min-height: 0;
}
#tab-preview { padding: 14px 16px; }
.preview-toolbar { margin-bottom: 12px; }
.pcard { max-width: none; }
.copy-view { font: 13px/1.8 Consolas, Menlo, monospace; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.material-list-full { max-height: none; overflow: visible; }
.finished-row-btn { cursor: pointer; transition: background 0.12s; }
.finished-row-btn:hover { background: var(--accent-weak); }
.finished-row-btn.active { background: var(--accent-weak); }
.type-info-card { display: flex; flex-direction: column; gap: 8px; }
.type-info-card .ti-name { font-size: 17px; font-weight: 700; }
.type-info-card .ti-row { font-size: 13.5px; color: var(--muted); }
.type-info-card .ti-row b { color: var(--ink); font-weight: 600; }
/* 窄屏响应式：左栏折叠为图标条，中右上下堆叠 */
@media (max-width: 1080px) {
  .result-area { min-width: 300px; width: 42%; }
}
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .sidebar-brand { border-bottom: none; border-right: 1px solid var(--line); padding: 10px 14px; }
  .sidebar-nav { flex-direction: row; padding: 6px; flex-wrap: wrap; }
  .nav-item { padding: 8px 12px; }
  .nav-list-label, .nav-divider, .project-list-wrap { display: none; }
  .sidebar-user { border-top: none; margin-left: auto; padding: 8px 12px; }
  .sidebar-foot { border-top: none; flex-direction: row; align-items: center; }
  .nav-extra { margin: 0 8px 0 auto; }
  .main-area { max-height: none; position: static; }
  .result-area { width: 100%; min-width: 0; height: auto; position: static; border-left: none; border-top: 1px solid var(--line); }
  .result-panel { height: auto; }
  .result-body { max-height: 70vh; }
  .nav-collapse { display: none; }
}

/* ---------- 类型卡片（自定义角标） ---------- */
.type-card { position: relative; }
.type-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-weak);
  border-radius: 4px;
  padding: 1px 6px;
}
.type-card .btn-del {
  margin-top: 6px;
  align-self: flex-start;
  font-size: 12.5px;
  padding: 3px 10px;
  color: var(--err);
  border-color: #f3c7c9;
}

/* ---------- 规则库 ---------- */
.ct-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}
@media (max-width: 720px) { .ct-grid { grid-template-columns: 1fr; } }
.ct-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.ct-rules-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font: 13px/1.6 Consolas, Menlo, monospace;
  background: #fff;
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-weak); }
.ct-actions { display: flex; gap: 10px; margin-top: 12px; align-items: center; }
.hidden-file { display: none; }
.file-btn { position: relative; overflow: hidden; }

/* ---------- 项目库（类型分组） ---------- */
.group-title {
  font-size: 15px;
  font-weight: 600;
  margin: 18px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}
.group-title:first-child { margin-top: 0; }
.project-card .meta-line {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

/* ---------- 成品库 ---------- */
.lib-path-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.lib-path-row code {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 13px;
  word-break: break-all;
}
.finished-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.finished-table th {
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
}
.finished-table td {
  border-bottom: 1px dashed var(--line);
  padding: 9px 10px;
  vertical-align: top;
}
.finished-table tr:last-child td { border-bottom: none; }
.finished-table .file-cell { word-break: break-all; }
.copy-btn {
  font-size: 12px;
  padding: 2px 10px;
  margin-left: 8px;
}

/* ---------- 布局 ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 18px 20px 40px; }.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.panel > h2 { margin: 0 0 14px; font-size: 16px; }

.workbench-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 16px;
  align-items: start;
}
.side-col > .panel { margin-bottom: 16px; }
@media (max-width: 900px) {
  .workbench-grid { grid-template-columns: 1fr; }
}

/* ---------- 通用控件 ---------- */
.btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 8px;
  padding: 7px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { color: #fff; opacity: 0.92; }
.btn-ghost { background: transparent; }

input[type="text"], input[type="password"], select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-weak);
}

.hint { color: var(--muted); font-size: 13px; }
.hint code {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  word-break: break-all;
}
.empty-hint {
  color: var(--muted);
  padding: 26px 16px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.form-msg { color: var(--err); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* ---------- 提示条 ---------- */
.banner {
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 16px;
  font-size: 14px;
}
.banner-error {
  background: var(--err-weak);
  color: var(--err);
  border: 1px solid #f3c7c9;
}

/* ---------- 类型入口卡片 ---------- */
.type-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.type-card {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px 16px;
  cursor: pointer;
  font: inherit;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.type-card:hover { border-color: var(--accent); }
.type-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-weak);
  background: var(--accent-weak);
}
.type-name { font-weight: 600; font-size: 15px; }
.type-desc { color: var(--muted); font-size: 13px; }

/* ---------- 新建项目表单 ---------- */
.new-project {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.np-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}
.np-grid label, .new-project > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.np-actions { display: flex; justify-content: flex-end; }
@media (max-width: 720px) {
  .np-grid { grid-template-columns: 1fr; }
}

/* ---------- 篇章结构（卡片：13.3） ---------- */
.structure-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fafbfc;
}
.structure-head {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.structure-title { font-weight: 600; }
.structure-sentence { font-weight: 400; font-size: 13.5px; color: var(--muted); }
.structure-head .auto-check { margin-left: auto; margin-right: 0; }
.structure-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 720px) {
  .structure-grid { grid-template-columns: 1fr; }
}
.structure-field { display: flex; align-items: center; gap: 8px; }
.structure-label { font-size: 13px; color: var(--muted); white-space: nowrap; }
.structure-sep { color: var(--muted); }
.num-input { width: 72px; text-align: center; }
.structure-grid.is-disabled { opacity: 0.45; }
.structure-grid.is-disabled input { pointer-events: none; }
.auto-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 10px;
}
.auto-check input { accent-color: var(--accent); }

/* ---------- 品牌命名特色（三勾选＋勾选后展开控件，13.4） ---------- */
.feature-checks { display: flex; flex-direction: column; gap: 8px; }
.feature-check {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
  flex-wrap: wrap;
}
.feature-check input { accent-color: var(--accent); transform: translateY(1px); }
.feature-check .feature-name { font-weight: 600; }
.feature-check.is-active { color: var(--accent); }
.feature-detail { padding-left: 26px; }
.feature-detail input { max-width: 420px; }
.region-cascade {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.region-cascade select { width: auto; min-width: 130px; }
.region-cascade input { width: auto; min-width: 150px; flex: 1; max-width: 260px; }

/* ---------- 项目列表 ---------- */
.project-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.project-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px 16px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(47, 107, 223, 0.12);
}
.project-name { font-weight: 600; font-size: 15px; }
.project-meta { color: var(--muted); font-size: 13px; }
.project-status {
  display: inline-block;
  font-size: 12px;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
}
.project-status.is-running { background: var(--run-weak); color: var(--run); }
.project-status.is-done { background: var(--ok-weak); color: var(--ok); }
.project-status.is-error { background: var(--err-weak); color: var(--err); }

/* ---------- 步骤面板 ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
}
/* 选中步骤：浅灰底区别于其它标签（Owner 2026-11-14） */
.step.active { background: #efede7; }
.step[data-state="running"] { border-color: var(--run); }
.step[data-state="error"] { border-color: var(--err); }
.step-btn {
  flex: 1;
  min-width: 0;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  padding: 0;
  color: var(--ink);
}
.step-btn:disabled { cursor: not-allowed; opacity: 0.6; }
.step-no { color: var(--accent); font-weight: 700; margin-right: 6px; }
.step-name { font-weight: 600; }
.step-desc { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.step-status {
  font-size: 12.5px;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--bg);
  color: var(--muted);
}
.step[data-state="running"] .step-status { background: var(--run-weak); color: var(--run); }
.step[data-state="done"] .step-status { background: var(--ok-weak); color: var(--ok); }
.step[data-state="error"] .step-status { background: var(--err-weak); color: var(--err); }
.step-msg { margin-top: 10px; font-size: 13px; color: var(--err); min-height: 18px; }
.step-msg.step-info { color: var(--run); }
.finish-row { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- 素材区 ---------- */
.material-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 220px; overflow: auto; }
.material-list li {
  padding: 5px 8px;
  border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
  word-break: break-all;
}
.material-list li:last-child { border-bottom: none; }

/* ---------- 效果页预览 ---------- */
.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.preview-toolbar h2 { margin: 0; font-size: 16px; }
.pager { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.pager .page-indicator { color: var(--muted); font-size: 13px; min-width: 48px; text-align: center; }

.preview-deck { display: flex; flex-direction: column; align-items: center; }

.pcard {
  width: 100%;
  max-width: 780px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 30px 34px;
  box-shadow: var(--shadow);
}
.pcard + .pcard { margin-top: 16px; }
.pcard-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 10px;
  margin-bottom: 14px;
}

/* 版级卡片 */
.pcard-version { text-align: center; }
.ver-title { margin: 4px 0 8px; font-size: 28px; letter-spacing: 1px; }
.ver-sub { color: var(--muted); font-size: 15px; margin: 0 0 10px; }
.ver-slogan { font-size: 17px; font-weight: 600; color: var(--accent); margin: 10px 0; }
.ver-intro, .ver-outro { color: var(--ink); font-size: 14.5px; margin: 6px 0; }

/* 节卡片 */
.pcard-section { position: relative; }
.sec-chapter { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.sec-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.sec-title { margin: 0; font-size: 24px; letter-spacing: 0.5px; }
.badge-style {
  background: var(--accent-weak);
  color: var(--accent);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.sec-intro, .sec-outro { color: var(--muted); font-size: 14px; margin: 4px 0; }
.sec-slogan { font-weight: 600; color: var(--accent); margin: 8px 0; }
.sec-body { margin: 10px 0; }
.sec-line { margin: 6px 0; font-size: 15.5px; }

/* 施工令任务3：结构化图形内嵌预览 */
.sec-figs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-top: 14px; }
.sec-fig { position: relative; border: 1px solid #e0e4ec; border-radius: 8px; overflow: hidden; background: #fff; }
.sec-fig img { display: block; width: 100%; height: auto; }
.sec-fig .fig-dl {
  position: absolute; top: 6px; right: 6px;
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(26, 26, 26, 0.72); color: #fff; text-decoration: none;
}
.sec-fig .fig-dl:hover { background: rgba(26, 26, 26, 0.9); }

/* 施工令任务4：AI 生成图 */
.img-slot { position: relative; }
.img-ai { display: block; width: 100%; height: auto; border-radius: 6px; margin-top: 8px; }
.img-dl {
  position: absolute; top: 26px; right: 8px;
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(26, 26, 26, 0.72); color: #fff; text-decoration: none;
}
.img-dl:hover { background: rgba(26, 26, 26, 0.9); }

/* 配图占位框 */
.img-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.img-slot {
  border: 2px dashed #c3c9d4;
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--muted);
  background: #fafbfc;
  font-size: 13px;
}
.img-slot .img-n { font-weight: 600; color: var(--ink); margin-right: 8px; }
.img-slot .img-type { color: var(--accent); font-weight: 600; margin-right: 8px; }
.img-slot .img-desc { margin: 6px 0 0; }

/* ---------- 对话修订 ---------- */
.chat-log {
  max-height: 260px;
  overflow: auto;
  background: #fafbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.chat-msg { margin: 4px 0; font-size: 14px; }
.chat-msg .chat-role { font-weight: 600; margin-right: 6px; }
.chat-user .chat-role { color: var(--accent); }
.chat-sys { color: var(--muted); }
.chat-input { display: flex; gap: 10px; margin-top: 12px; }
.chat-input input { flex: 1; }

/* ---------- 设置弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-mask { position: absolute; inset: 0; background: rgba(31, 35, 41, 0.45); }
.modal-body {
  position: relative;
  width: min(520px, 92vw);
  background: #fff;
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  max-height: 86vh;
  overflow: auto;
}
.modal-body h3 { margin: 0 0 6px; }
/* 策划稿结构勾选（创建表单）：分类分行 */
.schema-items-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.schema-group-row {
  display: flex;
  gap: 6px 14px;
  align-items: center;
  flex-wrap: wrap;
}
.schema-group-name {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft, #666);
  min-width: 64px;
}
.schema-items-grid label {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.schema-items-grid label.locked { color: var(--ink-soft, #888); cursor: not-allowed; }
.schema-items-grid input:disabled { cursor: not-allowed; }
/* 无人值守开关（创建表单底部） */
.auto-run-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-weak);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  cursor: pointer;
}
.auto-run-row input { margin-top: 3px; flex: 0 0 auto; }
/* 已完成步骤卡片：可点击看产出（右侧「重跑」重新生成） */
.step.is-viewable { cursor: pointer; }
.step.is-viewable:hover { border-color: var(--accent); }
.step-rerun {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  margin-left: 8px;
}

/* 施工令任务1：待确认步的「确认·下一步」主按钮 */
.step-confirm {
  flex: 0 0 auto;
  border: 1px solid var(--accent, #2563eb);
  background: var(--accent, #2563eb);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
  cursor: pointer;
  margin-left: 8px;
}
.step-confirm:disabled { opacity: 0.5; cursor: default; }
.step[data-state="awaiting_confirm"] {
  border-color: var(--accent, #2563eb);
  background: rgba(37, 99, 235, 0.04);
}
.step-rerun:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-weak); }
/* 右栏「步骤产出」视图 */
.doc-view-head {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.doc-view {
  padding: 14px 16px 40px;
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-word;
}
.doc-view /* 右栏正式文档排版（Owner 2026-11-14：像正式的文档） */
.doc-h { font-family: "黑体", SimHei, sans-serif; font-weight: 700; color: var(--ink); text-align: center; margin: 18px 0 10px; font-size: 17px; }
.doc-h1 { font-size: 19px; }
.doc-h2 { font-size: 16px; text-align: left; margin-top: 20px; }
.doc-h3, .doc-h4 { font-size: 14.5px; text-align: left; }
.doc-tag { font-family: "黑体", SimHei, sans-serif; font-weight: 700; color: var(--ink); margin: 14px 0 6px; }
.doc-tag-inline { font-family: "黑体", SimHei, sans-serif; font-weight: 700; margin-right: 4px; }
.doc-p { margin: 6px 0; text-indent: 2em; line-height: 1.9; font-size: 14.5px; }
.doc-li { margin: 4px 0 4px 2em; line-height: 1.8; }
.doc-table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.doc-table th, .doc-table td { border: 1px solid #999; padding: 5px 8px; text-align: left; vertical-align: top; }
.doc-table th { background: #f4f1e8; font-weight: 700; }
.doc-view .doc-meta { color: var(--muted); font-size: 12.5px; }
.doc-view .doc-meta { color: var(--muted); font-size: 12.5px; }
.modal-body label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 14px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.key-overview { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.key-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
}
.key-row:last-child { border-bottom: none; }
.key-ok { color: var(--ok); word-break: break-all; }
.key-miss { color: var(--muted); }

/* ---------- 打印样式（浏览器打印 / 存 PDF）----------
   注意：本段必须位于 .hidden 规则之后，打印时强制展开全部卡片分页输出 */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; }
  .topbar, .banner, .side-col, .preview-toolbar, .chat-panel, .modal,
  .empty-hint, .step-msg { display: none !important; }
  .container { max-width: none; padding: 0; }
  .panel { border: none; box-shadow: none; padding: 0; margin: 0; }
  .preview-deck { display: block; }
  .pcard {
    display: block !important;
    box-shadow: none;
    border: 1px solid #bbb;
    page-break-after: always;
    break-after: page;
    max-width: none;
    margin: 0 0 12px;
  }
  .pcard:last-child { page-break-after: auto; break-after: auto; }
  .pcard.hidden { display: block !important; }
}

/* ===== 中列工作台纵向布局（Owner 2026-11-14：加第⑨步后九张卡占满视口，底部归档卡与输入框被压缩错位）=====
   结构：场景面板撑满视口 → 步骤列表内部滚动 → 归档卡/品牌挑选/输入框固定在底部、永不压缩 */
#scene-project {
  height: calc(100vh - 28px);
  overflow: hidden;
}
#scene-project .workbench-flow {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
#scene-project .steps {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  gap: 8px;
}
#scene-project .step { padding: 8px 12px; }
#scene-project .finish-row,
#scene-project #brandPick,
#scene-project .chat-input,
#scene-project #projSettingsBox {
  flex: 0 0 auto;
}
#scene-project #brandPick { max-height: 40vh; overflow-y: auto; }

/* ===== 第④步标签上的品牌挑选开关（Owner 2026-11-14：从底部面板移入标签） ===== */
.brand-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  flex-wrap: wrap;
}
.brand-nav .bn-title { font-weight: 700; color: var(--ink); }
.brand-nav .bn-link { color: var(--accent); text-decoration: underline; cursor: pointer; }
.brand-nav .bn-pick { padding: 3px 10px; font-size: 12.5px; }

/* ===== 费用徽章与总览弹层（Owner 2026-11-14） ===== */
.cost-badge {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent, #0f766e);
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 12px;
  padding: 2px 10px;
  cursor: pointer;
  white-space: nowrap;
}
.cost-badge:hover { border-color: var(--accent, #0f766e); }
.cost-pop {
  position: fixed;
  top: 56px;
  right: 24px;
  z-index: 300;
  width: 300px;
  background: #fff;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, .14);
}
.cost-pop .cp-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 9px 12px; font-weight: 700; font-size: 13px;
  border-bottom: 1px solid var(--line, #e2e8f0);
}
.cost-pop .cp-head a { text-decoration: none; color: #64748b; font-size: 16px; line-height: 1; }
.cost-pop .cp-body { max-height: 46vh; overflow-y: auto; padding: 6px 0; }
.cost-pop .cp-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 7px 12px; font-size: 13px;
}
.cost-pop .cp-row:hover { background: #f8fafc; }
.cost-pop .cp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-pop .cp-total { font-weight: 700; color: var(--accent, #0f766e); white-space: nowrap; }

/* ===== Toast 浮出提示（Owner 2026-11-14：发送指令反馈） ===== */
#toastHost {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}
.toast {
  background: #0f766e;
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(15, 23, 42, .18);
  opacity: 1;
  transition: opacity .3s;
}
.toast-err { background: #b91c1c; }

/* ===== 网站 Logo（Owner 2026-11-14） ===== */
.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}
.brand-wrap { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }

/* 失败卡片红字错误详情（Owner 2026-11-14） */
.step-errmsg {
  margin: 4px 8px 0 44px;
  font-size: 12px;
  line-height: 1.5;
  color: #c0392b;
  word-break: break-all;
}

/* 图文稿配图（Owner 2026-11-14） */
.doc-imgwrap { margin: 10px 0; text-align: center; }
.doc-img { max-width: 78%; max-height: 380px; border: 1px solid #e2d6c8; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.doc-imgcap { font-size: 12px; color: #8a7a68; margin-top: 6px; }
