/* 第 12 轮 · 戊：项目页骨架（流程条、集导航、顶栏参数、主控位置）、小说工序、剧本工序。
   只用甲在 r12-system.css 里给出的变量与组件类，不另画一套；页面底纹不铺整条不透明底色。 */

/* ── 1. 项目页骨架 ───────────────────────────────────────────── */

/* 页面四边贴外壳给的位置（左 = 导航选中框右边 + 8，上 = 顶栏底 + 8，右下各 8）。
   JS 在每次重绘后按外壳实测再校一次，这里只是首帧的兜底。 */
.r12f-project {
  position: absolute;
  top: 8px;
  left: 0;
  right: 8px;
  bottom: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  --r12f-side: 0px;
  --r12-side-w: 360px;
  overflow: hidden;
}

/* 流程条那一行、二级工序、内容都在主控左边那一列；主控在右侧时这一列右边 = 主控左边 − 8 */
.r12f-cols {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 8px;
}

.r12f-col {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.r12f-cols > .r12m-side {
  width: var(--r12-side-w);
  margin: 0;
}

.r12f-project.is-nav-open { --r12f-nav: 228px; }
.r12f-project.is-side-open { --r12f-side: 368px; }

/* 流程条：高 44，六项在顶栏左右两组之间水平居中（四稿一·8） */
.r12f-flowbar {
  position: relative;
  flex: none;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.r12f-track {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.r12f-flow-item {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r12-r-pill);
  background: transparent;
  color: var(--r12-muted);
  font-size: var(--r12-fs-ui, 13px);
  line-height: var(--r12-lh-ui, 20px);
  font-weight: 500;
  white-space: nowrap;
  transition: background-color var(--r12-dur-2) var(--r12-ease), color var(--r12-dur-2) var(--r12-ease);
}

.r12f-flow-item:hover { background: var(--r12-hover); color: var(--r12-ink); }
.r12f-flow-item:active { transform: scale(.99); }

.r12f-flow-item[aria-current='step'] {
  background: var(--r12-selected-bg);
  color: var(--r12-ink);
  font-weight: 600;
  box-shadow: var(--r12-selected-shadow, none);
}

.r12f-flow-item[aria-disabled='true'],
.r12f-flow-item[aria-disabled='true']:hover {
  color: var(--r12-faint);
  background: transparent;
  cursor: not-allowed;
}

.r12f-flow-name { white-space: nowrap; }

.r12f-flow-link {
  width: 16px;
  height: 1px;
  flex: none;
  background: var(--r12-line-strong);
}

/* 二级工序：流程条下面一行，同一条窗口中线；整行不宽于 520，1280 宽、主控在右侧也不压主控 */
.r12f-substeps {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.r12f-stepper-wrap { width: 100%; max-width: 520px; }

.r12f-substeps .r12-step { cursor: pointer; }
.r12f-substeps .r12-step[aria-disabled='true'] { cursor: not-allowed; }

/* 三栏：集导航 | 内容；主控是右侧栏时在列外 */
.r12f-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
}

.r12f-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }

.r12f-nav {
  width: 220px;
  flex: none;
  margin-right: 8px;
  min-height: 0;
  overflow: hidden;
  transition: width var(--r12-dur-4) var(--r12-ease), margin var(--r12-dur-4) var(--r12-ease),
    opacity var(--r12-dur-3) var(--r12-ease), border-color var(--r12-dur-3) var(--r12-ease);
}

.r12f-nav.is-closed {
  width: 0;
  margin-right: 0;
  border-width: 0;
  opacity: 0;
  pointer-events: none;
}

.r12f-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* 老样式（r11-rules.css 的 button 规则）给按钮设了 align-items:center，
   列表行要整行靠左：标题一行、状态小字一行，左内边距 12。 */
.r12f-navrow {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  width: 100%;
  flex: none;
  /* 每行高度固定、不许被压扁，放不下时由列表自己滚 */
  height: 54px;
  min-height: 54px;
  padding: 7px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--r12-muted);
  text-align: left;
  transition: background-color var(--r12-dur-2) var(--r12-ease), color var(--r12-dur-2) var(--r12-ease);
}

.r12f-navrow b { font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); font-weight: 500; color: var(--r12-ink); }
.r12f-navrow small { font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); color: var(--r12-faint); }
.r12f-navrow:hover { background: var(--r12-hover); }

.r12f-navrow[aria-current='true'] {
  background: var(--r12-selected-bg);
  box-shadow: var(--r12-selected-shadow, none);
}

.r12f-navrow[aria-current='true'] b { font-weight: 600; }
.r12f-navrow[aria-current='true'] small { color: var(--r12-muted); }

.r12f-nav-search {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 8px 8px;
  padding: 0 8px;
  height: 30px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-control);
  background: var(--r12-surface-3);
}

.r12f-nav-search svg { width: 14px; height: 14px; flex: none; color: var(--r12-muted); }

.r12f-nav-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--r12-ink);
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  outline: 0;
}

.r12f-nav-search input::placeholder { color: var(--r12-faint); }

.r12f-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  /* --r12-dock-clear：主控在底部条时 = 主控从内容底往上占的高度 + 16，在右侧栏时 = 0。
     底部条时面板区要让出「主控顶 − 8」，即 clear − 8，见下面的 .is-dock 规则。 */
  padding: 0;
}

/* 己的工作区自己铺满并各自滚动，这里不再加内边距 */
.r12f-content:has(> .r12x-stage) { padding: 0; }

/* 主控是底部条时：它浮在内容上，面板区到「主控顶 − 8」为止。
   主控顶 = 内容区底 − clear + 16，所以滚动区底部让出 clear − 8，.r12-ws 与各面板随之收在这里。 */
/* 七稿 30：底部条浮在页面上，面板区不再为它让位；面板底 = 窗口底 − 8 */
.r12f-project.is-dock .r12f-body { padding-bottom: 0; }

/* ── 1b. 自动推进条：高 32、下间距 4，状态与主操作保持一行 ─────── */

.r12f-auto {
  flex: none;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--r12-line);
  border-radius: 10px;
  background: var(--r12-surface);
  color: var(--r12-muted);
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
}

.r12f-auto-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: none; }
.r12f-auto-left b { font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); font-weight: 600; color: var(--r12-ink); white-space: nowrap; }

.r12f-auto-progress {
  width: 96px;
  height: 4px;
  flex: none;
  border-radius: var(--r12-r-pill);
  background: var(--r12-surface-3);
  overflow: hidden;
}

.r12f-auto-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--r12-ink);
  transition: width var(--r12-dur-4) var(--r12-ease);
}

.r12f-auto-mid { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.r12f-auto-right { flex: 1 1 0; min-width: 0; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r12f-auto > .r12-btn { flex: none; }

.r12f-auto.is-checkpoint {
  border-color: color-mix(in srgb, var(--r12-review) 55%, transparent);
  background: color-mix(in srgb, var(--r12-review) 12%, var(--r12-surface));
}

.r12f-auto.is-checkpoint .r12f-auto-left b,
.r12f-auto.is-checkpoint .r12f-auto-right { color: var(--r12-review); }

.r12f-auto.is-paused .r12f-auto-left b { color: var(--r12-muted); }
.r12f-auto.is-failed {
  border-color: color-mix(in srgb, var(--r12-error) 55%, transparent);
  background: color-mix(in srgb, var(--r12-error) 10%, var(--r12-surface));
}
.r12f-auto.is-failed .r12f-auto-left b { color: var(--r12-error); }
.r12f-auto.is-budget {
  border-color: color-mix(in srgb, var(--r12-review) 55%, transparent);
  background: color-mix(in srgb, var(--r12-review) 12%, var(--r12-surface));
}
.r12f-auto.is-budget .r12f-auto-left b { color: var(--r12-review); }
.r12f-auto-note {
  flex: none;
  margin: -2px 0 4px 10px;
  color: var(--r12-faint);
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
}

/* 修正单 23 第 11 条：自动跑着时改了内容，推进条下面一张两选一的小卡 */
.r12f-auto-edit {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: -2px 0 8px;
  padding: 8px 12px;
  border: 1px solid var(--r12-line);
  border-radius: 12px;
  background: var(--r12-surface);
  color: var(--r12-ink);
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
}

.r12f-auto-edit-text { flex: 1 1 240px; min-width: 0; }
.r12f-auto-edit-actions { display: flex; gap: 8px; margin-left: auto; }

/* 六稿第三节：一键成片方案卡；七稿三·3：中间可滚，底栏不滚 */
.r12f-plan-card { display: flex; flex-direction: column; gap: 0; max-height: calc(86vh - 52px); }
.r12f-plan-scroll { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; padding-right: 2px; }
.r12f-plan-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.r12f-plan-head b { font-size: var(--r12-fs-title, 15px); line-height: var(--r12-lh-title, 22px); font-weight: 600; color: var(--r12-ink); }
.r12f-plan-head span { color: var(--r12-muted); font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); }
.r12f-plan-skip {
  margin: -6px 0 0;
  color: var(--r12-muted);
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
}
.r12f-plan-settings { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.r12f-plan-block { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--r12-line); }
.r12f-plan-label { color: var(--r12-muted); font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); }
.r12f-plan-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); }
.r12f-plan-row small { margin-left: 8px; color: var(--r12-muted); font-size: var(--r12-fs-small, 12px); }
.r12f-plan-row.is-total { font-weight: 600; color: var(--r12-ink); }
.r12f-plan-check { display: flex; align-items: center; gap: 6px; font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); }
.r12f-plan-check input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex: none;
  margin: 0;
  accent-color: var(--r12-ink);
  cursor: pointer;
}
.r12f-plan-check.is-skipped { color: var(--r12-faint); }
.r12f-plan-check.is-skipped input[type="checkbox"] { cursor: default; }
.r12f-plan-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.r12f-plan-models { display: flex; flex-direction: column; gap: 4px; color: var(--r12-muted); font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); }
.r12f-plan-balance {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--r12-r-control, 8px);
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  font-size: var(--r12-fs-ui, 13px);
  line-height: var(--r12-lh-ui, 20px);
}
.r12f-plan-tier-note { margin: 0; color: var(--r12-muted); font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); }
.r12f-plan-time { margin: 0; color: var(--r12-muted); font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); }
.r12f-plan-foot { display: flex; align-items: center; gap: 12px; flex: none; padding: 8px 0 16px; border-top: 1px solid var(--r12-line); margin-top: 8px; }
.r12f-plan-actions { display: flex; gap: 8px; margin-left: auto; }

/* 自动模式里「生成 …」主按钮换成弱态 */
.r12f-weak,
.r12f-weak:hover {
  background: var(--r12-surface-3);
  color: var(--r12-faint);
  cursor: default;
}

/* ── 2. 顶栏插槽：项目名、参数胶囊、自动／专家 ───────────────── */

.r12f-project-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--r12-fs-title, 15px);
  line-height: var(--r12-lh-title, 22px);
  font-weight: 600;
  color: var(--r12-ink);
  white-space: nowrap;
}

.r12f-params {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.r12f-param {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.r12f-param svg { width: 14px; height: 14px; color: var(--r12-muted); }

/* ── 3. 通用文档块 ───────────────────────────────────────────── */

.r12f-doc {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 0 4px;
}

.r12f-doc-wide { max-width: 1180px; }

.r12f-doc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.r12f-doc-head h2 { font-size: var(--r12-fs-title, 15px); line-height: var(--r12-lh-title, 22px); font-weight: 600; color: var(--r12-ink); }
.r12f-doc-head p { margin-top: 4px; font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); color: var(--r12-muted); }

.r12f-head-side { display: flex; align-items: center; gap: 8px; flex: none; }

.r12f-name { width: 360px; flex: none; }
.r12f-name .r12-input,
.r12f-name input { width: 100%; }

.r12f-upload-wrap { position: relative; }

.r12f-upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 132px;
  padding: 20px;
  border: 1px dashed var(--r12-line-strong);
  border-radius: var(--r12-r-panel);
  background: color-mix(in srgb, var(--r12-surface-2) 55%, transparent);
  cursor: pointer;
  text-align: center;
  transition: border-color var(--r12-dur-2) var(--r12-ease), background-color var(--r12-dur-2) var(--r12-ease);
}

.r12f-upload:hover,
.r12f-upload:focus-visible { border-color: var(--r12-ink); outline: 0; }
.r12f-upload.is-over { border-color: var(--r12-accent); background: var(--r12-hover); }

.r12f-upload-icon { color: var(--r12-muted); }
.r12f-upload-icon svg { width: 22px; height: 22px; }

.r12f-upload-hint {
  font-size: var(--r12-fs-ui, 13px);
  line-height: var(--r12-lh-ui, 20px);
  color: var(--r12-muted);
  /* 折行时按语义均分，任何宽度下都不许只剩一个词 */
  text-wrap: balance;
}

.r12f-upload-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.r12f-upload-row .r12f-upload-hint { flex: 1; text-align: center; }

.r12f-loaded {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  color: var(--r12-muted);
}

.r12f-loaded b { font-weight: 600; color: var(--r12-ink); }

/* 七稿 0.6：不再用下划线文字，一律做 28 高的安静胶囊 */
.r12f-linkbtn {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r12-r-pill);
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  font: inherit;
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  text-decoration: none;
  cursor: pointer;
}

.r12f-linkbtn:hover { background: var(--r12-hover); }

.r12f-feedback-panel { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.r12f-feedback-panel .r12f-textarea { min-height: 120px; }
.r12f-feedback-foot { display: flex; justify-content: flex-end; gap: 8px; }

.r12f-textarea {
  width: 100%;
  min-height: 264px;
  height: auto;
  padding: 12px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-control);
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  font-family: inherit;
  font-size: var(--r12-fs-body, 14px);
  line-height: var(--r12-lh-body, 22px);
  resize: vertical;
  outline: 0;
}

.r12f-textarea:focus-visible { outline: 2px solid var(--r12-selected-border); outline-offset: -1px; }
.r12f-textarea::placeholder { color: var(--r12-faint); }

.r12f-area-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  color: var(--r12-muted);
}

.r12f-area-head b { font-weight: 500; color: var(--r12-ink); font-variant-numeric: tabular-nums; }

.r12f-doc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.r12f-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-control);
  background: var(--r12-surface-2);
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  color: var(--r12-muted);
}

.r12f-note svg { width: 16px; height: 16px; flex: none; color: var(--r12-muted); }

/* ── 4. 故事拆分 ─────────────────────────────────────────────── */

.r12f-split-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  gap: 8px;
  align-items: start;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

.r12f-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px 8px;
  overflow: auto;
  max-height: 520px;
}

.r12f-listrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--r12-ink);
  font-size: var(--r12-fs-ui, 13px);
  line-height: var(--r12-lh-ui, 20px);
  text-align: left;
  transition: background-color var(--r12-dur-2) var(--r12-ease);
}

.r12f-listrow:hover { background: var(--r12-hover); }
.r12f-listrow small { font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); color: var(--r12-faint); font-variant-numeric: tabular-nums; }

.r12f-listrow[aria-current='true'] {
  background: var(--r12-selected-bg);
  font-weight: 600;
  box-shadow: var(--r12-selected-shadow, none);
}

.r12f-reader {
  width: 100%;
  max-width: 720px;
  justify-self: center;
  padding: 24px 28px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-panel);
  background: var(--r12-surface);
}

.r12f-reader h2 { font-size: var(--r12-fs-title, 15px); line-height: var(--r12-lh-title, 22px); font-weight: 600; color: var(--r12-ink); margin-bottom: 12px; }
.r12f-reader p { font-size: var(--r12-fs-body, 14px); line-height: var(--r12-lh-body, 22px); color: var(--r12-ink); margin-bottom: 12px; }
.r12f-reader p:last-child { margin-bottom: 0; }

.r12f-facts { display: flex; flex-direction: column; gap: 10px; }

.r12f-fact { display: flex; flex-direction: column; gap: 2px; }
.r12f-fact dt { font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); color: var(--r12-muted); }
.r12f-fact dd { font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); color: var(--r12-ink); }

/* ── 5. 改编配置 ─────────────────────────────────────────────── */

.r12f-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 8px;
  align-items: stretch;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.r12f-config-grid > .r12-panel { min-width: 0; }

.r12f-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.r12f-form-row > .r12-field { min-width: 0; }

.r12f-number { position: relative; display: flex; align-items: center; }

.r12f-number input {
  width: 100%;
  padding-right: 56px;
  text-align: left;
}

.r12f-number em {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  font-style: normal;
  color: var(--r12-muted);
  pointer-events: none;
}

.r12f-hint {
  margin: 0 0 12px;
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  color: var(--r12-faint);
}

.r12f-label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  color: var(--r12-muted);
}

.r12f-intensities {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.r12f-intensity {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-card);
  background: var(--r12-surface-2);
  color: var(--r12-muted);
  text-align: left;
  transition: border-color var(--r12-dur-2) var(--r12-ease);
}

.r12f-intensity b { font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); font-weight: 600; color: var(--r12-ink); }
.r12f-intensity span { font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); color: var(--r12-muted); }
.r12f-intensity:hover { border-color: var(--r12-line-strong); }

.r12f-intensity[aria-pressed='true'] {
  border-color: var(--r12-selected-border);
  box-shadow: 0 0 0 1px var(--r12-selected-border);
}

.r12f-intensity .r12-check { top: 8px; right: 8px; }
.r12f-intensity[aria-pressed='true'] .r12-check { display: grid; }

.r12f-expand {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding: 6px 0 0;
  border: 0;
  border-top: 1px solid var(--r12-line);
  border-radius: 0;
  background: transparent;
  color: var(--r12-ink);
  font-size: var(--r12-fs-ui, 13px);
  line-height: var(--r12-lh-ui, 20px);
  font-weight: 500;
  cursor: pointer;
}

.r12f-expand:hover { color: var(--r12-ink); }
.r12f-expand svg { width: 16px; height: 16px; color: var(--r12-muted); }

.r12f-extra {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
}

.r12f-extra[hidden] { display: none; }

.r12f-req {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-control);
  background: transparent;
  text-align: left;
  transition: border-color var(--r12-dur-2) var(--r12-ease), background-color var(--r12-dur-2) var(--r12-ease);
}

.r12f-req:hover { border-color: var(--r12-line-strong); }
.r12f-req-box {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border: 1px solid var(--r12-line-strong);
  border-radius: 4px;
  color: var(--r12-bg);
}

.r12f-req-box svg { width: 12px; height: 12px; display: none; }

.r12f-req[aria-pressed='true'] .r12f-req-box { background: var(--r12-ink); border-color: var(--r12-ink); }
.r12f-req[aria-pressed='true'] .r12f-req-box svg { display: block; }

.r12f-req-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.r12f-req-text b { font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); font-weight: 500; color: var(--r12-ink); }
.r12f-req-text small { font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); color: var(--r12-muted); }

.r12f-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.r12f-know {
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 10px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-pill);
  background: transparent;
  color: var(--r12-muted);
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  transition: border-color var(--r12-dur-2) var(--r12-ease), color var(--r12-dur-2) var(--r12-ease);
}

.r12f-know:hover { border-color: var(--r12-line-strong); color: var(--r12-ink); }

.r12f-know[aria-pressed='true'] {
  border-color: var(--r12-selected-border);
  background: var(--r12-selected-bg);
  color: var(--r12-ink);
  font-weight: 600;
  box-shadow: var(--r12-selected-shadow, none);
}

/* 右栏外框照旧和左栏等高，里面的内容吸在滚动区顶部，主按钮一直可见 */
.r12f-config-right { position: relative; }

.r12f-config-sticky {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
}

.r12f-config-right .r12-panel-body { flex: 1; display: flex; flex-direction: column; }
.r12f-notes { min-height: 96px; }
.r12f-summary { display: flex; flex-direction: column; gap: 14px; height: 100%; }

.r12f-total { display: flex; flex-direction: column; gap: 2px; }
.r12f-total b {
  /* 预计总字数是展示用的大数字，不算正文四档字号 */
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  color: var(--r12-ink);
  font-variant-numeric: tabular-nums;
}
.r12f-total span { font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); color: var(--r12-muted); }

.r12f-rows { display: flex; flex-direction: column; gap: 8px; }
.r12f-rows > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.r12f-rows dt { font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); color: var(--r12-muted); }
.r12f-rows dd { font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); color: var(--r12-ink); font-variant-numeric: tabular-nums; }

.r12f-output {
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  color: var(--r12-muted);
  padding-top: 10px;
  border-top: 1px solid var(--r12-line);
}

.r12f-summary .r12-btn { margin-top: auto; width: 100%; }

/* ── 6. 剧本预览 ─────────────────────────────────────────────── */

.r12f-preview-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.r12f-script-body { display: flex; flex-direction: column; gap: 12px; }

.r12f-scene {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-card);
  background: var(--r12-surface);
}

.r12f-scene-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--r12-fs-ui, 13px);
  line-height: var(--r12-lh-ui, 20px);
  font-weight: 600;
  color: var(--r12-ink);
}

.r12f-scene-head small { font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); font-weight: 400; color: var(--r12-muted); margin-left: auto; }

.r12f-line {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
  font-size: var(--r12-fs-body, 14px);
  line-height: var(--r12-lh-body, 22px);
  color: var(--r12-ink);
}

.r12f-line > p { flex: 1; min-width: 0; }

/* 七稿三·2：台词用满卡片宽度；「改」按钮悬停才浮出来，不占行内宽度 */
.r12f-line-edit {
  position: absolute;
  right: 28px;
  top: 2px;
  height: 24px;
  padding: 0 6px;
  border: 0;
  border-radius: 6px;
  background: var(--r12-surface-3);
  color: var(--r12-muted);
  font: inherit;
  font-size: var(--r12-fs-small, 12px);
  opacity: 0;
  cursor: pointer;
}
.r12f-line:hover .r12f-line-edit,
.r12f-line-edit:focus-visible { opacity: 1; }
.r12f-line > p b { font-weight: 600; margin-right: 6px; }

.r12f-line-tag {
  flex: none;
  height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--r12-surface-3);
  color: var(--r12-muted);
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  font-weight: 500;
}

.r12f-line-tag.is-speech { color: var(--r12-ink); }

.r12f-line-more {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--r12-faint);
  opacity: 0;
  transition: opacity var(--r12-dur-2) var(--r12-ease), background-color var(--r12-dur-2) var(--r12-ease);
}

.r12f-line:hover .r12f-line-more,
.r12f-line-more:focus-visible { opacity: 1; }
.r12f-line-more:hover { background: var(--r12-hover); color: var(--r12-ink); }
.r12f-line-more svg { width: 16px; height: 16px; display: block; }

/* 生成带 */
.r12f-band {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-card);
  background: var(--r12-surface);
  backdrop-filter: blur(6px);
}

.r12f-band-note { font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); color: var(--r12-muted); }
.r12f-band > .r12-btn:last-child { margin-left: auto; }

.r12f-all-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.r12f-all-head .r12-btn { margin-left: auto; }

/* 全集：每集一节，可展开 / 收起 */
.r12f-episode-doc {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-card);
  background: var(--r12-surface);
}

.r12f-episode-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--r12-ink);
  font-size: var(--r12-fs-ui, 13px);
  line-height: var(--r12-lh-ui, 20px);
  font-weight: 600;
  text-align: left;
}

.r12f-episode-head small { margin-left: auto; font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); font-weight: 400; color: var(--r12-muted); }
.r12f-episode-head svg { width: 14px; height: 14px; flex: none; color: var(--r12-muted); }
.r12f-episode-body { display: flex; flex-direction: column; gap: 10px; }
.r12f-episode-body[hidden] { display: none; }

.r12f-speaker { font-weight: 600; margin-right: 6px; }

/* 审核条 */
.r12f-review {
  position: sticky;
  /* 七稿 30：只有被底部条压住的面板，审核条才往上抬；其余贴面板底 */
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  margin-top: 8px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-card);
  background: var(--r12-surface);
}

.r12f-review-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--r12-fs-ui, 13px);
  line-height: var(--r12-lh-ui, 20px);
  font-weight: 500;
  color: var(--r12-review);
}

.r12f-review .r12-btn:nth-last-child(2) { margin-left: auto; }

/* 九稿 0.2：审核条是中间栏上方独立窄卡，跟下面面板隔 8、同宽；不随内容滚。 */
.r12f-main-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.r12f-main-col > .r12-panel:not(.r12f-review-card) { flex: 1; min-height: 0; }

.r12f-review-card {
  flex: none;
  box-sizing: border-box;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-card);
  background: var(--r12-surface);
}

.r12f-review-card .r12f-review-state { margin-right: auto; }

/* 九稿 0.1：右栏 / 浮出卡标题行最右的〔×〕，32 正圆。 */
.r12-icon-btn.r12f-side-x {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.r12f-side-x svg { width: 18px; height: 18px; }

/* 九稿 49：甲把面板头的图标钮默认设为透明，右栏〔×〕要一眼看得到。 */
.r12-panel-head .r12-icon-btn.r12f-side-x { opacity: 1; }

/* 九稿二轮 0.3：剧本全集右侧摘要卡，圆角跟其他右侧卡一致。 */
.r12f-overview-card { border-radius: var(--r12-r-card); }

/* 九稿第 6 节：团队项目流程条的悬停卡，只读、不抢焦点。 */
.r12f-team-hover {
  position: fixed;
  z-index: 40;
  display: flex;
  flex-direction: column;
  min-width: 236px;
  padding: 10px 12px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-card);
  background: var(--r12-pop-bg);
  box-shadow: var(--r12-shadow-pop);
  pointer-events: none;
}

.r12f-team-hover-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--r12-fs-ui, 13px);
  line-height: var(--r12-lh-ui, 20px);
  font-weight: 600;
  color: var(--r12-ink);
}

.r12f-team-hover-head img {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
}

.r12f-team-hover-line {
  margin-top: 6px;
  color: var(--r12-muted);
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
}

/* ── 7. 导入剧本 ─────────────────────────────────────────────── */

/* 七稿三·2：还没有剧本时才出现的内容区空状态 */
.r12f-script-empty {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--r12-muted);
  font-size: var(--r12-fs-ui, 13px);
  line-height: var(--r12-lh-ui, 20px);
}
.r12f-script-empty strong { color: var(--r12-ink); font-size: var(--r12-fs-title, 15px); line-height: var(--r12-lh-title, 22px); }
.r12f-script-empty-actions { display: flex; gap: 8px; margin-top: 8px; }

.r12f-import {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 8px;
}

.r12f-import-left { min-width: 0; }
.r12f-import-right { min-width: 0; }

.r12f-paste {
  min-height: 228px;
}

.r12f-import-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
}

.r12f-import-foot span { font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); color: var(--r12-muted); }

.r12f-result { display: flex; flex-direction: column; gap: 12px; padding: 0 16px 16px; }
.r12f-result-group h4 { font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); font-weight: 500; color: var(--r12-muted); margin-bottom: 4px; }
.r12f-result-group p { font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); color: var(--r12-ink); }
.r12f-result-group p small { font-size: var(--r12-fs-small, 12px); color: var(--r12-faint); margin-left: 6px; }

.r12f-doubt {
  padding: 8px 10px;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-control);
  background: var(--r12-surface-2);
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  color: var(--r12-muted);
}

.r12f-doubt b { display: block; font-weight: 600; color: var(--r12-review); margin-bottom: 2px; }

/* ── 8. 空状态与过渡 ─────────────────────────────────────────── */

.r12f-stage-empty { padding-top: 48px; }

.r12f-script-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
}

html[data-motion='reduced'] .r12f-flowbar,
html[data-motion='reduced'] .r12f-substeps,
html[data-motion='reduced'] .r12f-nav,
html[data-motion='reduced'] .r12f-scope { transition: none; }

/* ── 四稿：项目页统一骨架（流程条进顶栏、通栏、版式类、集导航） ── */

#topbar .r12f-flowbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.r12f-banner {
  position: relative;
  flex: none;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.r12f-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

/* 五稿三·1：子步骤条的位置和宽度由布局脚本按顶栏流程条的首尾量出来，
   不参与通栏左右两组的排布；放不下时脚本改成按自身宽度居中。 */
.r12f-banner-steps {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0;
  max-width: none;
  overflow: hidden;
  flex: none;
  min-width: 0;
  transform: translateY(-50%);
}
/* 五稿修正单 16：放不下时先紧凑（只有当前步骤写全名，其余只留序号圈），再不行换成下拉 */
.r12f-banner-steps[data-r12f-steps-mode='compact'] .r12-step:not([aria-current='step']) .r12-step-text { display: none; }
.r12f-banner-steps[data-r12f-steps-mode='compact'] .r12-step:not([aria-current='step']) { gap: 0; }
.r12f-banner-steps[data-r12f-steps-mode='menu'] .r12-stepper { display: none; }
.r12f-stepspick {
  display: none;
  height: 28px;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r12-r-pill);
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  font-family: inherit;
  font-size: var(--r12-fs-ui, 13px);
  line-height: var(--r12-lh-ui, 20px);
  white-space: nowrap;
  cursor: pointer;
}
.r12f-stepspick small { color: var(--r12-muted); font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); }
.r12f-stepspick svg { width: 14px; height: 14px; flex: none; color: var(--r12-muted); }
.r12f-stepspick:hover { background: var(--r12-hover); }
.r12f-banner-steps[data-r12f-steps-mode='menu'] .r12f-stepspick { display: inline-flex; }
/* 七稿三·1：范围永远完整显示，不再用 is-left-tight / is-left-extreme 压左边；
   放不下时只降级中间的步骤条（全名 → 紧凑 → 下拉）。 */
.r12f-stepspick.is-min > .r12f-stepspick-name { display: none; }
.r12f-banner-right { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
.r12f-range { color: var(--r12-ink); font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); white-space: nowrap; }
.r12f-topbar-mode { display: inline-flex; align-items: center; margin-left: 8px; }
.r12f-team-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  margin-left: 8px;
  border-radius: var(--r12-r-pill);
  background: var(--r12-surface-3);
  color: var(--r12-ink);
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-small, 18px);
  white-space: nowrap;
}
.r12f-team-tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--team-color, var(--r12-muted)); flex: none; }
.r12f-pageset-wrap { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.r12f-pageset { border: 0; cursor: pointer; font-family: inherit; white-space: nowrap; }
.r12f-pageset svg { width: 12px; height: 12px; color: var(--r12-muted); }
/* 窄窗口有模型芯片时，「本页设置」缩成 28 的图标按钮，给芯片让出宽度 */
.r12f-pageset.is-compact { width: 28px; padding: 0; justify-content: center; }
.r12f-model-chip { border: 0; cursor: pointer; color: var(--r12-ink); background: var(--r12-surface-3); font-family: inherit; }
.r12f-model-chip:hover { background: var(--r12-hover); }
.r12f-model-chip svg { width: 12px; height: 12px; color: var(--r12-muted); }

/* 通栏左：集导航 → 选集下拉 → 单集/全集 → 竖分隔线 → 子步骤（四稿四·2） */
.r12f-epick { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r12f-epick[aria-disabled='true'] { color: var(--r12-muted); cursor: default; }
.r12f-banner-div { width: 1px; height: 20px; flex: none; background: var(--r12-line); }
.r12f-ep-item { gap: 8px; }
.r12f-ep-item small { margin-left: auto; color: var(--r12-muted); }
.r12f-side-toggle { flex: none; }

/* 左栏表单：输入框铺满左栏内容宽 */
/* 四稿五·1：侧栏里的输入框铺满内容宽，外框连边框一起算，正好等于栏内宽。
   名称框在 label.r12f-field 里，行内布局会带进基线/空白，这里显式成块、去掉外边距。 */
.r12f-side-body .r12-input { display: block; box-sizing: border-box; width: 100%; margin: 0; }

/* 工作区版式：己的四个工作区直接用这四个类 */
.r12-ws {
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  align-items: stretch;
  /* 行高不许被内容撑破：放不下由面板内部自己滚（四稿四·3 面板区到主控顶 − 8 为止） */
  grid-auto-rows: minmax(0, 1fr);
  overflow: hidden;
}

.r12-ws > .r12-panel { height: 100%; min-height: 0; overflow: hidden; }
.r12-ws > .r12-panel > .r12-panel-body { min-height: 0; overflow: auto; }

.r12-ws.is-list-main-side { grid-template-columns: 240px minmax(0, 1fr) 340px; }
.r12-ws.is-main-side { grid-template-columns: minmax(0, 1fr) 400px; }
.r12-ws.is-list-main { grid-template-columns: 240px minmax(0, 1fr); }
.r12-ws.is-main { grid-template-columns: minmax(0, 1fr); }
.r12-ws > * { min-width: 0; min-height: 0; }

/* 窄窗口（内容区宽减去右侧栏主控后 < 1100）：side 收成按钮，点开浮层 340 */
.r12f-project.is-narrow .r12-ws.is-main-side { grid-template-columns: minmax(0, 1fr); }
.r12f-project.is-narrow .r12-ws.is-list-main-side { grid-template-columns: 240px minmax(0, 1fr); }
/* 窄窗口第三栏由戊自己的视图改画成浮层；没改画的页面先把第三栏藏掉，避免挤到第二行 */
.r12f-project.is-narrow .r12-ws.is-list-main-side > :nth-child(3) { display: none; }
.r12f-content { position: relative; }

.r12f-side-float {
  position: absolute;
  /* 八稿 44：首帧先按面板标题行高度让开，脚本量到开关底边后按实际值覆盖 */
  top: 52px;
  right: 0;
  bottom: 0;
  width: 340px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--r12-line);
  border-radius: var(--r12-r-panel);
  background: var(--r12-pop-bg);
  box-shadow: var(--r12-shadow-pop);
}

/* 集导航：宽 220、每行 40 固定高 */
.r12f-nav { width: 220px; }
/* 行内两行字合计 20 + 18 = 38，上下各留 1：上下内边距必须为 0，否则文字会超出 40 的行框 */
.r12f-navrow { height: 40px; min-height: 40px; padding: 0 12px; gap: 0; justify-content: center; }
/* 长标题单行省略，状态行同样不许溢出；宽度仍由内容撑开（标题保持靠左，不铺满整行） */
.r12f-navrow b,
.r12f-navrow small { max-width: 100%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 四稿密度：面板标题 13/20 600；列表行 36–40；按钮一律 is-dense */
.r12f-project .r12-panel-head h2,
.r12f-project .r12-panel-head h3 { font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); font-weight: 600; }
.r12f-listrow { height: 36px; min-height: 36px; padding: 0 12px; align-items: center; }

/* 上传原文：左 360 侧栏 | 右原文编辑框铺满 */
.r12-ws.is-side-main { grid-template-columns: 360px minmax(0, 1fr); }
.r12f-side-col { display: flex; flex-direction: column; min-height: 0; }
.r12f-side-body { flex: 1; min-height: 0; overflow: auto; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 12px; }
.r12f-side-body p { margin: 0; font-size: var(--r12-fs-body, 14px); line-height: var(--r12-lh-body, 22px); color: var(--r12-ink); }
.r12f-line-tag.is-inner { color: var(--r12-muted); }
.r12f-editor-panel { display: flex; flex-direction: column; min-height: 0; }
.r12f-editor-body { flex: 1; min-height: 0; display: flex; align-items: stretch; padding: 0 12px 12px; }
.r12f-editor-body > * { flex: 1 1 auto; min-height: 0; height: 100%; }
.r12f-editor-body .r12-textarea { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.r12f-editor-body .r12-textarea textarea,
.r12f-editor-body textarea { flex: 1; min-height: 0; height: 100%; box-sizing: border-box; }

/* 右栏设置面板（参数从顶栏挪进来） */
.r12f-settings { display: flex; flex-direction: column; gap: 6px; }
.r12f-setting { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); }
.r12f-setting dt { color: var(--r12-muted); }
.r12f-setting dd { color: var(--r12-ink); text-align: right; }
.r12f-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 28px; font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); }
.r12f-setting-row > span:first-child { color: var(--r12-muted); }
.r12f-setting-row > span:last-child { color: var(--r12-ink); }
/* 五稿修正单 16：可点的「画风」行和只读行同排法：透明底、同一行、值 + 12 的小箭头 */
.r12f-setting-row.r12f-setting-btn {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.r12f-setting-btn > span:last-child { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.r12f-setting-btn > span:last-child svg { width: 12px; height: 12px; flex: none; color: var(--r12-muted); }
.r12f-setting-btn:hover > span:last-child { color: var(--r12-ink); }
/* 模型调用修正 21：「本集设置」里的写作模型一行，锁定的小锁也是 12 */
.r12f-write-row [data-r12f-write-name] { display: inline-flex; align-items: center; gap: 4px; }
.r12f-write-row svg { width: 12px; height: 12px; flex: none; color: var(--r12-muted); }

/* 剧本正文：面板内可滚，审核条在面板底 */
.r12f-script-panel .r12f-script-scroll { padding: 0 8px 8px; }

/* 文档页：目录 | 正文 | 设置 */
.r12f-doc-body { flex: 1; min-height: 0; overflow: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.r12f-doc-sec { display: flex; flex-direction: column; gap: 2px; }
.r12f-doc-sec dt { font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); color: var(--r12-muted); }
.r12f-doc-sec dd { font-size: var(--r12-fs-body, 14px); line-height: var(--r12-lh-body, 22px); color: var(--r12-ink); }

/* 导入剧本 / 全集总揽：表格 */
.r12f-table-wrap { flex: 1; min-height: 0; overflow: auto; padding: 0 8px 8px; }
.r12f-counts { display: flex; gap: 16px; padding: 0 0 8px; }
.r12f-count b { display: block; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--r12-ink); }
.r12f-count span { font-size: var(--r12-fs-small, 12px); line-height: var(--r12-lh-small, 18px); color: var(--r12-muted); }
.r12f-ep-row { cursor: pointer; }
.r12f-ep-row[aria-current='true'] td { background: var(--r12-selected-bg); }
.r12f-ep-table td { height: 40px; }
.r12f-ep-table th { height: 36px; }
.r12f-ep-table tbody tr:hover td { background: var(--r12-hover); }

.r12f-params-block { margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--r12-line); }
.r12f-params-block h4 { font-size: var(--r12-fs-ui, 13px); line-height: var(--r12-lh-ui, 20px); font-weight: 600; color: var(--r12-ink); margin-bottom: 6px; }
.r12f-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

.r12f-count b { font-size: 15px; line-height: 22px; }

/* 剧本单集：行号 + 标签 + 台词，悬停出「改」 */
.r12f-lines { display: flex; flex-direction: column; gap: 2px; padding: 4px 8px; }
.r12f-line-no {
  width: 32px;
  flex: none;
  text-align: right;
  font-size: var(--r12-fs-small, 12px);
  line-height: var(--r12-lh-body, 22px);
  color: var(--r12-faint);
  font-variant-numeric: tabular-nums;
}
/* 十稿：hover 灰条落在整行上，同一父容器里长台词和短台词都一样宽；
   「改」「更多」在行内流里，完整落在灰条内，不会压住文字。 */
.r12f-line { padding: 4px 6px; border-radius: 6px; }
.r12f-line:hover { background: var(--r12-hover); }
/* 行内可改文字回到行内流：角色名和台词共用同一条灰条，不再各自铺一层窄底。 */
.r12f-line .r12-editable {
  display: inline;
  margin: 0 -3px;
  padding: 1px 3px;
  border-color: transparent;
  background: transparent;
}
.r12f-line .r12-editable:hover { background: transparent; }
.r12f-line .r12-editable:focus,
.r12f-line .r12-editable:focus-visible {
  background: var(--r12-surface-3);
  border-color: var(--r12-selected-border);
}
.r12f-line .r12f-speaker { margin-right: 6px; }
.r12f-line-edit {
  position: static;
  right: auto;
  top: auto;
  flex: none;
  height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--r12-muted);
  font-size: var(--r12-fs-small, 12px);
  line-height: 18px;
  opacity: 0;
  transition: opacity var(--r12-dur-2) var(--r12-ease), background-color var(--r12-dur-2) var(--r12-ease);
}
.r12f-line:hover .r12f-line-edit,
.r12f-line-edit:focus,
.r12f-line-edit:focus-visible { opacity: 1; }
.r12f-line-edit:hover,
.r12f-line-edit:focus-visible { background: var(--r12-hover); color: var(--r12-ink); }
.r12f-line-more:focus,
.r12f-line-more:focus-visible { opacity: 1; }

.r12f-script-panel { display: flex; flex-direction: column; min-height: 0; }
.r12f-script-scroll { flex: 1; min-height: 0; overflow: auto; }
.r12f-script-panel .r12f-review { flex: none; position: static; margin: 0; border-radius: 0 0 var(--r12-r-panel) var(--r12-r-panel); border-left: 0; border-right: 0; border-bottom: 0; }

/* 面板里的内容铺满工作区（占屏 ≥70%） */
.r12-ws > .r12-panel { height: 100%; }
.r12f-ws-fill { height: 100%; display: flex; flex-direction: column; min-height: 0; }

/* 七稿 30：被底部条横向压住的面板，滚动区底部留出条高 + 16；固定条抬到条上方 */
.r12f-content .r12-panel.is-under-dock .r12f-side-body,
.r12f-content .r12-panel.is-under-dock .r12f-script-scroll,
.r12f-content .r12-panel.is-under-dock .r12f-list,
.r12f-content .r12-panel.is-under-dock .r12f-doc-body,
.r12f-content .r12-panel.is-under-dock.r12f-config-left .r12-panel-body,
.r12f-content .r12-panel.is-under-dock.r12f-config-right .r12-panel-body {
  padding-bottom: var(--r12-dock-clear, 0px);
}
/* 原文编辑框：框体铺满面板，留白加在框内底部，最后一行字滚得到条上面 */
.r12f-content .r12-panel.is-under-dock .r12f-editor-body textarea {
  padding-bottom: calc(12px + var(--r12-dock-clear, 0px));
}
.r12f-content .r12-panel.is-under-dock .r12f-review {
  bottom: var(--r12-dock-clear, 0px);
}
/* 剧本面板的审核条是 static，靠下外边距抬到浮层上方 */
.r12f-content .r12-panel.is-under-dock.r12f-script-panel .r12f-review {
  margin-bottom: var(--r12-dock-clear, 0px);
}

/* 底部条组只让条和浮卡可点，空白处不挡下面的面板；不加底色 */
.r12f-project .r12m-dock-holder {
  pointer-events: none;
  background: transparent;
}
.r12f-project .r12m-dock-holder > * { pointer-events: auto; }

@media (max-width: 1360px) {
  .r12f-config-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .r12f-split-grid { grid-template-columns: 200px minmax(0, 1fr) 260px; }
}
