:root{color:#221914;font-synthesis:none;text-rendering:optimizelegibility;background:#f4f1ec;font-family:Inter,Noto Sans TC,PingFang TC,Microsoft JhengHei,system-ui,sans-serif}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;border:0}main{min-height:100vh}.workspace{grid-template-columns:390px minmax(0,1fr);gap:22px;padding:22px;display:grid}.control-panel,.editor-table,.quote-sheet,.pdf-preview{background:#fffdf9;border:1px solid #ded5ca}.control-panel{flex-direction:column;gap:18px;height:calc(100vh - 44px);padding:22px;display:flex;position:sticky;top:22px;overflow:auto}.brand{align-items:center;gap:14px;display:flex}.brand img{object-fit:contain;width:72px;height:42px}.brand p,.brand h1,.table-toolbar h2,.table-toolbar p{margin:0}.brand p{color:#8d7868;font-size:13px}.version-badge{color:#6b5444;background:#efe5d8;margin-top:6px;padding:3px 7px;font-size:11px;font-weight:700;display:inline-block}.brand h1{letter-spacing:0;font-size:24px}.upload-zone{color:#332118;background:#fbf6ee;border:1px dashed #bba387;place-items:center;gap:7px;min-height:144px;display:grid}.upload-zone span,.microcopy,.table-toolbar p,.formula-box p{color:#817267;font-size:13px;line-height:1.55}.upload-zone input{display:none}.manual-entry-button{color:#fffaf3;background:#6a4a2f;justify-content:center;align-items:center;gap:8px;min-height:44px;font-weight:800;display:inline-flex}.status{background:#fff8ea;border-left:4px solid #c79b57;align-items:flex-start;gap:9px;padding:12px;font-size:14px;line-height:1.45;display:flex}.status.done{background:#f1f8ef;border-color:#67986b}.status.warning{border-color:#d69d2f}.status.error{background:#fff1ef;border-color:#b7554d}.spin{animation:.9s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.field-group label,.field-grid label{color:#5b4d43;gap:8px;font-size:13px;font-weight:700;display:grid}.mode-grid,.currency-toggle{grid-template-columns:repeat(2,1fr);gap:8px;margin-top:8px;display:grid}.mode-grid button,.currency-toggle button{color:#3c281e;background:#f6efe6;border:1px solid #0000;justify-content:space-between;align-items:center;min-height:52px;padding:10px 12px;display:flex}.currency-toggle button{justify-content:center}.project-price-panel{background:#fbf6ee;border:1px solid #eaded0;padding:12px}.project-price-panel .currency-toggle{grid-template-columns:repeat(3,1fr)}.checkbox-line{align-items:center;grid-template-columns:none!important;gap:8px!important;display:flex!important}.checkbox-line input{width:16px;height:16px}.mode-grid button.active,.currency-toggle button.active{color:#fffaf2;background:#301d14;border-color:#301d14}.field-grid{grid-template-columns:1fr 1fr;gap:12px;display:grid}.pdf-ocr-panel{background:#fbf6ee;border:1px solid #eaded0;gap:10px;padding:12px;display:grid}.page-range{grid-template-columns:1fr 1fr;gap:10px;display:grid}.page-range label{color:#5b4d43;gap:6px;font-size:13px;font-weight:700;display:grid}.field-grid .wide{grid-column:1/-1}input,select{color:#221914;background:#fff;border:1px solid #d8cec2;width:100%;min-height:38px;padding:8px 10px}.actions{grid-template-columns:1fr 1fr;gap:9px;display:grid}.actions button,.secondary,.ghost{color:#fffaf3;background:#301d14;justify-content:center;align-items:center;gap:7px;min-height:40px;display:inline-flex}.secondary{width:100%}.secondary.alt{background:#6a4a2f}.actions .ghost{color:#301d14;background:#ebe2d8}.formula-box{background:#f8f3ec;border:1px solid #eaded0;padding:14px}.formula-box p{margin:8px 0 0}.quote-area{gap:22px;min-width:0;display:grid}.editor-table{padding:18px}.table-toolbar{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:14px;display:flex}.table-toolbar h2{font-size:21px}.table-toolbar span{color:#5c4537;background:#f0e7dc;padding:5px 10px;font-size:13px;font-weight:700}.table-toolbar-actions{flex-shrink:0;align-items:center;gap:8px;display:flex}.compact-add-button{color:#fffaf3;background:#301d14;justify-content:center;align-items:center;gap:6px;min-height:32px;padding:6px 10px;font-size:13px;font-weight:800;display:inline-flex}.item-editor{gap:8px;display:grid;overflow-x:auto}.pager{flex-wrap:wrap;gap:6px;margin:0 0 14px;display:flex}.pager button{color:#3c281e;background:#efe5d8;border:1px solid #0000;min-width:34px;min-height:32px;padding:6px 10px}.pager button.active{color:#fffaf2;background:#301d14}.quote-pager{width:min(100%,1080px);margin:0 auto -6px}.editor-row{grid-template-columns:110px 160px minmax(260px,1fr) 70px 100px 96px 74px 110px 40px;align-items:center;gap:8px;min-width:1060px;display:grid}.editor-row strong{text-align:right;font-size:14px}.icon-only{color:#5b4031;background:#f4ebe2;place-items:center;width:38px;height:38px;display:grid}.image-upload-control{color:#5b4031;cursor:pointer;background:#f4ebe2;justify-content:center;align-items:center;gap:4px;min-height:38px;padding:4px 6px;font-size:12px;font-weight:800;display:flex;overflow:hidden}.image-upload-control img{object-fit:cover;background:#fff;border:1px solid #d8cbbd;width:26px;height:26px}.image-upload-control input{display:none}.pdf-preview{grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;padding:14px;display:grid}.pdf-preview img{object-fit:contain;background:#fff;border:1px solid #e1d6cb;width:100%;max-height:340px}.quote-sheet{color:#2a1d17;width:min(100%,1080px);margin:0 auto 32px;padding:52px 58px;position:relative;overflow-x:auto;box-shadow:0 18px 50px #2b201814}.quote-sheet.screen-hidden{display:none}.quote-header{border-top:4px solid #2d1a12;border-bottom:1px solid #c7b9aa;justify-content:space-between;align-items:flex-start;padding:24px 0 18px;display:flex}.quote-header img{object-fit:contain;object-position:left center;width:154px;height:64px}.quote-header h2{letter-spacing:8px;margin:16px 0 6px;font-size:22px}.quote-header p{color:#77695e;margin:0;font-size:13px}.quote-meta{background:#fffaf3;border:1px solid #ded4c8;grid-template-columns:repeat(3,1fr);gap:10px 18px;margin:24px 0;padding:14px;font-size:14px;display:grid}.quote-meta p{margin:0}.quote-meta .full{grid-column:1/-1}.quote-sheet h3{text-align:center;letter-spacing:5px;margin:28px 0 14px;font-size:17px}table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:760px;font-size:14px}th{color:#fff8ef;background:#321e14;border:1px solid #6b574c;padding:13px 9px}td{vertical-align:middle;border:1px solid #ded4c8;padding:12px 10px;line-height:1.45}th:first-child,td:first-child{text-align:center;width:54px}th:nth-child(2),td:nth-child(2){text-align:center;width:112px}th:nth-child(5),td:nth-child(5){text-align:center;width:62px}th:nth-child(6),td:nth-child(6),th:nth-child(7),td:nth-child(7){text-align:right;width:128px;font-weight:700}.quote-table.no-image th:first-child,.quote-table.no-image td:first-child{text-align:center;width:54px}.quote-table.no-image th:nth-child(2),.quote-table.no-image td:nth-child(2){text-align:center;width:24%}.quote-table.no-image th:nth-child(3),.quote-table.no-image td:nth-child(3){width:auto}.quote-table.no-image th:nth-child(4),.quote-table.no-image td:nth-child(4){text-align:center;width:62px}.quote-table.no-image th:nth-child(5),.quote-table.no-image td:nth-child(5),.quote-table.no-image th:nth-child(6),.quote-table.no-image td:nth-child(6){text-align:right;width:126px;font-weight:700}tbody tr:nth-child(2n){background:#fbf7f1}.image-cell img{object-fit:contain;background:#fff;width:82px;height:70px}.image-cell span{color:#765f4f;background:#eee5db;place-items:center;width:82px;height:70px;margin:0 auto;font-size:13px;font-weight:700;display:grid}td strong,td span{display:block}td span{color:#6e5c50;margin-top:5px;font-size:13px}.quote-summary{border:1px solid #ded4c8;justify-content:end;gap:0;width:min(360px,100%);margin-top:18px;margin-left:auto;display:grid}.quote-summary div{border-bottom:1px solid #ded4c8;grid-template-columns:1fr 150px;align-items:center;min-height:42px;display:grid}.quote-summary div:last-child{border-bottom:0}.quote-summary span,.quote-summary strong{padding:10px 12px}.quote-summary strong{text-align:right}.quote-summary .grand-total{background:#f3eadf;font-size:17px;font-weight:800}.quote-summary .project-original,.quote-summary .project-discount,.quote-summary .project-final{color:#c62828}.quote-summary .project-original strong{text-decoration:line-through;text-decoration-thickness:2px}.quote-summary .project-final{background:#fff0ee}.quote-footer{color:#7b7068;justify-content:space-between;font-size:11px;display:flex;position:absolute;bottom:18px;left:58px;right:58px}.quote-terms-sheet{align-content:start;gap:30px;min-height:1080px;padding-bottom:78px;display:grid}.terms-section h3{text-align:left;letter-spacing:2px;margin:0 0 14px;font-size:18px}.terms-section p{margin:8px 0;line-height:1.8}.payment-table{table-layout:fixed;min-width:0;margin:10px 0 14px}.payment-table th:first-child,.payment-table td:first-child{text-align:center;width:12%}.payment-table th:nth-child(2),.payment-table td:nth-child(2){text-align:left;width:48%;font-weight:500}.payment-table th:nth-child(3),.payment-table td:nth-child(3){text-align:center;width:16%;font-weight:500}.payment-table th:nth-child(4),.payment-table td:nth-child(4){text-align:right;width:24%;font-weight:800}.signature-section{grid-template-columns:1fr 1fr;gap:48px;margin-top:24px;display:grid}.signature-section div{border-top:1px solid #8f8176;min-height:150px;padding-top:20px}.signature-section strong,.signature-section span{display:block}.signature-section p{color:#4f433b;min-height:46px;margin:12px 0 34px;line-height:1.6}.mode-code{color:#5c4537;border:1px solid #c9b8a6;place-items:center;width:26px;height:26px;font-size:13px;font-weight:800;display:grid;position:absolute;bottom:14px;left:18px}@media (width<=1080px){.workspace{grid-template-columns:1fr}.control-panel{height:auto;position:static}}@media (width<=720px){.workspace{padding:12px}.quote-sheet{padding:28px 18px}.quote-meta{grid-template-columns:1fr}.quote-header{gap:12px;display:grid}.table-toolbar{display:grid}.table-toolbar-actions{justify-content:space-between}}@media print{@page{size:A4 portrait;margin:8mm}body{background:#fff}.control-panel,.editor-table,.pdf-preview,.quote-pager{display:none}.workspace{padding:0;display:block}.quote-sheet{width:100%;max-width:none;box-shadow:none;break-after:page;page-break-after:always;border:0;min-height:281mm;margin:0;padding:0;overflow:visible}.quote-footer{font-size:8.5px;bottom:0;left:0;right:0}.quote-terms-sheet{gap:18px;min-height:281mm;padding-bottom:26px}.terms-section h3{margin-bottom:8px;font-size:12px}.terms-section p{margin:5px 0;font-size:9.5px;line-height:1.55}.payment-table{margin:8px 0 10px;font-size:9px}.payment-table th,.payment-table td{padding:6px 7px}.payment-table th:first-child,.payment-table td:first-child{width:12%}.signature-section{gap:34px;margin-top:18px;font-size:9.5px}.signature-section div{min-height:92px;padding-top:12px}.signature-section p{min-height:30px;margin:8px 0 20px}.quote-sheet.screen-hidden{display:block}.quote-sheet:last-child{break-after:auto;page-break-after:auto}.quote-header{padding:10px 0}.quote-header img{width:120px;height:48px}.quote-meta{gap:6px 10px;margin:12px 0;padding:8px;font-size:10px}.quote-sheet h3{margin:14px 0 8px;font-size:13px}table{table-layout:fixed;width:100%;min-width:0;font-size:9.5px}th{padding:6px 4px}td{word-break:break-word;overflow-wrap:anywhere;padding:6px 4px;line-height:1.35}th:first-child,td:first-child{width:7%}th:nth-child(2),td:nth-child(2){width:12%}th:nth-child(3),td:nth-child(3){width:22%}th:nth-child(4),td:nth-child(4){width:31%}th:nth-child(5),td:nth-child(5){width:6%}th:nth-child(6),td:nth-child(6),th:nth-child(7),td:nth-child(7){width:11%}.quote-table.no-image th:first-child,.quote-table.no-image td:first-child{width:6%}.quote-table.no-image th:nth-child(2),.quote-table.no-image td:nth-child(2){width:24%}.quote-table.no-image th:nth-child(3),.quote-table.no-image td:nth-child(3){width:38%}.quote-table.no-image th:nth-child(4),.quote-table.no-image td:nth-child(4){text-align:center;width:6%}.quote-table.no-image th:nth-child(5),.quote-table.no-image td:nth-child(5),.quote-table.no-image th:nth-child(6),.quote-table.no-image td:nth-child(6){text-align:right;width:13%}.payment-table th:first-child,.payment-table td:first-child{text-align:center;width:12%}.payment-table th:nth-child(2),.payment-table td:nth-child(2){text-align:left;width:48%}.payment-table th:nth-child(3),.payment-table td:nth-child(3){text-align:center;width:16%}.payment-table th:nth-child(4),.payment-table td:nth-child(4){text-align:right;width:24%}.image-cell img,.image-cell span{width:54px;height:46px;font-size:9px}.quote-summary{break-inside:avoid;page-break-inside:avoid;width:300px;margin-top:12px;font-size:11px}.quote-summary div{grid-template-columns:1fr 128px;min-height:30px}.quote-summary span,.quote-summary strong{padding:6px 8px}.quote-summary .grand-total{font-size:13px}.mode-code{width:20px;height:20px;font-size:10px;bottom:0;left:0}}
