.cost-model-panel{margin:18px 0;border:1px solid #dce7d9;background:#fff;border-radius:14px;padding:0}
.cost-model-panel>summary{padding:18px 21px;color:#224b35;font-size:14px;font-weight:700;list-style:none}
.cost-model-panel>summary::-webkit-details-marker{display:none}
.cost-model-panel>summary::after{content:'⌄';float:right;color:#758b76}
.cost-model-panel[open]>summary::after{transform:rotate(180deg)}
.cost-model-panel>summary span{margin-left:12px;color:#819280;font-size:11px;font-weight:400}
.cost-model-body{padding:0 20px 20px}
.cost-model-actions{display:flex;flex-wrap:wrap;gap:9px;margin:15px 0}
.cost-model-actions button{font-size:12px;padding:9px 13px}
#costModelStatus{font-size:12px;min-height:18px;margin:10px 0}
.cost-source,.cost-empty{font-size:12px;color:#839282;line-height:1.6}
.cost-section{margin:10px 0;border:1px solid #e1e8dd;border-radius:9px;padding:0}
.cost-section>summary{padding:12px 15px;border:0;color:#34583f;font-size:13px;font-weight:650;list-style:none}
.cost-section>summary::-webkit-details-marker{display:none}
.cost-section[open]>summary{background:#f5f8f2;border-bottom:1px solid #e1e8dd}
.cost-section>summary span{float:right;color:#889687;font-weight:400}
.cost-table-scroll{overflow:auto;max-height:510px}
.cost-table{width:100%;min-width:650px;border-collapse:collapse;text-align:left;font-size:12px}
.cost-table th,.cost-table td{padding:9px 11px;border-bottom:1px solid #e8eee5;vertical-align:top;line-height:1.5}
.cost-table th{position:sticky;top:0;background:#edf4ea;color:#506853;z-index:1;white-space:nowrap}
.cost-table input,.cost-table select{min-width:86px;max-width:140px;margin:0;padding:7px;font-size:12px}
.cost-table input:disabled,.cost-table select:disabled{border-color:transparent;background:transparent;color:#344a38;opacity:1}
.cost-table small{display:block;font-size:10px;color:#899788}
.cost-parts{display:flex;flex-wrap:wrap;gap:7px;min-width:240px}
.cost-part{font-size:11px;color:#607364;display:inline-flex;align-items:center;gap:3px;background:#f4f7f2;padding:4px 6px;border-radius:5px}
.cost-part input{max-width:64px;min-width:52px}
.cost-grid{display:grid;grid-template-columns:repeat(3,minmax(155px,1fr));gap:12px;padding:16px}
.cost-grid input{margin-top:5px}
#costModelPreview{margin-top:22px}
#costModelPreview h3{font-size:15px}
.cost-search{max-width:350px;margin:12px 0}
.cost-search input{margin-top:4px}
@media(max-width:760px){.cost-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cost-model-body{padding:0 12px 14px}}
@media(max-width:460px){.cost-grid{grid-template-columns:1fr}}
.cost-add-bar{display:flex;align-items:center;gap:10px;margin-top:10px;flex-wrap:wrap}
.cost-add-bar button{padding:6px 14px}
.cost-add-bar small{color:#8a6d3b}
.cost-name-input{width:130px;padding:4px 6px}
.cost-source-input{min-width:110px;width:150px;padding:4px 6px}
.cost-delete{color:#9a3f2b}
.cost-delete-confirm{background:#9a3f2b!important;color:#fff!important;border-color:#9a3f2b!important}
.cost-part-remove{flex:0 0 auto;padding:3px 7px;color:#9a3f2b}
.cost-table select[data-cost-moq-scope]{min-width:170px;max-width:230px}
.cost-table .cost-undo{display:block;margin-top:5px;padding:2px 0;font-size:11px}
/* 复合结构表有 11 列（含算法/内膜/内膜克重），默认 650px 会挤成一团 */
.cost-table[data-cost-group="composites"]{min-width:1120px}
.cost-table[data-cost-group="composites"] select[data-cost-key="algorithm"]{min-width:150px;max-width:190px}
.cost-warn{color:#a8562f}
.cost-part select{min-width:100px;max-width:150px}
.cost-section-io{display:inline-flex;gap:8px;margin-left:auto;font-weight:400}
.cost-section-io button,.cost-section-io .cost-import-label{padding:3px 10px;font-size:11px;border:1px solid #cbd9c7;background:#fff;color:#214c39;border-radius:6px;cursor:pointer;display:inline-flex;align-items:center;gap:4px}
.cost-section-io button:disabled,.cost-section-io .cost-import-label[hidden]{opacity:.4;cursor:default}
.cost-section-io button:hover:not(:disabled),.cost-section-io .cost-import-label:hover{border-color:#64836c;background:#f1f6ed}
.cost-modal{position:fixed;inset:0;background:#1f2a23aa;display:grid;place-items:center;z-index:99;padding:24px}
.cost-modal[hidden]{display:none}
.cost-modal-card{background:#fff;border-radius:14px;width:min(880px,100%);max-height:86vh;display:flex;flex-direction:column;box-shadow:0 30px 60px #0d1f171a}
.cost-modal-card>header{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid #e3e9de}
.cost-modal-card>header h3{margin:0;font-size:16px}
.cost-modal-card>header button{padding:6px 10px}
.cost-modal-body{padding:14px 18px;overflow:auto;flex:1}
.cost-modal-summary{color:#546b5b;margin:0 0 12px;font-size:13px}
.cost-modal-table-scroll{overflow:auto;border:1px solid #e3e9de;border-radius:8px}
.cost-modal-card>footer{display:flex;align-items:center;gap:14px;padding:12px 18px;border-top:1px solid #e3e9de;background:#fafcf8}
.cost-modal-card>footer label{display:flex;align-items:center;gap:6px;color:#546b5b;font-size:13px}
.cost-modal-card>footer span{flex:1;color:#78937e;font-size:12px}
.cost-modal-card>footer button{padding:8px 18px}
.cost-diff-table{width:100%;border-collapse:collapse;font-size:12px}
.cost-diff-table th,.cost-diff-table td{padding:8px 10px;text-align:left;border-bottom:1px solid #eef2e8;vertical-align:top}
.cost-diff-table th{background:#f5f8f3;font-weight:600;color:#3a5443;position:sticky;top:0}
.cost-diff-table tr[data-cost-diff-op="add"]{background:#f0f8ec}
.cost-diff-table tr[data-cost-diff-op="delete"]{background:#fbecea;color:#8a3320}
.cost-diff-table tr[data-cost-diff-op="modify"]{background:#fcf6e8}
.cost-diff-table tr[data-cost-diff-op="skip"]{color:#8a9881}
.cost-diff-table tr[data-cost-diff-op="unchanged"]{color:#78937e}
.cost-diff-fields{margin:4px 0 0;padding:0;list-style:none;font-size:11px;color:#465d50;display:flex;flex-direction:column;gap:2px}
.cost-diff-fields code{color:#214c39;background:#e8eee5;padding:1px 5px;border-radius:3px;margin-right:4px}
.cost-diff-fields .diff-before{color:#b15841;text-decoration:line-through}
.cost-diff-fields .diff-after{color:#3a7340;font-weight:600}
.cost-diff-empty{text-align:center;color:#8a9881;padding:18px 0}
.cost-import-label{cursor:pointer;margin:0}
.cost-import-label input[type=file]{display:none}
