:root{color-scheme:light;--bg:#f9fafb;--panel:#ffffff;--panel-soft:#f8fafc;--panel-muted:rgba(255,255,255,0.8);--text:#111827;--muted:#6b7280;--line:#f3f4f6;--line-strong:#e5e7eb;--primary:#14b8a6;--primary-strong:#0d9488;--primary-deep:#0f766e;--primary-soft:#f0fdfa;--primary-soft-strong:#ccfbf1;--accent:#06b6d4;--accent-soft:#ecfeff;--success:#059669;--success-soft:#e6f7ef;--warning:#b45309;--warning-soft:#fff7ed;--danger:#dc2626;--danger-soft:#fef2f2;--shadow:0 1px 3px rgba(0,0,0,0.04),0 1px 2px rgba(0,0,0,0.06);--shadow-hover:0 10px 40px rgba(0,0,0,0.08);--shadow-glass:0 8px 32px rgba(0,0,0,0.08);--radius:8px;--radius-sm:8px;--radius-xs:6px;--focus:0 0 0 3px rgba(20,184,166,0.3);font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif}*{box-sizing:border-box}html{overflow-x:hidden}body{margin:0;background:linear-gradient(180deg,#ffffff 0,var(--bg) 168px),var(--bg);color:var(--text);min-height:100vh;-webkit-font-smoothing:antialiased;text-rendering:geometricPrecision;overflow-x:hidden}body::before{display:none}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled,input:disabled,select:disabled,textarea:disabled{cursor:not-allowed;opacity:0.65}.page{width:min(1760px,100%);margin:0 auto;padding:18px;position:relative;z-index:1}body.mask-scroll-lock .page::before{content:"";position:fixed;inset:0;z-index:80;background:rgba(15,23,42,0.48)}.topbar{position:sticky;top:12px;z-index:30;display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px;padding:12px 14px;border:1px solid rgba(229,231,235,0.65);border-radius:var(--radius);background:var(--panel-muted);box-shadow:var(--shadow);backdrop-filter:blur(18px)}.title-wrap{min-width:0}h1{margin:0;font-size:18px;line-height:1.35;font-weight:700;letter-spacing:0}.subtitle{margin:4px 0 0;color:var(--muted);font-size:13px;line-height:1.45}.shell{display:grid;grid-template-columns:minmax(320px,400px) minmax(0,1fr) minmax(280px,330px);gap:16px;align-items:stretch;min-height:0}body.no-header .topbar{display:none}body.no-header .shell{margin-top:20px}.panel{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);min-width:0;transition:border-color 0.2s ease,box-shadow 0.3s ease,transform 0.3s ease}.form-panel,.result-panel,.history-panel{padding:14px;overflow:auto;scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}.section{padding:14px 0;border-top:1px solid var(--line)}.section:first-child{border-top:0;padding-top:0}.section-title{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:10px}.section-title>div{min-width:0}.section-title h2,.section-title h3{margin:0;font-size:15px;line-height:1.3;color:var(--text);font-weight:700}.section-title p{margin:2px 0 0;color:var(--muted);font-size:12px}.field{display:grid;gap:6px;margin-bottom:10px}.field.inline{grid-template-columns:1fr 1fr;gap:10px}label,.label{color:#374151;font-size:14px;font-weight:600}.hint{color:var(--muted);font-size:12px;line-height:1.5;overflow-wrap:anywhere}.input,.select,.textarea{width:100%;border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:#fff;color:var(--text);outline:none;padding:10px 12px;min-height:42px;font-size:14px;transition:border-color 0.2s ease,box-shadow 0.2s ease,background 0.2s ease,transform 0.2s ease}.textarea{min-height:148px;resize:vertical;line-height:1.5}@media (hover:none) and (pointer:coarse){.input,.select,.textarea{font-size:16px}}.input:hover:not(:disabled),.select:hover:not(:disabled),.textarea:hover:not(:disabled){border-color:#d1d5db}.input[readonly]{background:var(--panel-soft);color:#475569;cursor:default}.input:focus,.select:focus,.textarea:focus{border-color:var(--primary);box-shadow:var(--focus)}.prompt-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:2px;flex-wrap:wrap}.prompt-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.prompt-count{color:var(--muted);font-size:12px;font-weight:650}.field-label-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}.label-help-row{justify-content:flex-start;gap:6px}.help-trigger{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;min-height:0;padding:0;border:1px solid #cbd5e1;border-radius:50%;background:#fff;color:var(--muted);font-size:12px;font-weight:800;line-height:1;box-shadow:none;cursor:help}.help-trigger:hover,.help-trigger:focus-visible{outline:none;border-color:var(--primary);color:var(--primary-deep);box-shadow:var(--focus)}.help-tooltip{position:fixed;z-index:140;max-width:min(280px,calc(100vw - 24px));padding:8px 10px;border-radius:var(--radius-xs);background:rgba(15,23,42,0.94);color:#fff;box-shadow:0 14px 36px rgba(15,23,42,0.24);font-size:12px;line-height:1.5;overflow-wrap:anywhere;pointer-events:none}.field-label-actions{display:flex;align-items:center;gap:10px;flex:0 0 auto;white-space:nowrap}.text-action{border:0;background:transparent;color:var(--success);padding:0;min-height:0;font-size:12px;font-weight:700;box-shadow:none;cursor:pointer}.text-action:hover,.text-action:focus-visible{color:var(--primary-deep);text-decoration:underline;box-shadow:none}.free-key-notice{margin-top:-2px;color:var(--success);font-weight:650}.key-balance-notice{margin-top:-2px;color:var(--danger);font-weight:650}.key-row,.action-row,.toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.key-row .input{flex:1 1 180px;min-width:0}.btn{min-width:0;min-height:42px;border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:#fff;color:#374151;padding:10px 14px;font-size:14px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:8px;box-shadow:0 1px 2px rgba(0,0,0,0.04);transition:background 0.2s ease,border-color 0.2s ease,color 0.2s ease,transform 0.2s ease,box-shadow 0.2s ease}.btn:hover:not(:disabled){border-color:#d1d5db;background:#f8fafc;box-shadow:var(--shadow)}.btn:focus-visible,.segment:focus-visible,.preview-close:focus-visible{outline:none;box-shadow:var(--focus)}.btn:active:not(:disabled){transform:scale(0.98)}.btn-primary{border-color:transparent;background:var(--primary);color:#fff;box-shadow:0 4px 12px rgba(20,184,166,0.25)}.btn-primary:hover:not(:disabled){border-color:transparent;background:var(--primary-strong);box-shadow:0 10px 20px rgba(20,184,166,0.3)}.btn-success{border-color:var(--success);background:var(--success);color:#fff}.btn-danger{border-color:transparent;color:#fff;background:var(--danger);box-shadow:0 4px 12px rgba(239,68,68,0.25)}.btn-danger:hover:not(:disabled){border-color:transparent;background:#b91c1c}.btn-text-danger{color:var(--danger);background:#fff;border-color:var(--line-strong);box-shadow:0 1px 2px rgba(0,0,0,0.04)}.btn-text-danger:hover:not(:disabled){color:#b91c1c;background:var(--danger-soft);border-color:#fecaca}.btn-sm{min-height:32px;padding:6px 12px;font-size:12px;border-radius:var(--radius-xs)}.btn-block{width:100%}.segmented{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:4px;border:1px solid var(--line);border-radius:var(--radius);background:var(--panel-soft)}.segment{min-width:0;border:1px solid transparent;background:transparent;color:#334155;border-radius:var(--radius-sm);min-height:38px;font-size:13px;font-weight:700;padding:8px;transition:background 0.2s ease,border-color 0.2s ease,color 0.2s ease}.segment.active{border-color:var(--primary);background:#fff;color:var(--primary-deep);box-shadow:0 1px 2px rgba(20,184,166,0.12)}.soft-box{border:1px solid var(--line);border-radius:var(--radius);background:var(--panel-soft);padding:12px}.source-panel{display:none;transition:border-color 0.2s ease,background 0.2s ease,box-shadow 0.2s ease}.source-panel.visible{display:block}.source-panel.drag-over{border-color:var(--primary);background:var(--primary-soft);box-shadow:var(--focus)}.source-header{display:flex;align-items:start;justify-content:space-between;gap:10px;margin-bottom:10px}.source-header>div{min-width:0}.source-header .btn-sm{flex:0 0 auto;white-space:nowrap}.file-input{display:none}.source-grid,.result-grid{display:grid;gap:10px}.source-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.source-item,.result-item,.history-item{border:1px solid var(--line);border-radius:var(--radius);background:#fff;overflow:hidden;box-shadow:0 1px 2px rgba(0,0,0,0.04)}.source-item,.result-item{transition:border-color 0.2s ease,box-shadow 0.2s ease,transform 0.2s ease}.source-item:hover,.result-item:hover{border-color:#d1d5db;box-shadow:var(--shadow)}.source-thumb{width:100%;aspect-ratio:4 / 3;object-fit:cover;display:block;background:#eef2f7}.source-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px;border-top:1px solid var(--line);font-size:12px}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.empty-box,.state-box{min-height:220px;border:1px dashed var(--line-strong);border-radius:var(--radius);background:var(--panel-soft);display:flex;align-items:center;justify-content:center;text-align:center;padding:24px;color:var(--muted);flex-direction:column;gap:8px}.empty-box>div,.state-box>div{max-width:100%;overflow-wrap:anywhere;word-break:break-word}.state-box{min-height:300px;gap:10px}.state-title{color:var(--text);font-weight:700;font-size:16px;overflow-wrap:anywhere}.spinner{width:28px;height:28px;border:3px solid var(--primary-soft-strong);border-top-color:var(--primary);border-radius:50%;animation:spin 0.85s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}details.config-details{border:1px solid var(--line);border-radius:var(--radius);background:#fff}details.config-details>summary{list-style:none;cursor:pointer;padding:11px 12px;font-weight:700;display:flex;align-items:center;justify-content:space-between;gap:8px}details.config-details>summary::-webkit-details-marker{display:none}.config-body{border-top:1px solid var(--line);padding:12px;display:grid;gap:10px}.config-summary{display:inline-flex;align-items:center;flex:0 0 auto;max-width:46%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid var(--line);border-radius:999px;padding:4px 8px;font-size:12px;font-weight:700;line-height:1.2}.config-summary.is-unconfigured{border-color:var(--line-strong);background:var(--panel-soft);color:var(--muted)}.config-summary.is-configured{border-color:#bbf7d0;background:var(--success-soft);color:var(--success)}.config-summary.is-error{border-color:#fecaca;background:var(--danger-soft);color:var(--danger)}details.config-details>summary h2{margin:0;font-size:15px;line-height:1.3}details.config-details>summary p{margin:2px 0 0;color:var(--muted);font-size:12px;font-weight:400;line-height:1.45}.custom-size{display:grid;margin-top:10px;gap:10px;grid-template-columns:1fr 1fr}.custom-size-hint{grid-column:1 / -1}.size-summary{margin-top:8px;color:var(--muted);font-size:12px;line-height:1.5}.size-summary.warning{color:var(--warning);font-weight:650}.mask-panel{display:none;margin-top:12px}.mask-panel.visible{display:block}.mask-panel.fullscreen{position:fixed;inset:14px;z-index:90;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow-glass);display:flex;flex-direction:column;overflow:hidden;padding:14px}#maskFullscreenButton{flex:0 0 auto;white-space:nowrap}.mask-tools{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:10px 0}.range-wrap{display:flex;align-items:center;gap:8px;min-width:min(100%,220px);border:1px solid var(--line);border-radius:var(--radius-sm);background:#fff;padding:6px 8px;font-size:12px;color:var(--muted)}.range-wrap input{min-width:80px;flex:1;accent-color:var(--primary)}.mask-frame{border:1px solid var(--line);border-radius:var(--radius);background:#fff;overflow:hidden}.fullscreen .mask-frame{min-height:0;flex:1;overflow:auto}.mask-canvas-wrap{position:relative;min-width:100%;background:#e2e8f0}.mask-canvas-wrap canvas{display:block;width:100%;height:auto}#maskDrawingCanvas{position:absolute;inset:0;touch-action:none;cursor:crosshair}.result-actions,.panel-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;flex-wrap:wrap;margin-bottom:12px}.panel-heading h2{margin:0;font-size:17px;line-height:1.35}.panel-heading p{margin:4px 0 0;color:var(--muted);font-size:13px;line-height:1.45}.result-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.result-image-button{position:relative;display:block;width:100%;border:0;padding:0;background:#eef2f7;min-height:220px;overflow:hidden}.result-image-button::after{content:"点击预览";position:absolute;right:10px;bottom:10px;border-radius:var(--radius-xs);background:rgba(15,23,42,0.72);color:#fff;padding:5px 8px;font-size:12px;opacity:0;transform:translateY(4px);transition:opacity 0.2s ease,transform 0.2s ease}.result-image-button:hover::after{opacity:1;transform:translateY(0)}.result-image{width:100%;max-height:460px;object-fit:contain;display:block}.result-body{padding:10px;border-top:1px solid var(--line);display:grid;gap:9px}.result-reference-button{flex:1 1 auto;white-space:nowrap}.result-image-wrap{position:relative}.result-download-button{position:absolute;top:10px;right:10px;z-index:1;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:1px solid rgba(255,255,255,.7);border-radius:8px;background:rgba(15,23,42,.68);color:#fff;box-shadow:0 2px 8px rgba(15,23,42,.18)}.result-download-button:hover,.result-download-button:focus-visible{background:rgba(15,23,42,.86);outline:none}.result-download-button:disabled{opacity:.55}.result-download-button .icon{width:18px;height:18px}.result-body>.toolbar{flex-wrap:nowrap}.result-meta{display:flex;align-items:start;justify-content:space-between;gap:8px;font-size:13px}.pill{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;background:#eef2f7;color:#475569;padding:4px 8px;font-size:12px;font-weight:700;white-space:nowrap}.pill.partial{background:var(--primary-soft);color:var(--primary-deep)}.revised{background:var(--panel-soft);border-radius:var(--radius);padding:8px;color:#475569;font-size:12px;line-height:1.55}.history-list{display:grid;gap:10px}.history-item{width:100%;text-align:left;padding:10px;transition:border-color 0.15s ease,background 0.15s ease}.history-item:hover{border-color:#d1d5db;background:#f8fafc}.history-item.active{border-color:var(--primary);background:var(--primary-soft)}.history-top{display:flex;justify-content:space-between;gap:8px;align-items:start;margin-bottom:8px}.history-badges{display:flex;flex:0 0 auto;flex-direction:column;align-items:flex-end;gap:6px}.history-time{font-weight:700;font-size:13px;color:var(--text)}.history-meta,.history-prompt{color:var(--muted);font-size:12px;line-height:1.45}.history-thumbs{margin-top:9px;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.history-thumb{position:relative;overflow:hidden;border-radius:6px;border:1px solid var(--line);background:#eef2f7;aspect-ratio:1 / 1}.history-thumb img{width:100%;height:100%;object-fit:cover;display:block}.history-more{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#fff;background:rgba(15,23,42,0.58);font-size:12px;font-weight:800}.prompt-polish-modal{position:fixed;inset:0;z-index:95;display:none;align-items:center;justify-content:center;padding:18px;background:rgba(15,23,42,0.52)}.prompt-polish-modal.visible{display:flex}.prompt-polish-dialog{width:min(1080px,calc(100vw - 24px));max-height:min(760px,calc(100dvh - 32px));display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:12px;border:1px solid var(--line);border-radius:var(--radius);background:#fff;box-shadow:0 24px 80px rgba(15,23,42,0.24);padding:14px}.prompt-polish-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.prompt-polish-header>div{min-width:0}.prompt-polish-header h2{margin:0;color:var(--text);font-size:17px;line-height:1.35}.prompt-polish-header p{margin:4px 0 0;color:var(--muted);font-size:13px;line-height:1.45;overflow-wrap:anywhere}.prompt-polish-close{flex:0 0 auto;width:34px;height:34px;min-height:0;padding:0;border:1px solid var(--line-strong);border-radius:50%;background:#fff;color:#475569;font-size:20px;line-height:1}.prompt-polish-close:hover,.prompt-polish-close:focus-visible{outline:none;border-color:var(--primary);color:var(--primary-deep);box-shadow:var(--focus)}.prompt-polish-options{min-height:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:stretch;gap:10px;overflow:auto;padding-right:2px;scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}.prompt-polish-option{width:100%;min-width:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:10px;border:1px solid var(--line-strong);border-radius:var(--radius);background:var(--panel-soft);color:var(--text);padding:12px;text-align:left;box-shadow:none;transition:border-color 0.2s ease,background 0.2s ease,box-shadow 0.2s ease}.prompt-polish-option:hover{border-color:var(--primary);background:#fff;box-shadow:var(--shadow)}.prompt-polish-option-title{color:var(--primary-deep);font-size:12px;font-weight:800;line-height:1.35}.prompt-polish-option-body{color:#1f2937;font-size:14px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere}.prompt-polish-option-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.prompt-polish-option-actions .btn{width:100%}.prompt-polish-state{grid-column:1 / -1;min-height:180px;display:flex;align-items:center;justify-content:center;border:1px dashed var(--line-strong);border-radius:var(--radius);background:var(--panel-soft);color:var(--muted);padding:20px;text-align:center;font-size:13px;line-height:1.5;overflow-wrap:anywhere}.prompt-polish-error{color:var(--danger);background:var(--danger-soft);border-color:#fecaca}.prompt-polish-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}.preview-modal{position:fixed;inset:0;z-index:100;display:none;align-items:center;justify-content:center;background:rgba(15,23,42,0.86);overflow:hidden;padding:18px}.preview-modal.visible{display:flex}.preview-title{position:absolute;top:14px;left:14px;max-width:calc(100vw - 92px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#fff;background:rgba(15,23,42,0.72);border-radius:999px;padding:7px 11px;font-size:13px}.preview-close{position:absolute;top:14px;right:14px;width:40px;height:40px;border-radius:50%;border:1px solid rgba(255,255,255,0.28);background:rgba(15,23,42,0.72);color:#fff;font-size:22px;line-height:1}.preview-image{max-width:92vw;max-height:86vh;object-fit:contain;border-radius:var(--radius);box-shadow:0 24px 80px rgba(0,0,0,0.45);will-change:transform;user-select:none}.preview-toolbar{position:absolute;left:50%;bottom:18px;transform:translateX(-50%);display:flex;align-items:center;gap:8px;padding:8px;border:1px solid rgba(255,255,255,0.22);border-radius:var(--radius);background:rgba(15,23,42,0.72);backdrop-filter:blur(12px)}.preview-toolbar .btn{min-height:34px;border-color:rgba(255,255,255,0.2);background:rgba(255,255,255,0.08);color:#fff;box-shadow:none}.preview-toolbar .btn:hover:not(:disabled){background:rgba(255,255,255,0.16)}.toast-host{position:fixed;z-index:120;right:16px;bottom:16px;display:grid;gap:8px;max-width:min(420px,calc(100vw - 32px))}.toast{border:1px solid var(--line);border-left-width:4px;border-radius:var(--radius);background:#fff;box-shadow:var(--shadow);padding:10px 12px;color:var(--text);font-size:13px;line-height:1.45;transition:opacity 0.2s ease,transform 0.2s ease}.toast.info{border-left-color:var(--primary)}.toast.success{border-left-color:var(--success)}.toast.warning{border-left-color:var(--warning)}.toast.error{border-left-color:var(--danger)}.hidden{display:none !important}body.mask-scroll-lock{overflow:hidden}.submit-section{position:sticky;bottom:-14px;z-index:8;margin:0 -14px -14px;padding:12px 14px;background:rgba(255,255,255,0.96);border-top:1px solid var(--line);backdrop-filter:blur(14px)}.submit-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}.submit-summary{min-width:0;color:var(--muted);font-size:12px;line-height:1.45}@media (min-width:1241px){html,body{height:100%;overflow:hidden}.page{height:100dvh;display:flex;flex-direction:column;overflow:hidden}.topbar{flex:0 0 auto}.shell{flex:1 1 auto;height:auto;overflow:hidden}.form-panel,.result-panel,.history-panel{height:100%;min-height:0;max-height:none}}@media (max-width:1240px){.shell{grid-template-columns:minmax(300px,390px) minmax(0,1fr);align-items:start;min-height:calc(100vh - 104px)}.history-panel{grid-column:1 / -1;max-height:none}.form-panel,.result-panel{max-height:none}}@media (min-width:768px){.page{padding:24px}}@media (min-width:1024px){.page{padding:0 32px 32px}}@media (max-width:840px){.page{padding:10px}.topbar{align-items:stretch;flex-direction:column;position:static}.shell{grid-template-columns:1fr}.result-grid{grid-template-columns:1fr}.field.inline,.custom-size{grid-template-columns:1fr}.segmented{grid-template-columns:1fr}.source-grid{grid-template-columns:1fr}.submit-bar{grid-template-columns:1fr}.submit-section .action-row{display:grid;grid-template-columns:1fr 1fr;justify-content:stretch;width:100%}.submit-section .btn{width:100%;flex:initial;padding-left:10px;padding-right:10px}.submit-section #submitButton{grid-column:1 / -1}.prompt-polish-dialog{max-height:calc(100dvh - 24px);padding:12px}.prompt-polish-options{grid-template-columns:1fr}.prompt-polish-actions{display:grid;grid-template-columns:1fr}.prompt-polish-actions .btn{width:100%}}:root{--bg:#eef6fb;--panel:#fff;--line:#e6eef5;--line-strong:#d8e5ef;--text:#16243b;--muted:#71839a;--primary:#18aeb2;--primary-strong:#0d969c;--radius:12px;--radius-sm:9px}body{background:radial-gradient(circle at 50% -20%,#fff 0,#eef6fb 58%,#e7f1f8 100%)}.page{width:100%;max-width:none;padding:0 20px 32px}.topbar{position:relative;top:auto;margin:0 -20px 20px;padding:16px 36px;min-height:72px;border:0;border-bottom:1px solid #e2edf5;border-radius:0 0 12px 12px;background:rgba(255,255,255,.72);box-shadow:0 4px 18px rgba(70,110,140,.06)}.brand{display:flex;align-items:center;gap:14px}.brand-mark{width:40px;height:40px;display:grid;place-items:center;border-radius:9px;color:#fff;font-size:21px;background:linear-gradient(145deg,#28c2bd,#138eaa);box-shadow:0 5px 12px rgba(18,157,171,.24)}h1{font-size:22px;letter-spacing:.02em}.subtitle{margin-top:2px;color:#53677f;font-size:14px}.top-actions{display:flex;align-items:center;gap:22px;color:#29405c;font-size:14px;font-weight:600}.api-status{padding:8px 13px;border-radius:20px;background:#e7f8f5;color:#159985}.api-status i{display:inline-block;width:8px;height:8px;margin-right:7px;border-radius:50%;background:#17aa84}.avatar{width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#e7eef6;font-size:20px}.shell{grid-template-columns:minmax(330px,385px) minmax(0,1fr) minmax(300px,385px);gap:14px}.panel{border:1px solid #e3edf4;border-radius:12px;box-shadow:0 8px 24px rgba(71,112,143,.08)}.form-panel,.result-panel,.history-panel{padding:20px}.section{padding:17px 0;border-top-color:#edf2f6}.section:first-child{padding-top:0}.section-title h2,.panel-heading h2{font-size:16px}.panel-heading{padding-bottom:14px;border-bottom:1px solid #edf2f6}.input,.select,.textarea{border-color:#d7e4ee;background:#fbfdff}.textarea{min-height:118px}.segmented{background:#f0f6fa;padding:3px;border-radius:9px}.segment{min-height:35px;border:0;border-radius:7px;color:#425a73;background:transparent}.segment.active{color:#fff;background:linear-gradient(135deg,#20b7b5,#159da8);box-shadow:0 3px 8px rgba(20,160,170,.2)}.btn{min-height:38px;border-radius:9px;border-color:#dce8f0;color:#35506b;background:#f7fafc}.btn-primary{background:linear-gradient(135deg,#20b7b5,#159ea9);border-color:transparent;color:#fff;box-shadow:0 5px 12px rgba(20,160,170,.22)}.result-panel{display:flex;flex-direction:column}.result-panel #resultBody{flex:1;display:flex;min-height:0}.result-panel .state-box{width:100%;margin:0;border:0;border-radius:10px;background:linear-gradient(145deg,#f7fbfd,#f1f7fb);justify-content:center;min-height:0}.result-panel .state-box:before{content:'✧';display:block;font-size:70px;color:#bdced9;margin-bottom:12px}.result-panel .state-box .state-title{font-size:20px;color:#182d46}.submit-section{margin:18px -20px -20px;padding:14px 20px}.submit-bar{grid-template-columns:1fr auto}.submit-section #submitButton{min-width:210px;font-size:17px}.history-list{gap:0}.history-item{border:0;border-bottom:1px solid #edf2f6;border-radius:0;padding:10px 0;box-shadow:none}.history-item:hover{background:#f7fbfd}.history-thumb{width:98px;height:76px;border-radius:8px}.history-top{padding-top:0}.history-meta,.history-prompt{color:#7a8da2}@media (max-width:840px){.page{padding:0 10px 20px}.topbar{margin:0 -10px 14px;padding:14px 18px}.top-actions{gap:8px}.shell{grid-template-columns:1fr}.result-panel{min-height:520px}}:root{--bg:#edf6fb;--panel:#fff;--line:#e5eef5;--line-strong:#d5e3ed;--text:#15243a;--muted:#7b8da3;--primary:#18aeb2;--primary-strong:#0f9ca3;--radius:12px;font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif}html,body{width:100%;min-height:100%;overflow:hidden}body{background:radial-gradient(circle at 50% -24%,#fff 0,#edf6fb 62%,#e7f1f8 100%);color:var(--text)}.icon-definitions{position:absolute;width:0;height:0;overflow:hidden}.icon{width:18px;height:18px;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:-4px}.page{width:100%;max-width:none;height:100dvh;margin:0;padding:0 20px 30px;display:flex;flex-direction:column;overflow:hidden}.topbar{position:relative;top:auto;flex:0 0 72px;min-height:72px;margin:0 -20px 20px;padding:0 36px;border:0;border-bottom:1px solid #e2edf5;border-radius:0 0 12px 12px;background:rgba(255,255,255,.76);box-shadow:0 4px 18px rgba(70,110,140,.06)}.brand-mark{width:40px;height:40px;border-radius:9px;background:linear-gradient(145deg,#29c4bd,#148da8);box-shadow:0 5px 12px rgba(18,157,171,.24)}.brand-mark svg{width:27px;height:27px}h1{font-size:22px;letter-spacing:.02em}.subtitle{margin-top:2px;color:#53677f;font-size:14px}.top-actions{gap:18px;color:#29405c;font-size:14px;font-weight:600}.api-status{padding:8px 13px;border-radius:20px;background:#e7f8f5;color:#159985}.api-status i{width:8px;height:8px;margin-right:7px;background:#17aa84}.avatar{border:0;color:#29405c}.shell{grid-template-columns:386px minmax(0,1fr) 386px;gap:13px;flex:1 1 auto;height:auto;min-height:0;align-items:stretch}.panel{height:100%;border:1px solid #e3edf4;border-radius:12px;box-shadow:0 8px 24px rgba(71,112,143,.08);overflow:hidden}.form-panel{padding:0;display:flex;flex-direction:column}.form-heading{flex:0 0 60px;display:flex;align-items:center;gap:11px;padding:0 20px;border-bottom:1px solid #edf2f6}.form-heading h2{margin:0;font-size:17px}.form-heading .icon{color:#243955}.form-content{min-height:0;overflow-y:auto;overflow-x:hidden;padding:0 20px 18px;scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}.form-panel .section{padding:14px 0;border-top:1px solid #edf2f6}.form-panel .section:first-child{border-top:0}.config-details{border:0 !important;border-radius:0 !important;background:none !important}.config-details>summary{padding:0 0 10px !important;border:0;cursor:default;justify-content:flex-start !important}.config-details>summary h2{display:flex;align-items:center;gap:9px;margin:0;font-size:15px}.config-details>summary .icon{width:18px;height:18px}.config-details>summary::marker{display:none}.config-details>summary::-webkit-details-marker{display:none}.config-body{display:grid;gap:9px;border-top:1px solid #edf2f6;padding:12px 0 0}.api-key-field{display:grid;grid-template-columns:100px minmax(0,1fr);align-items:center;gap:6px 10px}.api-key-field .field-label-row{display:contents}.api-key-field .field-label-row label{grid-column:1;grid-row:1}.api-key-field .key-row{grid-column:2;grid-row:1}.api-key-field .hint{grid-column:2}.form-panel label,.form-panel .label{color:#2b3d55;font-size:13px;font-weight:700}.api-key-field .input{min-height:35px;height:35px;padding:6px 10px;font-size:13px;border-radius:9px}.api-url-field{display:grid;grid-template-columns:100px minmax(0,1fr);align-items:center;gap:10px;margin:0}.api-url-field .input{min-height:35px;height:35px;padding:6px 10px;font-size:13px;border-radius:9px}.key-row{gap:8px}.key-row .input{flex:1}#toggleKeyButton{width:35px;padding:6px;color:#71869d}#toggleKeyButton .icon{width:16px;height:16px}.connection-ok{color:#1da67e;font-size:12px;font-weight:700}.config-body .action-row{justify-content:space-between;align-items:center;margin-left:110px}.config-body .action-row .config-summary{order:0;flex:1;min-width:0;max-width:none;border:0;padding:0;background:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal;line-height:1.5}.config-body .action-row{flex-wrap:nowrap}.config-body .action-row{min-width:0}#saveConfigButton{flex-shrink:0}.config-summary.is-checking{color:#2672b3}.api-status{display:inline-flex;align-items:center;max-width:260px}.api-status>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.api-status i{flex-shrink:0;background:currentColor}.api-status[data-state="is-unconfigured"]{color:var(--muted);background:var(--panel-soft)}.api-status[data-state="is-checking"]{color:#2672b3;background:#eaf4fc}.api-status[data-state="is-error"]{color:var(--danger);background:var(--danger-soft)}#saveConfigButton{min-height:33px;min-width:92px;padding:6px 12px}.free-key-notice{display:none !important}.field-label-actions{display:none !important}.mode-field{margin-bottom:0}.mode-field>.label,.prompt-field label,.size-section label,.size-label{display:flex;align-items:center;gap:8px}.mode-field>.label .icon,.prompt-field label .icon,.size-label .icon{width:17px;height:17px}.segmented{gap:7px;padding:3px;margin-top:0;border:0;border-radius:9px;background:#f0f6fa}.segment{min-height:35px;border:0;border-radius:7px;color:#425a73;background:transparent;font-size:13px}.segment.active{color:#fff;background:linear-gradient(135deg,#20b7b5,#159da8);box-shadow:0 3px 8px rgba(20,160,170,.2)}#promptPolishButton,#promptHint{display:none !important}.model-row{margin:14px 0 0}.model-row>.field{grid-template-columns:80px minmax(0,1fr);align-items:center;margin:0}.model-row>.field:last-child{grid-template-columns:42px minmax(0,1fr)}.model-row .select{min-height:35px;padding:6px 36px 6px 12px;font-size:13px;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23334c67' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;background-size:16px 16px}.model-select-row{display:flex;align-items:center;gap:8px;min-width:0}.model-select-row .select{flex:1 1 auto;min-width:0}.model-refresh-button{flex:0 0 36px;width:36px;min-height:35px;padding:4px 0;font-size:20px;line-height:1}.prompt-actions{display:none}body.has-prompt .prompt-actions{display:flex}.prompt-field{margin:14px 0 0}.prompt-field .field-label-row{margin-bottom:6px}.textarea{min-height:118px;height:118px;resize:none;padding:10px 12px;border-color:#d7e4ee;border-radius:9px;background:#fbfdff;font-size:13px;line-height:1.65}.prompt-editor{display:flex;flex-direction:column;min-width:0;height:128px;border:1px solid #d7e4ee;border-radius:9px;background:#fbfdff;overflow:hidden}.prompt-editor:focus-within{border-color:var(--primary);box-shadow:var(--focus)}.prompt-editor .textarea{display:block;flex:1;min-height:0;height:auto;padding:10px 12px 0;border:0;border-radius:0;box-shadow:none}.prompt-toolbar{justify-content:flex-end;flex-wrap:nowrap;flex:0 0 38px;margin:0;position:static;padding:2px 10px 8px}.prompt-toolbar .btn{min-height:28px;height:28px;padding:3px 10px}.prompt-count{color:#91a1b3;font-size:12px}.source-panel{display:block !important;margin-top:14px;padding:0;border:0;background:transparent}.source-header{margin-bottom:8px}.source-header .hint,.source-header>div+label{display:none}.source-header .label{display:flex;align-items:center;gap:8px}.source-header .btn-sm{display:none}.source-panel .empty-box{min-height:74px;height:74px;border:1px dashed #cfdfe9;border-radius:9px;background:#fbfdff;padding:10px;gap:4px;color:#91a1b3;font-size:12px}.source-panel .empty-box .state-title{color:#5c7188;font-size:13px;font-weight:600}.mask-panel{display:none}.mask-panel.visible{display:block}.size-section{padding-top:14px !important}.size-section .field{margin-bottom:0}.size-presets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-top:8px}.provider-segmented{width:100%;grid-template-columns:repeat(2,minmax(0,1fr))}.provider-field{flex:0 0 auto;padding:12px 20px;background:var(--panel);border-bottom:1px solid #edf2f6}body[data-provider="banana"]{--primary:#1d4ed8;--primary-strong:#1e40af;--primary-deep:#1e3a8a;--primary-soft:#eff6ff;--primary-soft-strong:#dbeafe;--focus:0 0 0 3px rgba(29,78,216,.3)}body[data-provider="banana"] .segment.active,body[data-provider="banana"] .btn-primary{background:linear-gradient(135deg,#2563eb,#1d4ed8);box-shadow:0 4px 12px rgba(29,78,216,.25)}body[data-provider="banana"] .size-preset.active{border-color:#1d4ed8;color:#1d4ed8;background:#dbeafe;box-shadow:inset 0 0 0 1px #1d4ed8}body[data-provider="banana"] .api-status{background:#dbeafe;color:#1d4ed8}body[data-provider="banana"] .brand-mark{background:linear-gradient(145deg,#3b82f6,#1d4ed8);box-shadow:0 5px 12px rgba(29,78,216,.24)}body[data-provider="banana"] .history-auto input{accent-color:#1d4ed8}.provider-segmented .segment[data-provider="banana"].active{background:#1d4ed8;box-shadow:0 3px 8px rgba(29,78,216,.2)}.banana-ratio-presets button[data-banana-ratio="auto"]{grid-column:1 / -1}.banana-ratio-presets .size-preset.active,.banana-resolution-presets .size-preset.active{color:#1d4ed8;border-color:#1d4ed8;background:#dbeafe}.size-preset{min-height:35px;border:1px solid #d8e5ef;border-radius:8px;background:#fbfdff;color:#334c67;font-size:13px}.size-preset.active{border-color:#13aeb1;color:#119ea3;background:#f2fbfb;box-shadow:inset 0 0 0 1px #13aeb1}.result-panel{padding:0;display:flex;flex-direction:column;container-type:inline-size}.result-panel .panel-heading{flex:0 0 60px;height:60px;margin:0;padding:0 20px;display:flex;align-items:center;border-bottom:1px solid #edf2f6}.result-panel .panel-heading h2,.history-panel .panel-heading h2{display:flex;align-items:center;gap:9px;font-size:16px}.result-panel .panel-heading p,.history-panel .panel-heading p{display:none}.canvas-clear{order:3;margin-left:auto;display:inline-flex;min-height:34px;padding:6px 12px}.result-panel #resultBody{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;overflow:auto;padding:2px 12px 0}.result-panel #resultBody>.result-grid{flex:0 0 auto;width:100%;align-items:start;padding-bottom:12px}.result-panel #resultBody>.state-box{flex:1}.result-panel .state-box{width:100%;min-height:0;margin:0;border:0;border-radius:10px;background:linear-gradient(145deg,#f7fbfd,#f1f7fb);justify-content:center;gap:0}.empty-art{width:320px;height:214px;margin-bottom:22px;background-image:url('/src/reference.png');background-size:1672px 941px;background-position:-674px -334px;background-repeat:no-repeat;opacity:.62}.result-panel .state-box .state-title{font-size:20px;line-height:28px;color:#172a43}.result-panel .state-box>div:not(.empty-art):not(.state-title){margin-top:10px;color:#788ca2;font-size:14px;line-height:26px}.submit-section{flex:0 0 100px;height:100px;margin:0;padding:0 18px;border-top:1px solid #edf2f6;background:rgba(255,255,255,.96)}.submit-bar{height:100%;display:grid;grid-template-columns:minmax(0,1fr) 284px minmax(0,1fr);align-items:center;gap:18px}.submit-info{display:flex;align-items:center;gap:14px;min-width:0}.generation-count{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;min-width:0}.generation-count label{color:#425a73;font-size:13px;font-weight:500;white-space:nowrap}.count-stepper{display:grid;grid-template-columns:30px 40px 30px;align-items:stretch;height:36px;border:1px solid #d8e5ef;border-radius:8px;background:#fbfdff}.count-stepper button{border:0;padding:0;background:transparent;color:#334c67;font-size:18px;border-radius:7px}.count-stepper button:hover:not(:disabled){background:var(--primary-soft);color:var(--primary-deep)}.count-stepper button:focus-visible{outline:2px solid var(--primary);outline-offset:1px}.count-stepper input{width:100%;min-width:0;border:0;border-left:1px solid #e5eef5;border-right:1px solid #e5eef5;border-radius:0;background:transparent;padding:0 2px;color:var(--text);font-size:14px;text-align:center;appearance:textfield}.count-stepper input::-webkit-inner-spin-button,.count-stepper input::-webkit-outer-spin-button{appearance:none;margin:0}.count-stepper input:focus{outline:2px solid var(--primary);outline-offset:-2px}.count-stepper input:invalid{outline:2px solid var(--danger);outline-offset:-2px}.submit-summary{display:none}.submit-section #submitButton{flex:0 0 284px;min-width:284px;height:60px;min-height:60px;border-radius:9px;font-size:17px;font-weight:700}.history-auto{display:flex;align-items:center;justify-self:end;gap:8px;min-width:0;color:#425a73;font-size:12px;font-weight:500}.history-auto input{width:18px;height:18px;accent-color:#19aeb0}.history-panel{padding:0;display:flex;flex-direction:column}.history-panel .panel-heading{flex:0 0 60px;height:60px;margin:0;padding:0 20px;align-items:center;border-bottom:1px solid #edf2f6}.history-panel .panel-heading>div{min-width:0}.history-clear{display:inline-flex;align-items:center;gap:6px;border:0;padding:6px 0;background:none;color:#71869d;font-size:12px;white-space:nowrap}.history-clear .icon{width:15px;height:15px}.history-panel #historyList{flex:1;min-height:0;overflow:auto;padding:0 20px;scrollbar-width:thin}.history-list{display:grid;gap:0;align-content:start}.history-item{width:100%;min-height:114px;display:grid;grid-template-columns:98px minmax(0,1fr);gap:14px;align-items:start;padding:10px 0;border:0;border-bottom:1px solid #edf2f6;border-radius:0;background:#fff;box-shadow:none;text-align:left;cursor:pointer}.history-item:hover{background:#f7fbfd}.history-cover{width:98px;height:91px;border-radius:8px;object-fit:cover;background:#e8f0f4}.history-copy{min-width:0;padding-top:2px}.history-title{display:flex;align-items:center;justify-content:space-between;gap:6px;color:#172a43;font-size:15px;font-weight:700;line-height:22px}.history-provider{flex:0 0 auto;padding:2px 7px;border-radius:999px;font-size:10px;font-weight:700;line-height:16px;letter-spacing:.02em}.history-provider-gpt{color:#0f766e;background:#ccfbf1}.history-provider-banana{color:#1d4ed8;background:#dbeafe}.history-title-text{min-width:0;flex:1 1 auto}.history-delete{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;border-radius:6px;background:transparent;color:#6f879e;cursor:pointer}.history-delete:hover,.history-delete:focus-visible{color:var(--danger);background:var(--danger-soft);outline:none}.history-delete .icon{width:16px;height:16px}.history-prompt{margin-top:2px;color:#71849a;font-size:12px;line-height:20px}.history-time{margin-top:4px;color:#8497ab;font-size:12px;line-height:18px;font-weight:500}.history-badges,.history-thumbs{display:none}body[data-mode="edit"] .source-header .btn-sm,body[data-mode="mask"] .source-header .btn-sm{display:inline-flex}@media (max-width:1240px){html,body{overflow:auto}.page{height:auto;min-height:100dvh;padding:0 12px 20px}.topbar{margin:0 -12px 14px;padding:0 18px}.shell{grid-template-columns:1fr}.panel{height:auto;min-height:520px}.form-content{overflow:visible}}@media (max-width:840px){.shell{grid-template-columns:1fr}.submit-bar{display:flex;flex-wrap:wrap;height:auto;padding:12px 0}.submit-section{height:auto}.submit-section #submitButton{flex:1 1 100%;min-width:0}.history-auto{width:100%}}.config-details[open]>summary{cursor:default}@container (max-width:660px){.submit-section{flex:0 0 auto;height:auto}.submit-bar{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);height:auto;padding:12px 0;gap:12px}.submit-info{grid-column:1;grid-row:1}.history-auto{grid-column:2;grid-row:1;width:auto}.submit-section #submitButton{grid-column:1 / -1;grid-row:2;justify-self:center;width:min(284px,100%);min-width:0}.result-panel .panel-heading{flex-basis:auto;height:auto;min-height:60px;padding:12px}}.result-panel .state-box::before{content:none !important;display:none !important}