:root {
  --paper: #f4efe7;
  --paper-deep: #e9dfd2;
  --surface: rgba(255, 253, 249, 0.92);
  --surface-solid: #fffdf9;
  --ink: #352a25;
  --muted: #766b64;
  --line: #ded3c8;
  --accent: #c86642;
  --accent-dark: #9f4428;
  --accent-soft: #f2d7c9;
  --sage: #718577;
  --danger: #a54136;
  --shadow: 0 18px 60px rgba(75, 49, 35, 0.1);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background:
  radial-gradient(circle at 10% 4%, rgba(207, 133, 92, 0.17), transparent 24rem),
  radial-gradient(circle at 88% 20%, rgba(119, 139, 119, 0.13), transparent 28rem),
  var(--paper); }
button, input, textarea { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 12px max(24px, calc((100vw - 1320px) / 2)); border-bottom: 1px solid rgba(117, 93, 79, 0.13); background: rgba(244, 239, 231, 0.82); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark { display: grid; width: 46px; height: 46px; place-items: center; border-radius: 14px 14px 14px 5px; background: var(--ink); color: white; font-family: Georgia, serif; font-size: 24px; box-shadow: 0 8px 22px rgba(53, 42, 37, 0.18); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: .04em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.shell { width: min(1320px, calc(100% - 40px)); margin: 0 auto; padding: 46px 0 80px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 54px; align-items: end; padding: 30px 6px 48px; }
.eyebrow { margin: 0 0 14px; color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .22em; }
.hero h1 { max-width: 780px; margin: 0; font-family: Georgia, "Songti SC", serif; font-size: clamp(38px, 5vw, 68px); font-weight: 500; line-height: 1.08; letter-spacing: -.035em; }
.hero-copy { max-width: 720px; margin: 25px 0 0; color: var(--muted); font-size: 16px; line-height: 1.85; }
.hero-note { position: relative; overflow: hidden; padding: 25px; border: 1px solid rgba(132, 102, 80, .18); border-radius: var(--radius-lg); background: rgba(255, 253, 249, .64); box-shadow: var(--shadow); }
.hero-note::after { content: ""; position: absolute; right: -45px; bottom: -55px; width: 150px; height: 150px; border-radius: 50%; background: var(--accent-soft); opacity: .55; }
.hero-note span, .side-label { display: block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.hero-note strong { position: relative; z-index: 1; display: block; margin-top: 12px; font-size: 20px; }

.stepper { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 253, 249, .58); }
.step { position: relative; display: flex; align-items: center; gap: 10px; min-height: 62px; padding: 10px 18px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; text-align: left; }
.step:last-child { border-right: 0; }
.step span { font-family: Georgia, serif; font-size: 12px; }
.step.active { background: var(--ink); color: white; }
.step.completed { color: var(--accent-dark); }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.panel { border: 1px solid rgba(119, 93, 75, .16); border-radius: var(--radius-xl); background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
.main-panel { min-height: 650px; padding: clamp(24px, 4vw, 54px); }
.side-panel { position: sticky; top: 96px; padding: 26px; }
.side-section { padding: 0 0 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.side-section:last-child { padding: 0; margin: 0; border: 0; }
.side-section strong { display: block; margin-top: 9px; font-size: 18px; }
.side-section p { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; word-break: break-word; }
.compact-list p { position: relative; padding-left: 15px; }
.compact-list p::before { content: ""; position: absolute; left: 0; top: .65em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.progress { height: 6px; margin-top: 16px; overflow: hidden; border-radius: 99px; background: var(--paper-deep); }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .35s ease; }

.stage { display: none; }
.stage.active { display: block; animation: fadeIn .28s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.section-heading { display: flex; justify-content: space-between; gap: 28px; align-items: end; margin-bottom: 32px; }
.section-heading > div { display: flex; align-items: baseline; gap: 14px; }
.section-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 32px; font-weight: 500; }
.section-heading p { max-width: 360px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; text-align: right; }
.section-number { color: var(--accent); font-family: Georgia, serif; font-size: 12px; }

.field { display: block; margin-bottom: 22px; }
.field > span { display: block; margin-bottom: 9px; font-size: 13px; font-weight: 700; }
.field small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }
.field-note { margin: -4px 0 20px; color: var(--muted); font-size: 12px; line-height: 1.65; }
input[type="text"], input[type="password"], input[type="url"], textarea { width: 100%; border: 1px solid var(--line); border-radius: var(--radius-md); outline: none; background: rgba(255,255,255,.72); color: var(--ink); transition: border-color .2s, box-shadow .2s; }
input[type="text"], input[type="password"], input[type="url"] { height: 52px; padding: 0 16px; }
textarea { padding: 16px; line-height: 1.75; resize: vertical; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(200, 102, 66, .1); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.upload-card { display: grid; min-height: 170px; place-items: center; align-content: center; gap: 7px; margin-bottom: 18px; border: 1px dashed #c3ad9d; border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(255,255,255,.7), rgba(243,229,216,.42)); cursor: pointer; transition: transform .2s, border-color .2s; }
.upload-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.upload-card input { display: none; }
.upload-card strong { font-size: 14px; }
.upload-card small { color: var(--muted); font-size: 11px; }
.upload-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: var(--ink); color: white; font-size: 22px; }
.reference-url-box { padding: 14px 14px 1px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.54); }
.reference-url-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.reference-url-row .button { min-height: 44px; white-space: nowrap; }
.file-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.file-chip { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 99px; background: white; color: var(--muted); font-size: 11px; }
.file-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.file-chip button { display: grid; width: 20px; height: 20px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: var(--paper-deep); color: var(--muted); cursor: pointer; }
.visual-identification { padding: 14px 16px; margin-top: 16px; border: 1px solid #d8cdbf; border-radius: var(--radius-md); background: rgba(247,242,234,.72); }
.visual-identification strong { display: block; font-size: 13px; }
.visual-identification p { margin: 7px 0; color: var(--ink); font-size: 12px; line-height: 1.65; }
.visual-identification small { color: var(--muted); font-size: 11px; }
.research-depth { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: #f2f5ef; color: #4f644c; font-size: 12px; line-height: 1.5; }
.unresolved-fields { margin-top: 12px; padding: 12px 14px; border: 1px solid #e9b9a7; border-radius: 12px; background: #fff5f0; }
.unresolved-fields strong, .candidate-products > strong { display: block; font-size: 13px; }
.unresolved-fields p, .candidate-item p { margin: 6px 0 0; font-size: 12px; line-height: 1.6; }
.persona-candidates { display: grid; gap: 8px; margin-top: 14px; }
.persona-candidates > strong { display: block; font-size: 13px; }
.persona-item { padding: 11px 13px; border: 1px solid #ded5c8; border-radius: 11px; background: #faf8f4; }
.persona-item b { font-size: 12px; }
.persona-item p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.candidate-products { display: grid; gap: 8px; margin-top: 14px; }
.candidate-item { padding: 11px 13px; border: 1px solid #ded5c8; border-radius: 11px; background: #faf8f4; }
.candidate-item.best_match { border-color: #9eb498; background: #f3f7f1; }
.candidate-item.excluded { opacity: .72; }
.candidate-item b { font-size: 12px; }
.candidate-item a { display: inline-block; margin-top: 6px; color: var(--accent-dark); font-size: 11px; }
.product-review-prompt { padding: 16px 18px; margin-top: 18px; border: 1px solid #d8c48d; border-radius: var(--radius-md); background: #fff9e8; color: #6f571a; }
.product-review-prompt strong { display: block; font-size: 14px; }
.product-review-prompt p { margin: 7px 0 0; font-size: 12px; line-height: 1.65; }

.button { min-height: 46px; padding: 0 18px; border: 1px solid transparent; border-radius: 12px; font-weight: 700; cursor: pointer; transition: transform .16s, box-shadow .16s, opacity .16s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button-primary { background: var(--accent); color: white; box-shadow: 0 9px 22px rgba(176, 75, 41, .2); }
.button-primary:hover:not(:disabled) { background: var(--accent-dark); }
.button-secondary { border-color: var(--line); background: white; }
.button-ghost { min-height: 38px; border-color: rgba(104,78,62,.18); background: transparent; }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 30px; }
.actions.split { justify-content: space-between; }
.actions.wrap { flex-wrap: wrap; }
.badge { padding: 7px 10px; border-radius: 99px; font-size: 11px; font-weight: 800; }
.badge-muted { background: var(--paper-deep); color: var(--muted); }
.badge-ok { background: #dce9df; color: #3f6e50; }
.badge-error { background: #f3d9d4; color: var(--danger); }
.badge-article { background: #e8ecf4; color: #3d5a80; }
.badge-article strong { font-weight: 800; }
.badge-version { background: #f3ede2; color: #8a7457; font-weight: 700; font-variant-numeric: tabular-nums; }
.badge-version:hover { background: #ede4d2; }

.alert, .result-block { padding: 18px; margin: 18px 0; border-radius: var(--radius-md); }
.alert { border: 1px solid #e7c1b5; background: #fff2ec; color: var(--danger); }
.alert.warning { border-color: #e3d09b; background: #fff9e6; color: #765d1c; }
.result-block { border: 1px solid var(--line); background: rgba(255,255,255,.66); }
.result-block h3 { margin: 0 0 12px; font-size: 18px; }
.identity-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.identity-item { padding: 11px; border-radius: 10px; background: var(--paper); }
.identity-item span { display: block; color: var(--muted); font-size: 10px; }
.identity-item strong { display: block; margin-top: 5px; font-size: 12px; }
.fact-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.fact-list li { padding: 10px 12px; border-left: 3px solid var(--sage); background: #f5f7f3; font-size: 12px; line-height: 1.55; }
.source-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.source-links a { color: var(--accent-dark); font-size: 11px; }

.query-list { display: grid; gap: 12px; margin-bottom: 24px; }
.query-card { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255,255,255,.64); cursor: pointer; transition: border-color .2s, transform .2s; }
.query-card:hover { transform: translateX(2px); border-color: #bf9a83; }
.query-card.selected { border-color: var(--accent); background: #fff7f2; }
.query-card input { accent-color: var(--accent); }
.query-card strong { display: block; font-size: 14px; line-height: 1.5; }
.query-card small { display: block; margin-top: 4px; color: var(--muted); }
.query-index { color: var(--accent); font-family: Georgia, serif; font-size: 12px; }
.query-validation { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.58); color: var(--muted); font-size: 11px; line-height: 1.6; }
.query-validation.valid { background: #eff6f0; color: #46624c; }
.query-validation.warning { background: #fff6eb; color: #8a5b31; }
.query-validation.invalid { background: #fff0ed; color: #9a4437; }
.query-progress { margin-top: 8px; padding: 8px 12px; border-radius: 10px; background: #fff6eb; color: #8a5b31; font-size: 11px; line-height: 1.6; }
.query-progress.error { background: #fdecec; color: #a33b3b; }

/* 上镜内容清单面板（M06 独立环节，2026-09-03） */
.claim-panel { padding: 18px; margin: 18px 0; border: 1px solid #d9ccbe; border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(255,255,255,.85), rgba(244,239,232,.72)); }
.claim-panel .section-heading { margin-bottom: 8px; }
.claim-list-text { width: 100%; min-height: 220px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font-family: inherit; font-size: 13px; line-height: 1.9; resize: vertical; }
.claim-panel-meta { color: var(--muted); font-size: 12px; }
.claim-panel .actions { margin-top: 16px; }
.claim-stale { margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; background: #fff0e3; color: #a04e1d; font-size: 12px; line-height: 1.6; }
.palette { display: flex; gap: 7px; margin-top: 10px; }
.palette span { width: 24px; height: 24px; border: 2px solid white; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.style-lock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 14px; }
.style-lock-grid > div { padding: 9px 10px; border-radius: 9px; background: rgba(255,255,255,.62); }
.style-lock-grid span { display: block; color: var(--muted); font-size: 9px; }
.style-lock-grid strong { display: block; margin-top: 4px; font-size: 10px; line-height: 1.45; }

.render-pipeline { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 18px; padding: 15px; border: 1px solid #dccfbe; border-radius: var(--radius-md); background: rgba(255,255,255,.58); }
.render-pipeline > div { min-width: 0; }
.render-pipeline span { display: block; color: var(--accent); font-family: Georgia, serif; font-size: 10px; }
.render-pipeline strong { display: block; margin-top: 3px; font-size: 12px; }
.render-pipeline small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.render-pipeline i { color: #b7a89b; font-size: 13px; font-style: normal; }
.render-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.render-tools > div { padding: 12px; border-radius: 10px; background: rgba(255,255,255,.72); }
.render-tools > div:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.render-tools > div:last-child { box-shadow: inset 3px 0 0 var(--sage); }
.render-tools.single { grid-template-columns: 1fr; }

/* 2026-09-16 布局改版：四帧缩略图带（画面只出缩略图＋底图上传）＋下方 2×2 纯文字卡 */
.story-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.strip-cell { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; }
/* 缩略图框与 1392×1856 底图同比例（3:4），图片铺满整框，不留两侧底色 */
.strip-thumb { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 9px; background: linear-gradient(145deg, #eee2d5, #d9c3b2); }
.strip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.strip-state { margin: 0; color: var(--muted); font-size: 10px; text-align: center; }
.strip-actions { display: flex; gap: 6px; }
.strip-actions .button { flex: 1 1 0; min-width: 0; min-height: 32px; padding: 0 8px; font-size: 10px; }
.strip-actions a.button { display: grid; place-items: center; text-decoration: none; }
.storyboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.story-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; }
.story-placeholder { padding: 24px; color: rgba(53,42,37,.62); text-align: center; }
.story-placeholder span { display: block; font-family: Georgia, serif; font-size: 44px; }
.story-placeholder small { display: block; margin-top: 8px; line-height: 1.55; }
.story-placeholder .placeholder-status { margin-top: 10px; }
.story-placeholder .placeholder-progress { width: 72%; height: 4px; margin: 14px auto 0; border-radius: 99px; background: rgba(53,42,37,.14); overflow: hidden; position: relative; }
.story-placeholder .placeholder-progress i { position: absolute; top: 0; bottom: 0; left: -45%; width: 45%; border-radius: 99px; background: linear-gradient(90deg, transparent, var(--accent), transparent); animation: placeholder-slide 1.3s ease-in-out infinite; }
@keyframes placeholder-slide { to { left: 100%; } }
.story-placeholder.generating .placeholder-status { color: var(--accent-dark); font-weight: 700; }
.story-placeholder.error .placeholder-status { color: #a33b3b; font-weight: 700; }
.product-name-row { display: flex; gap: 8px; }
.product-name-row input { flex: 1; min-width: 0; }
.product-name-row .icon-button { flex: 0 0 auto; align-self: center; }
.secondary-product-block { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.secondary-product-block h4 { margin: 0; font-size: 14px; }
.secondary-status { margin: 6px 0 10px; font-size: 11px; }
.secondary-status.ok { color: var(--accent-dark); font-weight: 700; }
.secondary-status.warn { color: #a06a1a; }
.unresolved-hint { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.story-role { position: absolute; top: 7px; left: 7px; padding: 4px 8px; border-radius: 99px; background: rgba(53,42,37,.84); color: white; font-size: 9px; }
.story-copy { padding: 16px; }
.story-copy h3 { display: flex; align-items: baseline; gap: 7px; margin: 0; font-size: 15px; line-height: 1.5; }
.story-index { flex: 0 0 auto; color: var(--accent-dark); font-family: Georgia, serif; font-size: 13px; }
.content-focus { margin-top: 12px; padding: 10px 11px; border-left: 3px solid var(--accent); background: #fbf6ef; }
.content-focus span { display: block; color: var(--accent-dark); font-size: 9px; font-weight: 800; }
.content-focus strong { display: block; margin-top: 4px; font-size: 12px; line-height: 1.5; }
.material-plan { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 11px; }
.material-plan > div { padding: 8px; border-radius: 8px; background: #f7f3ee; }
.material-plan span { display: block; color: var(--accent-dark); font-size: 9px; font-weight: 800; }
.material-plan small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.content-unit-plan { margin-top: 10px; padding: 10px; border: 1px solid #dfd3c8; border-radius: 9px; background: #fffaf5; }
.content-unit-plan > strong { display: block; margin-bottom: 7px; color: var(--accent-dark); font-size: 10px; }
.content-unit-plan > div { display: grid; grid-template-columns: 82px 1fr; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px dashed #e6d9cf; }
.content-unit-plan > div:first-of-type { border-top: 0; }
.content-unit-plan span { color: #8a6558; font-size: 8px; font-weight: 800; }
.content-unit-plan p { margin: 0; color: var(--ink); font-size: 10px; font-weight: 700; line-height: 1.4; }
.camera-plan { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.camera-plan > strong { display: block; margin-bottom: 7px; font-size: 10px; }
.camera-plan > div { display: grid; grid-template-columns: 34px 1fr; gap: 7px; align-items: start; padding: 6px 0; border-top: 1px dashed var(--line); }
.camera-plan > div:first-of-type { border-top: 0; }
.camera-plan p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.camera-plan b { color: var(--ink); }
.camera-priority { padding: 3px 4px; border-radius: 4px; background: #eee8e0; text-align: center; font-size: 8px; font-weight: 800; }
.camera-priority.must { background: #7f3529; color: white; }
.camera-priority.optional { background: #ebe9e5; color: var(--muted); }
.frame-pipeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 0 16px 14px; }
.frame-pipeline span { position: relative; padding-top: 17px; color: #9b8f87; font-size: 9px; text-align: center; }
.frame-pipeline span::before { content: ""; position: absolute; top: 4px; left: 50%; width: 8px; height: 8px; border: 2px solid white; border-radius: 50%; background: #d9d1ca; box-shadow: 0 0 0 1px #d9d1ca; transform: translateX(-50%); }
.frame-pipeline span:not(:last-child)::after { content: ""; position: absolute; top: 8px; left: calc(50% + 8px); width: calc(100% - 16px); height: 1px; background: #ddd4cd; }
.frame-pipeline span.done { color: #4e6d59; }
.frame-pipeline span.done::before { background: var(--sage); box-shadow: 0 0 0 1px var(--sage); }
.frame-pipeline span.current { color: var(--accent-dark); font-weight: 800; }
.frame-pipeline span.current::before { background: var(--accent); box-shadow: 0 0 0 2px #f1c8b7; }
.layer-panel { margin: 0 16px 14px; padding: 12px; border: 1px dashed #d7c8bb; border-radius: 10px; background: #faf7f2; }
.layer-panel strong { display: block; margin-bottom: 8px; font-size: 10px; letter-spacing: .08em; }
.layer-list { display: flex; flex-wrap: wrap; gap: 5px; }
.layer-list span { padding: 4px 7px; border-radius: 99px; background: white; color: var(--muted); font-size: 9px; box-shadow: inset 0 0 0 1px #e6ddd5; }
.layer-list span::before { content: "✓"; margin-right: 4px; color: var(--sage); font-weight: 800; }
.layer-list span.pending { color: #a3968e; background: #f2ede8; }
.layer-list span.pending::before { content: "○"; color: #aa9c91; }
.asset-preview-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 0 16px 14px; }
.asset-preview-strip figure { position: relative; overflow: hidden; aspect-ratio: 4 / 3; margin: 0; border: 1px solid #dfd5cb; border-radius: 9px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 50% / 16px 16px; }
.asset-preview-strip img { width: 100%; height: 100%; object-fit: cover; }
.asset-preview-strip figcaption { position: absolute; left: 5px; bottom: 5px; padding: 3px 6px; border-radius: 99px; background: rgba(53,42,37,.78); color: white; font-size: 8px; }
.story-actions { display: flex; gap: 8px; padding: 0 16px 16px; }
.story-actions .button { flex: 1; min-height: 38px; padding: 0 10px; font-size: 11px; }

.settings-dialog { width: min(640px, calc(100% - 28px)); padding: 0; border: 0; border-radius: var(--radius-xl); background: var(--surface-solid); box-shadow: 0 30px 100px rgba(36,25,20,.28); }
.settings-dialog::backdrop { background: rgba(35,28,24,.45); backdrop-filter: blur(7px); }
.settings-dialog form { padding: 30px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; margin-bottom: 26px; }
.dialog-heading h2 { margin: 0; font-family: Georgia, "Songti SC", serif; font-size: 28px; font-weight: 500; }
.icon-button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: white; font-size: 22px; cursor: pointer; }
.inline-message { min-height: 22px; color: var(--muted); font-size: 12px; }
.inline-message.ok { color: #477158; }
.inline-message.error { color: var(--danger); }

.toast { position: fixed; z-index: 50; right: 24px; bottom: 24px; max-width: 380px; padding: 13px 16px; border-radius: 12px; background: var(--ink); color: white; font-size: 12px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: none; }
.hidden { display: none !important; }
.loading::after { content: ""; display: inline-block; width: 12px; height: 12px; margin-left: 9px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -2px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-note { max-width: 520px; }
  .workspace { grid-template-columns: 1fr; }
  .side-panel { position: static; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .side-section { padding: 0; margin: 0; border: 0; }
}

@media (max-width: 680px) {
  .topbar { padding: 10px 16px; }
  #connectionBadge { display: none; }
  .brand small { display: none; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .button { min-height: 36px; padding: 0 10px; font-size: 11px; }
  .shell { width: min(100% - 24px, 1320px); padding-top: 24px; }
  .hero { padding-top: 12px; }
  .hero h1 { font-size: 38px; }
  .stepper { grid-template-columns: repeat(5, minmax(54px, 1fr)); }
  .step { justify-content: center; padding: 8px 4px; font-size: 0; }
  .step span { font-size: 12px; }
  .main-panel { min-height: 0; padding: 24px 18px; border-radius: 20px; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 10px; text-align: left; }
  .identity-grid, .field-row, .storyboard-grid, .style-lock-grid, .reference-url-row { grid-template-columns: 1fr; }
  .story-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip-thumb { max-width: 180px; margin: 0 auto; }
  .render-pipeline, .render-tools { grid-template-columns: 1fr; }
  .render-pipeline i { display: none; }
  .render-pipeline small { white-space: normal; }
  .query-card { grid-template-columns: 24px 1fr; }
  .query-index { display: none; }
  .side-panel { grid-template-columns: 1fr; }
  .actions.split { align-items: stretch; flex-direction: column-reverse; }
  .actions .button { width: 100%; }
}

/* ============ 手动排版编辑器 ============ */
.me-overlay { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; background: rgba(30, 24, 20, .72); backdrop-filter: blur(6px); }
.me-topbar { display: flex; align-items: center; gap: 12px; padding: 12px 18px; background: rgba(255, 250, 244, .97); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.me-topbar strong { font-size: 14px; color: var(--ink); }
.me-spacer { flex: 1; }
.me-body { flex: 1; display: flex; min-height: 0; }
.me-stage-wrap { flex: 1; display: grid; place-items: center; overflow: auto; padding: 12px; }
.me-stage { position: relative; box-shadow: 0 10px 40px rgba(0, 0, 0, .45); flex: 0 0 auto; }
.me-stage img { display: block; width: 100%; height: 100%; }
.me-blocks { position: absolute; inset: 0; }
.me-block { position: absolute; display: flex; flex-direction: column; justify-content: center; cursor: move; user-select: none; touch-action: none; box-sizing: border-box; }
.me-block.me-selected { outline: 2px solid #4c8dff; outline-offset: 3px; border-radius: 4px; }
.me-block.me-editing { outline: 2px dashed #4c8dff; outline-offset: 3px; border-radius: 4px; cursor: text; }
.me-line { display: block; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.me-edit { width: 100%; min-height: 1em; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-all; caret-color: #2b6cb0; }
.me-block.me-textbg::before { content: ""; position: absolute; inset: calc(var(--pad-y) * -1) calc(var(--pad-x) * -1); background: var(--bg-color); border-radius: var(--bg-radius, 6px); z-index: -1; }
.me-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.me-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .15); cursor: pointer; padding: 0; box-sizing: border-box; }
.me-swatch.active { outline: 2px solid #4c8dff; outline-offset: 2px; }
.me-panel { width: 300px; flex: 0 0 300px; overflow-y: auto; padding: 16px; background: rgba(255, 250, 244, .97); border-left: 1px solid rgba(0, 0, 0, .08); box-sizing: border-box; }
.me-mode-modal { position: fixed; inset: 0; background: rgba(30, 20, 12, .45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.me-mode-card { background: #fffaf4; border-radius: 14px; padding: 24px; width: 380px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); display: flex; flex-direction: column; gap: 10px; box-sizing: border-box; }
.me-mode-card h4 { margin: 0; font-size: 17px; }
.me-mode-card p { margin: 0; color: #6b5b4e; font-size: 13px; }
.me-mode-actions { display: flex; flex-direction: column; gap: 8px; margin: 6px 0; }
.me-mode-card small { color: #8a7a6c; line-height: 1.5; font-size: 12px; }
/* 首页"手动排版编辑器测试"选择浮层（2026-09-04） */
.hero-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 20px; }
.hero-actions small { max-width: 620px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.me-test-card { width: 440px; max-height: calc(100vh - 120px); overflow: hidden; }
.me-test-list { overflow-y: auto; margin: 4px -24px -24px; padding: 0 24px 10px; }
.me-test-sample { padding: 13px 2px; border-bottom: 1px solid var(--line); }
.me-test-sample:last-child { border-bottom: 0; padding-bottom: 4px; }
.me-test-sample strong { display: block; font-size: 14px; }
.me-test-sample p { margin: 5px 0 0; color: #6b5b4e; font-size: 12px; line-height: 1.6; }
.me-test-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.me-test-actions .button { min-height: 36px; padding: 0 14px; font-size: 12px; }
.me-test-footer { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.me-test-footer strong { flex: 1; min-width: 0; color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.5; }
.me-test-footer .button { flex: none; min-height: 30px; padding: 0 10px; font-size: 11px; }
.me-panel h4 { margin: 0 0 14px; font-size: 14px; color: var(--ink); }
.me-field { margin-bottom: 14px; }
.me-field > span { display: block; margin-bottom: 5px; font-size: 12px; color: var(--muted); }
.me-field input[type="text"] { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: white; }
.me-field select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: white; }
.me-row { display: flex; align-items: center; gap: 10px; }
.me-row input[type="number"] { width: 110px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: white; }
.me-row input[type="range"] { flex: 1; accent-color: #755616; }
.me-row strong { min-width: 52px; font-size: 12px; color: var(--ink); }
.me-hint { font-size: 12px; line-height: 1.7; color: var(--muted); }
.me-warn-overlay { position: fixed; inset: 0; z-index: 220; display: grid; place-items: center; background: rgba(20, 14, 10, .5); }
.me-warn-box { width: min(560px, 88vw); max-height: 76vh; overflow-y: auto; background: #fffaf4; border: 1px solid rgba(0, 0, 0, .14); border-radius: 14px; box-shadow: 0 18px 60px rgba(0, 0, 0, .4); padding: 18px 20px; box-sizing: border-box; }
.me-warn-box h4 { margin: 0 0 12px; font-size: 15px; color: #a04b3d; }
.me-warn-box ul { margin: 0 0 10px; padding-left: 18px; }
.me-warn-box li { font-size: 13px; line-height: 1.65; color: var(--ink); margin-bottom: 6px; }
.me-warn-box p { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 0 0 14px; }
.me-warn-box .button { margin-right: 10px; }
.me-warn { font-size: 12px; line-height: 1.5; color: #a04b3d; background: #fbeae6; border: 1px solid #ecc4b9; border-radius: 8px; padding: 8px 10px; margin: 0 0 14px; }
.me-align-group { display: flex; gap: 6px; }
.me-align-group button { flex: 1; padding: 7px 0; border: 1px solid var(--line); border-radius: 8px; background: white; font-size: 12px; cursor: pointer; }
.me-align-group button.active { background: var(--ink); color: white; border-color: var(--ink); }
.me-panel .button { width: 100%; margin-bottom: 10px; box-sizing: border-box; }
/* 分镜帧级失败补帧控件（2026-09-03）：保留已成功帧，逐帧补跑失败页 */
#reframeControls { margin-top: 10px; }
#reframeControls .reframe-summary { margin: 0 0 8px; font-size: 13px; line-height: 1.6; color: var(--ink); }
#reframeControls .reframe-buttons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
#reframeControls .reframe-buttons .button { margin: 0; }


/* 压缩图上文字面板（text_compressor，2026-09-16）：挂在分镜进度卡下方，手动触发把四帧已上图文字逐条压短 */
#compressPanel { margin-top: 10px; background: #fffaf4; border: 1px solid rgba(0, 0, 0, .1); border-radius: 12px; padding: 12px 14px; }
#compressPanel .compress-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#compressPanel .compress-head strong { font-size: 14px; color: var(--ink); }
#compressPanel .compress-hint { font-size: 12px; color: var(--muted); flex: 1; min-width: 200px; line-height: 1.5; }
#compressPanel .compress-head .button { margin: 0; }
#compressPanel .compress-summary { margin: 10px 0 0; font-size: 12px; color: #5a7d4f; }
#compressPanel .compress-block { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 8px; }
#compressPanel .compress-block h4 { margin: 0 0 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
#compressPanel .compress-drop { margin: 0; padding-left: 18px; }
#compressPanel .compress-drop li { font-size: 12px; line-height: 1.6; color: var(--muted); margin-bottom: 3px; }

/* 排版编辑器全屏壳（2026-09-06 ⑦-66）：主站工作台内嵌 /od/ 子站 iframe（客户用，
   保留 /od/ 独立入口；open-design 零改动）。盖过一切业务层 */
.od-shell { position: fixed; inset: 0; z-index: 300; display: flex; flex-direction: column; background: #fff; }
.od-shell-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 14px 0 18px; border-bottom: 1px solid rgba(0, 0, 0, .08); flex-shrink: 0; }
.od-shell-head { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.od-shell-head strong { font-size: 13px; color: var(--ink); }
.od-shell-head small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-shell-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.od-shell-actions .button { margin: 0; }
.od-shell-frame { flex: 1; width: 100%; border: 0; min-height: 0; }

/* 任务排版条（2026-09-06 ⑦-66）：step5 分镜网格下、4 帧一起导入 OpenDesign 排版 */
.task-od-bar { margin-top: 16px; }
.task-od-card { border: 1px dashed #d9c9ae; border-radius: 12px; background: #fcf8f0; padding: 14px 16px 15px; }
.task-od-head strong { font-size: 14px; color: var(--ink); }
.task-od-head p { margin: 6px 0 0; font-size: 12px; line-height: 1.7; color: #6b5b4e; }
.task-od-status { margin: 10px 0 0; font-size: 12px; color: #6b5b4e; }
.task-od-status.warn { color: #a04b3d; font-weight: 600; }
.task-od-card small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.task-od-card .me-test-actions { margin-top: 10px; }

/* ── 修改密码弹窗（2026-09-07 账号模式自助改密） ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(58, 47, 31, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.modal.hidden { display: none; }
.modal-card {
  width: 400px;
  max-width: 92vw;
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.modal-card h3 {
  margin: 0 0 6px;
  font-size: 17px;
  color: #3b2f1f;
}
.modal-sub {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.6;
  color: #8d8271;
}
.modal-msg {
  font-size: 13px;
  line-height: 1.6;
  margin: 12px 0 0;
}
.modal-msg.error { color: #b3382c; }
.modal-msg.ok { color: #2f7d4f; }
