#story-dialog{width:min(1180px,96vw);max-width:1180px;padding:24px;max-height:94dvh;border-radius:14px;overflow:auto}
.story-heading{display:flex;justify-content:space-between;align-items:center;gap:20px}
.story-heading h2{font:600 26px "Microsoft YaHei",sans-serif;margin:8px 0 20px}
#story-close{font-size:25px;min-width:44px;border:0}
.story-source{display:flex;gap:14px;align-items:end;flex-wrap:wrap;border-bottom:1px solid var(--line);padding-bottom:18px;margin-bottom:20px}
.story-source label{display:flex;flex-direction:column;font-size:13px;gap:6px;color:var(--muted)}.story-source select{font-size:14px}
.story-picker{flex:1;min-width:240px}.story-picker select{width:100%;max-width:none}
.story-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:22px}
.story-player{min-width:0}
#story-canvas{width:100%;height:auto;aspect-ratio:16/9;border-radius:10px;background:#0c1720;border:1px solid #324a57}
.story-playbar,.story-export{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px}
.story-playbar button,.story-export button{font-size:13px}
#story-time{font-size:13px;color:var(--gold);font-variant-numeric:tabular-nums}
.story-voice{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted)}
.story-voice input{min-height:20px;width:16px;padding:0}
#story-seek{width:100%;accent-color:var(--gold);min-height:24px;padding:0;background:transparent}
#story-status{font-size:12px;color:var(--gold)}
.story-editor{overflow:auto;max-height:600px;padding-right:7px}
.story-editor h3{font-size:18px;color:var(--gold);margin:0}.story-editor .hint{font-size:12px}
.story-editor fieldset{border:1px solid var(--line);border-radius:8px;padding:10px;margin:12px 0}
.story-editor legend{font-size:12px;color:var(--gold);padding:0 6px}
.story-editor input,.story-editor textarea{width:100%;font-size:13px}
.story-editor textarea{min-height:105px;resize:vertical;margin-top:7px;line-height:1.8}
#story-custom{padding:0 0 18px}#story-custom label{font-size:14px;color:var(--muted)}
#story-input{width:100%;min-height:140px;resize:vertical;margin-top:8px}
@media(max-width:850px){.story-layout{grid-template-columns:1fr}.story-editor{max-height:none}.story-heading h2{font-size:22px}.story-source{gap:10px}.story-picker{min-width:200px}#story-dialog{padding:18px}}
@media(max-width:700px){header{height:auto;min-height:72px;padding-top:8px;padding-bottom:8px}.header-right{flex-wrap:wrap;justify-content:flex-end;max-width:calc(100% - 70px)}.header-right button{font-size:12px;min-height:36px}.story-heading h2{font-size:19px}.story-source label{flex:1;min-width:110px}.story-source .story-picker{flex-basis:100%}.story-playbar{gap:8px}.story-playbar button{padding:6px 10px}}
.chapter-heading{flex-wrap:wrap}.chapter-heading>div{flex:1;min-width:220px}.chapter-heading>button{font-size:13px}@media(max-width:700px){.chapter-heading>div{flex-basis:100%}}
#story-result{margin-top:22px;padding-top:18px;border-top:1px solid var(--line)}
#story-result h3{font-size:17px;color:var(--gold)}
#story-result video{width:100%;display:block;aspect-ratio:16/9;background:#0c1720;border-radius:8px;margin:12px 0}
#story-result .button{display:inline-flex}
#story-canvas{contain:paint}
#story-current{margin-top:14px;color:var(--gold);font-size:15px;line-height:1.7;min-height:26px}
#story-chapters{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0 18px}
#story-chapters button{padding:4px 8px;min-width:38px;min-height:38px;font-size:14px;font-variant-numeric:tabular-nums}
#story-chapters button.active{color:#10222b;background:var(--gold);border-color:var(--gold)}
#story-count{font-size:14px;color:var(--muted);font-weight:400}
#story-caption{color:var(--text);font-size:16px;line-height:1.85;margin:8px 0 12px;min-height:30px;overflow-wrap:anywhere}
.story-source label,.story-playbar button,.story-export button,#story-time,.story-voice,#story-status,.story-editor legend,.story-editor input,.story-editor textarea,.story-editor .hint{font-size:14px}
.story-editor textarea{min-height:100px}
@media(min-width:851px){.story-editor{max-height:820px}.story-player{align-self:start}}
@media(prefers-reduced-motion:reduce){#story-dialog *{scroll-behavior:auto}}
#story-coverage{font-size:14px;color:#a3c6c8;padding:0 0 16px;line-height:1.7}
.story-editor-pages{display:flex;gap:8px;align-items:center;position:sticky;top:0;background:#152731;z-index:1;padding:8px 0;font-size:13px}
.story-editor-pages button{font-size:13px;min-height:36px;padding:5px 8px}
.story-source-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.story-source-actions button{font-size:14px}
.story-filter input{width:200px;font-size:14px}
@media(max-width:700px){.story-filter input{width:100%}.story-source .story-filter{flex-basis:100%}.story-source .story-picker{flex-basis:100%}}

/* v9: a larger screening stage and an opt-in editing workspace. */
#story-dialog{width:min(1440px,97vw);max-width:1440px;background:#0c1b25;border:1px solid #37515a;padding:24px 28px;box-shadow:0 28px 100px #0009}
.story-heading h2{font-size:28px;letter-spacing:.02em}.story-layout{grid-template-columns:minmax(0,1fr) 270px;gap:24px}
#story-canvas{border-radius:16px;box-shadow:0 14px 45px #0004;border-color:#34565d}
.story-playbar{padding:12px;background:#142b36;border-radius:12px;gap:8px}
#story-play{background:#8de0cf;color:#10262e;border-color:#8de0cf;min-width:100px;font-weight:700}
.story-speed{display:flex;align-items:center;gap:6px;font-size:14px;color:var(--muted)}.story-speed select{min-width:72px;font-size:14px}
#story-seek{min-height:36px;cursor:pointer}#story-caption{background:#122733;padding:14px 18px;border-left:3px solid #79d5c5;border-radius:0 8px 8px 0}
.story-editor{border-left:1px solid #304a56;padding-left:18px;max-height:760px}.story-editor fieldset{background:#10242f;border-color:#2a4651}
.story-focused .story-layout{grid-template-columns:1fr}.story-focused .story-editor,.story-focused .story-source,.story-focused #story-coverage{display:none}
.story-focused .story-player{width:min(1160px,100%);margin:auto}.story-focused #story-canvas{max-height:68dvh;object-fit:contain;background:#0b1822}
#story-dialog button:focus-visible,#story-dialog select:focus-visible,#story-dialog input:focus-visible{outline:2px solid #8de0cf;outline-offset:3px}
@media(max-width:1000px){.story-layout{grid-template-columns:1fr}.story-editor{border-left:0;padding-left:0;max-height:450px}}
@media(max-width:700px){#story-dialog{padding:16px 12px;width:98vw;max-height:97dvh}.story-heading h2{font-size:23px}.story-playbar{padding:9px;gap:7px}.story-playbar button{min-height:44px}.story-speed select{min-height:40px}.story-focused #story-canvas{max-height:none}#story-caption{font-size:16px;padding:12px}.story-source label{min-width:0}#story-item{min-width:0}}

.scene-theme-label{display:grid;gap:6px;font-size:14px;color:var(--muted);margin-top:10px}.scene-theme-label select{width:100%;font-size:14px}
