/* Copyright (c) 2026 魏永平。保留所有权利。
 * 本项目自有内容按 LICENSE.txt 商业授权；第三方权利见 THIRD-PARTY-NOTICES.md。 */
.contract-preview{width:min(1000px,96vw);background:#eef1f5}.contract-paper{box-sizing:border-box;max-width:210mm;background:#fff;color:#111;margin:12px auto;padding:15mm;font-family:"SimSun","宋体",serif;font-size:11pt;line-height:1.65}.contract-paper h1{text-align:center;color:#111;font-size:22pt;margin:0 0 7mm;overflow-wrap:anywhere}.contract-meta{display:flex;justify-content:space-between;flex-wrap:wrap;gap:6px;border-bottom:1px solid #333;padding-bottom:4mm}.contract-parties,.contract-signatures{display:grid;grid-template-columns:1fr 1fr;gap:8mm}.contract-party{min-width:0}.contract-party p{margin:2mm 0;overflow-wrap:anywhere}.contract-paper h3{font-size:12pt;margin:5mm 0 2mm}.contract-paper .tablewrap{border:0;border-radius:0;overflow:visible}.contract-paper table{width:100%;table-layout:fixed;white-space:normal;font-size:9pt}.contract-paper th,.contract-paper td{border:1px solid #333!important;padding:1.5mm!important;background:white!important;color:#111;overflow-wrap:anywhere;vertical-align:middle}.contract-paper th:first-child{width:7mm}.contract-paper th:nth-child(2){width:29mm}.contract-paper .contract-clause>div{white-space:pre-wrap;overflow-wrap:anywhere;min-height:12mm}.contract-total{text-align:right;font-weight:bold}.contract-signatures{margin-top:10mm;break-inside:avoid}.contract-signatures p:first-child{min-height:15mm}.contract-editor-section{border:1px solid var(--line,#ccc);border-radius:8px;margin:16px 0;padding:15px}.contract-editor-section legend{font-weight:bold;padding:0 6px}.contract-line-editor{min-width:1000px;white-space:normal}.contract-line-editor td{padding:5px}.contract-line-editor input,.contract-line-editor select{min-width:65px;width:100%;box-sizing:border-box;padding:6px}.contract-line-editor td:first-child{min-width:170px}.contract-line-editor input[data-contract-field=name]{margin-top:5px}@media(max-width:600px){.contract-paper{padding:15px;font-size:10pt}.contract-parties{grid-template-columns:1fr}.contract-paper .tablewrap{overflow:auto}.contract-paper table{min-width:620px}.contract-preview{padding:12px}}@page erp-contract{size:A4 portrait;margin:15mm}@media print{#printView.contract-print{page:erp-contract}#printView.contract-print .contract-paper{max-width:none;width:100%;padding:0;margin:0;font-size:11pt}#printView.contract-print .contract-parties{grid-template-columns:1fr 1fr}#printView.contract-print .contract-paper table{min-width:0;white-space:normal}#printView.contract-print .contract-paper thead{display:table-header-group}#printView.contract-print .contract-paper tr{break-inside:avoid}#printView.contract-print .contract-paper .tablewrap{overflow:visible}#printView.contract-print .contract-paper th,#printView.contract-print .contract-paper td{padding:1.5mm!important;border:1px solid #333!important}}
.contract-product-picker{width:min(1400px,96vw)}.contract-product-picker .toolbar{flex-wrap:wrap}.contract-product-picker .tablewrap{overflow:auto}.contract-product-picker table{min-width:1100px;white-space:normal}.contract-product-picker th,.contract-product-picker td{font-size:12px;padding:8px;overflow-wrap:anywhere}.contract-product-picker [data-cp-pick]{cursor:pointer}.contract-product-picker [data-cp-pick]:hover,.contract-product-picker [data-cp-pick]:focus{background:var(--soft,#e9f5f8)}.contract-product-details table{white-space:normal}.contract-product-details td{overflow-wrap:anywhere}.contract-line-editor [data-contract-product]{width:100%;white-space:normal}
.contract-category-filters{display:flex;gap:12px;align-items:flex-end}.contract-category-filters label{flex:1;min-width:180px;margin:0}.contract-category-filters select,.contract-category-filters input{width:100%;max-width:none;box-sizing:border-box}@media(max-width:600px){.contract-category-filters label{flex-basis:100%;min-width:0}}
.contract-reference-head{display:grid;grid-template-columns:1fr 1fr;gap:1mm 8mm;margin-bottom:4mm}.contract-reference-head p{margin:1mm 0;overflow-wrap:anywhere}.contract-reference h3{font-size:10.5pt;margin:3mm 0}.contract-reference .contract-reference-clause{margin:3mm 0;white-space:pre-wrap;overflow-wrap:anywhere}.contract-reference .contract-reference-signatures{gap:0;border:1px solid #333;margin-top:5mm}.contract-reference-signatures>div{padding:2mm;min-width:0;overflow-wrap:anywhere}.contract-reference-signatures>div+div{border-left:1px solid #333}.contract-reference-signatures p{margin:1mm 0}.contract-reference-signatures h3{margin:0 0 2mm;border-bottom:1px solid #333}.contract-reference-date{text-align:right;font-size:10pt}.contract-line-editor td:first-child{min-width:35px;width:35px}.contract-line-editor td:nth-child(2){min-width:170px}.contract-reference .contract-goods tfoot{display:table-row-group}@media print{.contract-reference-signatures{grid-template-columns:1fr 1fr}.contract-reference-head{grid-template-columns:1fr 1fr}}

.contract-reference table.contract-goods{table-layout:auto}.contract-reference .contract-goods th,.contract-reference .contract-goods td{text-align:center!important;vertical-align:middle}.contract-reference .contract-goods thead td,.contract-reference .contract-goods th{width:auto}.contract-reference .contract-goods .contract-subtotal-col,.contract-reference .contract-goods .contract-note-col{width:18%}.contract-reference .contract-goods tbody td:first-child,.contract-reference .contract-goods tbody td:nth-child(4){white-space:nowrap}

.contract-reference .contract-goods tfoot td:first-child{text-align:left!important}
