/* 变更列表(报价记录/订单/送货单等)像 Excel：表头吸顶 + 单元格不换行 + 横向滚动 + 拖表头调列宽/换列位。：不要上下自动换行撑高行、可左右拖拽看信息、表头固定。：表格区整体撑满往下显示；按表头可左右调整拖动。 */
#result_list { white-space: nowrap; }
#result_list th, #result_list td { white-space: nowrap !important; vertical-align: middle; }

/* 可滚动容器（SimpleBar 接管）：整体撑到屏幕底部，横向滚动条落在容器底边，不压住数据行 */
.qc-scrollwrap {
  overflow: auto;
  min-height: max(260px, calc(100vh - 360px));
  max-height: calc(100vh - 200px);
}
.qc-scrollwrap .simplebar-content { padding-bottom: 16px !important; }
.qc-scrollwrap #result_list thead th {
  position: sticky; top: 0; z-index: 20;
  background: #ffffff;
}
html.dark .qc-scrollwrap #result_list thead th, [data-theme="dark"] .qc-scrollwrap #result_list thead th {
  background: #1f2937;
}

/* 行距压缩：不上下撑高，尽量提高单屏信息量 */
#result_list th, #result_list td {
  padding-top: 4px !important; padding-bottom: 4px !important;
  line-height: 1.25 !important; font-size: 12px;
}
/* 成交状态下拉 / 成交金额输入也压扁，避免它们撑高行 */
#result_list td select, #result_list td input {
  padding-top: 2px !important; padding-bottom: 2px !important; min-height: 0 !important;
  line-height: 1.2 !important;
}

/* 加工品名称列默认定宽（可拖表头加宽，拖过的宽度会记住） */
#result_list th.column-product_name, #result_list td.field-product_name {
  max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
/* 序号列窄一点 */
#result_list th.column-seq, #result_list td.field-seq {
  width: 46px; text-align: center; color: #6b7280;
}

/* —— 表头：列分隔线 + 可拖 —— */
#result_list thead th { border-right: 1px solid #e5e7eb; cursor: grab; }
#result_list thead th:last-child { border-right: 0; }
[data-theme="dark"] #result_list thead th { border-right-color: #374151; }
#result_list thead th a { cursor: pointer; }
/* 列宽手柄：表头右边缘 12px，悬停显示绿色分隔线 */
#result_list th .col-resizer {
  position: absolute; right: -6px; top: 0; height: 100%; width: 12px; z-index: 2;
  cursor: col-resize; user-select: none; touch-action: none;
}
#result_list th .col-resizer::after {
  content: ""; position: absolute; left: 5px; top: 0; bottom: 0; width: 2px; background: transparent;
}
#result_list th .col-resizer:hover::after, body.qc-resizing #result_list th .col-resizer::after { background: #10b981; }
body.qc-resizing, body.qc-resizing * { cursor: col-resize !important; user-select: none !important; }
/* 换列位：被拖的表头变淡，目标位置显示绿色插入线 */
body.qc-dragging, body.qc-dragging * { cursor: grabbing !important; user-select: none !important; }
#result_list th.qc-drag-src { opacity: .45; }
#result_list th.qc-drop-left { box-shadow: inset 3px 0 0 #10b981; }
#result_list th.qc-drop-right { box-shadow: inset -3px 0 0 #10b981; }

/* 列复位按钮 */
#qc-col-reset {
  display: block; margin: 0 0 6px auto; font-size: 12px; line-height: 1; padding: 5px 9px;
  border: 1px solid #d1d5db; border-radius: 6px; background: #fff; color: #374151; cursor: pointer;
}
#qc-col-reset:hover { border-color: #10b981; color: #047857; }
[data-theme="dark"] #qc-col-reset { background: #1f2937; color: #d1d5db; border-color: #374151; }

/* 成交状态=成交：整行深色标识 */
#result_list tr.qc-won td { background: #dcfce7 !important; }
[data-theme="dark"] #result_list tr.qc-won td, html.dark #result_list tr.qc-won td { background: #14532d !important; }
#result_list select.qc-won-sel {
  background: #166534 !important; color: #fff !important; font-weight: 700 !important;
  border-color: #166534 !important;
}
#result_list select.qc-won-sel option { background: #fff; color: #111; font-weight: 400; }
