:root{color-scheme:light;--bg:#f3f6f7;--surface:#fff;--surface-soft:#f7fafb;--surface-raised:#fff;--text:#18313c;--muted:#72858d;--line:#e2eaed;--line-strong:#d3e0e4;--brand:#176d71;--brand-strong:#12585d;--brand-soft:#e6f3f1;--accent:#e27e59;--danger:#c55252;--shadow:0 14px 38px rgba(20,57,69,.055);--radius:18px;--font:'DM Sans',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;--display:'Manrope','DM Sans',system-ui,sans-serif}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:14px;line-height:1.5;transition:background .2s,color .2s}button,input,select{font:inherit}button{cursor:pointer}button:disabled{cursor:not-allowed;opacity:.45}.app-shell{max-width:1500px;margin:0 auto;padding:0 46px}.topbar{height:82px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:11px;color:var(--text);text-decoration:none}.brand img{display:block;border-radius:12px}.brand-copy{display:flex;flex-direction:column;line-height:1.05}.brand-copy strong{font-family:var(--display);font-size:20px;font-weight:800;letter-spacing:.04em}.brand-copy small{font-size:9px;letter-spacing:.16em;color:var(--muted);font-weight:700;margin-top:5px}.top-actions{display:flex;align-items:center;gap:10px}.install-button{height:38px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 13px;border:1px solid var(--brand);border-radius:12px;background:var(--brand-soft);color:var(--brand);font-size:11px;font-weight:800;white-space:nowrap;transition:.18s}.install-button:hover{background:var(--brand);color:#fff;transform:translateY(-1px)}.install-button svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.install-button.install-ready{box-shadow:0 0 0 3px rgba(23,109,113,.12)}.privacy-chip{display:inline-flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:8px 13px;color:var(--muted);font-size:11px;font-weight:600;margin-right:6px}.status-dot{width:7px;height:7px;border-radius:50%;background:#45a482;box-shadow:0 0 0 3px rgba(69,164,130,.12)}.icon-button{height:38px;width:38px;border:1px solid var(--line);background:var(--surface);border-radius:12px;display:grid;place-items:center;color:var(--text);transition:.18s}.icon-button:hover{border-color:var(--brand);color:var(--brand);transform:translateY(-1px)}.icon-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.moon-icon{display:none}.main-content{padding-top:42px}.intro-row{display:flex;justify-content:space-between;align-items:flex-end;gap:32px;margin-bottom:29px}.eyebrow{display:flex;align-items:center;gap:9px;color:var(--brand);font-size:10px;font-weight:800;letter-spacing:.13em;margin-bottom:11px}.eyebrow-mark{width:18px;height:2px;border-radius:5px;background:var(--accent)}h1,h2,h3,p{margin-top:0}h1,h2,h3{font-family:var(--display)}h1{font-size:clamp(30px,3.5vw,43px);letter-spacing:-.045em;line-height:1.13;margin-bottom:10px;font-weight:800}.accent-text{color:var(--brand)}.intro-copy>p{font-size:14px;color:var(--muted);margin:0}.intro-meta{display:flex;gap:10px;padding-bottom:2px}.stat-card{min-width:100px;background:var(--surface);border:1px solid var(--line);border-radius:13px;padding:11px 14px;display:flex;flex-direction:column}.stat-number{font-family:var(--display);font-size:19px;font-weight:800;line-height:1.2}.stat-label{font-size:10px;color:var(--muted);margin-top:3px}.workspace-grid{display:grid;grid-template-columns:minmax(0,1.13fr) minmax(365px,.87fr);align-items:start;gap:20px}.left-column,.right-column{display:flex;flex-direction:column;gap:18px;min-width:0}.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);min-width:0}.source-panel{padding:24px}.panel-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:15px}.panel-heading h2{font-size:19px;letter-spacing:-.035em;margin:4px 0 4px;font-weight:800}.panel-subtitle{font-size:12px;color:var(--muted);margin:0}.step-label{color:var(--brand);font-size:9px;font-weight:800;letter-spacing:.13em}.text-button,.reset-button{background:transparent;border:0;color:var(--brand);font-weight:700;font-size:11px;padding:5px 0}.text-button:hover,.reset-button:hover{text-decoration:underline}.dropzone{position:relative;min-height:151px;border:1.5px dashed #b5cdcf;background:linear-gradient(120deg,rgba(231,246,243,.72),rgba(245,249,250,.8));border-radius:15px;margin-top:22px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;cursor:pointer;transition:.18s;padding:18px}.dropzone:hover,.dropzone.drag-over{border-color:var(--brand);background:var(--brand-soft)}.dropzone input{position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}.upload-icon{height:39px;width:39px;display:grid;place-items:center;border-radius:12px;background:#dcefed;color:var(--brand);margin-bottom:10px}.upload-icon svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.dropzone strong{font-size:12px;font-weight:700}.dropzone strong span{color:var(--brand);text-decoration:underline;text-underline-offset:3px}.dropzone small{font-size:10px;color:var(--muted);margin-top:4px}.list-heading{display:flex;justify-content:space-between;align-items:center;margin-top:22px;margin-bottom:10px}.list-heading h3{font-size:13px;margin:0 0 2px;font-weight:800}.muted-caption{color:var(--muted);font-size:10px}.mini-badge{background:var(--surface-soft);border:1px solid var(--line);color:var(--muted);font-size:10px;font-weight:700;padding:5px 9px;border-radius:999px}.image-list{display:flex;flex-direction:column;gap:8px;max-height:410px;overflow:auto;padding:1px 3px 1px 1px;scrollbar-width:thin;scrollbar-color:var(--line-strong) transparent}.empty-list{border:1px solid var(--line);border-radius:13px;min-height:135px;display:flex;flex-direction:column;justify-content:center;align-items:center;color:var(--muted);text-align:center;padding:17px}.empty-list strong{color:var(--text);font-size:11px;margin-top:5px}.empty-list p{font-size:10px;margin:3px 0 0}.empty-illustration{width:53px;height:35px;position:relative;margin-bottom:3px}.empty-illustration span{position:absolute;width:26px;height:32px;background:var(--surface-soft);border:1px solid var(--line-strong);border-radius:4px;top:1px;left:13px;transform:rotate(-10deg)}.empty-illustration span:nth-child(2){transform:rotate(8deg);left:18px;background:#edf5f4}.empty-illustration span:nth-child(3){transform:rotate(0);left:23px;top:5px;background:var(--surface);border-color:#9cbdbc}.image-item{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:10px;padding:8px;border:1px solid var(--line);border-radius:12px;background:var(--surface-raised);transition:border-color .15s,background .15s}.image-item.selected{border-color:var(--brand);background:var(--brand-soft)}.image-thumb{width:48px;height:55px;border-radius:8px;background:var(--surface-soft);overflow:hidden;display:grid;place-items:center;border:1px solid var(--line)}.image-thumb img{width:100%;height:100%;object-fit:cover}.image-detail{min-width:0}.image-detail strong{display:block;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:700}.image-detail small{display:block;color:var(--muted);font-size:9px;margin-top:3px}.image-actions{display:flex;align-items:center;gap:3px}.mini-action{width:27px;height:28px;border:1px solid transparent;background:transparent;border-radius:7px;color:var(--muted);display:grid;place-items:center;font-size:14px;padding:0}.mini-action:hover{background:var(--surface);color:var(--brand);border-color:var(--line)}.mini-action.remove:hover{color:var(--danger)}.mini-action svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.list-footer{padding-top:9px;margin-top:9px;border-top:1px solid var(--line);font-size:9px;color:var(--muted)}.output-panel{padding:22px 24px}.compact-heading{align-items:center;margin-bottom:17px}.compact-heading h2{margin-bottom:0}.pdf-chip{font-size:10px;font-weight:800;letter-spacing:.06em;color:#b34f46;background:#fbece8;border:1px solid #f2d8d2;border-radius:8px;padding:5px 8px}.field-label{display:block;color:var(--muted);font-size:10px;font-weight:700;margin-bottom:6px}.filename-field{height:41px;display:flex;align-items:center;border:1px solid var(--line-strong);border-radius:10px;background:var(--surface-soft);padding:0 12px}.filename-field:focus-within{border-color:var(--brand)}.filename-field input{min-width:0;flex:1;height:100%;border:0;outline:0;background:transparent;color:var(--text);font-size:12px;font-weight:600}.filename-field span{font-size:11px;color:var(--muted);font-weight:700}.export-summary{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:14px 0}.export-summary>div{background:var(--surface-soft);border:1px solid var(--line);border-radius:9px;padding:8px 10px;display:flex;flex-direction:column;gap:3px}.export-summary span{font-size:9px;color:var(--muted)}.export-summary strong{font-size:11px;font-weight:800}.primary-button{height:45px;width:100%;border:0;border-radius:11px;background:var(--brand);color:#fff;display:flex;align-items:center;justify-content:center;gap:9px;font-weight:800;font-size:12px;box-shadow:0 6px 15px rgba(23,109,113,.15);transition:background .18s,transform .18s}.primary-button:hover:not(:disabled){background:var(--brand-strong);transform:translateY(-1px)}.primary-button svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.button-arrow{margin-left:auto;padding-right:14px;font-size:16px;font-weight:500}.privacy-note{display:flex;align-items:center;justify-content:center;gap:6px;color:var(--muted);font-size:9px;margin:12px 0 0}.privacy-note svg{width:13px;height:13px;fill:none;stroke:#4e9b81;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.export-progress{margin-top:12px}.progress-track{width:100%;height:5px;border-radius:99px;overflow:hidden;background:var(--line)}.progress-track span{display:block;height:100%;width:0;background:var(--brand);border-radius:99px;transition:width .2s}.export-progress>span{display:block;font-size:10px;color:var(--muted);margin-top:5px}.preview-panel{padding:21px 22px 16px}.preview-heading{align-items:center}.preview-heading h2{font-size:17px}.preview-count{font-size:10px;font-weight:700;color:var(--muted);background:var(--surface-soft);border:1px solid var(--line);padding:5px 8px;border-radius:8px}.paper-stage{min-height:310px;background:radial-gradient(ellipse at center,#edf2f3 0%,#f6f8f9 65%,#fbfcfc 100%);border:1px solid var(--line);border-radius:12px;margin-top:14px;padding:18px;display:flex;justify-content:center;align-items:center;overflow:hidden}.paper-frame{width:min(72%,260px);position:relative;background:#fff;box-shadow:0 6px 22px rgba(30,54,64,.16);border-radius:2px;overflow:hidden;aspect-ratio:210/297}.paper-frame canvas{display:block;width:100%;height:100%;object-fit:contain}.paper-placeholder{position:absolute;inset:0;display:flex;flex-direction:column;gap:8px;align-items:center;justify-content:center;text-align:center;color:#a0afb4;font-size:9px;padding:12px}.paper-placeholder svg{width:45px;height:45px;fill:none;stroke:#b2c3c7;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}.preview-caption{display:flex;align-items:center;justify-content:center;gap:7px;color:var(--muted);font-size:9px;margin-top:10px}.preview-dot{width:6px;height:6px;border-radius:50%;background:#9db9b7}.settings-panel{padding:22px}.settings-panel .compact-heading{margin-bottom:16px}.control-section{border-top:1px solid var(--line);padding:15px 0 14px}.control-section:first-of-type{border-top:0;padding-top:0}.control-section h3{font-size:12px;margin:0 0 11px;font-weight:800;letter-spacing:-.01em}.two-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px}.two-fields label,.select-full{display:flex;flex-direction:column;gap:5px;min-width:0}.two-fields label>span,.select-full>span{font-size:9px;color:var(--muted);font-weight:700}.two-fields select,.select-full select,.custom-size input,.dialog-field select{width:100%;min-width:0;height:35px;border:1px solid var(--line-strong);border-radius:8px;background:var(--surface-soft);color:var(--text);padding:0 9px;font-size:10px;font-weight:600;outline:none}.two-fields select:focus,.select-full select:focus,.custom-size input:focus,.dialog-field select:focus{border-color:var(--brand)}.custom-size{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:-1px 0 10px}.custom-size label{display:flex;flex-direction:column;gap:5px}.custom-size label span{font-size:9px;color:var(--muted);font-weight:700}.field-help{color:var(--muted);font-size:9px;line-height:1.45;margin:7px 0 0}.select-full{margin-bottom:10px}.toggle-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 0 10px;cursor:pointer}.toggle-row>span{display:flex;flex-direction:column;gap:2px}.toggle-row strong{font-size:10px}.toggle-row small{font-size:9px;color:var(--muted)}.toggle-row input{position:absolute;opacity:0;pointer-events:none}.toggle-row i{height:20px;width:35px;border-radius:99px;background:#d5dfe2;position:relative;flex-shrink:0;transition:.18s}.toggle-row i:before{content:"";position:absolute;left:3px;top:3px;width:14px;height:14px;border-radius:50%;background:white;box-shadow:0 1px 2px rgba(0,0,0,.15);transition:.18s}.toggle-row input:checked+i{background:var(--brand)}.toggle-row input:checked+i:before{transform:translateX(15px)}.slider-row{margin-top:9px}.slider-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:3px}.slider-head label{font-size:10px;font-weight:600;color:var(--text)}.slider-head output{font-size:9px;color:var(--brand);font-weight:800;font-variant-numeric:tabular-nums}.slider-row input[type=range]{appearance:none;width:100%;height:4px;border-radius:99px;background:var(--line-strong);outline:none;display:block;margin:8px 0 4px;accent-color:var(--brand)}.slider-row input[type=range]::-webkit-slider-thumb{appearance:none;width:13px;height:13px;background:var(--brand);border:2px solid var(--surface);box-shadow:0 0 0 1px var(--brand);border-radius:50%;cursor:pointer}.slider-row input[type=range]::-moz-range-thumb{width:10px;height:10px;background:var(--brand);border:2px solid var(--surface);box-shadow:0 0 0 1px var(--brand);border-radius:50%;cursor:pointer}.last-control-section{padding-bottom:0}.app-footer{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:26px 0 31px;color:var(--muted);font-size:9px}.footer-brand{display:flex;align-items:center;gap:7px}.footer-brand img{border-radius:7px}.footer-brand strong{font-family:var(--display);color:var(--text);font-size:11px}.footer-meta{display:flex;align-items:center;gap:8px}.footer-separator{color:#b0bec2}.policy-link{color:var(--muted);text-decoration:none}.policy-link:hover{color:var(--brand);text-decoration:underline}.settings-dialog{padding:0;border:0;background:transparent;max-width:min(460px,calc(100vw - 28px));width:100%;max-height:calc(100vh - 28px)}.settings-dialog::backdrop{background:rgba(11,28,34,.5);backdrop-filter:blur(4px)}.dialog-card{background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:18px;padding:24px;box-shadow:0 24px 70px rgba(0,0,0,.22)}.dialog-heading{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:18px}.dialog-heading h2{font-size:20px;margin:3px 0 0}.close-dialog{font-size:20px;line-height:1}.dialog-field{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:13px 0;border-top:1px solid var(--line)}.dialog-field>div{display:flex;flex-direction:column}.dialog-field strong{font-size:11px}.dialog-field small{font-size:9px;color:var(--muted);margin-top:3px}.dialog-field select{width:130px}.about-box{display:flex;gap:12px;background:var(--surface-soft);border:1px solid var(--line);border-radius:12px;padding:13px;margin-top:15px}.about-logo img{width:38px;height:38px}.about-box strong{font-size:11px}.about-box p{font-size:9px;color:var(--muted);margin:3px 0}.about-box small{font-size:8px;color:var(--muted)}.copyright-note{text-align:center;color:var(--muted);font-size:9px;margin:13px 0}.dialog-done{margin-top:5px}.toast-region{position:fixed;right:22px;bottom:20px;z-index:20;display:flex;flex-direction:column;gap:8px;pointer-events:none}.toast{max-width:min(360px,calc(100vw - 40px));background:#173943;color:#fff;border-radius:10px;padding:11px 15px;font-size:11px;box-shadow:0 9px 30px rgba(0,0,0,.18);animation:toast-in .2s ease-out}.toast.error{background:#8e3e3e}@keyframes toast-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}

[data-theme="dark"]{color-scheme:dark;--bg:#101b20;--surface:#17262d;--surface-soft:#1d3038;--surface-raised:#1a2a31;--text:#e5eff0;--muted:#9aafb5;--line:#2b4149;--line-strong:#3b5660;--brand:#79c4bd;--brand-strong:#5ba9a2;--brand-soft:#203d40;--accent:#ed9b7a;--shadow:0 14px 38px rgba(0,0,0,.15)}[data-theme="dark"] .dropzone{background:linear-gradient(120deg,rgba(34,65,67,.75),rgba(25,46,54,.8));border-color:#446c70}[data-theme="dark"] .dropzone:hover,[data-theme="dark"] .dropzone.drag-over{background:var(--brand-soft)}[data-theme="dark"] .upload-icon{background:#2b4c4e}[data-theme="dark"] .paper-stage{background:radial-gradient(ellipse at center,#26383f 0%,#1b2c32 70%,#17262d 100%)}[data-theme="dark"] .pdf-chip{background:#4b302d;border-color:#66413b;color:#f2b5a5}[data-theme="dark"] .sun-icon{display:none}[data-theme="dark"] .moon-icon{display:block}[data-theme="dark"] .empty-illustration span{background:#263c43;border-color:#48606a}[data-theme="dark"] .empty-illustration span:nth-child(2){background:#203840}[data-theme="dark"] .empty-illustration span:nth-child(3){background:#17262d}[data-theme="dark"] .status-dot{box-shadow:0 0 0 3px rgba(69,164,130,.18)}
@media(max-width:1100px){.app-shell{padding:0 28px}.workspace-grid{grid-template-columns:minmax(0,1fr) minmax(330px,.9fr);gap:15px}.source-panel,.output-panel,.settings-panel{padding:19px}.preview-panel{padding:19px}.paper-stage{min-height:275px}}
@media(max-width:820px){.app-shell{padding:0 20px}.workspace-grid{grid-template-columns:1fr}.right-column{display:grid;grid-template-columns:minmax(0,.95fr) minmax(0,1.05fr);align-items:start}.preview-panel{position:sticky;top:12px}.paper-frame{width:min(86%,255px)}.paper-stage{min-height:295px}.intro-row{align-items:flex-start}.intro-meta{padding-top:4px}}
@media(max-width:600px){.app-shell{padding:0 13px}.topbar{height:68px}.brand img{width:37px;height:37px}.privacy-chip{font-size:0;padding:9px}.privacy-chip .status-dot{width:8px;height:8px}.top-actions{gap:7px}.install-button{height:35px;width:35px;padding:0;border-radius:11px}.install-button span{display:none}.install-button svg{width:17px;height:17px}.icon-button{width:35px;height:35px}.main-content{padding-top:27px}.intro-row{display:block;margin-bottom:20px}.intro-copy>p{font-size:12px;max-width:390px}.intro-meta{margin-top:15px}.stat-card{min-width:0;flex:1;padding:8px 11px}.stat-number{font-size:17px}.workspace-grid{gap:13px}.left-column,.right-column{gap:13px}.source-panel,.output-panel,.settings-panel,.preview-panel{padding:17px;border-radius:15px}.panel-heading h2{font-size:17px}.panel-subtitle{font-size:10px}.dropzone{min-height:135px;margin-top:16px}.right-column{display:flex}.preview-panel{position:static}.paper-stage{min-height:270px;padding:14px}.paper-frame{width:min(67%,235px)}.settings-panel{order:2}.preview-panel{order:1}.app-footer{display:block;padding:20px 1px 25px}.footer-meta{margin-top:9px;flex-wrap:wrap}.image-item{grid-template-columns:43px minmax(0,1fr) auto;gap:8px;padding:7px}.image-thumb{width:43px;height:50px}.image-actions{gap:0}.mini-action{width:25px;height:27px}.two-fields{gap:8px}.dialog-card{padding:20px}.toast-region{right:12px;bottom:12px}}
@media(max-width:370px){.brand-copy small{font-size:8px}.image-actions .mini-action:nth-child(1){display:none}.paper-frame{width:75%}.export-summary{gap:5px}.export-summary>div{padding:7px}.two-fields select{font-size:9px;padding:0 6px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
