:root{font-family:"Segoe UI","Microsoft YaHei",sans-serif;color:#253b39;background:#edf2ee;font-synthesis:none;--accent:#a52e3c;--accent-hover:#872330;--ink:#253b39;--muted:#5d6a65;--border:#d6dfd9;--green:#244d43;--focus:#aa3846}
*{box-sizing:border-box}body{margin:0}button,input{font:inherit}button{cursor:pointer}button:disabled{cursor:default;opacity:.45}button, input{accent-color:var(--accent)}button:focus-visible,input:focus-visible,[tabindex]:focus-visible{outline:3px solid var(--focus);outline-offset:3px}::selection{background:#ecd1d3;color:#67232c}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.icon-defs{position:absolute;width:0;height:0;overflow:hidden}[hidden]{display:none!important}h1,h2,p{margin:0}button{transition:background .16s ease,color .16s ease}button:hover:enabled{filter:brightness(.97)}
.app-header{height:82px;background:var(--green);color:#f8f6ef;display:flex;align-items:center;justify-content:space-between;padding:0 32px;gap:24px}.brand,.header-actions{display:flex;align-items:center;gap:14px}.brand-mark{display:grid;place-items:center;width:38px;height:38px;background:#f6f0e4;color:var(--green);border-radius:9px}.brand-mark svg{width:25px;height:25px}h1{font-size:21px;font-weight:650;letter-spacing:.04em}.local-label{border-left:1px solid #7a9488;padding-left:14px;font-size:12px;color:#d0ded5}.privacy{font-size:12px;color:#d0ded5}.button{min-height:42px;padding:10px 16px;border:1px solid transparent;border-radius:6px;display:inline-flex;gap:8px;align-items:center;justify-content:center;font-size:13px;font-weight:600}.primary{background:var(--accent);color:#fff}.primary:hover:enabled{background:var(--accent-hover)}.secondary{background:#fff;border-color:var(--border);color:var(--ink)}.full{width:100%}.app-layout{display:grid;grid-template-columns:294px minmax(0,1fr);min-height:calc(100vh - 82px)}
.tools{background:#fcfcf8;border-right:1px solid var(--border);display:flex;flex-direction:column}.tool-section{padding:25px 24px;border-bottom:1px solid #e1e6e0}.tool-section h2{display:flex;gap:10px;align-items:center;font-size:14px;font-weight:650;margin-bottom:18px}.step{width:22px;height:22px;display:grid;place-items:center;background:#e7eee8;border-radius:50%;font-size:12px;color:#385b50;font-variant-numeric:tabular-nums}.upload-button{width:100%;height:72px;border:1px dashed #9baea3;background:#f1f5ef;color:var(--green);border-radius:6px;display:flex;gap:10px;align-items:center;justify-content:center;font-size:13px;font-weight:600}.caption{font-size:11px;color:var(--muted);line-height:1.85;margin-top:10px}.treatment{font-size:12px;color:#315f4e;display:flex;align-items:center;gap:6px;margin-top:18px}.treatment svg{width:16px;height:16px}.file-info{display:flex;gap:10px;margin-top:16px;align-items:center}.file-info div{min-width:0}.file-info strong{display:block;font-size:12px;font-weight:600;overflow-wrap:anywhere}.file-info span{display:block;font-size:11px;color:var(--muted);margin-top:5px}.stamp-preview{display:flex;align-items:center;gap:14px;margin:18px 0}.stamp-preview img{width:64px;height:64px;object-fit:contain;background:#f1f2ed;border:1px solid var(--border);border-radius:5px}.stamp-preview span{font-size:12px;color:var(--muted);overflow-wrap:anywhere;min-width:0}fieldset{border:0;padding:0;margin:24px 0 0;min-width:0}fieldset:disabled{opacity:.45}.control-title{display:flex;justify-content:space-between;align-items:center;font-size:12px}.control-title output{font-variant-numeric:tabular-nums;color:var(--muted)}input[type=range]{width:100%;margin:12px 0 22px;height:18px;cursor:pointer}input[type=range]:disabled{cursor:default}.text-button{border:0;background:none;color:#8b3942;font-size:12px;padding:4px 0}.export-notes p{font-size:12px;line-height:1.9;color:var(--muted)}.export-notes .caption{font-size:11px}.tool-footer{font-size:11px;color:var(--muted);padding:22px 24px;margin-top:auto}
.workspace{min-width:0;display:flex;flex-direction:column;height:calc(100vh - 82px)}.workspace-toolbar{min-height:60px;background:#f7f9f5;border-bottom:1px solid var(--border);padding:0 30px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px}.page-navigation{display:flex;align-items:center;gap:12px}.page-navigation>span{min-width:55px;text-align:center;font-variant-numeric:tabular-nums}.icon-button{border:1px solid var(--border);border-radius:5px;background:#fff;width:30px;height:30px;display:grid;place-items:center;color:var(--ink)}.icon-button svg{width:16px;height:16px}.flip{transform:rotate(180deg)}.work-area{overflow:auto;flex:1;min-height:0;padding:32px 38px;scrollbar-color:#aebdb2 #edf2ee;scrollbar-width:thin}.work-area.drag-over{background:#dee9df;outline:2px dashed var(--green);outline-offset:-10px}.empty-state{height:100%;min-height:420px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center}.empty-icon{width:82px;height:96px;display:grid;place-items:center;margin-bottom:26px;color:#557a64;background:#dfe8dd;border-radius:12px}.empty-icon svg{width:44px;height:44px;stroke-width:1.2}.empty-state h2{font-size:24px;font-weight:600;letter-spacing:.015em}.empty-state p{font-size:13px;line-height:1.9;color:var(--muted);margin:14px 0 25px}.empty-state .button{padding:12px 22px}.empty-note{font-size:11px;color:var(--muted);margin-top:18px}.page-shell{max-width:850px;margin:auto}.paper{position:relative;background:#fff;box-shadow:0 5px 24px #243a3917;isolation:isolate}.paper>canvas{display:block;width:100%;height:auto}.page-caption{font-size:11px;text-align:center;color:var(--muted);margin:18px 0 8px}.stamp-layer{position:absolute;transform:translate(-50%,-50%) rotate(var(--angle,0deg));touch-action:none;cursor:grab;outline:1px dashed #aa3846;user-select:none;z-index:1}.stamp-layer:active{cursor:grabbing}.stamp-layer:focus-visible{outline:2px solid var(--focus);outline-offset:3px}.stamp-layer img{display:block;width:100%;height:100%;pointer-events:none}.drag-label{position:absolute;top:-24px;left:50%;transform:translateX(-50%);white-space:nowrap;background:var(--accent);color:#fff;font-size:11px;line-height:20px;padding:0 7px;border-radius:3px;pointer-events:none}.workspace-footer{display:flex;justify-content:space-between;gap:14px;background:#f7f9f5;padding:13px 30px;border-top:1px solid var(--border);font-size:11px;color:var(--muted)}.status{margin:16px 30px 0;padding:12px 15px;background:#e0ebe2;border-radius:5px;color:#28533c;font-size:12px;line-height:1.65}.status.error{background:#f9e6e6;color:#8d2939}.status.busy{background:#fff2d8;color:#745220}.workspace[aria-busy=true] .paper{opacity:.6;pointer-events:none}dialog{border:1px solid var(--border);border-radius:10px;padding:28px;max-width:450px;color:var(--ink)}dialog::backdrop{background:#203b3955}dialog h2{font-size:19px;margin-bottom:14px}dialog p{font-size:13px;color:var(--muted);line-height:1.8}.dialog-actions{display:flex;gap:12px;justify-content:flex-end;margin-top:24px}
@media(min-width:1600px){.app-layout{grid-template-columns:320px minmax(0,1fr)}.tool-section{padding:27px 30px}.work-area{padding:40px}}
@media(max-width:850px){.app-header{padding:0 18px;height:70px}.privacy,.local-label{display:none}.app-layout{grid-template-columns:245px minmax(0,1fr);min-height:calc(100vh - 70px)}.workspace{height:calc(100vh - 70px)}.tool-section{padding:22px 17px}.work-area{padding:24px 16px}.workspace-toolbar{padding:0 16px}.workspace-footer{padding:12px 16px}.workspace-footer span:last-child{display:none}.empty-state h2{font-size:20px}}
@media(max-width:600px){.app-header{gap:8px;padding:0 14px}.brand{gap:9px}h1{font-size:17px}.brand-mark{width:32px;height:32px}.header-actions .button{font-size:12px;padding:10px}.header-actions .button svg{display:none}.app-layout{display:flex;flex-direction:column}.tools{border-right:0;display:grid;grid-template-columns:1fr 1fr}.tool-section{padding:18px 14px}.tool-section:nth-child(2){border-left:1px solid var(--border)}.tool-section h2{font-size:12px;gap:6px}.upload-button{font-size:12px;height:62px}.tools .button{font-size:11px;padding:10px 6px}.tools .button svg{display:none}.export-notes,.tool-footer{display:none}.workspace{height:auto;min-height:540px}.work-area{overflow:visible;min-height:440px}.empty-state{min-height:380px}.workspace-toolbar{min-height:54px}.caption{font-size:11px}.treatment{font-size:11px;gap:3px}.stamp-preview{gap:8px}.stamp-preview img{width:44px;height:44px}.stamp-preview span{font-size:11px}fieldset{margin-top:18px}.status{margin:12px 15px 0}}
.page-navigation select{border:1px solid var(--border);border-radius:5px;background:#fff;color:var(--ink);font:inherit;padding:5px 8px;min-height:30px;cursor:pointer}.page-navigation select:focus-visible{outline:3px solid var(--focus);outline-offset:2px}.workspace-toolbar{padding-top:12px;padding-bottom:12px}.empty-icon{background:none}
@media(min-width:601px){.tools{height:calc(100vh - 82px);overflow:auto;scrollbar-width:thin;scrollbar-color:#aebdb2 #fcfcf8}}
@media(min-width:601px) and (max-width:850px){.tools{height:calc(100vh - 70px)}}
@media(max-width:600px){.page-navigation{gap:7px}.page-navigation>span{min-width:42px}.page-navigation select{padding:5px;font-size:11px}}
@media(prefers-reduced-motion:reduce){button{transition:none}}
.white-removal{display:flex;align-items:center;gap:8px;margin:0 0 14px;font-size:12px;min-height:30px}.white-removal input{width:18px;height:18px}.stamp-preview img{background-color:#fff;background-image:linear-gradient(45deg,#e5e9e3 25%,transparent 25%),linear-gradient(-45deg,#e5e9e3 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e5e9e3 75%),linear-gradient(-45deg,transparent 75%,#e5e9e3 75%);background-size:12px 12px;background-position:0 0,0 6px,6px -6px,-6px 0}.mobile-adjust{display:none}.output-panel{position:fixed;bottom:18px;right:24px;z-index:5;background:#fcfcf8;box-shadow:0 6px 28px #183c342a;padding:18px 20px;border-radius:8px;max-width:calc(100vw - 32px);display:flex;align-items:center;gap:22px}.output-panel strong{display:block;font-size:14px}.output-panel>div:first-child{min-width:0}.output-panel span{display:block;font-size:12px;overflow-wrap:anywhere;color:var(--muted);margin-top:6px}.output-actions{display:flex;gap:10px;flex-shrink:0}
#preview-title{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
button,input,select{touch-action:manipulation}
.offline-panel{grid-column:1/-1}.offline-panel>p{font-size:12px;line-height:1.8;color:var(--muted)}.offline-panel .button{margin-top:12px}.offline-panel details{font-size:12px;line-height:1.8;color:var(--muted);margin-top:14px}.offline-panel summary{cursor:pointer;min-height:30px;color:var(--green)}.offline-panel details p{margin-top:10px}@media(max-width:767px){.offline-panel>p,.offline-panel details{font-size:13px}.offline-panel summary{min-height:44px;display:flex;align-items:center}}
.width-entry{display:flex;align-items:center;gap:5px;color:var(--muted);flex-shrink:0}.width-entry input{width:82px;min-height:36px;border:1px solid var(--border);border-radius:5px;padding:6px;background:#fff;color:var(--ink);text-align:right;font-variant-numeric:tabular-nums}.size-hint{font-size:11px;line-height:1.7;color:var(--muted);margin:-12px 0 20px}@media(max-width:767px){.width-entry input{width:76px;min-height:44px}.size-hint{font-size:12px;margin:0 0 16px}}
.paper>.seam-canvas{position:absolute;inset:0;pointer-events:none}.seam-section .white-removal{margin-bottom:0}.seam-section select{font:inherit;color:var(--ink);background:#fff;border:1px solid var(--border);border-radius:5px;padding:8px;min-height:36px}.seam-section .control-title:first-child{margin-bottom:20px}.tools #seam-controls{display:block}.seam-section{grid-column:1/-1}@media(max-width:767px){.seam-section select{min-height:44px}.seam-section .white-removal{font-size:14px}}
.startup-notice{max-width:680px;margin:64px auto;padding:30px;background:#fcfcf8;border-radius:12px}.startup-notice h2{font-size:22px;margin-bottom:16px}.startup-notice p,.startup-notice li{font-size:14px;line-height:1.85}.startup-notice ol{padding-left:22px;margin:20px 0}.startup-actions{display:flex;gap:12px;margin-bottom:16px}.startup-actions a{text-decoration:none}.startup-notice .caption{font-size:12px}@media(max-width:767px){.startup-notice{margin:28px 16px;padding:24px}.startup-notice h2{font-size:20px}.startup-actions .button{min-height:44px}}
@media(max-width:767px){
  .app-header{position:sticky;top:0;z-index:6;height:64px;padding:0 14px;gap:8px}.brand{gap:9px}h1{font-size:18px}.brand-mark{width:32px;height:32px}.local-label,.privacy{display:none}.header-actions .button{font-size:13px;min-height:44px;padding:10px 12px}.header-actions .button svg{display:none}
  .app-layout{display:flex;flex-direction:column;min-height:calc(100dvh - 64px)}.tools{height:auto;overflow:visible;border-right:0;display:grid;grid-template-columns:1fr 1fr}.tool-section{padding:16px 14px;min-width:0}.tool-section:nth-child(2){border-left:1px solid var(--border)}.tool-section h2{font-size:14px;gap:6px;margin-bottom:12px}.tools .button{font-size:13px;min-height:44px;padding:10px 7px}.tools .button svg{display:none}.upload-button{font-size:13px;min-height:62px}.caption,.file-info span,.stamp-preview span{font-size:12px;line-height:1.65}.treatment{font-size:12px;gap:4px}.file-info strong{font-size:13px}.file-info>svg{display:none}.stamp-preview{gap:8px;margin:12px 0}.stamp-preview img{width:42px;height:42px}.white-removal{font-size:12px;min-height:44px;margin-bottom:10px}.white-removal input{width:20px;height:20px;flex-shrink:0}.export-notes,.tool-footer{display:none}
  .mobile-adjust{display:flex;margin-top:12px}.tools fieldset{display:none;margin:18px 0 0}.tools fieldset.expanded{display:block}.control-title{font-size:14px}input[type=range]{min-height:44px;margin:5px 0 12px}.text-button{font-size:14px;min-height:44px}.workspace{height:auto;min-height:460px}.work-area{overflow:visible;min-height:380px;padding:20px 16px}.workspace-toolbar{position:sticky;top:64px;z-index:3;min-height:62px;padding:9px 14px;gap:8px;font-size:12px}.page-navigation{gap:5px}.page-navigation>span{min-width:36px}.icon-button{width:44px;height:44px}.page-navigation select{padding:7px 5px;min-height:44px;font-size:12px;max-width:85px}.status{margin:12px 16px 0;font-size:13px}.empty-state{min-height:330px}.empty-state h2{font-size:22px}.empty-state p{font-size:14px}.empty-note{font-size:12px}.paper{scroll-margin-top:140px}.stamp-layer::after{content:"";position:absolute;inset:-12px}.page-caption,.workspace-footer{font-size:12px}.workspace-footer{padding:14px 16px 120px}.workspace-footer span:last-child{display:none}
  .output-panel{left:0;right:0;bottom:0;max-width:none;border-radius:0;padding:14px 16px calc(14px + env(safe-area-inset-bottom));display:block;box-shadow:0 -4px 22px #183c3421}.output-panel span{max-height:2.6em;overflow:hidden}.output-actions{margin-top:12px}.output-actions .button{min-height:44px;font-size:14px;flex:1}
}
