:root{--brand: rgb(66,59,140);--brand-dark: rgb(50,45,112);--brand-soft: rgb(241,240,250);--bg: #f4f6fb;--paper: #ffffff;--ink: #171827;--muted: #667085;--soft: #98a2b3;--line: #d8deea;--shadow: 0 20px 54px rgba(22, 28, 45, .14);--radius: 8px}*{box-sizing:border-box}html,body{width:100%;height:100%;margin:0;overflow:hidden;color:var(--ink);background:var(--bg);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Microsoft YaHei,sans-serif;font-size:14px}button,input{font:inherit}.page{display:grid;grid-template-rows:auto minmax(0,1fr) 28px;width:100%;height:100vh;height:100dvh;min-height:0;overflow:hidden}.topbar{display:flex;align-items:center;justify-content:space-between;gap:18px;height:64px;padding:0 24px;border-bottom:1px solid var(--line);background:#fff}.brand{display:flex;align-items:center;gap:10px;min-width:0}.brand-mark{display:block;width:36px;height:36px;border-radius:8px;object-fit:cover}.brand-home-link{display:block;flex:0 0 auto;border-radius:8px}.brand-home-link:focus-visible{outline:2px solid rgba(66,59,140,.35);outline-offset:2px}.brand-title{font-size:17px;font-weight:750;white-space:nowrap}.top-actions{display:flex;align-items:center;gap:10px}.duplicate-notice{padding:6px 9px;border:1px solid #f1c7c2;border-radius:4px;color:#b42318;background:#fff4f2;font-size:12px;font-weight:700;white-space:nowrap}.duplicate-notice[hidden]{display:none}.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:36px;padding:0 14px;border:1px solid var(--line);border-radius:7px;color:var(--ink);background:#fff;cursor:pointer}.btn.primary{border-color:var(--brand);color:#fff;background:var(--brand)}.btn.primary:hover{background:var(--brand-dark)}.btn:disabled{cursor:not-allowed;opacity:.45}.icon{width:17px;height:17px;stroke:currentColor;stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}.workspace{display:grid;grid-template-columns:280px minmax(0,1fr) 320px;grid-template-areas:"sidebar preview invoices";min-height:0;overflow:hidden}.preview-shell{grid-area:preview;position:relative;display:grid;grid-template-rows:auto 1fr;min-width:0;min-height:0;overflow:hidden;background:linear-gradient(180deg,#f9faff 0,#f9faff00 180px),var(--bg)}.preview-toolbar{display:flex;align-items:center;justify-content:space-between;min-height:54px;padding:10px 22px;border-bottom:1px solid var(--line);background:#ffffffc2;backdrop-filter:blur(12px)}.file-title{display:flex;align-items:center;gap:10px;min-width:0;color:var(--muted)}.file-title strong{color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.viewer-tools{display:flex;align-items:center;gap:8px;color:var(--muted);white-space:nowrap}.tool-btn{display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--line);border-radius:7px;color:var(--muted);background:#fff;cursor:pointer}.tool-btn:disabled{opacity:.4;cursor:default}.preview-area{position:relative;min-height:0;overflow-x:auto;overflow-y:auto;overscroll-behavior:contain;padding:30px 34px 46px}.empty-state{display:grid;place-items:center;min-height:100%}.add-panel{width:min(560px,100%);text-align:center}.big-add{display:inline-grid;place-items:center;width:168px;height:168px;margin-bottom:24px;border:0;border-radius:34px;color:#fff;background:var(--brand);box-shadow:0 24px 54px #423b8c57;cursor:pointer}.big-add:hover{background:var(--brand-dark);transform:translateY(-1px)}.big-add svg{width:74px;height:74px}h1{margin:0 0 10px;font-size:28px;line-height:1.25;letter-spacing:0}.empty-desc{margin:0 auto 6px;max-width:500px;color:var(--muted);line-height:1.7}.browser-tip{margin:0 auto 16px;color:var(--soft);font-size:12px;line-height:1.6}.app-promo{margin:0 auto 22px;max-width:520px;color:#4f566a;font-size:14px;line-height:1.7}.app-download-link{display:inline-flex;align-items:center;margin-left:4px;color:var(--brand);font-weight:750;text-decoration:none}.app-download-link:hover{color:var(--brand-dark);text-decoration:underline}.support{display:flex;justify-content:center;gap:8px;flex-wrap:wrap;color:var(--muted);font-size:12px}.chip{display:inline-flex;align-items:center;height:26px;padding:0 10px;border:1px solid #d9d5f0;border-radius:999px;color:var(--brand);background:var(--brand-soft);font-weight:650}.pdf-stack{display:none;width:min(760px,100%);margin:0 auto;gap:4px;transform-origin:top center}#mergedPreviewPages{display:grid;gap:4px}.pdf-stack.ready{display:grid}.pdf-page{min-height:980px;padding:54px 58px;border:1px solid #cfd6e3;border-radius:4px;background:#fff;box-shadow:var(--shadow)}.pdf-page.cover{display:grid;align-content:start;gap:0}.pdf-page.cover.is-hidden{display:none}.summary-title{margin:0 0 18px;color:#242636;font-size:26px;font-weight:800;text-align:center}.preview-sheet{position:relative;aspect-ratio:210 / 297;min-height:0;padding:0;overflow:hidden;border:1px solid #cfd6e3;border-radius:4px;background:#fff;box-shadow:var(--shadow)}.preview-sheet.per-4-sheet{display:grid;align-items:center}.invoice-grid{position:absolute;inset:0}.invoice-preview-card{position:absolute;display:grid;place-items:center;min-width:0;min-height:0;border:0;border-radius:0;overflow:visible;background:#fff}.invoice-preview-card.with-sequence{grid-template-rows:minmax(0,1fr) 14px}.invoice-preview-card.with-sequence.sequence-rotated{grid-template-rows:minmax(0,1fr);grid-template-columns:14px minmax(0,1fr)}.sequence-rotated .invoice-canvas-wrap{grid-row:1;grid-column:2}.sequence-rotated .invoice-sequence{grid-row:1;grid-column:1;width:max-content;transform:rotate(90deg)}.invoice-sequence{width:100%;color:#c5c7ce;font-size:10px;line-height:14px;justify-self:center;text-align:left;white-space:nowrap}.page-separator{position:absolute;z-index:3;pointer-events:none}.page-separator.horizontal{right:0;left:0;border-top:1px dashed #8f8aa9}.page-separator.vertical{top:0;bottom:0;border-left:1px dashed #8f8aa9}.invoice-canvas-wrap{position:relative;display:grid;place-items:center;width:100%;height:100%;min-width:0;min-height:0;padding:0;overflow:hidden;aspect-ratio:auto!important;background:#fff}.invoice-canvas-wrap canvas{display:block;width:100%;height:100%;object-fit:contain;max-width:100%;max-height:100%;box-shadow:none;background:#fff}.preview-status{display:flex;align-items:center;justify-content:center;min-height:220px;color:var(--muted);text-align:center;line-height:1.7}.table-total{display:flex;justify-content:flex-end;align-items:center;gap:16px;min-height:58px;padding:0 14px;border:1px solid #dfe4ec;border-top:0;color:var(--ink);background:#fbfcff;font-size:18px;font-weight:750}.table-total strong{color:var(--brand);font-size:22px;font-weight:850}.pdf-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:13px}.pdf-table th,.pdf-table td{height:42px;padding:0 10px;border:1px solid #dfe4ec;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pdf-table th{color:#333646;background:#f2f3f8;font-weight:750}.invoice-page-title{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:28px;padding-bottom:18px;border-bottom:2px solid #d9d5f0}.invoice-page-title h2{margin:0;color:var(--brand);font-size:23px;letter-spacing:0}.fake-invoice{display:grid;gap:16px}.invoice-box{border:1px solid #dfe4ec;border-radius:4px;overflow:hidden}.invoice-row{display:grid;grid-template-columns:120px 1fr 120px 1fr;min-height:44px;border-bottom:1px solid #dfe4ec}.invoice-row:last-child{border-bottom:0}.invoice-label,.invoice-value{display:flex;align-items:center;padding:0 12px;border-right:1px solid #dfe4ec}.invoice-label{color:var(--muted);background:#f7f8fb}.invoice-value:last-child{border-right:0}.amount{color:var(--brand);font-size:22px;font-weight:800;text-align:right}.page-foot{margin-top:34px;color:var(--soft);text-align:center;font-size:12px}.side{grid-area:sidebar;display:grid;grid-template-rows:auto auto 1fr;min-height:0;overflow:hidden;border-right:1px solid var(--line);background:#fff}.invoice-side{grid-area:invoices;display:grid;grid-template-rows:auto 1fr;min-width:0;min-height:0;overflow:hidden;border-left:1px solid var(--line);background:#fff}.side-head{padding:18px 18px 14px;border-bottom:1px solid var(--line)}.side-head h2{margin:0 0 5px;font-size:17px;letter-spacing:0}.side-head p{margin:0;color:var(--muted);font-size:13px;line-height:1.5}.result-box{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;padding:14px 18px;border-bottom:1px solid var(--line);background:#fbfcff}.result-card{padding:12px;border:1px solid #e2e6ef;border-radius:7px;background:#fff}.result-label{margin-bottom:5px;color:var(--muted);font-size:12px}.result-value{font-size:20px;font-weight:800}.result-card.wide{grid-column:1 / -1}.merge-mode,.preview-config{padding:14px 18px;border-bottom:1px solid var(--line)}.preview-config h3{margin:0 0 12px;font-size:14px}.config-toggle{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--muted);font-size:13px;cursor:pointer}.config-toggle+.config-toggle{margin-top:12px}.margin-setting{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding-top:14px;border-top:1px solid var(--line);color:var(--muted);font-size:13px}.summary-title-setting{margin-top:12px}.summary-title-setting+.config-toggle{margin-top:14px}.summary-title-setting label{display:block;margin-bottom:6px;color:var(--muted);font-size:12px}.summary-title-setting input{width:100%;height:34px;padding:0 9px;border:1px solid #d8d3ef;border-radius:6px;color:var(--ink);background:#fff;outline:none}.summary-title-setting input:focus{border-color:var(--brand);box-shadow:0 0 0 2px #423b8c1f}.margin-stepper{display:grid;grid-template-columns:30px 58px 30px;align-items:center;height:30px;border:1px solid #d8d3ef;border-radius:7px;overflow:hidden;background:#fff}.margin-stepper button{display:grid;place-items:center;width:30px;height:30px;padding:0;border:0;color:var(--brand);background:#fff;cursor:pointer}.margin-stepper button:disabled{color:#b8bcc7;cursor:default}.margin-stepper output{display:grid;place-items:center;height:30px;border-right:1px solid #e4e1f2;border-left:1px solid #e4e1f2;color:var(--ink);font-size:12px;font-weight:700}.switch-control{position:relative;flex:0 0 auto;width:38px;height:22px}.switch-control input{position:absolute;opacity:0;pointer-events:none}.switch-track{position:absolute;inset:0;border-radius:11px;background:#cfd3dd;transition:background .18s ease}.switch-track:after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 4px #14162338;transition:transform .18s ease}.switch-control input:checked+.switch-track{background:var(--brand)}.switch-control input:checked+.switch-track:after{transform:translate(16px)}.switch-control input:focus-visible+.switch-track{outline:2px solid rgba(66,59,140,.3);outline-offset:2px}.merge-mode-title{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px;font-weight:750}.merge-mode-title span{color:var(--muted);font-size:12px;font-weight:500}.mode-options{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}.mode-btn{height:38px;border:1px solid #d8d3ef;border-radius:7px;color:var(--brand);background:#fff;cursor:pointer;font-weight:750}.mode-btn.active{border-color:var(--brand);color:#fff;background:var(--brand);box-shadow:0 8px 18px #423b8c33}.file-list{min-height:0;overflow:auto;scrollbar-width:none;padding:14px 18px}.file-list::-webkit-scrollbar{display:none}.file-item{display:flex;align-items:center;gap:10px;min-height:50px;padding:10px;margin-bottom:8px;border:1px solid #e2e6ef;border-radius:7px;background:#fff}.file-item>div:last-child{min-width:0;flex:1}.file-icon{display:grid;place-items:center;width:30px;height:30px;border-radius:7px;color:var(--brand);background:var(--brand-soft);flex:0 0 auto}.file-name{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-meta{margin-top:2px;color:var(--soft);font-size:12px}.empty-list{display:grid;place-items:center;min-height:180px;color:var(--soft);text-align:center;line-height:1.7}.side-actions{display:grid;align-self:end;gap:10px;padding:16px 18px 18px;border-top:1px solid var(--line)}.hidden-input{display:none}.site-footer{display:flex;align-items:center;justify-content:center;min-width:0;border-top:1px solid var(--line);color:var(--soft);background:#fff;font-size:11px;white-space:nowrap}.is-ready .empty-state{display:none}.is-ready .pdf-stack{display:grid}@media(max-width:960px){.workspace{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;grid-template-areas:"preview" "sidebar"}.invoice-side{display:none}.side{grid-template-columns:1fr 1fr;grid-template-rows:auto auto;border-right:0;border-top:1px solid var(--line)}.side-head,.file-list{display:none}.result-box,.merge-mode{min-width:0}.side-actions{grid-column:1 / -1;display:flex;padding:10px 14px}.side-actions .btn{flex:1}.pdf-page{min-height:780px;padding:36px 28px}.result-box{grid-template-columns:repeat(2,1fr)}.invoice-row{grid-template-columns:96px 1fr}.invoice-label,.invoice-value{min-height:40px}.topbar{padding:0 14px}.top-actions .btn:not(.primary){display:none}}
.summary-paged{aspect-ratio:210/297;min-width:620px;min-height:0!important;padding:22px 32px!important;overflow:hidden}.summary-paged .summary-title{margin-bottom:8px;font-size:20px;line-height:1.2}.summary-paged .pdf-table{font-size:11px}.summary-paged .pdf-table th,.summary-paged .pdf-table td{height:23px;padding:0 6px}.summary-paged .table-total{min-height:36px;font-size:13px}.summary-paged .table-total strong{font-size:16px}.summary-paged .page-foot{margin-top:8px;font-size:10px}