:root{--bg:#0b0c0d;--surface:#141619;--surface-2:#191c20;--surface-3:#20242a;--line:#2b3037;--text:#f5f7f8;--muted:#8c949f;--green:#c2ff6b;--green-2:#7de8a0;--green-dark:#153522;--danger:#ff8279;--amber:#f2c36b;--shadow:0 22px 60px rgba(0,0,0,.35)}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 76% -10%,#1c3928 0,#101413 28%,var(--bg) 62%);color:var(--text);font-family:'Noto Sans SC','DM Sans',sans-serif;font-size:14px;letter-spacing:.01em}button{font:inherit;color:inherit;border:0;cursor:pointer}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--green);outline-offset:2px}.topbar{height:72px;border-bottom:1px solid #24272a;display:flex;align-items:center;padding:0 4.2vw;gap:44px;background:rgba(7,8,9,.82);backdrop-filter:blur(18px)}.brand{font-size:20px;font-weight:700;display:flex;align-items:center;gap:10px;white-space:nowrap}.brand-mark{width:31px;height:31px;border-radius:50%;border:6px solid #17d06b;display:inline-flex;align-items:center;justify-content:center;position:relative}.brand-mark span{width:8px;height:8px;background:#fff;border-radius:50%}.brand-accent{color:var(--green-2);margin-left:2px}.nav{display:flex;align-items:center;gap:34px;flex:1}.nav a{color:#e2e5e7;text-decoration:none;font-size:15px;white-space:nowrap}.nav a span{font-size:19px;margin-left:4px}.nav .hot{font-size:20px;margin-left:-25px}.top-actions{display:flex;align-items:center;gap:18px}.consult{background:#202326;border:1px solid #292d31;padding:10px 20px;border-radius:22px}.avatar{width:38px;height:38px;border-radius:50%;background:#b6eaf5;display:grid;place-items:center;font-size:21px}.page{padding:27px 4.2vw 46px}.page-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.back,.history{background:transparent;color:#cfd4d8;font-size:15px}.back{font-size:25px}.back span{font-size:14px;margin-left:7px}.history{text-decoration:underline;text-underline-offset:4px}.history span{font-size:12px;margin-left:5px}.workspace{display:grid;grid-template-columns:minmax(480px,1fr) minmax(640px,1.7fr);gap:18px;min-height:calc(100vh - 150px)}.panel{background:rgba(21,23,26,.95);border:1px solid #20242a;border-radius:12px;box-shadow:var(--shadow);position:relative}.config-panel{padding:27px 28px 24px;overflow:auto;max-height:calc(100vh - 150px)}.panel-title{display:flex;justify-content:space-between;align-items:flex-start}.panel-title h1{font-size:24px;margin:0 0 5px;letter-spacing:-.04em}.panel-title p,.section-head p{color:var(--muted);margin:0;font-size:12px}.help{width:24px;height:24px;border:1px solid #3e454c;border-radius:50%;background:#22262b;color:#adb4bb}.stepper{display:flex;align-items:center;margin:26px 0 23px}.step{display:flex;align-items:center;gap:7px;color:#73808b;font-size:12px;white-space:nowrap}.step b{width:25px;height:25px;border-radius:50%;display:grid;place-items:center;border:1px solid #465058;color:#87929a;font-size:12px}.step.active{color:var(--green)}.step.active b{background:var(--green);border-color:var(--green);color:#172318}.line{height:1px;background:#343a40;flex:1;margin:0 9px}.config-section{border-top:1px solid #292e34;padding:20px 0 0;margin-top:18px}.section-head{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:14px}.section-head h2{margin:0 0 4px;font-size:15px}.required,.counter{font-size:11px;color:var(--green);background:#1e3024;border:1px solid #33583d;padding:4px 7px;border-radius:5px}.counter{color:#808b95;background:transparent;border-color:#363d44}.source-tabs{display:flex;background:#1d2125;border-radius:7px;padding:3px;margin-bottom:12px}.tab{flex:1;padding:8px;background:transparent;border-radius:5px;color:#8d969f;font-size:13px}.tab.active{background:#333a34;color:#d8ff9b;box-shadow:inset 0 0 0 1px #506452}.selected-reference{display:flex;align-items:center;gap:10px;border:1px solid #373e46;background:#20252a;border-radius:8px;padding:9px}.ref-thumb{width:69px;height:46px;background:linear-gradient(140deg,#d5c2a1,#899965 52%,#15241d);border-radius:5px;position:relative;overflow:hidden}.ref-thumb:after{content:'';position:absolute;inset:0;background:linear-gradient(140deg,transparent 42%,rgba(255,255,255,.28) 43%,transparent 48%)}.play{width:24px;height:24px;border-radius:50%;background:rgba(13,16,15,.72);display:grid;place-items:center;font-size:10px}.ref-thumb .play{position:absolute;left:22px;top:11px}.ref-duration{position:absolute;right:4px;bottom:3px;font-size:9px}.ref-meta{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}.ref-meta strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ref-meta span{color:#8e98a0;font-size:11px}.ref-tags i,.library-info i{font-style:normal;font-size:10px;color:#aee877;background:#263b29;padding:2px 5px;border-radius:3px;margin-right:4px}.icon-btn{background:transparent;color:#9ba5ac;font-size:20px;padding:4px 6px;border-radius:5px}.icon-btn:hover{background:#2b3137;color:#fff}.secondary-btn{background:#272c30;border:1px solid #3a4249;color:#d9dee1;border-radius:7px;padding:9px 12px;font-size:12px}.secondary-btn:hover{background:#333a40}.secondary-btn.full{width:100%;margin-top:9px;text-align:center}.secondary-btn span{color:var(--green);margin-left:5px}.asset-grid{display:flex;flex-direction:column;gap:8px}.asset-card{display:flex;align-items:center;gap:10px;border:1px dashed #404850;border-radius:8px;padding:11px 12px;background:#1b1f23;transition:.2s}.asset-card:hover{border-color:#6e8e61;background:#222a25}.asset-card.required-card{border-style:solid}.asset-icon{width:26px;height:26px;border-radius:6px;background:#2b3830;color:var(--green);display:grid;place-items:center;font-size:16px}.asset-card>div:nth-child(2){display:flex;flex-direction:column;gap:3px;flex:1}.asset-card strong{font-size:12px}.asset-card span{font-size:11px;color:#8d969f}.add-btn{width:25px;height:25px;border-radius:50%;background:#2f3831;color:var(--green);font-size:20px;line-height:1}.asset-hint{color:#707982;font-size:11px;margin-top:9px}.ai-link{background:transparent;color:#b9f47a;font-size:11px}.textarea-wrap{position:relative}.textarea-wrap textarea{width:100%;height:98px;resize:vertical;border:1px solid #3a4148;border-radius:8px;background:#1a1e22;color:#f1f4f4;padding:11px 12px;font-family:inherit;font-size:12px;line-height:1.65}.textarea-wrap textarea::placeholder{color:#6e7780}.char-count{position:absolute;right:10px;bottom:8px;color:#707982;font-size:10px}.char-count b{font-weight:400}.chips{display:flex;gap:6px;margin-top:9px}.chip{background:#242a2e;color:#9fa9b0;border:1px solid #353d43;border-radius:20px;padding:5px 9px;font-size:11px}.chip:hover{color:var(--green);border-color:#5a7958}.field-label{display:block;color:#89939b;font-size:11px;margin:13px 0 8px}.option-row{display:flex;gap:7px}.option{min-width:57px;padding:7px 11px;background:#252a2f;border:1px solid #3b424a;border-radius:6px;color:#9ca5ad;font-size:12px}.option.active{background:#263b2a;border-color:#90dd68;color:#c4fc83}.switch-row{display:flex;align-items:center;justify-content:space-between;margin-top:17px;padding-top:14px;border-top:1px solid #292e33}.switch-row div{display:flex;flex-direction:column;gap:3px}.switch-row strong{font-size:12px}.switch-row span{font-size:10px;color:#7d8790}.switch{width:40px;height:22px;border-radius:20px;background:#353b40;padding:2px;transition:.2s}.switch span{display:block;width:18px;height:18px;border-radius:50%;background:#858e94;transition:.2s}.switch.on{background:#5e884b}.switch.on span{background:#c9ff83;transform:translateX(18px)}.submit-wrap{display:flex;align-items:center;gap:15px;border-top:1px solid #292e33;margin-top:22px;padding-top:19px}.cost{display:flex;flex-direction:column;gap:3px;min-width:100px}.cost span,.cost small{font-size:10px;color:#7c868e}.cost strong{font-size:18px}.cost em{font-style:normal;color:#e9b965;font-size:12px}.primary-btn{flex:1;background:linear-gradient(110deg,#bdf766,#78e4a1);color:#152117;border-radius:8px;padding:13px;font-weight:700;font-size:13px;box-shadow:0 8px 22px rgba(135,226,127,.14);transition:.2s}.primary-btn:hover{transform:translateY(-1px);box-shadow:0 11px 26px rgba(135,226,127,.24)}.primary-btn span{float:right;font-size:17px;line-height:12px}.result-panel{overflow:hidden;display:flex;flex-direction:column}.result-head{padding:27px 29px 19px;display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid #2a2f35}.eyebrow{font-size:10px;letter-spacing:.18em;color:#7f8b89}.result-head h2{margin:8px 0 0;font-size:20px}.status-pill{display:flex;align-items:center;gap:7px;border:1px solid #3b4446;border-radius:20px;padding:6px 11px;color:#a7b0b4;font-size:11px}.status-pill span{width:7px;height:7px;border-radius:50%;background:#7b858b}.status-pill.ready span{background:var(--green)}.status-pill.working{color:var(--amber);border-color:#665536}.status-pill.working span{background:var(--amber);box-shadow:0 0 0 4px rgba(242,195,107,.1)}.status-pill.success{color:#a9ec82;border-color:#486b43}.status-pill.success span{background:#91e36a}.status-pill.failed{color:var(--danger);border-color:#6a3f3d}.status-pill.failed span{background:var(--danger)}.result-content{padding:26px 29px;overflow:auto}.preview-stage{height:370px;background:radial-gradient(circle at 50% 38%,#27382d 0,#18201c 27%,#111416 70%);border:1px solid #2b3430;border-radius:10px;display:grid;place-items:center;position:relative;overflow:hidden}.preview-stage:before{content:'';position:absolute;width:480px;height:480px;border-radius:50%;border:1px solid rgba(186,244,119,.08);box-shadow:0 0 0 80px rgba(187,255,128,.015),0 0 0 160px rgba(187,255,128,.012)}.preview-placeholder{text-align:center;z-index:1}.placeholder-orb{width:58px;height:58px;border-radius:18px;border:1px solid #708c5e;background:linear-gradient(140deg,#26372b,#162019);display:grid;place-items:center;margin:0 auto 15px;color:#bdf66d;font-size:23px;box-shadow:0 0 30px rgba(179,242,109,.12)}.preview-placeholder h3{font-size:16px;margin:0 0 7px}.preview-placeholder p{color:#86918f;font-size:12px;margin:0 0 18px}.text-btn{background:transparent;color:#baf27b;font-size:12px}.summary-card{margin-top:14px;border:1px solid #2d3538;background:#1b2022;border-radius:10px;padding:16px 17px}.summary-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.summary-top h3{font-size:13px;margin:0}.summary-top span{font-size:10px;color:#667277}.summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px 26px}.summary-grid div{display:flex;flex-direction:column;gap:4px}.summary-grid span{font-size:10px;color:#768188}.summary-grid strong{font-size:12px;font-weight:500;color:#d9dfdf}.future-card{display:flex;align-items:center;gap:12px;border:1px solid #354639;background:linear-gradient(100deg,#1b2a1f,#1b2420);padding:14px 17px;border-radius:10px;margin-top:14px}.future-icon{width:30px;height:30px;border-radius:8px;background:#2b4430;color:#baf57b;display:grid;place-items:center;font-size:17px}.future-card div:nth-child(2){flex:1}.future-card strong{font-size:12px}.future-card p{font-size:10px;color:#85928a;margin:5px 0 0}.soon{font-size:9px;color:#baf57b;letter-spacing:.12em}.history-drawer{position:absolute;inset:0;background:#181c1f;transform:translateX(100%);transition:.3s;z-index:5;padding:27px 29px}.history-drawer.open{transform:translateX(0)}.drawer-head{display:flex;justify-content:space-between;align-items:flex-start;padding-bottom:18px;border-bottom:1px solid #2b3034}.drawer-head h3{font-size:20px;margin:8px 0 0}.history-item{display:flex;align-items:center;gap:12px;padding:15px 0;border-bottom:1px solid #292f34}.history-thumb{width:62px;height:42px;border-radius:5px;display:grid;place-items:center;color:#fff;font-size:12px}.thumb-1{background:linear-gradient(140deg,#dfc494,#8ba068,#12221a)}.thumb-2{background:linear-gradient(140deg,#d5a55c,#936c38,#292b1e)}.thumb-3{background:linear-gradient(140deg,#6f3c4e,#2e2131);color:#ffaaa0}.history-item>div:nth-child(2){display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}.history-item strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-item span{font-size:10px;color:#7c878e}.history-status{font-size:10px!important;padding:4px 7px;border-radius:4px}.history-status.success{color:#b5f188;background:#253b29}.history-status.failed{color:#ffaaa0;background:#432c2c}.modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.66);backdrop-filter:blur(5px);display:none;align-items:center;justify-content:center;z-index:20}.modal-backdrop.show{display:flex}.library-modal{width:min(900px,calc(100vw - 60px));max-height:min(720px,calc(100vh - 60px));background:#1a1e21;border:1px solid #343b40;border-radius:14px;box-shadow:0 30px 90px rgba(0,0,0,.65);padding:26px;overflow:auto}.modal-head{display:flex;justify-content:space-between;align-items:flex-start}.modal-head h2{font-size:22px;margin:8px 0 5px}.modal-head p{font-size:12px;color:#8c979d;margin:0}.library-toolbar{display:flex;align-items:center;gap:14px;margin:24px 0 19px}.search{height:36px;border:1px solid #3b4349;background:#141719;border-radius:7px;display:flex;align-items:center;gap:8px;padding:0 11px;width:220px}.search span{font-size:19px;color:#829097}.search input{border:0;outline:none;background:transparent;color:#fff;width:100%;font:inherit;font-size:12px}.filter-pills{display:flex;gap:7px;overflow:auto}.filter{white-space:nowrap;background:#252b2f;border:1px solid #373f45;color:#9aa5aa;border-radius:18px;padding:7px 11px;font-size:11px}.filter.active{background:#29422b;border-color:#6e9c5c;color:#c3fb83}.library-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:15px}.library-card{border:1px solid #333a3f;background:#202529;border-radius:10px;overflow:hidden;transition:.2s}.library-card:hover,.library-card.selected{border-color:#7eb769;box-shadow:0 8px 25px rgba(0,0,0,.22)}.library-cover{height:178px;position:relative;display:flex;align-items:flex-end;justify-content:space-between;padding:11px;color:#f5f5f5;font-size:10px}.cover-a{background:linear-gradient(150deg,#b6d99c 0,#e6c39a 35%,#547a4b 76%,#192a20)}.cover-b{background:linear-gradient(145deg,#d7c59d,#bfd0b0 38%,#799185 70%,#3d5042)}.cover-c{background:linear-gradient(145deg,#758d7c,#c2ad91 40%,#65736c 74%,#1c2b27)}.cover-d{background:linear-gradient(145deg,#d49c5f,#b9673a 36%,#453227 73%,#17191a)}.library-cover .play{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:38px;height:38px;font-size:13px}.library-info{padding:13px}.library-info>strong{display:block;font-size:13px;margin-bottom:4px}.library-info>span{display:block;color:#8b959b;font-size:11px;margin-bottom:10px}.library-info>div{display:flex;align-items:center}.library-info i{background:#2d3b31;color:#a5dc81}.choose{margin-left:auto;background:#304931;color:#c4fb8b;padding:6px 9px;border-radius:5px;font-size:10px}.toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,20px);opacity:0;background:#e9f8dd;color:#172118;padding:10px 16px;border-radius:7px;box-shadow:0 8px 25px rgba(0,0,0,.35);font-size:12px;transition:.25s;z-index:30}.toast.show{opacity:1;transform:translate(-50%,0)}.generated .preview-stage{background:#0c1010}.generated-video{width:100%;height:100%;object-fit:cover;border-radius:10px;background:linear-gradient(145deg,#d0b58e,#7e986e 40%,#1e3627)}.result-actions{display:flex;gap:8px;position:absolute;right:22px;bottom:18px}.result-actions button{background:rgba(15,20,17,.84);border:1px solid rgba(210,255,164,.3);padding:9px 12px;border-radius:6px;color:#d7fcb3;font-size:11px}.progress-box{width:min(420px,75%);text-align:center;z-index:1}.progress-box h3{font-size:16px;margin:0 0 7px}.progress-box p{color:#98a19d;font-size:11px;margin:0 0 20px}.progress-track{height:5px;border-radius:5px;background:#313a33;overflow:hidden}.progress-bar{width:58%;height:100%;background:linear-gradient(90deg,#bfff6f,#79e5a2);border-radius:5px;animation:pulse 1.5s infinite alternate}.progress-meta{display:flex;justify-content:space-between;color:#7b8782;font-size:10px;margin-top:8px}@keyframes pulse{from{width:45%}to{width:68%}}@media(max-width:1100px){.topbar{gap:22px;padding:0 24px}.nav{gap:18px}.page{padding-left:24px;padding-right:24px}.workspace{grid-template-columns:minmax(410px,1fr) minmax(520px,1.3fr)}}@media(max-width:900px){.nav a:nth-child(n+4){display:none}.workspace{grid-template-columns:1fr}.config-panel{max-height:none}.result-panel{min-height:650px}.library-grid{grid-template-columns:1fr}.library-toolbar{align-items:flex-start;flex-direction:column}.search{width:100%}}

/* Reference video parsing */
.reference-section .selected-reference{position:relative}
.reference-analysis-button{width:36px;height:36px;flex:none;padding:0;border-radius:6px;display:grid;place-items:center;background:#26382c;color:#baff79;font-size:19px;line-height:1}
.reference-analysis-button:hover{background:#344b3b;color:#d8ffaf}
.reference-analysis-button[hidden]{display:none}
.reference-analysis-overlay{position:absolute;inset:0;z-index:6;display:grid;place-items:center;padding:12px;background:rgba(7,9,8,.82);backdrop-filter:blur(1px)}
.reference-analysis-overlay[hidden]{display:none}
.reference-analysis-prompt{display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center}
.reference-analysis-prompt strong{max-width:290px;color:#f2f3f2;font-size:12px;font-weight:500;line-height:1.5}
.reference-analysis-prompt button{min-width:104px;height:32px;padding:0 14px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;gap:7px;background:#baff79;color:#172018;font-size:12px;font-weight:700}
.reference-analysis-prompt button:disabled{cursor:wait;background:#789960;color:#e6f2dc}
.analysis-spinner{display:none;width:14px;height:14px;border:2px solid rgba(21,32,22,.3);border-top-color:#172018;border-radius:50%}
.selected-reference.is-analyzing .analysis-spinner{display:block;animation:referenceAnalysisSpin .8s linear infinite}
.reference-analysis-backdrop{position:fixed;inset:0;z-index:120;display:none;align-items:center;justify-content:center;padding:24px;background:rgba(0,0,0,.72);backdrop-filter:blur(5px)}
.reference-analysis-backdrop.show{display:flex}
.reference-analysis-dialog{width:min(920px,100%);max-height:min(760px,calc(100vh - 48px));overflow:auto;border:1px solid #41444a;border-radius:8px;background:#24252a;box-shadow:0 28px 90px rgba(0,0,0,.66);scrollbar-width:thin;scrollbar-color:#55595d transparent}
.reference-analysis-head{position:sticky;top:0;z-index:2;display:flex;align-items:flex-start;justify-content:space-between;gap:20px;padding:24px 26px 20px;border-bottom:1px solid #3a3c42;background:#24252a}
.reference-analysis-head span{color:#a7e870;font-size:10px}
.reference-analysis-head h2{margin:7px 0 5px;font-size:20px;letter-spacing:0}
.reference-analysis-head p{margin:0;color:#a4a7ad;font-size:12px}
.reference-analysis-close{width:32px;height:32px;flex:none;padding:0;border-radius:50%;background:#393b41;color:#e8e9eb;font-size:20px;line-height:1}
.reference-analysis-close:hover{background:#4a4d53}
.reference-analysis-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;padding:1px;background:#3a3c42}
.reference-analysis-section{min-width:0;padding:20px 22px;background:#292a30}
.reference-analysis-section h3{display:flex;align-items:center;gap:8px;margin:0 0 10px;color:#eef0f1;font-size:13px;letter-spacing:0}
.reference-analysis-section h3 span{width:24px;height:24px;border-radius:5px;display:grid;place-items:center;background:#38463a;color:#baff79;font-size:11px}
.reference-analysis-section p{margin:0;color:#c6c9cc;font-size:12px;line-height:1.75;overflow-wrap:anywhere}
@keyframes referenceAnalysisSpin{to{transform:rotate(360deg)}}
@media(max-width:620px){.reference-analysis-backdrop{padding:12px}.reference-analysis-dialog{max-height:calc(100vh - 24px)}.reference-analysis-head{padding:19px 18px 16px}.reference-analysis-head h2{font-size:18px}.reference-analysis-grid{grid-template-columns:1fr}.reference-analysis-section{padding:17px 18px}.reference-analysis-prompt strong{max-width:230px;font-size:11px}.reference-analysis-button{width:32px;height:32px}}
@media(prefers-reduced-motion:reduce){.selected-reference.is-analyzing .analysis-spinner{animation:none}}
