:root{--ink:#17231d;--muted:#68746e;--green:#1e684b;--pale:#eef5f1;--line:#dbe3de;--paper:#fff;--bg:#f4f6f4;--danger:#b23b3b}*{box-sizing:border-box}body{margin:0;font-family:"Microsoft YaHei",system-ui,sans-serif;color:var(--ink);background:var(--bg);display:flex;min-height:100vh}aside{position:fixed;width:230px;height:100vh;background:#183d30;color:#fff;padding:28px 18px}.brand{display:flex;gap:12px;align-items:center;font-weight:700;font-size:18px;margin-bottom:36px}.brand>span{display:grid;place-items:center;width:42px;height:42px;background:#d7a74b;color:#173b2e;border-radius:10px;font-size:22px}.brand small{display:block;font-size:9px;letter-spacing:2px;opacity:.55;margin-top:4px}nav{display:grid;gap:6px}nav button{border:0;background:transparent;color:#c8d9d1;padding:13px 16px;text-align:left;border-radius:8px;font-size:14px;cursor:pointer}nav button:hover,nav button.active{background:#2b5947;color:#fff}main{margin-left:230px;width:calc(100% - 230px);padding:30px 38px}header{display:flex;justify-content:space-between;align-items:start;margin-bottom:24px}h1{font-size:25px;margin:0 0 7px}header p{margin:0;color:var(--muted);font-size:13px}.date{font-size:13px;color:var(--muted)}.card{background:var(--paper);border:1px solid var(--line);border-radius:12px;padding:20px;box-shadow:0 2px 8px #17231d08;margin-bottom:18px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}.stat strong{display:block;font-size:26px;margin-top:12px}.stat span{font-size:13px;color:var(--muted)}.toolbar,.row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.toolbar{justify-content:space-between;margin-bottom:16px}.form-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.field label{display:block;color:var(--muted);font-size:12px;margin:0 0 6px}.field input,.field select,.field textarea,input,select{width:100%;border:1px solid var(--line);background:#fff;border-radius:7px;padding:9px 10px;color:var(--ink);outline:none}.field input:focus,.field select:focus,input:focus,select:focus{border-color:var(--green);box-shadow:0 0 0 3px #1e684b12}.span2{grid-column:span 2}.btn{border:1px solid var(--line);background:#fff;padding:9px 15px;border-radius:7px;cursor:pointer;color:var(--ink)}.btn.primary{background:var(--green);border-color:var(--green);color:#fff}.btn.danger{color:var(--danger)}.btn.small{padding:5px 9px;font-size:12px}.table-wrap{overflow:auto;border:1px solid var(--line);border-radius:9px}table{border-collapse:collapse;width:100%;font-size:13px;background:#fff}th,td{border-bottom:1px solid var(--line);padding:11px 10px;text-align:left;white-space:nowrap}th{background:#f2f6f3;color:#53615a;font-weight:600}tr:last-child td{border-bottom:0}.edit-table input,.edit-table select{min-width:76px;padding:7px 6px}.edit-table .material{min-width:100px}.edit-table th.variables{background:#fff7e8;color:#8a6423}.muted{color:var(--muted)}.money{font-variant-numeric:tabular-nums;text-align:right}.totalbar{text-align:right;padding:18px 4px 0;font-size:16px}.totalbar strong{font-size:23px;color:var(--green);margin-left:14px}.empty{text-align:center;padding:48px;color:var(--muted)}.status{padding:3px 8px;border-radius:10px;background:var(--pale);color:var(--green);font-size:11px}.tabs{display:flex;gap:8px;margin-bottom:16px}.tabs button.active{background:var(--green);color:#fff}#toast{position:fixed;right:24px;bottom:24px;background:#17231d;color:#fff;padding:12px 18px;border-radius:8px;display:none;z-index:20}.print-only{display:none}.formula-note{font-size:12px;color:var(--muted);padding:10px 12px;background:#f8faf8;border-radius:7px;margin:10px 0}.section-title{font-size:16px;margin:0 0 14px}.actions{display:flex;gap:6px}.red{color:var(--danger)}
#login{position:fixed;inset:0;background:#eef2ef;z-index:100;display:grid;place-items:center}#login.hidden{display:none}#login form{width:360px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:34px;box-shadow:0 20px 60px #183d3020;display:grid;gap:13px;text-align:center}.login-mark{width:52px;height:52px;margin:auto;display:grid;place-items:center;border-radius:12px;background:#183d30;color:#fff;font-size:26px;font-weight:bold}#login h2,#login p{margin:0}#login p,#login small{color:var(--muted)}.logo-preview{max-width:180px;max-height:60px}.monthly-doc{break-after:page}.print-sheet{break-after:page;overflow:hidden}.print-sheet:last-child{break-after:auto}.print-company{display:flex;justify-content:space-between;align-items:start}.print-company h2{margin:0;font-size:22px}.print-logo{max-width:32mm;max-height:14mm}.print-notice{font-size:10px;line-height:1.4}.page-no{text-align:right;font-size:10px}
#login{position:fixed;inset:0;background:#eef2ef;z-index:100;display:grid;place-items:center}#login.hidden{display:none}#login form{width:360px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:34px;box-shadow:0 20px 60px #183d3020;display:grid;gap:13px;text-align:center}.login-mark{width:52px;height:52px;margin:auto;display:grid;place-items:center;border-radius:12px;background:#183d30;color:#fff;font-size:26px;font-weight:bold}#login h2,#login p{margin:0}#login p,#login small{color:var(--muted)}.logo-preview{max-width:180px;max-height:60px}.monthly-doc{break-after:page}.print-sheet{break-after:page;overflow:hidden}.print-sheet:last-child{break-after:auto}.print-company{display:flex;justify-content:space-between;align-items:start}.print-company h2{margin:0;font-size:22px}.print-logo{max-width:32mm;max-height:14mm}.print-notice{font-size:10px;line-height:1.4}.page-no{text-align:right;font-size:10px}.preview-modal{display:none;position:fixed;inset:0;z-index:80;background:#414744;overflow:auto;padding:72px 24px 32px}.preview-modal.open{display:block}.preview-bar{position:fixed;z-index:81;left:0;right:0;top:0;height:58px;background:#fff;display:flex;align-items:center;gap:14px;padding:0 24px;box-shadow:0 2px 12px #0003}.preview-bar span{color:var(--muted);font-size:12px;margin-right:auto}#previewCanvas{display:grid;justify-content:center;gap:24px}#previewCanvas .print-sheet{display:block;background:#fff;box-shadow:0 8px 30px #0005;break-after:auto;transform-origin:top center}body.preview-open{overflow:hidden}
#login{position:fixed;inset:0;background:#eef2ef;z-index:100;display:grid;place-items:center}#login.hidden{display:none}#login form{width:360px;background:#fff;border:1px solid var(--line);border-radius:16px;padding:34px;box-shadow:0 20px 60px #183d3020;display:grid;gap:13px;text-align:center}.login-mark{width:52px;height:52px;margin:auto;display:grid;place-items:center;border-radius:12px;background:#183d30;color:#fff;font-size:26px;font-weight:bold}#login h2,#login p{margin:0}#login p,#login small{color:var(--muted)}.logo-preview{max-width:180px;max-height:60px}.monthly-doc{break-after:page}.print-sheet{break-after:page;overflow:hidden;color:#000}.print-sheet:last-child{break-after:auto}.print-company{display:flex;justify-content:space-between;align-items:start}.print-company h2{margin:0;font-size:22px}.print-logo{max-width:32mm;max-height:14mm}.print-notice{font-size:10px;line-height:1.4}.page-no{text-align:right;font-size:10px}.needle-table{border:1px solid #000!important;border-collapse:collapse!important;background:#fff!important}.needle-table th,.needle-table td{border:1px solid #000!important;background:#fff!important;color:#000!important}.preview-modal{display:none;position:fixed;inset:0;z-index:80;background:#414744;overflow:auto;padding:72px 24px 32px}.preview-modal.open{display:block}.preview-bar{position:fixed;z-index:81;left:0;right:0;top:0;height:58px;background:#fff;display:flex;align-items:center;gap:14px;padding:0 24px;box-shadow:0 2px 12px #0003}.preview-bar span{color:var(--muted);font-size:12px;margin-right:auto}#previewCanvas{display:grid;justify-content:center;gap:24px}#previewCanvas .print-sheet{display:block;background:#fff;box-shadow:0 8px 30px #0005;break-after:auto;transform-origin:top center}body.preview-open{overflow:hidden}
@media(max-width:1100px){.form-grid{grid-template-columns:repeat(2,1fr)}.stats{grid-template-columns:repeat(2,1fr)}}
@page{size:A4 portrait;margin:12mm 10mm 14mm}@media print{body{display:block;background:#fff;font-family:"SimSun","宋体",serif}aside,header,.no-print,#toast{display:none!important}main{margin:0;padding:0;width:100%}.card{border:0;box-shadow:none;padding:0;margin:0}.print-only{display:block}.print-head{text-align:center;margin-bottom:8mm}.print-head h2{font-size:22px;letter-spacing:8px;margin:0 0 5mm}.print-meta{display:flex;justify-content:space-between;font-size:12px;margin-bottom:3mm}.print-table{table-layout:fixed;font-size:11px}.print-table th,.print-table td{border:1px solid #222;padding:5px 3px;text-align:center;white-space:normal}.print-table thead{display:table-header-group}.print-table tr{break-inside:avoid}.print-total{text-align:right;border:1px solid #222;border-top:0;padding:7px;font-weight:bold}.print-foot{display:flex;justify-content:space-between;margin-top:7mm;font-size:12px}.variables{display:none!important}}
@page{size:241mm 140mm;margin:0}@media print{.print-sheet{display:block!important;box-sizing:border-box}.print-sheet .print-company{display:flex}.monthly-doc{break-after:page}}
@media print{.monthly-sheet .print-company h2{font-size:18px}.monthly-sheet .print-company{line-height:1.2}.monthly-sheet .page-no{margin:0}.monthly-sheet .print-meta{margin-bottom:2mm}.monthly-sheet .needle-table th,.monthly-sheet .needle-table td{padding:1px 2px;line-height:1.1}.monthly-sheet .print-total{padding:3px}.monthly-sheet .print-notice{font-size:8px;line-height:1.2}.monthly-sheet .print-foot{margin-top:3mm;font-size:9px}}
@media print{.monthly-sheet .print-notice::after{content:"客户签名：________________________";display:block;margin-top:6mm;font-size:10px}}
#previewCanvas .monthly-sheet .print-notice::after{content:"客户签名：________________________";display:block;margin-top:6mm;font-size:10px}
.monthly-sheet .print-notice{margin-top:5mm!important}
@media print{.monthly-sheet .print-notice{margin-top:5mm!important}}
.monthly-seal-box{position:relative;height:25mm;margin-top:3mm;font-size:10px;padding-top:9mm}.monthly-contract-seal{position:absolute;width:31mm;height:31mm;object-fit:contain;left:20mm;top:-2mm;z-index:2}
.print-doc-title{text-align:right}.print-doc-title h3{margin:0}.doc-no{margin-top:4px;font-size:10px;font-weight:normal}.template-editor{position:fixed;left:16px;top:72px;bottom:16px;width:230px;overflow:auto;background:#fff;padding:16px;border-radius:10px;box-shadow:0 4px 20px #0005;z-index:82;color:#17231d}.template-editor h3,.template-editor h4{margin:0 0 10px}.template-editor p{font-size:12px;color:#68746e}.template-editor label{display:grid;grid-template-columns:78px 1fr 30px;gap:6px;align-items:center;margin:7px 0;font-size:12px}.template-editor input{padding:4px;min-width:0}.template-editor .btn{width:100%;margin-top:8px}.preview-pages{display:grid;justify-content:center;gap:24px;margin-left:246px}.preview-pages .print-sheet{display:block;background:#fff;box-shadow:0 8px 30px #0005;break-after:auto}
@media print{.needle-table tbody td{height:var(--delivery-row-height,5mm);padding-top:1mm!important;padding-bottom:1mm!important}}
/* 针式打印：表头使用独立的紧凑高度，不跟随明细行高。 */
.needle-table th,.needle-table td{text-align:center!important;vertical-align:middle!important}
.needle-table thead th{height:4mm!important;min-height:0!important;padding:0 2px!important;line-height:1!important;text-align:center!important;vertical-align:middle!important}
.needle-table thead tr:first-child th{height:4mm!important}
.needle-table thead tr:nth-child(2) th{height:4mm!important}
.needle-table tbody td{height:6.2mm;text-align:center!important;vertical-align:middle!important}
@media print{.needle-table th,.needle-table td{text-align:center!important;vertical-align:middle!important}.needle-table thead th{height:4mm!important;min-height:0!important;padding:0 2px!important;line-height:1!important}.needle-table thead tr:first-child th{height:4mm!important}.needle-table thead tr:nth-child(2) th{height:4mm!important}.needle-table tbody td{height:6.2mm}}
/* 打印模板专属覆盖：消除后台通用表格的内边距和左对齐。 */
.print-sheet table.needle-table{table-layout:fixed!important;border-collapse:collapse!important}
.print-sheet table.needle-table th,.print-sheet table.needle-table td{box-sizing:border-box!important;text-align:center!important;vertical-align:middle!important;white-space:normal!important}
.print-sheet table.needle-table thead tr:first-child,.print-sheet table.needle-table thead tr:nth-child(2),.print-sheet table.needle-table thead th{height:4mm!important}
.print-sheet table.needle-table thead th{padding:0 1px!important;line-height:4mm!important}
.print-sheet table.needle-table tbody tr,.print-sheet table.needle-table tbody td{height:6.2mm}
.print-sheet table.needle-table tbody td{padding:0 1px!important;line-height:1!important}
#previewCanvas .print-sheet table.needle-table th,#previewCanvas .print-sheet table.needle-table td{text-align:center!important;vertical-align:middle!important}
@media print{.print-sheet table.needle-table{table-layout:fixed!important}.print-sheet table.needle-table th,.print-sheet table.needle-table td{text-align:center!important;vertical-align:middle!important}.print-sheet table.needle-table thead tr:first-child,.print-sheet table.needle-table thead tr:nth-child(2),.print-sheet table.needle-table thead th{height:4mm!important}.print-sheet table.needle-table thead th{padding:0 1px!important;line-height:4mm!important}.print-sheet table.needle-table tbody tr,.print-sheet table.needle-table tbody td{height:6.2mm}.print-sheet table.needle-table tbody td{padding:0 1px!important;line-height:1!important}}
.print-sheet table.needle-table .table-total-row,.print-sheet table.needle-table .table-total-row td{height:6.2mm!important;font-weight:normal;text-align:center!important;border:1px solid #000!important}
.print-sheet table.needle-table .freight-row,.print-sheet table.needle-table .freight-row td{height:6.2mm!important;text-align:center!important;border:1px solid #000!important}
@media print{.print-sheet.quote-sheet{width:210mm!important;height:297mm!important;padding:10mm!important}}
.quote-sheet{box-sizing:border-box;width:210mm!important;height:297mm!important;padding:10mm!important;background:#fff;color:#000;font-family:"SimSun","宋体",serif}.quote-head{display:grid;grid-template-columns:34mm 1fr 34mm;align-items:center;text-align:center;border-bottom:2px solid #000;padding-bottom:3mm}.quote-head h2{font-size:22px;margin:0}.quote-head>div{font-size:24px;font-weight:bold;letter-spacing:5px}.quote-contact{font-size:11px;padding:2mm 0}.quote-meta{display:grid;grid-template-columns:2fr 1.4fr 1fr 1fr;gap:3mm;font-size:11px;margin-bottom:2mm}.quote-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:10px}.quote-table th,.quote-table td{border:1px solid #000!important;text-align:center!important;vertical-align:middle!important;padding:1mm}.quote-table tbody tr{height:8mm}.quote-total{border:1px solid #000;border-top:0;text-align:right;padding:3mm;font-weight:bold}.quote-terms{font-size:10px;line-height:1.6;margin-top:5mm}.quote-sign{display:flex;justify-content:space-between;margin-top:15mm;font-size:11px}.quote-preview{margin-left:0!important}
.quote-terms p{margin:1.2mm 0}.quote-bank{border:1px solid #000;padding:2mm;line-height:1.7}.quote-sign{margin-top:7mm}
.seal-preview-wrap{display:flex;align-items:center;gap:12px;margin-top:8px}.seal-preview{width:90px;height:90px;object-fit:contain;border:1px dashed #bbb;background:#fff}.quote-provider-sign{position:relative;display:inline-block;min-width:65mm;min-height:24mm;padding-top:9mm}.quote-contract-seal{position:absolute;width:31mm;height:31mm;object-fit:contain;left:24mm;top:-3mm;z-index:2}
@media print{.quote-sheet{width:210mm!important;height:297mm!important;padding:10mm!important}.quote-table thead{display:table-header-group}.quote-table tr{break-inside:avoid}}
.quote-sheet{padding:var(--quote-margin,8mm)!important}.quote-sheet .quote-table{font-size:var(--quote-font-size,9px)!important}.quote-sheet .quote-table tbody tr,.quote-sheet .quote-table tbody td{height:var(--quote-row-height,5mm)!important;min-height:0!important}.quote-sheet .quote-table th,.quote-sheet .quote-table td{padding:.4mm .6mm!important;line-height:1.1!important}.quote-sheet .quote-terms{font-size:var(--quote-terms-size,9px)!important}.quote-editor+.quote-preview{margin-left:246px!important}
.quote-sheet .quote-head h2{white-space:nowrap!important;word-break:keep-all!important;overflow:visible!important;font-size:clamp(14px,2.15vw,22px)!important;line-height:1.15!important}
.quote-sheet .quote-table thead tr,.quote-sheet .quote-table thead th{height:6mm!important;min-height:6mm!important}.quote-sheet .quote-table thead th{padding:.8mm .5mm!important;line-height:1.25!important;white-space:nowrap!important;vertical-align:middle!important;font-size:var(--quote-font-size,9px)!important}
@media print{.quote-sheet .quote-table thead tr,.quote-sheet .quote-table thead th{height:6mm!important;min-height:6mm!important}.quote-sheet .quote-table thead th{padding:.8mm .5mm!important;line-height:1.25!important;white-space:nowrap!important;vertical-align:middle!important}}
.monthly-summary-sheet{background:#fff;color:#000;width:210mm;min-height:297mm;padding:8mm;box-sizing:border-box;font-family:"SimSun","宋体",serif}.monthly-summary-meta{display:flex;justify-content:space-between;margin:3mm 0;font-size:10px}.monthly-summary-table{width:100%;border-collapse:collapse;table-layout:fixed;font-size:8px}.monthly-summary-table th,.monthly-summary-table td{border:1px solid #000!important;padding:.6mm .4mm!important;text-align:center!important;vertical-align:middle!important;white-space:normal}.monthly-summary-table thead{display:table-header-group}.monthly-summary-table tr{break-inside:avoid}.monthly-summary-table tbody tr{height:5mm}.monthly-total td{font-weight:bold}.monthly-summary-footer{break-inside:avoid}.monthly-customer-sign{margin-top:6mm;font-size:10px}
@media print{.monthly-summary-sheet{width:210mm;min-height:297mm;padding:8mm}.monthly-summary-table thead{display:table-header-group}.monthly-summary-table tr{break-inside:avoid}#monthlyCard{display:block!important}}
.monthly-summary-table th:nth-child(3),.monthly-summary-table td:nth-child(3){white-space:nowrap!important}.monthly-visual-editor{background:#fff;border:1px solid var(--line);border-radius:12px;padding:18px;margin-bottom:18px}.monthly-visual-editor h3{margin:0 0 4px}.monthly-editor-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px 18px}.monthly-editor-grid label{display:grid;grid-template-columns:70px 1fr 30px;align-items:center;gap:6px;font-size:12px}.monthly-editor-grid input{min-width:0;padding:0}
.delivery-filters{display:grid;grid-template-columns:1fr 1fr 1fr auto;gap:14px;align-items:end;margin-bottom:18px;padding:14px;background:#f7faf8;border-radius:9px}.query-count{font-size:12px;color:var(--muted);margin:8px 0}.tax-label{color:#b23b3b;font-size:12px;font-weight:600}
.quote-customer-picker{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.print-sheet .print-meta span:last-child{margin-left:auto;text-align:right!important}.print-sheet .settlement-line{text-align:right;margin-top:2mm;font-size:10px}
/* 签章区单独下移一行，并加大两方之间距离。 */
.print-sheet .print-foot{margin-top:8mm!important;display:grid!important;grid-template-columns:42% 58%!important;column-gap:0!important;width:100%!important}
.print-sheet .print-foot span:first-child{text-align:left!important}
.print-sheet .print-foot span:last-child{text-align:left!important;padding:0!important}
@media print{.print-sheet .print-foot{margin-top:8mm!important;display:grid!important;grid-template-columns:42% 58%!important;column-gap:0!important}.print-sheet .print-foot span:last-child{text-align:left!important;padding:0!important}}
.material-price-hint{position:fixed;z-index:9999;max-width:430px;padding:10px 14px;border:1px solid rgba(37,99,235,.35);border-radius:9px;background:rgba(239,246,255,.92);box-shadow:0 8px 24px rgba(15,23,42,.16);color:#1e3a5f;backdrop-filter:blur(5px);pointer-events:none}.material-price-hint b{display:block;margin-bottom:4px}.small-rule-panel{margin-top:18px;padding-top:16px;border-top:1px solid #dbe3ec}
.print-sheet:not(.monthly-sheet) .print-meta{display:grid!important;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr) minmax(0,.85fr)!important;width:100%!important;align-items:center}.print-sheet:not(.monthly-sheet) .print-meta span:last-child{justify-self:end!important;margin-left:0!important;text-align:right!important;white-space:nowrap!important}
.brand>span{overflow:hidden;background:#fff!important}.brand>span img{display:block;width:100%;height:100%;object-fit:contain}.login-mark{width:78px!important;height:64px!important;padding:3px;background:#fff!important;border-radius:12px!important;overflow:hidden}.login-mark img{display:block;width:100%;height:100%;object-fit:contain}
.monthly-bottom-signatures{display:grid;grid-template-columns:1fr 1fr;align-items:center;margin-top:4mm;min-height:30mm;break-inside:avoid}.monthly-bottom-signatures .monthly-seal-box{margin:0;height:30mm;padding-top:10mm}.monthly-bottom-signatures .monthly-contract-seal{width:32mm;height:32mm;left:20mm;top:-1mm}.monthly-bottom-signatures .monthly-customer-sign{margin:0;text-align:center;font-size:10px}
.finance-customer-row{cursor:pointer}.finance-customer-row:hover td{background:#f4f8f6}.finance-detail{border-left:4px solid var(--green)}.status.paid{background:#e7f6ed;color:#18733b}.status.partial{background:#fff3d9;color:#8a5a00}.status.unpaid{background:#fdecec;color:#a92d2d}
#loginError{display:none;position:fixed;z-index:220;left:50%;top:calc(50% + 170px);transform:translateX(-50%);width:330px;padding:10px 12px;border:1px solid #efb5b5;border-radius:7px;background:#fff0f0;color:#a62121;font-size:13px;line-height:1.5;text-align:left}#loginError.show{display:block}#loginForm button:disabled{opacity:.55;cursor:not-allowed}#toast{z-index:200!important}
#mobileMenu,#mobileMask{display:none}@media(max-width:700px){body{display:block;min-width:0}#mobileMenu{display:block;position:fixed;z-index:75;left:12px;top:12px;width:42px;height:42px;border:0;border-radius:9px;background:#183d30;color:#fff;font-size:23px;box-shadow:0 3px 12px #0003}#mobileMask{position:fixed;z-index:68;inset:0;background:#0007}.mobile-nav-open #mobileMask{display:block}aside{z-index:70;width:min(82vw,290px);padding:20px 16px;transform:translateX(-105%);transition:transform .2s ease;overflow-y:auto}.mobile-nav-open aside{transform:translateX(0)}.brand{margin:42px 0 18px}main{margin-left:0;width:100%;padding:68px 10px 86px}header{display:block;margin-bottom:14px}header h1{font-size:21px}header .date{margin-top:8px}.card{padding:13px;border-radius:9px;margin-bottom:12px}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.stat strong{font-size:21px;margin-top:7px}.form-grid{grid-template-columns:1fr!important;gap:10px}.span2{grid-column:span 1}.field input,.field select,.field textarea,input,select{min-height:43px;font-size:16px}.btn{min-height:42px;padding:9px 12px}.toolbar{align-items:stretch}.toolbar>.btn,.toolbar>button{width:100%}.table-wrap,.card>table,#deliveryResult{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}table{font-size:12px;min-width:720px}.edit-table{min-width:1550px}.edit-table input,.edit-table select{min-width:82px;font-size:16px}.row.no-print[style*="justify-content:flex-end"]{position:sticky;bottom:0;z-index:30;background:#fff;padding:10px 0;margin-top:10px!important;border-top:1px solid var(--line);justify-content:stretch!important}.row.no-print[style*="justify-content:flex-end"] .btn{flex:1;min-width:90px}.delivery-filters{grid-template-columns:1fr!important;padding:10px}.preview-modal{padding:64px 6px 18px}.preview-bar{height:56px;padding:0 8px;gap:6px}.preview-bar span{display:none}.preview-bar .btn{min-height:38px;padding:6px 9px}.template-editor{position:static!important;width:auto!important;margin:0 0 10px!important;max-height:none!important}.preview-pages,.quote-editor+.quote-preview{margin-left:0!important;justify-content:start!important;overflow:auto!important}.preview-pages .print-sheet{transform:scale(.48);transform-origin:top left;margin-right:-52%;margin-bottom:-52%}#login form{width:calc(100vw - 28px);padding:25px 20px}#loginError{width:calc(100vw - 44px);top:calc(50% + 160px)}#toast{left:12px;right:12px;bottom:14px;text-align:center}.monthly-editor-grid{grid-template-columns:1fr}.finance-detail{overflow-x:auto}.quote-customer-picker{grid-template-columns:1fr}}
#app .backup-restore{display:grid;grid-template-columns:minmax(280px,1fr) auto;gap:14px;align-items:end;padding-top:14px;border-top:1px solid var(--line)}@media(max-width:700px){#app .backup-restore{grid-template-columns:1fr}#app .backup-restore .btn{width:100%}}
.quote-sheet .quote-sign{display:grid!important;grid-template-columns:50% 50%!important;justify-content:initial!important;align-items:start!important}.quote-sheet .quote-sign>span{display:block;text-align:left!important}
.quote-sheet .quote-sign>.quote-provider-sign+span{padding-top:9mm!important}
.todo-board-card{min-height:420px}.todo-board{display:grid;grid-template-columns:repeat(auto-fill,minmax(390px,1fr));gap:18px;margin-top:18px;align-items:start}.todo-note{position:relative;min-height:270px;height:auto;padding:18px;border:1px solid #d6c981;border-radius:4px;background:#fff9c9;box-shadow:0 5px 14px #2b37231a;transform:rotate(-.25deg)}.todo-note:nth-child(even){transform:rotate(.2deg)}.todo-note.normal{border-top:6px solid #56a36c}.todo-note.urgent{border-top:6px solid #e6a423;background:#fff0bd}.todo-note.overdue{border-top:6px solid #d9534f;background:#ffe0dc}.todo-note.done{border-top:6px solid #388e5c;background:#e5f4e9}.todo-note.cancelled{border-top:6px solid #8b9298;background:#eef0f1}.todo-note-head{display:flex;justify-content:space-between;gap:12px;align-items:start;border-bottom:1px dashed #b9ad6b;padding-bottom:10px}.todo-note-head h3{margin:0 0 4px;font-size:18px}.todo-note-head small{color:#687068}.todo-state{flex:none;border-radius:999px;padding:5px 9px;background:#fff9;font-size:12px;font-weight:700}.todo-lines{padding:10px 0;overflow-x:auto}.todo-item{display:grid;grid-template-columns:minmax(90px,1fr) 64px max-content;gap:10px;padding:7px 0;border-bottom:1px dotted #c5ba78;align-items:center;white-space:nowrap}.todo-item span{font-size:12px;color:#575e57}.todo-item em{font-style:normal;text-align:right;font-family:Consolas,monospace}.todo-meta,.todo-flags{display:flex;justify-content:space-between;gap:8px;margin-top:9px;font-size:12px}.todo-flags{padding:8px;background:#fff8;border-radius:5px}.todo-flags .yes{color:#187542;font-weight:700}.todo-flags .no{color:#8a5b23}.todo-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:12px}.todo-actions .todo-exported{background:#dfe3e5!important;border-color:#c3c9cc!important;color:#71787c!important;box-shadow:none}.todo-history-result{margin-top:12px;padding:9px;background:#fff9;border-radius:5px;font-weight:700}.quote-status{display:inline-block;padding:4px 8px;border-radius:999px;font-size:12px;font-weight:700;white-space:nowrap}.quote-status.won{background:#fff0b3;color:#805500}.quote-status.delivered{background:#d9f2e2;color:#176b3d}.quote-status.cancelled{background:#eceff1;color:#667078}.quote-status.pending{background:#e9eef5;color:#52606d}.round-symbol-input{font-weight:700;text-align:center;background:#f3f5f4!important;color:#17251f}@media(max-width:700px){.todo-board{grid-template-columns:1fr}.todo-note{min-height:270px;transform:none!important}.todo-item{grid-template-columns:minmax(80px,1fr) 62px max-content}.todo-actions .btn{flex:1}}
.todo-board{grid-template-columns:repeat(auto-fill,minmax(330px,1fr))}.todo-item{grid-template-columns:max-content max-content minmax(max-content,1fr);column-gap:2ch;width:100%}.todo-item span{text-align:left}.todo-item em{text-align:right}
.todo-head-actions{display:flex;align-items:center;gap:7px}.todo-organize{border:1px solid #a89b58;border-radius:5px;background:#fffbe2;color:#615a36;padding:4px 8px;cursor:pointer;font-size:12px}.todo-organize:hover{background:#fff}.todo-item b,.todo-item .todo-processing{font-size:14px;font-weight:700}.todo-processing.fine{color:#d22f27}.todo-processing.plate{color:#1769c2}.todo-processing.raw{color:#151515}
.quote-sheet,.monthly-summary-sheet{break-after:page;page-break-after:always}.quote-sheet:last-child,.monthly-summary-sheet:last-child{break-after:auto;page-break-after:auto}
.pdf-render-host{position:fixed;left:-30000px;top:0;z-index:-1;background:#fff}.pdf-render-host .print-sheet,.pdf-render-host .quote-sheet,.pdf-render-host .monthly-summary-sheet{display:block!important;transform:none!important;box-shadow:none!important;margin:0!important;background:#fff!important;overflow:hidden;break-after:auto!important}.pdf-render-host .quote-sheet,.pdf-render-host .monthly-summary-sheet{width:210mm!important;min-width:210mm!important;min-height:297mm!important}
.pdf-render-host .delivery-pdf-provider-sign{position:relative!important;display:block!important}.pdf-render-host .delivery-pdf-contract-seal{position:absolute!important;width:31mm!important;height:31mm!important;max-width:31mm!important;max-height:31mm!important;object-fit:contain!important;left:24mm!important;top:-17mm!important;z-index:3!important}.pdf-render-host .print-sheet{overflow:hidden!important}
@media(max-width:700px){
html,body{max-width:100%;overflow-x:hidden}body.mobile-nav-open{overflow:hidden}main{padding:66px 9px 96px}header{padding:0 3px}.card{padding:12px;overflow:hidden}.stats{grid-template-columns:1fr 1fr}.stat{min-height:96px}.toolbar{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}.toolbar h3{margin:0}.toolbar>.row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;gap:8px}.toolbar>.row .btn,.toolbar>.row button{width:100%;min-width:0}.tabs{overflow-x:auto;padding-bottom:3px}.tabs .btn{flex:0 0 auto}.formula-note{line-height:1.55}.totalbar{position:sticky;bottom:64px;z-index:24;background:#fff;border-top:1px solid var(--line);padding:10px 4px}.totalbar strong{font-size:20px}
.table-wrap:has(.edit-table){overflow:visible;border:0}.edit-table{display:block!important;width:100%!important;min-width:0!important;background:transparent}.edit-table thead{display:none}.edit-table tbody{display:grid;gap:12px}.edit-table tbody tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;background:#fff;border:1px solid #cedbd3;border-radius:10px;padding:10px;box-shadow:0 2px 7px #183d3010}.edit-table tbody td{display:flex;min-width:0;padding:0;border:0;white-space:normal;flex-direction:column;gap:5px}.edit-table tbody td::before{content:attr(data-mobile-label);display:block;color:var(--muted);font-size:11px;line-height:1.2}.edit-table tbody td:first-child{grid-column:1/-1;display:block;background:#edf5f0;border-radius:6px;padding:7px 9px;color:var(--green);font-weight:700}.edit-table tbody td:first-child::before{content:'明细行';display:inline;margin-right:6px;color:var(--green)}.edit-table tbody td:nth-child(3),.edit-table tbody td:nth-child(18),.edit-table tbody td:last-child{grid-column:1/-1}.edit-table input,.edit-table select{width:100%!important;min-width:0!important;height:42px;padding:8px;font-size:16px}.edit-table td:last-child .btn{width:100%}.edit-table .row{display:grid;grid-template-columns:auto 1fr;gap:4px!important}.edit-table .diam{align-self:center}
.table-wrap:not(:has(.edit-table)),.card>table,#deliveryResult,#quotationResult,.finance-detail,#monthlyCard{overflow-x:auto;-webkit-overflow-scrolling:touch}.table-wrap:not(:has(.edit-table)) table,.card>table,#deliveryResult table,#quotationResult table,.finance-detail table{min-width:760px}.table-wrap:not(:has(.edit-table)) th:last-child,.table-wrap:not(:has(.edit-table)) td:last-child,#deliveryResult th:last-child,#deliveryResult td:last-child,#quotationResult th:last-child,#quotationResult td:last-child{position:sticky;right:0;background:#fff;box-shadow:-3px 0 5px #17231d10;z-index:2}.table-wrap:not(:has(.edit-table)) th:last-child,#deliveryResult th:last-child,#quotationResult th:last-child{background:#f2f6f3;z-index:3}.delivery-filters{display:grid!important;grid-template-columns:1fr!important;gap:9px}.delivery-filters .btn{width:100%}
.todo-board{grid-template-columns:minmax(0,1fr)!important}.todo-note{min-height:0;padding:14px}.todo-note-head{flex-wrap:wrap}.todo-head-actions{margin-left:auto}.todo-lines{overflow-x:auto}.todo-item{grid-template-columns:max-content max-content minmax(110px,1fr)!important;column-gap:1.5ch;font-size:13px}.todo-item b,.todo-item .todo-processing{font-size:13px}.todo-meta{display:grid;grid-template-columns:1fr;gap:5px}.todo-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.todo-actions .btn{width:100%}
.preview-modal{padding:62px 4px 18px}.preview-bar{height:54px;padding:0 6px;gap:5px}.preview-bar b{font-size:13px}.preview-bar .btn{font-size:12px;padding:6px 8px}.template-editor{padding:12px!important}.template-editor label{grid-template-columns:72px minmax(0,1fr) 34px}.preview-pages .print-sheet{transform:scale(.45);margin-right:-55%;margin-bottom:-55%;transform-origin:top left}.monthly-summary-sheet{min-width:1000px}.monthly-visual-editor{overflow:hidden}.monthly-editor-grid{grid-template-columns:1fr!important}.backup-restore{grid-template-columns:1fr!important}
#toast{bottom:78px}.row.no-print[style*="justify-content:flex-end"]{gap:7px;overflow-x:auto;flex-wrap:nowrap!important}.row.no-print[style*="justify-content:flex-end"] .btn{flex:1 0 auto;min-width:88px}#login form{max-height:calc(100vh - 24px);overflow:auto}.brand{margin-top:38px}nav button{min-height:44px;font-size:15px}
}
.price-quote-table{width:100%!important;table-layout:fixed!important}.price-quote-table th:nth-child(1),.price-quote-table td:nth-child(1){width:12%}.price-quote-table th:nth-child(2),.price-quote-table td:nth-child(2){width:38%}.price-quote-table th:nth-child(3),.price-quote-table td:nth-child(3){width:22%}.price-quote-table th:nth-child(4),.price-quote-table td:nth-child(4){width:28%}.price-quote-table th,.price-quote-table td{text-align:center!important;vertical-align:middle!important}
.btn.blue{background:#1769c2;border-color:#1769c2;color:#fff}.btn.blue:hover{background:#12579f;border-color:#12579f}.price-quote-polished{margin-top:2mm!important;border:1.2px solid #000!important}.price-quote-polished th{background:#f1f4f6!important;font-weight:700!important;letter-spacing:.5px}.price-quote-polished th,.price-quote-polished td{padding:1.5mm 1.2mm!important}.price-quote-polished tbody tr:nth-child(even) td{background:#fafafa!important}
.price-quote-editor h4{margin:16px 0 7px}.price-quote-editor+ .quote-preview .quote-head h2{font-size:var(--price-quote-title-size,22px)!important}.price-quote-table col{width:auto}.price-quote-table th,.price-quote-table td{width:auto!important}
.add-line-bottom{justify-content:flex-end!important;margin-top:10px;margin-bottom:4px}.add-line-bottom .btn{min-width:130px}
@media(max-width:700px){.add-line-bottom{justify-content:stretch!important}.add-line-bottom .btn{width:100%;min-height:42px}}
.quick-modal{position:fixed;inset:0;z-index:95;display:none;align-items:center;justify-content:center;background:#0007;padding:16px}
.quick-modal.open{display:flex}
.quick-modal-box{width:min(680px,100%);max-height:86vh;overflow:auto;background:#fff;border-radius:12px;padding:18px;box-shadow:0 10px 40px #0004}
.quick-modal-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}
.quick-modal-box textarea{width:100%;min-height:190px;resize:vertical;font-size:14px;line-height:1.7}
.quick-modal-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:12px;flex-wrap:wrap}
.quick-modal-box small{display:block;margin-top:10px;line-height:1.5}
@media(max-width:700px){.quick-modal{padding:10px}.quick-modal-actions .btn{flex:1 0 auto;min-width:0}}
@media(max-width:700px){
/* 查询列表由用户横向滑动查看，右侧操作列不再覆盖客户名称。 */
.table-wrap:not(:has(.edit-table)) th:last-child,.table-wrap:not(:has(.edit-table)) td:last-child,#deliveryResult th:last-child,#deliveryResult td:last-child,#quotationResult th:last-child,#quotationResult td:last-child{position:static!important;right:auto!important;box-shadow:none!important}
.mobile-table-scroll{display:block;width:100%;max-width:100%;overflow-x:auto!important;overflow-y:hidden;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y}
.customer-table-scroll table{display:table!important;width:max-content!important;min-width:760px!important;overflow:visible!important}
.customer-table-scroll th:last-child,.customer-table-scroll td:last-child{position:static!important;right:auto!important;box-shadow:none!important}
.todo-history-delete{width:100%}
}
/* 月结单无论在手机还是电脑上发起打印，都强制使用单页 A4 宽度。 */
@media print{
#mobileMenu,#mobileMask{display:none!important}
html,body{width:210mm!important;min-width:210mm!important;max-width:210mm!important;overflow:visible!important}
main{margin:0!important;padding:0!important;width:210mm!important;max-width:210mm!important}
#monthlyCard{display:block!important;width:210mm!important;max-width:210mm!important;overflow:visible!important;padding:0!important;margin:0!important}
.monthly-summary-sheet{display:block!important;box-sizing:border-box!important;width:210mm!important;min-width:210mm!important;max-width:210mm!important;min-height:297mm!important;margin:0!important;overflow:hidden!important;transform:none!important}
.monthly-summary-table{display:table!important;width:100%!important;min-width:0!important;max-width:100%!important;table-layout:fixed!important;overflow:visible!important}
}
/* PDF 渲染不继承手机列表的最小宽度，避免两侧留白、内容被挤到中间。 */
.pdf-render-host .monthly-summary-sheet{box-sizing:border-box!important;width:210mm!important;min-width:210mm!important;max-width:210mm!important;height:297mm!important;min-height:297mm!important;max-height:297mm!important;padding:8mm!important;overflow:hidden!important}
.pdf-render-host .monthly-summary-table{display:table!important;width:100%!important;min-width:0!important;max-width:100%!important;table-layout:fixed!important;overflow:visible!important}
.pdf-render-host .monthly-summary-table th,.pdf-render-host .monthly-summary-table td{line-height:1.1!important}
.monthly-page-number{position:absolute;right:8mm;top:3mm;z-index:2;font-size:9px;font-weight:normal;color:#000;white-space:nowrap}
.btn.settle-button{background:#f2b705;border-color:#d49b00;color:#3b2a00;font-weight:700;min-width:88px}.btn.settle-button:hover{background:#dda800}.btn.settle-button.active{background:#c98e00;border-color:#a87500;color:#fff}
@media(max-width:700px){
/* 手机录单明细保持五列：料型独占一行，材质/长/宽/高/件数一行，其余按顺序排列。 */
.table-wrap:has(.edit-table){margin-left:-2px;margin-right:-2px}
.edit-table tbody{gap:6px}
.edit-table tbody tr{grid-template-columns:repeat(5,minmax(0,1fr));gap:5px;padding:6px;border-radius:7px}
.edit-table tbody td{gap:2px}
.edit-table tbody td:nth-child(2){grid-column:1}
.edit-table tbody td:nth-child(18){grid-column:span 3}
.edit-table tbody td:last-child{grid-column:span 2}
.edit-table tbody td::before{font-size:9px;line-height:1.05}
.edit-table tbody td:first-child{padding:4px 6px;border-radius:5px;font-size:11px}
.edit-table input,.edit-table select{height:33px;min-height:33px;padding:4px 6px;font-size:14px;border-radius:5px}
.edit-table td:last-child .btn{min-height:32px;height:32px;padding:4px 8px}
.edit-table .row{gap:3px!important}
}
.todo-remark{margin-top:8px;padding:8px 10px;background:#fff3b8;border:1.5px solid #e0a800;border-radius:6px;font-size:12.5px;font-weight:600;color:#6b3d00;white-space:pre-wrap;word-break:break-all;box-shadow:0 1px 4px rgba(0,0,0,.08)}
@media(max-width:700px){.todo-remark{white-space:normal}}
.site-footer{padding:18px 6px 8px;text-align:center;font-size:12px;color:var(--muted)}
.site-footer a{color:var(--muted);text-decoration:none}
.site-footer a:hover{color:var(--green)}
@media print{.site-footer{display:none!important}}
.todo-note.dueToday{border-top:6px solid #e62222;background:#ffe9e6}
.quick-type-choice{margin-top:12px;padding-top:12px;border-top:1px dashed #c5ba78}.quick-type-choice b{display:block;margin-bottom:8px}
