*{box-sizing:border-box;margin:0;padding:0}:root{--bg:#353535;--side:#292929;--panel:#4b4b4b;--card:#3c3c3c;--field:#363636;--line:#565656;--fg:#f3f3f3;--muted:#bebebe;--dim:#858585;--cyan:#11d9e6;--blue:#4b7df8;--orange:#ffb300;--red:#ef6262}html,body{height:100%}body{background:var(--bg);color:var(--fg);font:13px/1.45 "Microsoft YaHei UI","Microsoft YaHei","PingFang SC",Arial,sans-serif;overflow:hidden;user-select:none;-webkit-font-smoothing:antialiased}.hidden{display:none!important}.dim{color:var(--dim)}button,input,select,textarea{font:inherit}button{cursor:pointer}#app{height:100vh;display:flex}
#login-view{flex:1;display:flex;align-items:center;justify-content:center;background:linear-gradient(145deg,#272727,#3c4658)}.login-box{width:82%;max-width:290px;text-align:center}.login-logo{width:62px;height:62px;margin:0 auto 13px;border-radius:15px;line-height:62px;font-size:29px;font-weight:800;background:linear-gradient(135deg,var(--cyan),var(--blue))}.login-title{font-size:20px;font-weight:700}.login-sub,.login-hint{color:var(--muted);font-size:12px}.login-sub{margin:4px 0 24px}.login-hint{margin-top:13px}#key-input{width:100%;padding:11px;border:1px solid var(--line);border-radius:6px;background:var(--field);color:#fff;text-align:center;outline:0;margin-bottom:11px}#key-input:focus{border-color:var(--cyan)}
.cta{border:0;border-radius:22px;padding:11px 18px;color:#fff;font-weight:700;background:linear-gradient(90deg,#0fd7df,#4b79fa);box-shadow:0 3px 10px rgba(17,217,230,.16)}.cta:disabled{opacity:.5;cursor:default}#main-view{flex:1;display:flex;min-width:0}#side{width:40px;flex:0 0 40px;background:var(--side);border-right:1px solid #202020;display:flex;flex-direction:column;align-items:center;padding-top:7px}.side-logo{width:30px;height:30px;border-radius:5px;line-height:30px;text-align:center;background:linear-gradient(135deg,var(--cyan),var(--blue));font-weight:800;margin-bottom:10px}.side-btn{width:32px;height:36px;border:0;background:transparent;color:#ddd;font-size:12px;font-weight:700;border-radius:4px;margin:1px 0}.side-btn:hover,.side-btn.on{background:#4b4b4b;color:#fff}.side-version{margin-top:auto;margin-bottom:7px;padding:4px 2px;border:0;border-radius:4px;background:transparent;color:#777;font-size:9px;line-height:1.2;writing-mode:vertical-rl;cursor:default}.side-version.has-update{color:#ffe05c;background:#51491f;box-shadow:0 0 0 1px #8a762a;cursor:pointer;animation:updatePulse 1.5s ease-in-out infinite}.side-version.updating{color:var(--cyan);background:#29474a;cursor:default;animation:none}@keyframes updatePulse{50%{color:#fff3a0;background:#65591f}}#content{flex:1;display:flex;min-width:0}.view{display:none;flex:1;flex-direction:column;min-height:0}.view.on{display:flex}
#uhead,#uhead2,#uhead3{height:36px;flex:0 0 36px;display:flex;align-items:center;justify-content:space-between;padding:0 10px;background:#444;border-bottom:1px solid #5b5b5b}.user-line{display:flex;align-items:center;gap:7px;min-width:0}.user-icon{position:relative;width:14px;height:16px;flex:0 0 14px}.user-icon:before{content:"";position:absolute;left:4px;top:0;width:6px;height:6px;border-radius:50%;background:#e6e6e6}.user-icon:after{content:"";position:absolute;left:1px;bottom:0;width:12px;height:8px;border-radius:7px 7px 2px 2px;background:#e6e6e6}.user-line b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#uhead-quota{font-size:11px;color:#e7e7e7}.panel-title{height:33px;display:flex;align-items:center;gap:5px;padding:0 10px;background:#505050;border-bottom:1px solid #3c3c3c}.panel-title span{font-size:11px;color:#c8c8c8}.info-dot{display:inline-flex!important;align-items:center;justify-content:center;width:13px;height:13px;border:1px solid #aaa;border-radius:50%;font-size:9px!important;font-style:normal;font-weight:600;line-height:1;color:#bbb!important}#tool-switch{padding:5px 8px;background:#505050}.tool-tab{width:100%;height:38px;display:none;align-items:center;justify-content:flex-start;gap:8px;padding:0 12px;border:0;border-radius:4px;background:#3d3d3d;color:#fff;font-size:14px}.tool-tab.on{display:flex}.tool-tab .t-ico{display:inline-flex;align-items:center;justify-content:center;width:19px;height:19px;border-radius:4px;background:#574817;color:#ffd04b;font-size:10px;font-weight:700}.tool-tab:after{content:"v";margin-left:auto;font-size:11px;color:#ddd}.tool-menu-open .tool-tab{display:flex;border-radius:0}.tool-menu-open .tool-tab.on{background:#303030}.tool-menu-open .tool-tab:first-child{border-radius:4px 4px 0 0}.tool-menu-open .tool-tab:last-child{border-radius:0 0 4px 4px}
#main-scroll{flex:1;overflow:auto;min-height:0;background:#4b4b4b}#main-scroll::-webkit-scrollbar{width:5px}#main-scroll::-webkit-scrollbar-thumb{background:#747474}.block{border-bottom:1px solid #303030;padding:8px 10px}.sec-title{font-weight:700;font-size:14px;margin-bottom:6px}.sec-sub{font-size:10px;font-weight:400;color:#aaa}.chevron{float:right;font-size:17px}#img-drop{position:relative;min-height:66px;padding:5px;background:#3c3c3c;border:1px solid transparent;border-radius:4px;transition:.15s}#img-drop.drag{border-color:var(--cyan);background:#343f40}.drop-hint{position:absolute;right:8px;bottom:5px;color:#797979;font-size:10px;pointer-events:none}#img-row{display:flex;flex-wrap:wrap;gap:5px;min-height:54px}.img-cell,.img-add{width:54px;height:54px;border-radius:4px}.img-cell{position:relative;overflow:hidden;background:#282828;border:1px solid #666}.img-cell img{width:100%;height:100%;object-fit:cover}.img-cell .del{position:absolute;right:2px;top:2px;width:16px;height:16px;border-radius:50%;background:rgba(0,0,0,.75);line-height:16px;text-align:center;font-size:10px}.img-cell.stick:after{content:"\9009 \533A ";position:absolute;left:0;right:0;bottom:0;text-align:center;background:rgba(17,217,230,.8);font-size:9px;color:#111}.img-add{border:1px dashed #646464;background:#414141;color:#777;font-size:29px}.img-add:hover{color:var(--cyan);border-color:var(--cyan)}
.prompt-block{padding-bottom:9px}#prompt-input{display:block;width:100%;height:145px;resize:vertical;min-height:90px;max-height:260px;padding:12px 10px 32px;background:var(--field);color:#eee;border:0;border-radius:4px;outline:0;line-height:1.65;font-style:normal;letter-spacing:0}#prompt-input::placeholder{color:#969696;opacity:1;font-style:normal;letter-spacing:0}#prompt-input:focus{box-shadow:inset 0 0 0 1px #6a6a6a}.prompt-tools{height:27px;margin-top:-28px;padding:0 7px;position:relative;display:flex;align-items:center;justify-content:flex-end;gap:7px;color:#8b8b8b}.prompt-tools>span{margin-right:auto;font-size:10px}.icon-btn{width:24px;height:22px;background:transparent;border:0;color:#aaa;font-size:11px;font-weight:700}.icon-btn:hover{color:#fff}
.param-list{border-top:1px solid #5d5d5d}.p-row{min-height:39px;display:flex;align-items:center;padding:4px 10px;border-bottom:1px solid #333;background:#505050}.p-label{font-weight:600;font-size:13px;flex:1}.p-label small{font-weight:400;color:#bbb}#params select{width:126px;height:30px;border:0;border-radius:4px;padding:0 28px 0 10px;background:#3d3d3d;color:#fff;outline:0}.switch{width:34px;height:19px;border:0;border-radius:20px;background:#777;position:relative}.switch i{position:absolute;top:2px;left:2px;width:15px;height:15px;border-radius:50%;background:#fff;transition:.15s}.switch.on{background:var(--cyan)}.switch.on i{left:17px}
.result-block{min-height:185px}.result-empty{width:164px;height:132px;background:#3c3c3c;display:flex;align-items:center;justify-content:center;flex-direction:column;color:#ddd;gap:8px}.result-empty span{font-size:25px}.result-empty small{color:#888}#result-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.res-cell{position:relative;height:135px;overflow:hidden;background:#292929;border-radius:4px}.res-cell img{width:100%;height:100%;object-fit:contain}.res-cell .ins{position:absolute;left:7px;right:7px;bottom:6px;border:0;border-radius:4px;padding:5px;color:white;background:linear-gradient(90deg,#14cad9,#4e75f5)}#progress-box{padding:12px 2px}.bar{height:5px;background:#303030;border-radius:5px;overflow:hidden;margin:8px 0}#progress-fill{height:100%;width:2%;background:linear-gradient(90deg,var(--cyan),var(--blue));transition:.3s}.mini-btn{padding:5px 10px;border:1px solid #666;border-radius:4px;background:#414141;color:#ddd}.mini-btn.primary{border-color:var(--cyan)}.mini-btn.danger{color:#ff8c8c}.mini-btn.wide{width:calc(100% - 20px);margin:16px 10px;padding:9px}
#foot{flex:0 0 auto;padding:8px 10px 9px;background:#454545;border-top:1px solid #606060}#foot>div{display:flex;align-items:center;gap:5px;margin-bottom:7px;color:#eee}.coin{color:var(--orange);font-size:10px}#btn-gen{width:100%;font-size:14px;padding:10px}
#history-list{flex:1;overflow:auto;padding:10px}.hist-item{display:flex;gap:9px;padding:8px;margin-bottom:6px;background:#3c3c3c;border-radius:5px}.hist-item img{width:48px;height:48px;object-fit:cover;background:#222}.h-info{min-width:0}.h-tool{font-weight:600}.h-prompt{font-size:11px;color:#aaa;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.hist-empty{text-align:center;color:#999;padding-top:50px}.acc-card{margin:12px 10px;background:#404040;padding:4px 10px}.acc-row{display:flex;justify-content:space-between;padding:10px 0;border-bottom:1px solid #555}.about-box{margin:18px 10px;line-height:1.9}
#pop-mask{position:fixed;inset:0;background:rgba(0,0,0,.48);z-index:900}.pop{position:fixed;z-index:910;left:50%;top:50%;transform:translate(-50%,-50%);background:#414141;border:1px solid #777;box-shadow:0 8px 25px rgba(0,0,0,.45);border-radius:5px;padding:5px;min-width:150px}.pop-item{display:flex;width:100%;height:39px;align-items:center;border:0;background:transparent;color:#fff;text-align:left;padding:0 14px;white-space:nowrap}.pop-item:hover{background:#555}#menu-pop{left:8px;top:8px;transform:none;width:150px}.pop-open #params select{visibility:hidden}.imgpop{width:92%;max-width:360px}.imgpop img{display:block;max-width:100%;max-height:62vh;margin:auto}.imgpop-bar{display:flex;justify-content:center;gap:8px;margin-top:7px}.promptpop{width:92%;padding:10px}.pop-head{display:flex;justify-content:space-between;font-weight:700;margin-bottom:8px}.pop-head button{border:0;background:transparent;color:#fff;font-size:20px}.promptpop textarea{width:100%;height:48vh;resize:none;background:#303030;color:#fff;border:1px solid #666;padding:10px;outline:0;margin-bottom:8px}.promptpop .cta{width:100%}#toast{position:fixed;z-index:999;left:50%;bottom:68px;transform:translateX(-50%);max-width:86%;padding:8px 13px;border-radius:5px;background:rgba(18,18,18,.94);color:#fff;text-align:center;opacity:0;pointer-events:none;transition:.2s}#toast.show{opacity:1}
@media(max-width:270px){#side{width:35px;flex-basis:35px}.p-label{font-size:12px}#params select{width:110px}.result-empty{width:130px}}

/* CEP 6 / Chromium 41 compatibility. Keep this block free of CSS variables,
   flex gap, grid and inset so old Photoshop renders exactly like UXP. */
body{background:#353535;color:#f3f3f3;font-family:"Segoe UI","Microsoft YaHei UI","Microsoft YaHei",Arial,sans-serif}
#login-view{background:#2f3540;background:linear-gradient(145deg,#272727,#3c4658)}
#key-input{border-color:#565656;background:#363636}#key-input:focus{border-color:#11d9e6}
#side{background:#292929}.side-version.updating{color:#11d9e6}
.login-sub,.login-hint{color:#bebebe}.dim{color:#858585}
#img-drop.drag{border-color:#11d9e6}.img-add:hover{color:#11d9e6;border-color:#11d9e6}
#prompt-input{background:#363636}.switch.on{background:#11d9e6}
#progress-fill{background:#11d9e6;background:linear-gradient(90deg,#11d9e6,#4b7df8)}
.mini-btn.primary{border-color:#11d9e6}.coin{color:#ffb300}

.brand-mark{display:block;width:100%;height:100%;color:#fff}
.login-logo .brand-mark{width:42px;height:42px;margin:10px auto}
.side-logo .brand-mark{width:24px;height:24px;margin:3px auto}
.side-btn svg{display:block;width:17px;height:17px;margin:0 auto;fill:currentColor}
.icon-btn svg{display:block;width:15px;height:15px;margin:3px auto;fill:currentColor}
.t-ico svg{display:block;width:14px;height:14px;margin:2px auto;fill:currentColor}
.empty-image-icon svg{display:block;width:28px;height:28px;fill:currentColor}
.tool-tab:after{content:"";width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid #ddd;margin-left:auto}

.side-version{width:36px;min-height:22px;margin-top:auto;margin-bottom:7px;padding:4px 1px;white-space:nowrap;writing-mode:horizontal-tb;-webkit-writing-mode:horizontal-tb}
.user-line,.panel-title,.tool-tab,#img-row,.prompt-tools,.result-empty,#result-grid,#foot>div,.hist-item,.imgpop-bar{gap:0}
.user-line{flex:1;overflow:hidden}.user-line>*+*{margin-left:7px}#uhead-quota{flex:0 0 auto;white-space:nowrap;margin-left:6px}
.panel-title>*+*{margin-left:5px}.tool-tab>*+*{margin-left:8px}.tool-tab .tool-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#img-row{margin-right:-5px;margin-bottom:-5px}#img-row>*{margin-right:5px;margin-bottom:5px}
.drop-hint{left:68px;right:7px;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.img-add{position:relative;font-size:0}.plus-mark:before,.plus-mark:after{content:"";position:absolute;left:16px;top:26px;width:22px;height:2px;background:#8d8d8d}.plus-mark:after{transform:rotate(90deg);-webkit-transform:rotate(90deg)}.img-add:hover .plus-mark:before,.img-add:hover .plus-mark:after{background:#11d9e6}
.img-cell .del{font-size:0}.img-cell .del:before,.img-cell .del:after{content:"";position:absolute;left:3px;top:7px;width:10px;height:1px;background:#fff;transform:rotate(45deg);-webkit-transform:rotate(45deg)}.img-cell .del:after{transform:rotate(-45deg);-webkit-transform:rotate(-45deg)}

.prompt-block{position:relative}.chevron{float:right;width:8px;height:8px;margin:6px 3px 0 0;border-top:2px solid #ddd;border-left:2px solid #ddd;transform:rotate(45deg);-webkit-transform:rotate(45deg);font-size:0}
#prompt-input{height:118px;min-height:90px;max-height:240px;padding:10px;resize:none}
.prompt-tools{height:29px;margin-top:0;padding:0 7px;background:#363636;border-top:1px solid #494949}.prompt-tools>*+*{margin-left:7px}
.p-label{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.p-row>select,.p-row>.switch{flex:0 0 auto;margin-left:8px}

.result-empty>*+*{margin-top:8px}#result-grid{display:flex;flex-wrap:wrap;margin-right:-6px;margin-bottom:-6px}.res-cell{width:calc(50% - 6px);margin-right:6px;margin-bottom:6px}
#foot>div>*+*{margin-left:5px}.hist-item>*+*{margin-left:9px}.imgpop-bar>*+*{margin-left:8px}
#pop-mask{top:0;right:0;bottom:0;left:0}
.view{width:100%}#content{width:calc(100% - 40px)}
@media(max-width:270px){#content{width:calc(100% - 35px)}#params select{width:105px}.block{padding-left:8px;padding-right:8px}.p-row{padding-left:8px;padding-right:8px}}

/* Host-compositor compatibility: old CEP/UXP draws native text controls above
   HTML overlays unless they are explicitly hidden while a popup is open. */
.pop-open #main-scroll textarea,.pop-open #main-scroll input,.pop-open #main-scroll select{visibility:hidden!important}
#main-scroll{overflow-y:auto;overflow-x:hidden}
#content{width:auto;flex:1;overflow:hidden}.view{width:auto;min-width:0;overflow:hidden}
.tool-tab{position:relative}.tool-tab:after{position:absolute;right:12px;top:16px;margin-left:0}
.brand-mark{fill:#fff;stroke:#fff}
.side-btn svg{color:#ddd;fill:#ddd;stroke:#ddd}.side-btn.on svg,.side-btn:hover svg{fill:#fff;stroke:#fff}
.side-btn svg [fill="none"]{fill:none!important}.side-btn svg [stroke]{stroke:#ddd!important}.side-btn.on svg [stroke],.side-btn:hover svg [stroke]{stroke:#fff!important}
.t-ico svg{color:#ffd04b;fill:#ffd04b;stroke:#ffd04b}.t-ico svg [fill="none"]{fill:none!important}.t-ico svg [stroke]{stroke:#ffd04b!important}
.icon-btn svg{color:#bbb;fill:#bbb;stroke:#bbb}.icon-btn svg [fill="none"]{fill:none!important}.icon-btn svg [stroke]{stroke:#bbb!important}
.empty-image-icon svg{color:#ddd;fill:#ddd;stroke:#ddd}.empty-image-icon svg [fill="none"]{fill:none!important}.empty-image-icon svg [stroke]{stroke:#ddd!important}
