:root{--ink:#20222a;--muted:#92959f;--line:#e9eaee;--canvas:#f8f9fb;--accent:#6c5ce7;--soft:#f0edfc;--radius:14px;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);font-size:14px;background:var(--canvas);font-synthesis:none}
*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer}button:disabled{cursor:wait;opacity:.55}button:focus-visible,a:focus-visible{outline:3px solid #c8bdf5;outline-offset:3px}button{color:inherit}a{color:inherit;text-decoration:none}[hidden]{display:none!important}svg{fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.sidebar{position:fixed;inset:0 auto 0 0;width:192px;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:32px 20px;z-index:10}.brand{display:flex;align-items:center;gap:11px;font-size:19px;font-weight:650;letter-spacing:1px;margin:0 10px 45px}.brand-icon{display:grid;place-items:center;background:var(--ink);color:white;font-size:25px;width:31px;height:31px;border-radius:9px;font-weight:400}.sidebar nav{display:grid;gap:8px}.nav-item{border:0;background:transparent;text-align:left;padding:13px 17px;display:flex;gap:14px;align-items:center;font-size:14px;border-radius:9px;color:#737680;transition:background .18s}.nav-item svg{width:19px;height:19px}.nav-item:hover{background:var(--canvas)}.nav-item.active{background:var(--soft);color:var(--accent);font-weight:600}.manage-link{margin-top:auto;font-size:12px;color:#858893;display:flex;justify-content:space-between;padding:12px 15px}.manage-link:hover{color:var(--accent)}
main{margin-left:192px;padding:36px 42px 40px;max-width:1740px}.page-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:28px}h1{font-size:25px;font-weight:600;margin:0;letter-spacing:-.5px}.service-state{display:flex;align-items:center;gap:7px;color:#777c87;font-size:12px}.dot{width:6px;height:6px;border-radius:50%;background:#b8bdc7}.service-state.ready .dot{background:#60ac86}.service-state.offline .dot{background:#cf886a}
.workspace{display:grid;grid-template-columns:360px minmax(300px,1fr);gap:24px;align-items:start}.editor,.result-panel{border:1px solid var(--line);border-radius:var(--radius);background:#fff}.editor{padding:26px}.field{margin-bottom:21px}.field:last-child{margin-bottom:0}.label{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:550;margin-bottom:10px;color:#4d515e}.optional{font-weight:400;color:var(--muted);font-size:11px}.info{background:transparent;border:1px solid #c5c9d0;color:#969ca7;padding:0;display:inline-grid;place-items:center;width:13px;height:13px;border-radius:50%;font:10px Georgia,serif;font-weight:600;line-height:1;flex:none}.info:hover,.info:focus{color:var(--accent);border-color:var(--accent)}.tooltip{position:fixed;z-index:99;background:#30323d;color:#fff;padding:11px 13px;font-size:12px;font-weight:400;line-height:1.7;border-radius:8px;max-width:258px;box-shadow:0 5px 20px #1515271a;pointer-events:none}
select,input[type=number],input[type=text],textarea{border:1px solid #e4e6eb;border-radius:8px;color:var(--ink);background:#fff;width:100%;padding:11px 12px;outline:none;transition:border-color .15s,box-shadow .15s;font-size:13px}select{appearance:none;background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239096a4' stroke-width='1.8'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center/14px no-repeat;padding-right:32px}textarea{resize:vertical;min-height:162px;line-height:1.85;padding:13px}textarea::placeholder,input::placeholder{color:#afb3be}input:focus,textarea:focus,select:focus{border-color:#a496ef;box-shadow:0 0 0 3px #6c5ce70c}.row{display:grid;grid-template-columns:1fr 1fr;gap:14px}.ratio-row{display:flex;gap:7px}.ratio-btn{width:20%;height:56px;border:1px solid var(--line);border-radius:8px;background:#fff;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:6px;font-size:10px;color:#8a8f9a}.ratio-btn .shape{display:block;border:1.4px solid currentColor;border-radius:2px;height:13px;width:13px}.ratio-btn[data-value=wide] .shape{width:20px;height:12px}.ratio-btn[data-value=tall] .shape{width:11px;height:18px}.ratio-btn[data-value=landscape] .shape{width:17px;height:13px}.ratio-btn[data-value=portrait] .shape{width:13px;height:17px}.ratio-btn.selected{border-color:#beb2f3;color:var(--accent);background:#faf8ff}
details{margin:4px 0 20px;border-top:1px solid #f0f1f4;padding-top:16px}summary{color:#898f99;cursor:pointer;font-size:12px;list-style:none;display:flex;justify-content:space-between}summary::-webkit-details-marker{display:none}summary::after{content:'+';font-size:16px;line-height:12px}details[open] summary::after{content:'−'}details[open] summary{margin-bottom:20px}.switch-row{display:flex;align-items:center;justify-content:space-between}.switch-row .label{margin:0}.switch{appearance:none;width:32px;height:19px;background:#d7d9df;border-radius:20px;cursor:pointer;position:relative;margin:0;transition:background .2s}.switch:checked{background:var(--accent)}.switch:after{content:'';position:absolute;top:3px;left:3px;width:13px;height:13px;border-radius:50%;background:#fff;transition:transform .2s}.switch:checked:after{transform:translateX(13px)}.switch:focus-visible{outline:2px solid #b7aaf0;outline-offset:3px}.drop{border:1px dashed #dcdde6;border-radius:9px;background:#fcfcfd;padding:18px 12px;text-align:center;min-height:85px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:9px;cursor:pointer;font-size:12px;color:#9297a2;width:100%}.drop:hover,.drop.drag{border-color:#b2a5ed;background:#faf8ff;color:var(--accent)}.drop .upload-icon{font-size:21px;color:#a3a8b2}.upload-entry{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:8px;padding:8px;margin-bottom:8px}.upload-entry img,.upload-entry video{width:44px;height:44px;object-fit:cover;border-radius:5px;background:#f0f0f4}.upload-meta{min-width:0;flex:1;font-size:11px;color:#9a9ea9;line-height:1.8}.upload-name{color:#595e6b;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.remove-upload{border:0;background:none;color:#b0b4bd;font-size:18px;padding:5px}.upload-progress{font-size:11px;color:var(--accent);margin-top:8px}.form-footer{margin-top:25px}.primary{background:var(--accent);color:white;border:0;border-radius:9px;padding:13px 18px;font-weight:550;width:100%;display:flex;align-items:center;justify-content:space-between}.primary:hover{background:#5f4ed8}.primary span{font-size:19px;font-weight:400;line-height:1}#form-error{background:#fff5f4;color:#be655b;font-size:12px;line-height:1.7;padding:10px;border-radius:8px}
.result-panel{overflow:hidden;min-height:580px;display:flex;flex-direction:column}.result-head{height:64px;padding:0 24px;display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#828895;border-bottom:1px solid #f3f3f6}#result-actions{display:flex;gap:8px;align-items:center}.small-btn{background:#fff;border:1px solid var(--line);border-radius:7px;padding:7px 11px;font-size:11px;line-height:1.3;color:#6e7380;display:inline-block}.small-btn:hover{color:var(--accent);border-color:#d2c9f6}.small-btn.danger:hover{color:#b8584e;border-color:#efd0cb}.preview{background:#fff;display:flex;align-items:center;justify-content:center;min-height:440px;max-height:710px;flex:1;position:relative;padding:22px}.preview>img,.preview>video{max-width:100%;width:auto;max-height:640px;height:auto;object-fit:contain;border-radius:7px}.preview .empty{display:flex;flex-direction:column;align-items:center;gap:18px;font-size:12px;color:#acb0ba}.empty svg{width:48px;height:48px;color:#d8dbe3;stroke-width:1.2}.result-footer{padding:17px 24px;border-top:1px solid #f3f3f6;font-size:11px;color:#969ca7;min-height:51px;display:flex;gap:12px;justify-content:space-between;align-items:center}.result-footer .meta{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.result-footer .mono{font-variant-numeric:tabular-nums;white-space:nowrap}.working{display:flex;flex-direction:column;align-items:center;gap:18px;color:#8b919b;text-align:center;max-width:360px}.working p{margin:0;font-size:13px}.working small{font-size:11px;color:#a2a6b0}.spinner{height:27px;width:27px;border:2px solid #eeebf9;border-top-color:#9280eb;border-radius:50%;animation:spin 1s linear infinite}.progress-track{width:160px;height:3px;background:#eeebf6;border-radius:6px;overflow:hidden}.progress-bar{height:100%;background:#9e8fe6;transition:width .5s}.error-card{color:#b26760;padding:30px;line-height:1.8;font-size:13px;overflow-wrap:anywhere}.history-section{margin-top:30px}.history-heading{display:flex;align-items:center;gap:10px;margin-bottom:16px}h2{font-size:13px;font-weight:550;margin:0;color:#656b77}#history-count{color:#a9aebb;font-size:11px}.history{display:grid;grid-template-columns:repeat(auto-fill,minmax(126px,1fr));gap:14px}.history-card{padding:0;background:white;border:1px solid var(--line);border-radius:10px;text-align:left;overflow:hidden;position:relative;min-width:0}.history-card.selected{border-color:#bdb0ee}.history-cover{aspect-ratio:1.7;background:#f0f1f5;display:flex;align-items:center;justify-content:center;color:#adb1bc;font-size:12px;position:relative}.history-cover img,.history-cover video{width:100%;height:100%;position:absolute;inset:0;object-fit:cover}.history-caption{padding:10px;line-height:1.7}.history-caption strong{display:block;font-size:11px;color:#6b7180;font-weight:500;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.history-caption span{color:#adb1bc;font-size:10px}.history-empty{font-size:12px;color:#aeb3bd;padding:8px 0}.toast{position:fixed;bottom:25px;left:50%;transform:translateX(-50%);background:#30323d;color:#fff;padding:11px 20px;border-radius:9px;font-size:12px;z-index:80;box-shadow:0 5px 25px #0001}
@keyframes spin{to{transform:rotate(360deg)}}@media(min-width:1500px){.workspace{grid-template-columns:385px minmax(400px,1fr)}.editor{padding:29px}.preview{min-height:515px}}@media(max-width:1150px){main{padding:28px 24px}.sidebar{width:166px;padding:28px 14px}.brand{font-size:17px;margin-left:7px}.workspace{grid-template-columns:320px minmax(250px,1fr);gap:18px}main{margin-left:166px}.editor{padding:22px}.preview{min-height:400px}.result-panel{min-height:515px}}@media(max-width:900px){.sidebar{width:78px;padding:24px 10px}.brand{font-size:0;margin:0 auto 35px;gap:0}.brand-icon{font-size:24px}.nav-item{padding:14px 0;justify-content:center;font-size:0;gap:0}.nav-item svg{width:21px;height:21px}.manage-link{padding:12px 0;font-size:0;justify-content:center}.manage-link span{font-size:20px}main{margin-left:78px;padding:28px 22px}.workspace{grid-template-columns:310px minmax(220px,1fr);gap:16px}.result-head{padding:0 17px}}@media(max-width:700px){.sidebar{position:sticky;top:0;width:100%;height:63px;border-right:0;border-bottom:1px solid var(--line);flex-direction:row;align-items:center;padding:0 16px;gap:20px}.brand{margin:0}.brand-icon{width:28px;height:28px;font-size:23px}.sidebar nav{display:flex;flex:1;gap:5px;justify-content:center}.nav-item{font-size:12px;gap:7px;padding:10px 12px}.nav-item svg{width:15px;height:15px}.manage-link{display:none}main{margin-left:0;padding:24px 16px}.page-header{margin-bottom:20px}h1{font-size:22px}.workspace{grid-template-columns:1fr}.editor{padding:22px}.result-panel{min-height:360px}.preview{min-height:260px;max-height:500px}.preview>img,.preview>video{max-height:440px}.result-head{height:54px}.history{grid-template-columns:repeat(3,1fr);gap:9px}.history-caption{padding:8px}textarea{min-height:135px}.history-section{margin-top:26px}.result-footer{padding:14px 17px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important;animation-duration:2s!important}}
@media(min-width:701px){.result-panel{position:sticky;top:24px}.preview>img,.preview>video{max-height:min(640px,70vh)}}

.prompt-tools{display:flex;align-items:center;gap:9px;margin:-11px 0 20px}.prompt-tools .small-btn{color:var(--accent);background:#fcfbff}.text-btn{border:0;background:none;font-size:11px;color:#92959f;padding:5px;margin-left:auto}.optimization-status{font-size:12px;color:#898093;line-height:1.7;margin:-9px 0 18px}#optimization-candidate{margin-bottom:20px}#optimization-candidate textarea{min-height:200px;margin-bottom:8px;font-size:12px;background:#fcfcfe}

.logout-button{border:0;background:none;color:#969ba5;font-size:12px;text-align:left;padding:10px 15px}.logout-button:hover{color:var(--accent)}.login-page{min-height:100vh;display:grid;place-items:center;padding:24px}.login-card{width:min(100%,360px);padding:38px 32px;background:white;border:1px solid var(--line);border-radius:16px}.login-card h1{display:flex;align-items:center;gap:12px;font-size:22px;margin:0 0 34px}.login-card input[type=password]{width:100%;border:1px solid #e4e6eb;border-radius:8px;padding:12px;outline:none;font:inherit}.login-card .primary{margin-top:22px;justify-content:center}.login-error{color:#be655b;font-size:12px;margin:12px 0 0;line-height:1.6}@media(max-width:900px){.logout-button{padding:9px 0;text-align:center;font-size:10px}}@media(max-width:700px){.logout-button{font-size:11px;white-space:nowrap}.sidebar{gap:10px}}

.manage-link[hidden]+.logout-button{margin-top:auto}
