/* 第 11 轮 · 丁：项目流程页（导入剧本、小说改编、角色与场景）与首页。
   只做骨架、间距与首页两处重排；主控本身的形状与配色由乙那一路负责。 */

/* ── 项目流程页骨架：左栏 64，中间内容铺满，底部给主控条留 72 ───────── */
.project-page.v3 { grid-template-columns: 64px minmax(0, 1fr) auto; }
.project-page.v3 > .stage-nav,
.project-page.v3 > .r7-script-stage-nav { width: 64px; min-width: 0; }
.project-page.v3 .stage-nav { padding: 12px 6px; }

.r11f-workspace { flex: 1; width: 100%; min-width: 0; padding: 12px 24px 72px; }
.r11f-workspace.r7-script-workspace { flex: 1; width: 100%; min-width: 0; padding: 12px 24px 72px; }

/* 卡片墙铺满；卡片间距 10。 */
.asset-wall { padding: 20px 24px 88px; }
.asset-grid { gap: 10px; }

/* ── 页头：来源页签与粘贴/上传，同一行，高 32 ─────────────────────── */
.r11f-tabs-row { flex: none; height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.r11f-source-tabs { display: flex; align-items: center; gap: 20px; height: 32px; }
.r11f-source-tabs button { position: relative; height: 32px; padding: 0 1px; background: transparent; color: var(--muted); font-size: 14px; line-height: 20px; }
.r11f-source-tabs button.is-active { color: var(--ink); font-weight: 600; }
.r11f-source-tabs button.is-active::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; border-radius: 2px; background: var(--ink); }
.r11f-input-tabs { width: max-content; height: 32px; }
.r11f-input-tabs button { height: 28px; min-height: 28px; padding: 0 14px; font-size: 13px; }

/* ── 导入剧本：左右两栏紧挨，右栏 320 ─────────────────────────────── */
.r11f-import-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 960px) 320px; gap: 12px; align-items: stretch; }
.r11f-side { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.r11f-import-left .r11f-paste { flex: 1; min-height: 220px; }
.r11f-parse-row { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.r11f-parse-row > span { min-width: 0; color: var(--muted); font-size: 12px; line-height: 18px; text-align: right; }
.r11f-parse { flex: none; height: 32px; min-height: 32px; }

/* 上传：图标在 40 的灰圆正中。 */
.r11f-upload { flex: 1; min-height: 160px; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); }
.r11f-upload-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--ink); }
.r11f-upload-icon svg { width: 20px; height: 20px; display: block; }
.r11f-upload-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.r11f-upload-copy strong { font-size: 14px; line-height: 20px; font-weight: 550; }
.r11f-upload-copy span { color: var(--muted); font-size: 12px; line-height: 18px; }

/* 右栏：解析结果 / 格式示意。 */
.r11f-side-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; margin-bottom: 10px; }
.r11f-side-head strong { font-size: 14px; line-height: 20px; }
.r11f-side-foot { flex: none; display: flex; justify-content: flex-end; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.r11f-confirm { height: 32px; min-height: 32px; padding: 0 14px; border-radius: 10px; background: var(--cl-spend); color: var(--cl-on-spend); font-size: 13px; }
.r11f-confirm:hover:not(:disabled) { background: var(--cl-spend-hover); color: var(--cl-on-spend); }
.r11f-confirm:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }

.r11f-result-scroll { flex: 1; min-height: 0; overflow: auto; }
.r11f-result-group { padding: 10px 0; border-bottom: 1px solid var(--line); }
.r11f-result-group:first-child { padding-top: 0; }
.r11f-result-group h3 { margin-bottom: 6px; color: var(--muted); font-size: 12px; line-height: 18px; }
.r11f-result-group p { margin: 4px 0; font-size: 13px; line-height: 20px; }
.r11f-result-meta { float: right; color: var(--muted); font-size: 12px; }
.r11f-doubt { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--warning) 10%, transparent); }
.r11f-doubt > span { flex: none; color: var(--warning); font-size: 12px; font-weight: 600; }
.r11f-doubt p { color: var(--muted); font-size: 12px; line-height: 18px; }

.r11f-format-list { display: grid; gap: 8px; }
.r11f-format-list li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.r11f-format-list b { color: var(--ink); font-size: 12px; font-weight: 550; }
.r11f-format-list span { color: var(--muted); font-size: 12px; line-height: 18px; }
.r11f-format-code { margin-top: 12px; padding: 10px 12px; overflow: auto; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12px; line-height: 20px; white-space: pre-wrap; }

/* ── 小说改编：文件信息与步骤条同一块 ─────────────────────────────── */
.r11f-novel-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; margin-bottom: 12px; }
.r11f-loaded { min-width: 0; display: flex; align-items: center; gap: 10px; }
.r11f-loaded strong { font-size: 14px; line-height: 20px; }
.r11f-loaded > span { color: var(--muted); font-size: 12px; line-height: 18px; }
.r11f-link { padding: 0; background: transparent; color: var(--ink); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.r11f-novel-tools { flex: none; display: flex; align-items: center; gap: 12px; }
.r11f-menu-wrap { position: relative; display: inline-flex; }

.r11f-steps { display: flex; align-items: center; gap: 8px; }
.r11f-step { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); white-space: nowrap; }
.r11f-step b { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; font-size: 11px; font-weight: 550; }
.r11f-step strong { font-size: 12px; font-weight: 500; }
.r11f-step.is-active { color: var(--ink); }
.r11f-step.is-active b { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.r11f-step.is-active strong { font-weight: 600; }
.r11f-step.is-done { color: var(--ink); }
.r11f-step.is-done b { border-color: var(--ink); color: var(--ink); }
.r11f-steps > i { flex: 0 0 20px; height: 1px; background: var(--line-strong); }

.r11f-next { flex: none; height: 32px; min-height: 32px; padding: 0 14px; border-radius: 10px; background: var(--cl-spend); color: var(--cl-on-spend); font-size: 13px; }
.r11f-next:hover { background: var(--cl-spend-hover); color: var(--cl-on-spend); }

.r11f-menu { position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; width: 176px; padding: 6px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-3); }
.r11f-menu-item { width: 100%; min-height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 8px; border-radius: 8px; background: transparent; color: var(--ink); font-size: 13px; text-align: left; }
.r11f-menu-item:hover { background: var(--fill-hover); }
.r11f-menu-item svg { width: 16px; height: 16px; color: var(--muted); }

/* 原文框：高度随窗口，最大 视口 − 280。 */
.r11f-novel-body { flex: 1; min-height: 0; overflow: auto; }
.r11f-novel-doc { display: flex; flex-direction: column; width: min(960px, 100%); max-width: 960px; }
.r11f-novel-paste { flex: 1 1 auto; width: 100%; height: calc(100dvh - 280px); min-height: 200px; max-height: calc(100dvh - 280px); padding: 14px; resize: none; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font-size: 14px; line-height: 24px; outline: none; }
.r11f-novel-paste:focus { border-color: var(--focus); }
.r11f-novel-upload { flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: calc(100dvh - 280px); }
.r11f-novel-source { flex: none; margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 18px; }
.r11f-novel-foot { flex: none; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 12px; }
.r11f-name-field { display: grid; gap: 6px; width: 360px; max-width: 100%; }
.r11f-name-field > span { color: var(--muted); font-size: 12px; line-height: 18px; }
.r11f-name-field input { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--field-bg); color: var(--ink); font-size: 13px; outline: none; }
.r11f-name-field input:focus { border-color: var(--focus); }
.r11f-novel-actions { flex: none; display: flex; align-items: center; gap: 12px; }
.r11f-primary { height: 32px; min-height: 32px; padding: 0 16px; border-radius: 10px; background: var(--cl-spend); color: var(--cl-on-spend); font-size: 13px; font-weight: 600; }
.r11f-primary:hover { background: var(--cl-spend-hover); color: var(--cl-on-spend); }
.r11f-format-help { color: var(--muted); font-size: 12px; }
.r11f-format-help:hover { color: var(--ink); }
.r11f-format-note { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 18px; }

/* 故事拆分：两栏，内容最宽 960。 */
.r11f-split { display: grid; grid-template-columns: 240px minmax(0, 960px); gap: 12px; overflow: hidden; }
.r11f-pane { min-width: 0; min-height: 0; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.r11f-pane-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; margin-bottom: 10px; }
.r11f-pane-head strong { font-size: 13px; line-height: 18px; }
.r11f-pane-meta { color: var(--muted); font-size: 12px; }
.r11f-reading .r7-novel-text-card { padding: 0; }
.r11f-reading .r7-novel-text-card h2 { margin-bottom: 12px; font-size: 16px; }

/* 改编配置：两张卡片等高，内容从顶部对齐。 */
.r11f-config { overflow: auto; }
.r11f-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: stretch; width: min(960px, 100%); }
.r11f-config-card { min-width: 0; display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.r11f-config-card > header { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.r11f-config-card > header strong { font-size: 14px; line-height: 20px; }
.r11f-config-body { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.r11f-config-rows { display: grid; gap: 8px; }
.r11f-config-rows > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.r11f-config-rows dt { color: var(--muted); font-size: 12px; line-height: 18px; }
.r11f-config-rows dd { color: var(--ink); font-size: 13px; line-height: 20px; }
.r11f-config-seg { width: max-content; }
.r11f-config-seg button { height: 28px; min-height: 28px; padding: 0 12px; font-size: 12px; }

/* 剧本预览。 */
.r11f-preview-doc { width: min(960px, 100%); padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.r11f-preview-doc > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.r11f-preview-doc > header strong { font-size: 15px; line-height: 22px; }
.r11f-scene { margin: 14px 0 8px; color: var(--muted); font-size: 12px; letter-spacing: .04em; }
.r11f-line { margin: 4px 0; font-size: 14px; line-height: 24px; }
.r11f-line b { font-weight: 600; }
.r11f-action { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 22px; }

/* 原文版本信息：右侧抽屉。 */
.r11f-scrim { position: fixed; z-index: 290; inset: var(--prototype-h) 0 0 0; background: color-mix(in srgb, var(--ink) 16%, transparent); }
.r11f-drawer { position: fixed; z-index: 300; top: calc(var(--prototype-h) + var(--topbar-h) + 8px); right: 8px; bottom: 8px; width: min(360px, calc(100vw - 24px)); display: flex; flex-direction: column; padding: 16px; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-3); }
.r11f-drawer-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.r11f-drawer-head strong { font-size: 15px; line-height: 22px; }
.r11f-drawer-list { display: grid; gap: 4px; }
.r11f-drawer-list > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.r11f-drawer-list dt { color: var(--muted); font-size: 12px; line-height: 18px; }
.r11f-drawer-list dd { color: var(--ink); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.r11f-drawer-note { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 18px; }

/* ── 首页：顶部项目卡整排居中，160 宽，间距 10 ───────────────────── */
.r7-home .home-card-wrap.r11f-top-row .quick-cards { display: flex; align-items: stretch; justify-content: center; gap: 10px; }
.r11f-top-row .project-home-card { flex: 0 0 160px; width: 160px; height: 156px; }

/* 最近项目：网格左对齐，188 × 156，间距 10。 */
.r11f-project-grid { display: grid; grid-template-columns: repeat(auto-fill, 188px); justify-content: start; gap: 10px; }
.r11f-project-grid .project-home-card { width: 188px; height: 156px; }
.r11f-recent-projects { margin-top: 20px; }
.r11f-recent-projects .section-head { align-items: center; }

/* 最近分集：列表行与上面的卡片网格左右对齐。 */
.r11f-recent-episodes { margin-top: 20px; }
.r11f-recent-episodes .section-head { align-items: center; }
.r11f-recent-episodes .recent-episodes { border-radius: 12px; }
.r11f-recent-episodes .recent-episode { padding-inline: 10px; }

/* ── 首页一键成片：外框 720 居中，主操作短按钮同一行 ───────────────── */
.r7-home .home-content .r11f-oneclick-panel { width: 100%; max-width: 720px; margin: 20px auto 0; padding: 14px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-1); }
.r11f-dropzone { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); }
.r11f-drop-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--ink); }
.r11f-drop-icon svg { width: 20px; height: 20px; display: block; }
.r11f-drop-copy { flex: 1; min-width: 0; display: grid; gap: 2px; }
.r11f-drop-copy strong { font-size: 14px; line-height: 20px; font-weight: 550; }
.r11f-drop-copy span { color: var(--muted); font-size: 12px; line-height: 18px; }

.r11f-spec-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.r11f-spec { height: 28px; min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); font-size: 12px; }
.r11f-spec:hover { border-color: var(--line-strong); }
.r11f-spec span { color: var(--muted); }
.r11f-spec b { font-weight: 600; }

.r11f-oneclick-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; }
.r11f-oneclick-note { flex: 1; min-width: 0; margin: 0; color: var(--muted); font-size: 12px; line-height: 18px; }
.r11f-oneclick-submit { flex: none; height: 32px; min-height: 32px; padding: 0 14px; border-radius: 10px; background: var(--cl-spend); color: var(--cl-on-spend); font-size: 13px; line-height: 20px; font-weight: 600; white-space: nowrap; }
.r11f-oneclick-submit:hover { background: var(--cl-spend-hover); color: var(--cl-on-spend); }

@media (max-width: 980px) {
  .r11f-import-grid { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .r11f-import-right { min-height: 220px; }
  .r11f-split { grid-template-columns: 180px minmax(0, 1fr); }
  .r11f-config-grid { grid-template-columns: 1fr; }
  .r7-home .home-card-wrap.r11f-top-row .quick-cards { flex-wrap: wrap; }
  .r11f-oneclick-foot { flex-wrap: wrap; }
  .r11f-oneclick-submit { margin-left: auto; }
}

@media (max-width: 700px) {
  .r11f-workspace.r7-script-workspace { padding: 10px 12px 80px; }
  .r11f-tabs-row { height: auto; flex-wrap: wrap; gap: 8px; }
  .r11f-novel-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .r11f-novel-tools { flex-wrap: wrap; }
  .r11f-split { grid-template-columns: 1fr; overflow: auto; }
  .r11f-novel-foot { flex-direction: column; align-items: stretch; gap: 12px; }
  .r11f-novel-actions { justify-content: flex-start; }
  .r11f-project-grid { grid-template-columns: repeat(auto-fill, minmax(0, 1fr)); }
  .r11f-project-grid .project-home-card { width: 100%; }
  .r11f-oneclick-panel { margin-top: 14px; }
}
