:root{--lavender:#ddd6f4;--pink:#fdcdea;--mint:#e0f7ec;--bg:#f8f7fc;--surface:#fff;--text:#40374e;--muted:#7e748b;--primary:#806b9d;--border:#e9e4ef;--info-bg:#f0ecf8;--glass:rgba(255,255,255,.72);--shadow:0 12px 40px #40374e08;--spring:cubic-bezier(.2,.8,.2,1.15);color-scheme:light}
*,*::before,*::after{box-sizing:border-box}html{-webkit-text-size-adjust:100%}body{margin:0;color:var(--text);background:radial-gradient(ellipse at 8% 0%,#ddd6f465,transparent 48%),radial-gradient(ellipse at 100% 18%,#fdcdea45,transparent 40%),radial-gradient(ellipse at 70% 100%,#e0f7ec70,transparent 45%),var(--bg);background-attachment:fixed;font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans TC","Microsoft JhengHei",sans-serif}button,input,select{font:inherit}button{position:relative;isolation:isolate;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:transform .2s var(--spring),background .2s,border-color .2s,box-shadow .2s,color .2s,opacity .2s}button::after{content:"";position:absolute;inset:0;border-radius:inherit;background:linear-gradient(135deg,#ffffff65,transparent 65%);opacity:0;pointer-events:none;transition:opacity .2s;z-index:-1}button:hover:not(:disabled){transform:translateY(-1px)}button:hover:not(:disabled)::after{opacity:.8}button:active:not(:disabled){transform:translateY(1px) scale(.97)}button:disabled{opacity:.38;cursor:not-allowed}button:disabled::after{display:none}:focus-visible{outline:3px solid #b9a9d6;outline-offset:3px}[hidden]{display:none!important}.icon{width:20px;height:20px;flex:none;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;border:1px solid var(--border);padding:10px 16px;border-radius:14px;background:#fff;color:var(--text);font-size:16px;font-weight:550;white-space:nowrap;box-shadow:0 2px 6px #40374e03}.button:hover:not(:disabled){border-color:#cfc2df;background:#f9f7fd;box-shadow:0 5px 14px #40374e0a}.button-primary{border-color:#d1c5e8;background:var(--lavender);color:var(--text);box-shadow:inset 0 1px 0 #ffffff95,0 5px 15px #806b9d14}.button-primary:hover:not(:disabled){background:#d8cdef;border-color:#c3b3de;box-shadow:inset 0 1px 0 #ffffff95,0 7px 20px #806b9d24}.button-small{min-height:40px;padding:8px 12px;font-size:15px}.button-quiet{border:0;box-shadow:none;background:transparent;color:var(--muted)}.button-quiet:hover:not(:disabled){border:0;background:#eee9f580;box-shadow:none;color:var(--text)}.icon-button{width:38px;height:36px;display:inline-flex;align-items:center;justify-content:center;flex:none;background:transparent;border:0;border-radius:11px;color:var(--muted);font-size:23px;line-height:1}.icon-button:hover:not(:disabled){background:#ece6f5;color:var(--primary)}.icon-button[aria-pressed=true]{color:var(--primary);background:var(--lavender)}
.app-header{height:76px;display:flex;align-items:center;padding:0 32px;background:#ffffff80;border-bottom:1px solid #ffffffc9;backdrop-filter:blur(20px) saturate(135%);-webkit-backdrop-filter:blur(20px) saturate(135%)}.brand{display:flex;align-items:center;gap:12px}.brand-mark{width:37px;height:37px;display:grid;place-items:center;border-radius:12px;color:var(--text);background:var(--lavender);border:1px solid #ffffffad;box-shadow:inset 0 1px 0 #ffffffa0,0 3px 9px #806b9d13}.brand-mark .icon{width:25px;height:25px;stroke-width:1.5}.brand-name{font-size:25px;letter-spacing:-1px;font-weight:700}.brand-dot{color:var(--primary)}.brand-divider{height:23px;width:1px;background:#d9d1e4;margin:0 5px}.brand h1{font-size:16px;font-weight:500;margin:0;color:var(--muted)}.page{width:100%;max-width:1920px;margin:auto;padding:0 32px 26px}.visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;clip-path:inset(50%)}
.upload-card{min-height:calc(100svh - 102px);display:flex;align-items:center;justify-content:center;padding:30px 0}.drop-zone{width:min(620px,100%);padding:58px 30px 38px;text-align:center;border:1px solid #ffffffe0;border-radius:32px;background:#ffffff9e;box-shadow:inset 0 1px 0 #fff,0 24px 80px #806b9d0c;backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);transition:border-color .2s,box-shadow .2s,transform .25s var(--spring),background .2s}.drop-zone.is-dragover{border-color:#aa95c8;background:#f2ecffcc;box-shadow:inset 0 0 0 3px var(--lavender),0 24px 80px #806b9d19;transform:scale(1.015)}.upload-symbol{position:relative;margin:0 auto 25px;width:76px;height:76px;display:grid;place-items:center;border-radius:24px;color:var(--primary);border:1px solid #ffffffc9;background:linear-gradient(145deg,#ffffffed,#ddd6f4a8);box-shadow:inset 0 1px 0 #fff,0 8px 24px #806b9d0c}.upload-symbol>.icon{width:34px;height:34px;stroke-width:1.45}.mini-spark{position:absolute;right:-7px;top:-6px;width:28px;height:28px;display:grid;place-items:center;border:2px solid #fff;border-radius:10px;background:var(--pink);color:#80667b}.mini-spark .icon{width:19px;height:19px}.drop-zone h2{font-size:28px;letter-spacing:-.5px;font-weight:600;margin:0 0 32px}.drop-zone>.button{min-width:258px;min-height:60px;padding:14px 36px;border-radius:20px;font-size:21px;gap:12px}.drop-zone>.button .icon{width:24px;height:24px}.upload-options{display:flex;justify-content:center;align-items:center;gap:7px;flex-wrap:wrap;margin-top:23px;font-size:15px;color:var(--muted)}.paste-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:8px;border:0;border-radius:11px;color:var(--primary);background:transparent;font-size:15px}.paste-button:hover:not(:disabled){background:#eae2f6}.paste-button .icon{width:18px;height:18px}
#editor{padding-top:26px}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:24px;align-items:start}.canvas-column{position:relative;min-width:0;padding:0 16px 76px;border:1px solid #ffffffdf;border-radius:24px;background:#ffffffec;box-shadow:var(--shadow)}.toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:12px;height:94px;min-height:94px}.tool-buttons,.history-buttons,.navigation-pill{display:flex;align-items:center;border:1px solid #ffffffd9;background:var(--glass);backdrop-filter:blur(18px) saturate(120%);-webkit-backdrop-filter:blur(18px) saturate(120%);box-shadow:inset 0 1px 0 #fff,0 3px 12px #40374e06}.tool-buttons{justify-self:start;gap:2px;padding:5px;border-radius:17px;background:linear-gradient(135deg,#f3eef9bf,#f6f4fabf)}.tool-button{display:flex;justify-content:center;align-items:center;gap:7px;min-height:46px;padding:9px 11px;border:1px solid transparent;border-radius:12px;background:transparent;color:var(--muted);font-size:16px;white-space:nowrap;font-weight:500}.tool-button:hover{color:var(--text);background:#ffffff8c}.tool-button[aria-pressed=true]{background:var(--lavender);border-color:#ffffffb8;color:#57446f;box-shadow:inset 0 1px 0 #ffffffba,0 2px 5px #806b9d0d}.tool-button[data-tool=restore][aria-pressed=true]{background:var(--mint);color:#466758}.tool-button[data-tool=erase][aria-pressed=true]{background:var(--pink);color:#80556f}.tool-divider{height:23px;width:1px;background:#ded7e8;margin:0 3px}.toolbar .history-buttons{justify-self:center;gap:2px;padding:4px;border-radius:15px}.history-buttons .button{min-height:42px;padding:8px 9px;gap:6px;font-size:15px;border-radius:11px}.history-buttons .icon{width:18px;height:18px}.rerun-button{justify-self:end;font-size:15px;min-height:46px;padding:9px 13px;gap:7px;background:#fff0fa;border-color:#f1d9e9;color:#815f7b;box-shadow:inset 0 1px 0 #fff,0 3px 12px #fdcdea27}.rerun-button:hover:not(:disabled){background:#fde4f3;border-color:#ebc7e0;box-shadow:0 5px 15px #fdcdea55}.rerun-button .icon{width:19px;height:19px}
.split-view{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:16px}.image-pane{min-width:0;overflow:hidden;border:1px solid #e9e6ee;border-radius:17px;background:#fbfafc}.pane-header{height:54px;padding:0 18px;display:flex;align-items:center;border-bottom:1px solid #e9e6ee;background:#fbfafc}.pane-header h2{margin:0;font-size:16px;font-weight:600;letter-spacing:.1px}.canvas-stage{position:relative;height:clamp(380px,calc(100svh - 330px),960px);overflow:hidden;background:#f5f5f7}.canvas-stage canvas{display:block;width:100%;height:100%;touch-action:none;outline-offset:-4px}.view-bar{position:absolute;left:0;right:0;bottom:16px;display:flex;align-items:center;justify-content:center;pointer-events:none}.navigation-pill{gap:3px;padding:5px;border-radius:16px;pointer-events:auto}.navigation-pill .icon{width:19px;height:19px}.pill-divider{width:1px;height:19px;background:#e0d9e9;margin:0 5px}.selection-actions{position:absolute;left:50%;bottom:14px;transform:translateX(-50%);display:flex;gap:6px;padding:6px;border:1px solid #ffffffc9;border-radius:15px;background:#ffffffd9;box-shadow:0 5px 20px #40374e14;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);z-index:3}.selection-actions .button{white-space:nowrap}.busy-overlay{position:absolute;inset:0;display:grid;place-items:center;background:#f8f7fcbf;backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);z-index:5}.busy-card{display:flex;align-items:center;flex-direction:column;gap:16px;min-width:200px;max-width:calc(100% - 24px);padding:26px 22px 14px;border:1px solid #ffffffd9;border-radius:23px;background:#ffffffd9;box-shadow:0 8px 35px #40374e0c;text-align:center;font-size:16px}.spinner{width:30px;height:30px;border:3px solid var(--lavender);border-top-color:var(--primary);border-radius:50%;animation:spin .85s linear infinite}.busy-card progress{width:100%;height:5px;border:0;border-radius:9px;overflow:hidden;accent-color:var(--primary)}.busy-card progress::-webkit-progress-bar{background:#eee9f4;border-radius:9px}.busy-card progress::-webkit-progress-value{background:var(--primary);border-radius:9px}.busy-card progress::-moz-progress-bar{background:var(--primary)}.link-button{min-height:40px;border:0;border-radius:10px;background:transparent;color:var(--primary);font-size:14px;padding:6px 15px}.link-button:hover{background:var(--info-bg)}@keyframes spin{to{transform:rotate(360deg)}}
.sidebar{display:flex;flex-direction:column;gap:15px;min-width:0}.sidebar>#replaceButton{width:100%;min-height:48px;background:#ffffffb8;border-color:#ffffffde;box-shadow:inset 0 1px 0 #fff,0 3px 12px #40374e04}.sidebar>#replaceButton:hover{background:#f3eefb;border-color:#d9cce8}.controls{padding:0 23px 6px;border:1px solid #ffffffdf;border-radius:23px;background:#fffffff0;box-shadow:var(--shadow)}.controls-heading{height:65px;display:flex;align-items:center;margin-bottom:23px;border-bottom:1px solid var(--border);font-size:17px;font-weight:600}.controls fieldset{min-width:0;border:0;padding:0 0 24px;margin:0 0 23px;border-bottom:1px solid var(--border)}.controls legend{padding:0;font-size:16px;font-weight:550;margin-bottom:13px}.controls .background-panel{margin-bottom:0;padding-bottom:22px;border-bottom:0}.stepped-slider{position:relative;height:48px;margin-top:4px}.controls .stepped-slider input[type=range]{--fill:50%;display:block;width:100%;height:48px;padding:0;margin:0;appearance:none;-webkit-appearance:none;background:transparent;cursor:pointer;touch-action:pan-y;border:0;outline-offset:0;border-radius:16px}.stepped-slider input::-webkit-slider-runnable-track{height:8px;border-radius:8px;background:linear-gradient(to right,#ad9bc7 0,var(--lavender) var(--fill,50%),#eee9f4 var(--fill,50%) 100%);box-shadow:inset 0 1px 2px #40374e0a}.stepped-slider input::-webkit-slider-thumb{appearance:none;-webkit-appearance:none;width:28px;height:28px;margin-top:-10px;border:1px solid #fffffff0;border-radius:50%;background:radial-gradient(circle at center,#806b9d 0 2.5px,transparent 3px),linear-gradient(145deg,#fff,#f6f3fc);box-shadow:inset 0 1px 1px #fff,0 2px 6px #40374e30,0 0 0 1px #d9cfe7;transition:transform .18s var(--spring),box-shadow .18s}.stepped-slider input:hover::-webkit-slider-thumb{transform:scale(1.07);box-shadow:inset 0 1px 1px #fff,0 3px 8px #40374e30,0 0 0 4px #ddd6f450}.stepped-slider input:active::-webkit-slider-thumb{transform:scale(1.12);box-shadow:inset 0 1px 1px #fff,0 3px 8px #40374e30,0 0 0 6px #ddd6f465}.stepped-slider input::-moz-range-track{height:8px;border-radius:8px;background:#eee9f4;box-shadow:inset 0 1px 2px #40374e0a}.stepped-slider input::-moz-range-progress{height:8px;border-radius:8px;background:linear-gradient(to right,#ad9bc7,var(--lavender))}.stepped-slider input::-moz-range-thumb{width:26px;height:26px;border:1px solid #fffffff0;border-radius:50%;background:radial-gradient(circle at center,#806b9d 0 2.5px,transparent 3px),linear-gradient(145deg,#fff,#f6f3fc);box-shadow:0 2px 6px #40374e30,0 0 0 1px #d9cfe7;transition:transform .18s var(--spring),box-shadow .18s}.stepped-slider input:hover::-moz-range-thumb{transform:scale(1.07)}.stepped-slider input:active::-moz-range-thumb{transform:scale(1.12);box-shadow:0 3px 8px #40374e30,0 0 0 6px #ddd6f465}.slider-dots{position:absolute;left:14px;right:14px;top:21px;display:flex;justify-content:space-between;pointer-events:none}.slider-dots i{width:6px;height:6px;border-radius:50%;background:#b5a8ca;box-shadow:0 0 0 1px #ffffffc9;transition:opacity .15s}.slider-dots i[data-current=true]{opacity:0}.size-stops,.sensitivity-stops{display:flex;align-items:center;justify-content:space-between;gap:3px}.size-stops{margin:1px -7px 0}.size-stops button{display:grid;place-items:center;width:44px;height:44px;padding:8px;border:1px solid transparent;border-radius:14px;background:transparent;color:#ada1bc}.size-stops button:hover{background:#f4effa;color:var(--primary)}.size-stops button[aria-pressed=true]{color:var(--primary);border-color:#e0d6ee;background:#eee7f8;box-shadow:inset 0 1px 0 #fff}.brush-size-icon{width:24px;height:24px;fill:currentColor}.sensitivity-stops{margin-top:1px}.sensitivity-stops button{min-height:40px;min-width:44px;padding:7px 12px;border:1px solid transparent;border-radius:12px;background:transparent;color:var(--muted);font-size:15px}.sensitivity-stops button:hover{background:#f4effa}.sensitivity-stops button[aria-pressed=true]{border-color:#e5dcef;background:#f1eaf9;color:#6d5788;font-weight:550}.picked-color{display:flex;align-items:center;gap:10px;margin:22px 0 16px;font-size:14px;color:var(--muted)}.picked-swatch{width:27px;height:27px;flex:none;border:3px solid #fff;border-radius:9px;box-shadow:0 0 0 1px var(--border)}.segmented{display:flex;padding:4px;gap:4px;border:1px solid var(--border);border-radius:14px;background:#f7f5fa}.segmented button{flex:1;min-height:42px;border:0;border-radius:10px;background:transparent;color:var(--muted);font-size:15px}.segmented button[aria-pressed=true]{background:#fff;color:var(--primary);box-shadow:0 2px 6px #40374e09}.color-remove{width:100%;margin-top:13px;min-height:44px;font-size:15px;background:#f9f5fd;color:var(--primary)}.background-choices{display:flex;align-items:center;gap:15px;padding:4px 1px 0}.swatch,.palette-swatch{position:relative;width:36px;height:36px;flex:none;border:3px solid #fff;border-radius:50%;box-shadow:0 0 0 1px #e9e4ef}.swatch[aria-pressed=true],.palette-swatch.is-active{box-shadow:0 0 0 1px #fff,0 0 0 3px #a48abe}.checker{background:conic-gradient(#e5e4ec 25%,#fff 0 50%,#e5e4ec 0 75%,#fff 0) 0 0/12px 12px}.white{background:#fff}.black{background:#252330}.palette-swatch{display:grid;place-items:center;cursor:pointer;color:var(--muted);background:conic-gradient(#f3b8c7,#f4dfb3,#cbead4,#b8d9ea,#d4bfeb,#f3b8c7);transition:transform .2s var(--spring),box-shadow .2s;-webkit-tap-highlight-color:transparent}.palette-swatch span{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:#fff;font-size:22px;line-height:1;pointer-events:none}.palette-swatch:hover{transform:translateY(-1px) scale(1.05)}.palette-swatch:active{transform:scale(.95)}.palette-swatch input{position:absolute;inset:0;opacity:0;width:100%;height:100%;cursor:pointer}.palette-swatch:focus-within{outline:3px solid #b9a9d6;outline-offset:4px}.download-card{padding:16px;border:1px solid #ffffffdf;border-radius:23px;background:#fffffff0;box-shadow:var(--shadow)}.format-options{display:flex;gap:3px;padding:4px;margin-bottom:13px;border-radius:16px;background:#f1edf6;box-shadow:inset 0 1px 3px #40374e04}.format-options button{flex:1;min-height:40px;border:0;border-radius:12px;padding:7px 12px;background:transparent;color:var(--muted);font-size:16px;font-weight:550}.format-options button[aria-pressed=true]{background:#fff;color:#6e568d;box-shadow:0 2px 7px #40374e0b}.download-card>#downloadButton{width:100%;min-height:48px;font-size:17px}
.alert{position:fixed;z-index:30;left:50%;bottom:18px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 28px);padding:12px 18px;border:1px solid #eed5e3;border-radius:14px;background:#fff4fbdc;color:#925370;box-shadow:0 5px 25px #40374e0a;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);font-size:14px;pointer-events:none}
@media(min-width:1700px){.page{padding-left:48px;padding-right:48px}.app-header{padding:0 48px}.workspace{grid-template-columns:minmax(0,1fr) 320px;gap:26px}.canvas-column{padding-left:20px;padding-right:20px}}
@media(min-width:881px) and (max-width:1536px){.toolbar{gap:8px;height:98px;min-height:98px}.tool-buttons{gap:1px;padding:4px}.tool-button{flex-direction:column;gap:3px;min-height:64px;padding:7px 8px;font-size:15px}.tool-divider{display:none}.history-buttons .button{font-size:14px;padding:9px 8px;gap:5px}.history-buttons .icon{width:17px;height:17px}.toolbar .rerun-button{font-size:14px;padding:9px 11px;gap:6px}}
@media(max-width:1240px){.page{padding-left:20px;padding-right:20px}.app-header{padding:0 24px}.brand-divider,.brand h1{display:none}.workspace{grid-template-columns:minmax(0,1fr);gap:18px}.sidebar{gap:14px}.canvas-stage{height:clamp(350px,52svh,600px)}}
@media(max-width:880px){.app-header{height:68px}#editor{padding-top:18px}.brand-name{font-size:23px}.canvas-column{padding:0 12px 74px}.toolbar{grid-template-columns:1fr;gap:10px;height:auto;min-height:0;padding:14px 2px}.tool-buttons{grid-row:1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%;justify-self:stretch;gap:3px;padding:5px}.tool-button{flex-direction:column;padding:7px 4px;min-height:62px;font-size:15px;gap:5px}.tool-divider{display:none}.toolbar .history-buttons{grid-row:2;justify-self:center;gap:5px;padding:3px}.toolbar .history-buttons .button{font-size:15px;min-height:44px;padding:9px 13px;gap:7px}.toolbar .rerun-button{grid-row:3;width:100%;font-size:16px;min-height:46px}.split-view{gap:10px}.pane-header{height:46px;padding:0 13px}.pane-header h2{font-size:15px}.canvas-stage{height:46svh;min-height:280px;max-height:500px}.selection-actions{flex-direction:column;gap:4px;padding:4px;max-width:calc(100% - 12px);bottom:8px}.selection-actions .button{font-size:14px;padding:7px 9px;min-height:38px}.busy-card{min-width:0;width:calc(100% - 16px);max-width:none;padding:19px 9px 9px;font-size:14px;gap:13px}.busy-card .link-button{font-size:14px}.busy-card progress{max-width:160px}.upload-card{min-height:calc(100svh - 94px)}}
@media(max-width:560px){.app-header{height:66px;padding:0 20px}.page{padding-left:10px;padding-right:10px;padding-bottom:20px}.brand{gap:10px}.brand-mark{width:34px;height:34px;border-radius:11px}.brand-name{font-size:23px}.canvas-column{padding-left:6px;padding-right:6px;border-radius:20px}.toolbar{padding:11px 2px;gap:9px}.tool-buttons{border-radius:15px;padding:4px;gap:1px}.tool-button{font-size:14px;min-height:59px;border-radius:11px;gap:5px}.toolbar .history-buttons .button{font-size:14px;min-height:42px;padding:9px 12px}.toolbar .rerun-button{font-size:15px;min-height:44px}.split-view{gap:6px}.image-pane{border-radius:12px}.pane-header{height:44px;padding:0 10px}.pane-header h2{font-size:14px}.canvas-stage{height:43svh;min-height:260px;max-height:450px}.sidebar>.controls{padding:0 19px 5px;border-radius:20px}.controls-heading{height:60px}.download-card{padding:16px 19px;border-radius:20px}.selection-actions .button{font-size:13px;min-height:36px}.drop-zone{padding:40px 20px 30px;border-radius:27px}.drop-zone h2{font-size:25px;margin-bottom:29px}.drop-zone>.button{min-width:225px;min-height:58px;font-size:20px;padding:13px 25px}.upload-options,.paste-button{font-size:14px}.upload-options{gap:2px;margin-top:18px}.upload-card{min-height:calc(100svh - 86px);padding:20px 0}.alert{font-size:13px;padding:10px 14px}.busy-card{font-size:13px}.navigation-pill{gap:2px}}
@media(pointer:coarse){.navigation-pill .icon-button{width:42px;height:40px}.sensitivity-stops button{min-height:44px}}
@media(prefers-reduced-motion:reduce){button,button::after,.drop-zone,.palette-swatch,.slider-dots i{transition:none}.stepped-slider input::-webkit-slider-thumb{transition:none}.stepped-slider input::-moz-range-thumb{transition:none}.spinner{animation-duration:1.8s}}
