:root{font-family:"Segoe UI","Microsoft YaHei",sans-serif;color:#17251f;background:#edf2ef;line-height:1.5}*{box-sizing:border-box}body{margin:0}.shell{width:min(1180px,calc(100% - 32px));margin:38px auto 80px}header{background:#123f31;color:white;padding:34px 40px;border-radius:18px;box-shadow:0 16px 45px #123f3128}header h1{font-size:34px;margin:3px 0 8px}.eyebrow{letter-spacing:.18em;color:#a8d8c5;font-size:12px;font-weight:700}header p{margin:0;color:#dcebe5}.card{background:#fff;margin-top:22px;padding:26px 30px;border-radius:14px;box-shadow:0 8px 28px #193d2f12}h2{margin:0 0 18px;font-size:20px}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:17px 22px}label{display:flex;flex-direction:column;gap:7px;font-weight:600;color:#30473e}input,textarea{width:100%;border:1px solid #cbd8d2;border-radius:8px;padding:10px 12px;font:inherit;color:#15241e;background:#fbfdfc}input:focus,textarea:focus{outline:3px solid #55a98228;border-color:#34815f}.section-head{display:flex;justify-content:space-between;align-items:start;gap:20px}.section-head p{margin:-12px 0 15px;color:#687a72}.table-wrap{overflow:auto}table{border-collapse:collapse;width:100%;min-width:780px}th,td{border-bottom:1px solid #e2e9e5;padding:12px 10px;text-align:left;vertical-align:middle}th{font-size:13px;color:#607269;background:#f4f8f6}th:nth-child(2),th:nth-child(3){width:140px}th:nth-child(4){width:130px}th:last-child{width:46px}tfoot td{font-weight:750;background:#f4f8f6}.line-total{white-space:nowrap}.remove{background:transparent;color:#a43d3d;padding:5px 10px;font-size:20px}.secondary{background:#e8f3ee;color:#1b6247}.actions{display:flex;gap:14px;justify-content:flex-end;margin-top:24px}button{border:0;border-radius:9px;padding:11px 18px;font:inherit;font-weight:700;cursor:pointer;background:#285d48;color:white}.accent{background:#bf7b20}.actions button{min-width:150px}.actions button:disabled{opacity:.55;cursor:wait}#status{margin-top:16px;padding:14px 18px;border-radius:9px;min-height:50px;background:#fff}.success{color:#176943;border:1px solid #85c2a7}.error{color:#9b3030;border:1px solid #db9b9b}.working{color:#76511a;border:1px solid #d9ba85}@media(max-width:700px){.grid{grid-template-columns:1fr}.shell{width:min(100% - 18px,1180px);margin-top:10px}header,.card{padding:22px 18px}.section-head{display:block}.actions{flex-direction:column}.actions button{width:100%}}
.module-nav{display:flex;gap:12px;margin:22px 0}.module-nav button{background:#dbe8e2;color:#244b3b}.module-nav button.active{background:#123f31;color:#fff}.hidden{display:none}.rate{flex-direction:row;align-items:center}.rate input{width:130px}.cost-table{min-width:2100px}.cost-table th{white-space:nowrap}.cost-table td{padding:8px 6px}.cost-table input{min-width:90px;padding:7px}.cost-table .c-name,.cost-table .c-size{min-width:160px}.calc{font-variant-numeric:tabular-nums;background:#f5f8f6;text-align:right;min-width:90px}.one-to-quote{white-space:nowrap;padding:7px 10px}.remove-cost{background:transparent;color:#a43d3d;padding:7px}
.download-actions{align-items:end}.format-picker{flex-direction:row;align-items:center;gap:10px}.format-picker select{min-width:170px;border:1px solid #cbd8d2;border-radius:9px;padding:10px 12px;font:inherit;background:#fff;color:#17251f}
.technical-table{min-width:760px}.technical-table th:first-child{width:48%}.technical-table th:nth-child(2){width:20%}.technical-table th:nth-child(3){width:28%}.technical-table th:last-child{width:4%}.technical-table th input{font-weight:750;text-align:center;background:#e6f0eb}.technical-table textarea{min-height:48px}.remove-tech{background:transparent;color:#a43d3d;padding:5px 10px;font-size:20px}
.contact-recognizer{margin:0 0 22px;padding:16px;border:1px solid #c9ddd4;border-radius:12px;background:#f6faf8}.contact-image-drop{min-height:124px;border:2px dashed #9dbdaf;border-radius:10px;display:flex;align-items:center;justify-content:center;gap:18px;padding:16px;cursor:pointer;transition:.18s ease}.contact-image-drop:hover,.contact-image-drop:focus,.contact-image-drop.dragging{outline:0;border-color:#34815f;background:#edf7f2}.contact-image-drop.has-image{justify-content:flex-start}.contact-image-drop img{width:132px;height:92px;object-fit:contain;border-radius:7px;background:#fff;border:1px solid #d9e5df}.contact-image-copy{display:flex;flex-direction:column;gap:4px;color:#496057}.contact-image-copy strong{color:#173e2f;font-size:17px}.contact-image-copy small{color:#70847b}.contact-recognition-actions{display:flex;align-items:center;gap:12px;margin-top:12px}.contact-recognition-actions button{min-width:126px}.contact-recognition-actions button:disabled{opacity:.55;cursor:not-allowed}#contact-recognition-status{flex:1;padding:8px 10px;border-radius:7px;color:#5c7067}#contact-recognition-status.success,#contact-recognition-status.error,#contact-recognition-status.working{background:#fff}@media(max-width:700px){.contact-recognition-actions{align-items:stretch;flex-direction:column}.contact-recognition-actions button{width:100%}.contact-image-drop.has-image{flex-direction:column}.contact-image-drop img{width:100%;height:160px}}

/* 核算页：卡片式字段布局，避免超宽表格横向滚动 */
#costing-view .table-wrap{overflow:visible}
#costing-view .cost-table{display:block;width:100%;min-width:0;border-collapse:separate}
#costing-view .cost-table thead{display:none}
#costing-view .cost-table tbody{display:grid;gap:18px}
#costing-view .cost-table tr{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px 16px;padding:20px;border:1px solid #d9e5df;border-radius:12px;background:linear-gradient(145deg,#fff,#f8fbf9);box-shadow:0 5px 16px #193d2f0a}
#costing-view .cost-table td{display:flex;min-width:0;flex-direction:column;justify-content:flex-end;gap:7px;padding:0;border:0;background:transparent;text-align:left}
#costing-view .cost-table td::before{font-size:12px;font-weight:700;color:#607269;line-height:1.2}
#costing-view .cost-table td:nth-child(1)::before{content:'选择'}
#costing-view .cost-table td:nth-child(2)::before{content:'产品名称'}
#costing-view .cost-table td:nth-child(3)::before{content:'成本价格（CNY）'}
#costing-view .cost-table td:nth-child(4)::before{content:'数量（条）'}
#costing-view .cost-table td:nth-child(5)::before{content:'每箱数量'}
#costing-view .cost-table td:nth-child(6)::before{content:'箱数'}
#costing-view .cost-table td:nth-child(7)::before{content:'托盘尺寸'}
#costing-view .cost-table td:nth-child(8)::before{content:'每托盘箱数'}
#costing-view .cost-table td:nth-child(9)::before{content:'托盘数量'}
#costing-view .cost-table td:nth-child(10)::before{content:'装柜数量'}
#costing-view .cost-table td:nth-child(11)::before{content:'港杂费＋运费（CNY）'}
#costing-view .cost-table td:nth-child(12)::before{content:'每条运费（CNY）'}
#costing-view .cost-table td:nth-child(13)::before{content:'利润率（%）'}
#costing-view .cost-table td:nth-child(14)::before{content:'FOB 价格（CNY）'}
#costing-view .cost-table td:nth-child(15)::before{content:'FOB 单价（USD）'}
#costing-view .cost-table td:nth-child(16)::before{content:'总价（USD）'}
#costing-view .cost-table td:nth-child(18)::before{content:'操作'}
#costing-view .cost-table td:nth-child(2),#costing-view .cost-table td:nth-child(7){grid-column:span 2}
#costing-view .cost-table td:nth-child(12),#costing-view .cost-table td:nth-child(14),#costing-view .cost-table td:nth-child(15),#costing-view .cost-table td:nth-child(16){padding:10px 12px;border-radius:9px;background:#edf6f1;color:#164c38;font-size:16px;font-weight:750;font-variant-numeric:tabular-nums}
#costing-view .cost-table input{width:100%;min-width:0;padding:10px 12px}
#costing-view .cost-table .pick{width:20px;height:20px;margin:9px 0}
#costing-view .cost-table td:last-child{grid-column:1/-1;flex-direction:row;align-items:center;justify-content:flex-end;padding-top:12px;border-top:1px solid #e1e9e5}
#costing-view .cost-table td:last-child::before{margin-right:auto}
#costing-view .cost-table .remove-cost{font-size:20px}
@media(max-width:900px){#costing-view .cost-table tr{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){#costing-view .cost-table tr{grid-template-columns:1fr;padding:16px}#costing-view .cost-table td:nth-child(2),#costing-view .cost-table td:nth-child(7){grid-column:auto}}
.dimension-inputs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.cost-packing-panel{grid-column:1/-1!important;padding:18px!important;border:1px solid #cfe1d8!important;border-radius:11px!important;background:#f6faf8!important}.packing-title{font-size:17px;font-weight:800;color:#173e2f}.packing-input-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:13px 16px}.packing-input-grid select{width:100%;border:1px solid #cbd8d2;border-radius:8px;padding:10px 12px;font:inherit;background:#fff}.packing-results{display:grid;grid-template-columns:1fr 1fr;gap:12px}.packing-results div{padding:12px 14px;border-radius:9px;background:#e8f3ee;color:#164c38}.packing-results small,.packing-results strong{display:block}.packing-results strong{font-size:18px}.c-packing-preview,.quote-packing-preview{white-space:pre-line;font:10pt Arial,sans-serif;margin:0;padding:14px;border-radius:9px;background:#fff;border:1px solid #d5e3dc;color:#17251f}.quote-packing-preview:empty{display:none}.quote-packing-preview{margin-top:10px}@media(max-width:700px){.packing-input-grid,.packing-results{grid-template-columns:1fr}}

/* 客户资料库 */
.customer-library-card .section-head{align-items:center}.library-head-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:9px}.library-head-actions button{padding:9px 13px}.library-picker{margin:18px 0;padding:16px;border-radius:10px;background:#edf6f1}.library-picker select{width:100%;margin-top:7px;border:1px solid #b9cec4;border-radius:8px;padding:12px;font:inherit;background:#fff;color:#173e2f}.customer-editor{padding-top:4px}.library-actions{align-items:center}.library-actions #customer-library-status{margin-right:auto;color:#376553}.customer-table{min-width:760px}.customer-table th:last-child{width:310px}.customer-table td:last-child{display:flex;gap:7px}.customer-table button{padding:7px 10px;font-size:12px;white-space:nowrap}.customer-table .library-delete{background:#fff0f0;color:#a43d3d}.library-empty{text-align:center;color:#72827a;padding:30px}
@media(max-width:800px){.customer-library-card .section-head{align-items:stretch}.library-head-actions{justify-content:flex-start}.library-actions{align-items:stretch}.library-actions #customer-library-status{margin:0}.customer-table{min-width:680px}}

/* 业务资料库 */
.record-head-actions{display:flex;flex-wrap:wrap;gap:9px}.record-filters{display:grid;grid-template-columns:1fr 1fr auto;align-items:end;gap:16px;margin-top:20px;padding:16px;border-radius:10px;background:#edf6f1}.record-filters select{width:100%;border:1px solid #b9cec4;border-radius:8px;padding:11px 12px;font:inherit;background:#fff;color:#173e2f}.record-filters span{padding:11px 0;color:#47665a;font-weight:700}.business-record-table{min-width:940px}.business-record-table th:nth-child(1){width:210px}.business-record-table th:nth-child(2){width:110px}.business-record-table th:nth-child(3){width:130px}.business-record-table th:nth-child(4){width:190px}.business-record-table th:last-child{width:150px}.business-record-table td:last-child{display:flex;gap:8px}.business-record-table button{padding:7px 11px;font-size:12px}.business-record-table .record-delete{background:#fff0f0;color:#a43d3d}.record-type{display:inline-block;padding:4px 9px;border-radius:999px;background:#e8f3ee;color:#1b6247;font-size:12px;font-weight:700}.type-invoice{background:#edf2ff;color:#3658a5}.type-packing{background:#fff3df;color:#8c5b14}.type-costing{background:#f3ecff;color:#6842a5}
@media(max-width:760px){.record-filters{grid-template-columns:1fr}.record-head-actions{justify-content:flex-start}}
.collaboration-status{display:inline-block!important;width:auto!important;margin-top:16px!important;padding:7px 12px!important;border-radius:999px;background:#edf3f0;color:#245b46!important;font-weight:700;font-size:14px}.collaboration-status.error{background:#fff0ee;color:#a84236!important}

/* 桌面端 CRM 左侧类目栏 */
@media(min-width:1001px){
  .shell{width:min(1660px,calc(100% - 64px));display:grid;grid-template-columns:220px minmax(0,1fr);gap:24px 32px;align-items:start}
  .shell>header{grid-column:2;grid-row:1;margin:0}
  .module-nav{grid-column:1;grid-row:1/span 2;position:sticky;top:24px;display:flex;flex-direction:column;gap:12px;margin:0}
  .module-nav::before{content:'CRM工作台';display:block;padding:18px 20px;border-radius:12px;background:#dbe8e2;color:#244b3b;font-size:18px;font-weight:800}
  .module-nav button{width:100%;min-height:58px;text-align:left;padding:15px 20px}
  .shell>.view,.shell>form{grid-column:2;margin:0;min-width:0}
  .shell>form>.view{margin:0}
  .card:first-child{margin-top:0}
}
@media(max-width:1000px){
  .module-nav{position:static;display:flex;flex-direction:row;overflow-x:auto;gap:10px;margin:18px 0}
  .module-nav button{min-width:max-content}
}
