*{box-sizing:border-box}body{margin:0;color:#171715;background:#fafaf9;font:14px Arial,"Microsoft YaHei",sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed}header{height:93px;background:#fff;border-bottom:1px solid #e3e3e0;display:flex;align-items:center;justify-content:space-between;padding:0 32px}.brand{display:flex;align-items:center;gap:15px}.brand-icon{font-size:35px;color:#777}.brand h1{margin:0;font-size:25px;letter-spacing:1px}.brand p{margin:2px 0 0;font-size:12px}.plain{border:0;background:none;color:inherit;padding:10px;font-size:21px}.plain span{font-size:14px;margin-left:8px}.layout{display:grid;grid-template-columns:448px 1fr;min-height:calc(100vh - 93px)}aside{background:#fff;border-right:1px solid #e3e3e0;padding:22px 32px 30px}section{margin-bottom:22px}h2{font-size:16px;margin:0 0 14px}aside section:first-child{margin-bottom:40px}.upload{min-height:305px;border:1px dashed #ccc;border-radius:12px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px;gap:12px}.upload.drag{background:#f0f7f6;border-color:#179f92}#uploadEmpty{text-align:center;color:#999}#uploadEmpty p{color:#171715;margin:18px 0 8px}small,.hint{color:#92928d;font-size:12px}.black{background:#181817;color:#fff;border:0;border-radius:9px;padding:13px 24px;min-width:182px;font-weight:600}textarea{width:100%;border:1px solid #dcdcd7;border-radius:8px;padding:12px 14px;resize:vertical;min-height:85px;line-height:1.6;background:#fff}textarea::placeholder{color:#a5a5a0}.hint{margin-top:8px}.count-row{display:flex;align-items:center;justify-content:space-between;margin:10px 0}.stepper{display:flex;height:36px;border:1px solid #deded9;border-radius:7px;overflow:hidden}.stepper button{width:35px;border:0;background:#fff;color:#888;font-size:22px}.stepper input{width:42px;text-align:center;border:0;appearance:textfield;-moz-appearance:textfield}.stepper input::-webkit-inner-spin-button{appearance:none}.settings{display:flex;gap:14px}.settings label{flex:1;font-size:12px}select{display:block;margin-top:8px;border:1px solid #dcdcd7;border-radius:8px;background:#fff;padding:10px;width:100%;color:#444}details{margin-top:16px;color:#777;font-size:12px}summary{cursor:pointer}details label{display:block;margin-top:12px}details textarea{margin-top:6px;font-size:12px;min-height:65px}.generate{border:0;border-radius:30px;padding:17px;width:100%;background:#181817;color:#fff;font-weight:bold}.generate:disabled{background:#e2e2df;color:#aaa}main{padding:49px clamp(35px,5.5vw,110px);min-width:0}#intro{max-width:910px;margin:auto}#intro>h2{font-size:30px;margin-bottom:24px;letter-spacing:-1px}.subtitle{font-size:13px;margin:0;line-height:1.8}.divider{height:1px;background:#e4e4df;margin:29px 0 44px}.steps{display:grid;grid-template-columns:1fr 45px 1fr 45px 1fr;align-items:center;text-align:center}.number{display:inline-grid;place-items:center;background:#ebebe8;border-radius:50%;width:30px;height:30px;font-weight:bold;margin-bottom:20px}.step-icon{width:136px;height:125px;border:1px dashed #ccc;border-radius:12px;display:grid;place-items:center;margin:0 auto 24px;font-size:47px;color:#999}.squares{font-size:26px;letter-spacing:2px}h3{font-size:14px;margin:0 0 12px}.steps p{color:#777;font-size:12px;line-height:1.7;margin:0}.arrow{color:#aaa;font-size:27px;margin-top:7px}.preview{margin-top:74px}.preview>h3{margin-bottom:27px}.preview-grid{display:grid;grid-template-columns:1.6fr .8fr 1.1fr .9fr;gap:clamp(15px,3vw,60px);align-items:end;text-align:center}.placeholder{border:1px dashed #ccc;border-radius:11px;display:grid;place-items:center;font-size:11px;color:#888;max-width:100%;margin:0 auto 22px}.wide{width:260px;aspect-ratio:21/9}.tall{width:100px;aspect-ratio:9/16}.landscape{width:174px;aspect-ratio:3/2}.square{width:140px;aspect-ratio:1}.preview h4{font-size:13px;font-weight:400;margin:0 0 8px}.preview p{font-size:11px;color:#888;margin:0}.uploads{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:100%}.uploads:empty{display:none}.thumb{position:relative;height:90px}.thumb img{width:100%;height:100%;object-fit:contain;border-radius:6px;background:#f5f5f3}.thumb button{position:absolute;right:0;top:0;border:0;border-radius:50%;background:#171715;color:white;width:22px;height:22px}.result-heading{display:flex;justify-content:space-between;gap:20px}.result-heading h2{font-size:25px}.result-heading p{color:#777}.outline{border:1px solid #ddd;border-radius:8px;background:white;padding:10px 16px;height:42px}.progress-track{display:flex;gap:6px;margin:24px 0}.progress-track span{height:5px;background:#e5e5e0;flex:1;border-radius:3px}.progress-track span.done{background:#242421}.image-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:16px 0 32px}.result-card{background:white;border:1px solid #e5e5df;border-radius:10px;overflow:hidden}.result-card img{width:100%;aspect-ratio:1;object-fit:contain;cursor:zoom-in}.result-card footer{display:flex;justify-content:space-between;padding:13px;font-size:12px}.result-card a{color:#333}#formError,#taskError{color:#b64033;line-height:1.7;font-size:12px}.overlay{position:fixed;inset:0;background:#0004;z-index:10}.history-panel{position:absolute;right:0;top:0;bottom:0;width:min(520px,100%);background:#fafaf9;padding:28px;overflow:auto;margin:0;box-shadow:-6px 0 40px #0001}.panel-header{display:flex;justify-content:space-between;border-bottom:1px solid #e1e1dc;padding-bottom:20px;margin-bottom:22px}.panel-header h2{font-size:23px;margin:0}.panel-header p{font-size:12px;color:#888}.history-item{background:#fff;border:1px solid #e1e1dc;border-radius:10px;margin:14px 0;padding:16px;cursor:pointer}.history-item:hover{border-color:#999}.history-item time{font-size:12px;color:#888}.history-item p{line-height:1.5;overflow-wrap:anywhere}.history-item .mini-images{display:flex;gap:7px}.mini-images img{width:65px;height:65px;object-fit:cover;border-radius:5px}.status{float:right;font-size:12px}.muted{color:#888;line-height:1.8}dialog{border:0;padding:18px;border-radius:12px;max-width:90vw;background:#fff}dialog::backdrop{background:#0009}dialog>button{display:block;margin-left:auto}dialog img{max-width:80vw;max-height:78vh;object-fit:contain}[hidden]{display:none!important}button:focus-visible,a:focus-visible,summary:focus-visible{outline:2px solid #169c91;outline-offset:3px}@media(min-width:1700px){main{padding-left:clamp(110px,14.6vw,280px);padding-right:clamp(60px,14.6vw,280px)}}@media(max-width:1100px){.layout{grid-template-columns:350px 1fr}aside{padding:22px}.step-icon{width:100px;height:105px}main{padding:40px 25px}.steps{grid-template-columns:1fr 20px 1fr 20px 1fr}.preview-grid{gap:15px}#intro>h2{font-size:25px}.image-grid{grid-template-columns:repeat(2,1fr)}}@media(max-width:760px){header{height:78px;padding:0 18px}.brand h1{font-size:20px}.brand-icon{font-size:28px}.layout{display:flex;flex-direction:column}aside{border-right:0;border-bottom:1px solid #ddd;padding:24px}aside section:first-child{margin-bottom:24px}.upload{min-height:230px}main{padding:35px 20px}.steps{gap:4px}.step-icon{width:85px;height:90px;font-size:34px}.steps h3{font-size:12px}.steps p{font-size:10px}.arrow{font-size:18px}.preview{margin-top:45px}.preview-grid{grid-template-columns:1fr 1fr;gap:28px}.placeholder{max-height:150px}.result-heading h2{font-size:20px}}

.reference-description{display:block;margin-top:16px}.reference-description-head{display:flex;align-items:center;gap:10px;margin-bottom:8px;overflow-wrap:anywhere}.reference-description-head img{width:48px;height:48px;object-fit:contain;border:1px solid #ddd;border-radius:5px}.reference-description textarea{font-size:12px;min-height:70px}
.brand-icon{display:block;width:44px;height:44px;flex-shrink:0}.brand{gap:13px}@media(max-width:760px){.brand-icon{width:38px;height:38px}}
/* Generation states follow the source studio's progress card, output queue and error panel. */
#workspace{max-width:1008px;margin:0 auto}.result-heading{border-bottom:1px solid #e3e3de;padding-bottom:26px;align-items:flex-start}.result-heading h2{font-size:28px;line-height:1.4;margin-bottom:10px}.result-heading p{font-size:13px;line-height:1.8;margin:0;color:#7f7f79}.progress-card{display:flex;align-items:center;gap:14px;padding:15px 17px;border:1px solid #deded8;border-radius:12px;background:white;margin:20px 0}.progress-card #progressCurrent{font-size:12px;white-space:nowrap}.progress-card .progress-track{display:block;height:6px;flex:1;background:#e9e9e5;overflow:hidden;margin:0;border-radius:4px}.progress-card .progress-track span{display:block;height:100%;background:#252522;border-radius:4px;transition:width .35s}#progressCount{font-size:12px;color:#888;white-space:nowrap}.analysis-card{padding:16px 18px;background:#f1f1ed;border:1px solid #e2e2dc;border-radius:10px;font-size:12px;line-height:1.8;white-space:pre-line;max-height:160px;overflow:auto;margin-bottom:28px;color:#666}.queue-heading{margin:30px 0 18px}.generation-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px}.pending-card{min-width:0}.pending-image{border:1px solid #e1e1db;border-radius:10px;background:linear-gradient(110deg,#f0f0ec 30%,#fafaf8 45%,#f0f0ec 60%);background-size:220% 100%;animation:shimmer 2.4s linear infinite}.pending-card p{font-size:13px;font-weight:600;margin:12px 0 7px}.pending-card>span{font-size:11px;color:#999}.state-error{padding:70px 30px;text-align:center}.state-error .result-heading{border:0;display:flex;flex-direction:column;align-items:center;gap:18px}.state-error .result-heading h2{font-size:28px}.state-error .outline{order:2;background:#191917;color:#fff;padding:12px 22px;height:auto}.state-error #taskError{max-width:700px;margin:20px auto;padding:18px;border:1px solid #eadbd5;border-radius:10px;background:#fffaf8;overflow-wrap:anywhere;font-size:12px}.state-completed .image-grid{gap:24px}.state-completed .result-card img{aspect-ratio:auto;max-height:440px}.state-completed .result-card{border-radius:12px}@keyframes shimmer{to{background-position:-220% 0}}@media(prefers-reduced-motion:reduce){.pending-image{animation:none}}@media(max-width:900px){.generation-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.progress-card{flex-wrap:wrap}.result-heading h2{font-size:23px}}
/* Completed gallery matches the source studio card anatomy. */
.results-actions{display:flex;gap:10px;align-items:center;flex-shrink:0}.results-actions .black{min-width:0;padding:12px 18px;font-size:12px;border-radius:8px}.state-completed .result-heading{border:0;padding-bottom:24px}.state-completed .analysis-card{max-height:none;overflow:visible;white-space:normal;margin:0 0 28px;background:#f1f1ed;border-color:#e0e0da;padding:18px 20px;line-height:1.8}.results-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px;align-items:start}.results-gallery .result-card{min-width:0;border:1px solid #deded8;border-radius:12px;background:#fff;overflow:hidden}.results-gallery .result-image{position:relative;width:100%;min-height:120px;display:grid;place-items:center;background:#efefec;overflow:hidden}.image-zoom{position:absolute;inset:0;display:block;width:100%;height:100%;padding:0;border:0;background:none;cursor:zoom-in}.results-gallery .result-card img{width:100%;height:100%;max-height:none;aspect-ratio:auto;object-fit:contain;display:block}.result-index{position:absolute;left:10px;top:10px;min-width:30px;height:25px;display:grid;place-items:center;padding:0 7px;border-radius:13px;background:#171716e0;color:#fff;font-size:10px;font-weight:700;pointer-events:none}.result-copy{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:15px 15px 13px}.result-copy h2{margin:0;color:#292927;font-size:13px;line-height:1.4;font-weight:680}.result-copy p{margin:6px 0 0;color:#70706c;font-size:11px;line-height:1.5}.ratio-pill{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:24px;padding:0 8px;border:1px solid #dededa;border-radius:12px;background:#f7f7f4;color:#696965;font-size:10px}.result-footer{min-height:44px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 15px;border-top:1px solid #e2e2dc;color:#70706c;font-size:10px}.result-card-actions{display:flex;align-items:center;gap:12px;flex-shrink:0}.result-card-actions button{padding:4px 0;border:0;background:transparent;color:#383836;font-size:11px;font-weight:600}.image-failure{z-index:1;text-align:center;font-size:13px;color:#8b6f65;padding:20px;pointer-events:none}.image-failure small{display:block;margin-top:10px;line-height:1.7;font-size:11px;color:#999}@media(max-width:1100px){.results-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}.state-completed .result-heading{flex-wrap:wrap}.results-actions{flex-wrap:wrap}}@media(max-width:450px){.results-gallery{grid-template-columns:1fr}}
/* History: image-only collage on the left, record metadata on the right. */
.history-panel{width:min(840px,100%)}.history-item{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:22px;padding:18px;align-items:center}.history-info{min-width:0}.history-meta{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}.history-meta .status{float:none;white-space:nowrap}.history-item .history-description{font-size:13px;line-height:1.8;margin:14px 0;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden}.history-info .muted{font-size:12px;margin:0}.history-collage{display:grid;grid-template-columns:1.1fr 1fr 1fr;grid-auto-rows:1fr;gap:3px;aspect-ratio:1.15;border-radius:12px;overflow:hidden;background:#efefec;min-width:0}.history-collage>div{min-width:0;min-height:0;overflow:hidden;background:#f1f1ed}.history-collage img{display:block;width:100%;height:100%;object-fit:cover}.history-collage .collage-hero{grid-column:1;grid-row:1 / span 3}.history-collage .collage-hero img{object-fit:contain;background:#efefec}.history-collage[data-count="1"]{grid-template-columns:1fr}.history-collage[data-count="2"]{grid-template-columns:1fr 1fr}.history-collage[data-count="2"] .collage-detail{grid-row:1 / span 3}.history-collage[data-count="3"] .collage-hero{grid-row:1 / span 2}.history-collage[data-count="3"] .collage-detail{grid-column:2 / span 2}.history-collage[data-count="4"] .collage-detail:last-child{grid-column:2 / span 2;grid-row:2 / span 2}.history-collage[data-count="5"] .collage-hero{grid-row:1 / span 2}.history-collage[data-count="6"] .collage-detail:last-child{grid-column:2 / span 2}.history-collage.collage-empty{background:linear-gradient(135deg,#f3f3f0,#e9e9e5)}.history-collage .image-unavailable{background:repeating-linear-gradient(135deg,#eeeee9,#eeeee9 8px,#f4f4f1 8px,#f4f4f1 16px)}@media(max-width:560px){.history-panel{padding:20px 16px}.history-item{gap:12px;padding:12px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}.history-item .history-description{font-size:12px;line-height:1.6;-webkit-line-clamp:4;margin:10px 0}.history-meta{gap:6px}.history-meta time,.history-meta .status{font-size:10px}.history-info .muted{font-size:10px}}
.history-item{position:relative}
.history-open{position:absolute;inset:0;width:100%;background:transparent;border:0;border-radius:inherit;z-index:1}
.history-delete{position:relative;z-index:2;margin-top:12px;padding:6px 12px;border:1px solid #dec2bd;border-radius:6px;background:#fff;color:#a12e23;font-size:12px}
.history-delete:hover:not(:disabled){background:#fff1ee}
.history-delete:disabled{opacity:.55}
#historyFeedback{color:#555;font-size:13px}
#historyFeedback:empty{margin:0}

.segmented{position:relative;display:flex;gap:3px;padding:3px;margin-bottom:8px;border:1px solid #d6d6cf;border-radius:10px;background:#f1f1ee}.segmented label{flex:1;position:relative;cursor:pointer}.segmented input{position:absolute;opacity:0;width:1px;height:1px;margin:0}.segmented span{display:block;padding:8px 6px;border-radius:7px;text-align:center;font-size:13px;color:#55554f}.segmented input:checked+span{background:#171715;color:#fff;font-weight:600}.segmented input:focus-visible+span{outline:2px solid #171715;outline-offset:2px}.count-fields-inner{padding-top:10px}.skipped-parts{margin:12px 0 0;padding:10px 12px;border:1px dashed #d6d6cf;border-radius:8px;line-height:1.6}
.thumb .thumb-zoom{position:static;display:block;width:100%;height:100%;padding:0;border:0;border-radius:6px;background:none;color:inherit;cursor:zoom-in}.thumb .thumb-remove{z-index:1}.reference-zoom{flex:none;padding:0;border:0;border-radius:5px;background:none;line-height:0;cursor:zoom-in}.thumb-zoom:hover img,.reference-zoom:hover img{opacity:.85}.thumb-zoom:focus-visible,.reference-zoom:focus-visible{outline:2px solid #171715;outline-offset:2px}

/* 数量方式切换动效：滑块左右滑动，说明与数量输入框按高度渐变切换 */
.segmented span{position:relative;z-index:1;transition:color .25s ease,background-color .25s ease}
@supports selector(:has(*)){
.segmented::before{content:"";position:absolute;top:3px;bottom:3px;left:3px;width:calc((100% - 9px)/2);border-radius:7px;background:#171715;box-shadow:0 1px 3px #0002;transition:transform .32s cubic-bezier(.3,.7,.2,1)}
.segmented:has(#manualCount:checked)::before{transform:translateX(calc(100% + 3px))}
.segmented input:checked+span{background:transparent}
}
.count-panel{display:grid;grid-template-rows:0fr;opacity:0;transform:translateY(-4px);transition:grid-template-rows .32s cubic-bezier(.3,.7,.2,1),opacity .2s ease,transform .32s cubic-bezier(.3,.7,.2,1)}
.count-panel.is-open{grid-template-rows:1fr;opacity:1;transform:none;transition-delay:0s,.08s,0s}
.count-panel>div{overflow:hidden;min-height:0}
@media(prefers-reduced-motion:reduce){.segmented::before,.segmented span,.count-panel{transition:none}}
