/**
 * 「报价合同」界面样式（客户版 · 2026-10-01 按 5177 视觉重做）。
 *
 * 口径：**逐项照 5177 `发票样式` 的取值**（行号写在各条注释里），
 * 布局与字号/列宽/行高一律抄 5177 的**缩放前原值**；最终观感由板块缩放
 * `main > .view > .card > * { zoom: var(--workbench-section-scale) }`（默认 0.70，
 * 待办样式:2037-2039）与 5177 对齐 —— 2026-10-01 业务方实机反馈"报价合同字体太大"，
 * 根因就是当初只抄了 px、没抄这档缩放（旧基准 §6 C9 的"不复刻"建议已作废）。
 * 缩放区里的弹窗/菜单要反向除算（见本文件 .qc-overlay-* 之外的模块样式；
 * 本视图的弹窗宿主 #quoteOverlay 在 .card 之外，1:1 渲染，不需要补偿）。
 * 颜色只能走 `tokens.css` 的 `--wb-invoice-*` 令牌（`npm run check:design` 会把颜色字面量判红）。
 *
 * 与 5177 的对应关系：
 *   · 外层顺序：标题（INVOICE 眉题 + 报价合同）→ 页签 → 命令排+样式排同一行 → 左表右利润栏
 *     （IGW:25380-25400）；
 *   · 表格：公司抬头块 / PROFORMA INVOICE / TO·Address·PI NO.·Date / 条款 / 三行产品表头 /
 *     明细 / 汇总 / 备注 / 银行信息，全部是 CSS Grid 的单元格（IGW:15079-15147）；
 *     表头与抬头块绿底（发票样式:2212，颜色取 tokens 的 --wb-invoice-header-fill），
 *     单元格黑框（发票样式:1009/2095）；
 *   · 右侧利润栏：8 项指标 + 每行「总成本（含口径选择器）/ 实际报价(RMB) / 利润 + 备注」
 *     （IGW:16012-16200、发票样式:1015-1900）。
 *
 * 打印：`@media print` 只在 `body[data-qc-print="quote-contract"]` 时生效——
 * 打印的是**页面上的单据本体**（抬头 + PI 表 + 备注 + 银行信息），工具排与利润栏不打印。
 * 这与 5177 一致（那边没有打印按钮，用浏览器页面打印打在单据上，见 print.js 的说明）。
 */

/* ---------------- 标题与页签 ---------------- */

/*
 * 报价合同是"宽表工作台"：一张 PI 表本身就有 17 列（preferred 列宽合计 ≈2143px）+ 右侧利润栏，
 * 1120px 的面板宽会把命令排/样式排挤到两行、右侧栏也看不见。5177 对工作台板块是整幅宽度
 * （待办样式:2042-2057 `#invoice-generator { max-width: none; width: 100% }`；
 * 那边的 0.70 缩放只影响观感尺寸，不该由面板宽来补）。这里只放宽**报价合同这一个视图**的卡片，
 * 其他页面仍守基准 §3.2 的 1120px 面板宽。
 * min-width: 0：卡片是 `.view`（grid）的子项，不置 0 时会被表格的 max-content 撑开、
 * 整页出现横向滚动；置 0 后卡片停在视口宽，宽表由 `.qc-workarea` 自己横向滚动
 * （与 5177 `main`（block）下 `.section{width:100%}` + workarea 内部滚动的结构一致）。
 */
#viewQuoteContract .card {
  max-width: none;
  min-width: 0;
}

.invoice-workbench-heading-title {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 0 0 10px;
}

/* INVOICE 眉题（IGW:18270；.eyebrow 本体 订单档案样式:270-276，发票样式:84-87 换色） */
.invoice-workbench-heading-title .eyebrow {
  margin: 0;
  color: var(--wb-invoice-eyebrow-ink);
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-850);
  letter-spacing: var(--wb-tracking-wide);
  text-transform: uppercase;
}

.invoice-workbench-title-row {
  display: flex;
  align-items: center;
  gap: var(--wb-space-5);
  min-width: 0;
  margin: 0;
}

.invoice-workbench-title {
  margin: 0;
  color: var(--wb-invoice-title-ink);
  font-size: var(--wb-fs-38);
  font-weight: var(--wb-fw-900);
  line-height: 1.2;
  white-space: nowrap;
}

.invoice-contract-folder-title-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

/* 合同标题能打开本地文件夹：常态带淡下划线（2026-10-26） */
.invoice-contract-folder-title-button .invoice-workbench-title {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

.invoice-contract-folder-title-button:hover .invoice-workbench-title,
.invoice-contract-folder-title-button:focus-visible .invoice-workbench-title {
  color: var(--wb-link);
  text-decoration-color: currentColor;
}

/* 页签：深色实底选中态（照 发票样式:189-256，前两条宽度 212px / 158px） */
.invoice-document-tabs {
  display: grid;
  grid-template-columns: 212px 158px;
  justify-content: flex-start;
  gap: 0;
  margin: 0;
  width: max-content;
  min-width: max-content;
}

.invoice-document-tabs .tab {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--wb-invoice-panel-line);
  border-radius: var(--wb-radius-button);
  background: var(--wb-btn-bg);
  color: var(--wb-invoice-tab-ink);
  padding: 10px 16px;
  font: inherit;
  font-size: 26px;
  font-weight: var(--wb-fw-900);
  white-space: nowrap;
  cursor: pointer;
}

.invoice-document-tabs .tab.active,
.invoice-document-tabs .tab.is-active {
  border-color: var(--wb-invoice-tab-active-to);
  background: linear-gradient(180deg, var(--wb-invoice-tab-active-from), var(--wb-invoice-tab-active-to));
  color: var(--wb-invoice-tab-active-ink);
}

.invoice-document-tabs .tab:hover,
.invoice-document-tabs .tab:focus-visible {
  border-color: var(--wb-accent);
  outline: 0;
}

/* 空态（2026-10-23 首页精简）：首页只剩四个按钮，两个「新建」之间留出间距 */
.invoice-standalone-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wb-space-3);
  margin-top: var(--wb-space-4);
}

/* 订单档案模式横幅（5177 订单档案样式:10-48） */
.invoice-order-archive-mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wb-space-5);
  border: 1px solid var(--wb-oa-mode-banner-border);
  border-radius: var(--wb-radius-button);
  background: var(--wb-oa-mode-banner-bg);
  padding: 10px 12px;
  margin: var(--wb-space-3) 0;
}

.invoice-order-archive-mode-banner div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.invoice-order-archive-mode-banner span {
  color: var(--wb-oa-mode-banner-ink);
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-900);
}

.invoice-order-archive-mode-banner strong,
.invoice-order-archive-mode-banner small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.invoice-order-archive-mode-banner strong {
  color: var(--wb-text-primary);
  font-size: var(--wb-fs-15);
  font-weight: var(--wb-fw-800);
}

.invoice-order-archive-mode-banner small {
  color: var(--wb-oa-mode-banner-note);
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-700);
}

/* ---------------- 命令排 + 样式排（同一行；IGW:13822-13825 / 发票样式:769-775） ---------------- */

.invoice-quote-command-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wb-space-5);
  flex-wrap: wrap;
  margin: 8px 0 6px;
}

.qc-command-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--wb-space-3);
  min-width: 0;
  flex: 0 1 auto;              /* 发票样式:845-849 */
}

/* 命令排按钮：逐项照 5177 `.invoice-product-toolbar button`（发票样式:789-797）——
 * min-height 38 / padding 8px 12px / 字号 22 / 圆角 6 / 字重 800。
 * 客户版默认的小按钮 .btn-sm 是 30px/12px，直接缩放后会比 5177 小一档，故按 5177 覆盖。 */
.qc-command-row .btn {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: var(--wb-radius-control);
  font-size: 22px;
  font-weight: var(--wb-fw-800);
}

.qc-export-notice {
  display: flex;
  align-items: center;
  gap: var(--wb-space-2);
  flex-basis: 100%;
  margin: 0;
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-12);
}

/* 币种下拉：照 5177 `.invoice-quote-command-actions .invoice-currency-control select`
 * （发票样式:750-766）：min-width 136 / min-height 42 / 字号 15 / padding 7px 12px / 圆角 8。 */
.invoice-currency-control {
  display: inline-flex;
  align-items: stretch;
  min-height: 42px;
}

.invoice-currency-control select {
  min-width: 136px;
  min-height: 42px;
  border-radius: var(--wb-radius-button);
  padding: 7px 12px;
  font-size: 15px;
  font-weight: var(--wb-fw-800);
}

/* 样式排：靠右、浅蓝底（发票样式:808-900） */
.qc-style-toolbar {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--wb-space-4);
  margin-left: auto;
  padding: 8px 10px;
  border: 1px solid var(--wb-invoice-toolbar-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-invoice-toolbar-bg);
  color: var(--wb-invoice-toolbar-ink);
}

/* 样式排各项：字号/输入尺寸照 5177（发票样式:824-846：标签 22px、数字框 86×42、色块 44×42） */
.qc-style-item {
  display: inline-flex;
  align-items: center;
  gap: var(--wb-space-2);
  color: var(--wb-invoice-toolbar-ink);
  font-size: 22px;
  font-weight: var(--wb-fw-800);
  white-space: nowrap;
}

.qc-style-item input[type="number"] {
  width: 86px;
  height: 42px;
  font-size: 22px;
}

.qc-style-item input[type="color"] {
  width: 44px;
  height: 42px;
  padding: 2px;
}

.invoice-cell-align-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--wb-invoice-panel-line);
  border-radius: var(--wb-radius-control);
  background: var(--wb-btn-bg);
  overflow: hidden;
}

/* 对齐三键：min-width 88、高 42、字号 22（发票样式:859-873 + 882-889） */
.invoice-cell-align-button {
  min-width: 88px;
  min-height: 42px;
  border: 0;
  border-right: 1px solid var(--wb-invoice-panel-line);
  border-radius: 0;
  background: var(--wb-btn-bg);
  color: var(--wb-invoice-toolbar-ink);
  padding: 0 var(--wb-space-4);
  cursor: pointer;
  font-size: 22px;
}

.invoice-cell-align-button:last-child {
  border-right: 0;
}

.invoice-cell-align-button.is-active {
  background: var(--wb-invoice-align-active-bg);
  color: var(--wb-invoice-align-active-ink);
  box-shadow: inset 0 0 0 1px var(--wb-invoice-align-active-ring);
}

/* 样式排的两个动作按钮（设为默认布局 / 恢复单元格样式）：照 5177
 * `.invoice-cell-style-toolbar button`（发票样式:859-868）：高 42 / padding 5px 12px / 字号 22 / 圆角 5。 */
.qc-style-toolbar .btn {
  min-height: 42px;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 22px;
  font-weight: var(--wb-fw-800);
}

/* ---------------- 工作区：左表 + 右利润栏（发票样式:913-919） ---------------- */

.qc-workarea {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding-bottom: var(--wb-space-2);
}

.qc-workarea-inner {
  display: grid;
  grid-template-columns: max-content max-content;
  gap: 0;
  align-items: stretch;
  width: max-content;
  min-width: max-content;
}

.qc-table-host {
  min-width: 0;
  position: relative;
}

/* 公司选择条（2026-10-26）：只有「基础信息」里有多家公司时才出现，位置在 PI 抬头上面 */
.invoice-company-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--wb-space-3);
  padding: var(--wb-space-2) var(--wb-space-3);
  margin-bottom: var(--wb-space-2);
  border: 1px solid var(--wb-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-fill-soft);
}

.invoice-company-picker-label {
  display: inline-flex;
  align-items: center;
  gap: var(--wb-space-2);
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-700);
  color: var(--wb-text-secondary);
}

.invoice-company-select {
  height: 30px;
  min-width: 200px;
  padding: 0 var(--wb-space-2);
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius-control);
  background: var(--wb-surface);
  color: var(--wb-text-primary);
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-700);
}

.invoice-company-picker-hint {
  font-size: var(--wb-fs-11);
  color: var(--wb-text-secondary);
}

.invoice-company-picker.is-empty {
  background: var(--wb-fill-soft);
  border-style: dashed;
}

/* ---------------- PI 网格（CSS Grid，不是 table；发票样式:1006-1095） ---------------- */

.qc-grid {
  display: grid;
  grid-template-columns: var(--invoice-grid-column-template);
  grid-template-rows: var(--invoice-grid-row-template);
  position: relative;
  width: max-content;
  border-top: 1px solid var(--wb-invoice-grid-border);
  border-left: 1px solid var(--wb-invoice-grid-border);
  background: var(--wb-surface);
  color: var(--wb-invoice-input-ink);
  font-size: var(--wb-fs-13);
}

/* 一行收起（抬头三行）：IGW:14722-14724 + 发票样式:5799-5801 */
.invoice-row-collapsed {
  display: none;
}

.qc-grid-cell {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  min-width: 0;
  min-height: 0;
  padding: 3px 4px;
  border-right: 1px solid var(--wb-invoice-grid-border);
  border-bottom: 1px solid var(--wb-invoice-grid-border);
  box-sizing: border-box;
  text-align: center;
  overflow: hidden;
  white-space: pre-line;
  overflow-wrap: break-word;
}

.qc-grid-cell.invoice-cell-selected {
  outline: 2px solid var(--wb-table-cell-focus-border);
  outline-offset: -3px;
}

.qc-grid-cell.invoice-cell-range-selected {
  background-image: linear-gradient(var(--wb-table-row-selected-bg), var(--wb-table-row-selected-bg));
}

/* 绿底：表头与抬头块（发票样式:2211-2216 `.invoice-excel-preview th` / `.invoice-grid-header-cell`） */
.qc-grid-cell.invoice-grid-header-cell {
  background: var(--wb-invoice-header-fill);
  font-weight: var(--wb-fw-800);
  line-height: 1.35;
}

.invoice-header-cell-item,
.invoice-header-cell-product,
.invoice-header-cell-description {
  white-space: pre-line;
}

/* 2026-10-27：表头下拉（数量单位 / 价格形式），照 5177 `.invoice-combobox-*` */
.qc-header-combobox-cell {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 24px;
  place-items: center;
  align-content: stretch;
  justify-items: stretch;
  gap: 2px;
  padding: 2px 2px 5px;
  overflow: visible;
}

.qc-header-combobox-cell.is-open {
  z-index: 60;
}

.qc-header-combobox-display {
  display: grid;
  align-items: center;
  justify-items: center;
  min-height: 0;
  line-height: 1.08;
  white-space: pre-line;
  text-align: center;
}

.qc-header-combobox-arrow {
  position: relative;
  justify-self: center;
  align-self: center;
  width: 34px;
  height: 24px;
  border: 1px solid var(--wb-invoice-combo-border);
  border-radius: 4px;
  background: var(--wb-invoice-combo-bg);
  color: var(--wb-invoice-panel-ink);
  cursor: pointer;
}

.qc-header-combobox-arrow::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.qc-header-combobox-menu {
  position: absolute;
  z-index: var(--wb-z-toast);
  top: calc(100% + 3px);
  right: 0;
  display: grid;
  gap: 2px;
  min-width: min(320px, 80vw);
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--wb-border);
  border-radius: 6px;
  background: var(--wb-surface);
  box-shadow: var(--wb-shadow-modal);
}

.qc-header-combobox-option {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--wb-invoice-panel-ink);
  padding: 10px 12px;
  text-align: left;
  font-size: 26px;
  font-weight: var(--wb-fw-800);
  line-height: 1.25;
  cursor: pointer;
}

.qc-header-combobox-option:hover,
.qc-header-combobox-option:focus-visible,
.qc-header-combobox-option.is-active {
  background: var(--wb-fill-soft);
  outline: 0;
}

.invoice-preview-label {
  font-weight: var(--wb-fw-900);
  text-align: center;
  white-space: nowrap;
}

.invoice-preview-title-cell {
  font-weight: var(--wb-fw-900);
}

.invoice-preview-title-cell .invoice-template-title {
  display: block;
}

/* 表内输入：透明底、聚焦才显框（发票样式:2546-2570 / 3297-3315） */
.invoice-table-input,
.qc-grid-cell .qc-cell-input {
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  padding: 0 2px;
  font: inherit;
  line-height: 1.2;
  text-align: inherit;
  box-sizing: border-box;
}

.invoice-table-input:focus,
.qc-grid-cell .qc-cell-input:focus {
  border-color: var(--wb-invoice-input-border);
  background: var(--wb-input-bg);
  outline: 0;
  box-shadow: none;
}

.invoice-table-input::placeholder {
  color: var(--wb-invoice-placeholder-ink);
}

.invoice-table-input.strong {
  font-weight: var(--wb-fw-800);
}

/* 条款下拉（Payment Term / Trade Terms / Lead Time）：默认透明，聚焦才显框 */
.invoice-terms-select {
  width: 100%;
  text-align: left;
  text-align-last: left;
  min-width: 0;
  min-height: 26px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--wb-invoice-input-ink);
  font: inherit;
  font-weight: var(--wb-fw-700);
  padding: 2px 4px;
  box-sizing: border-box;
}

.invoice-terms-select:hover,
.invoice-terms-select:focus {
  border-color: var(--wb-invoice-input-border);
  background: var(--wb-input-bg);
  outline: none;
}

.qc-term-manager-rows {
  display: grid;
  gap: 8px;
  max-height: 46vh;
  overflow: auto;
  padding-right: 4px;
}

.qc-term-manager-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.qc-grid-cell > .qc-field-control,
.qc-grid-cell > .qc-pi-no-field {
  width: 100%;
}

.qc-cell-input::placeholder {
  color: var(--wb-invoice-cell-placeholder-ink);
}

.invoice-description-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  box-sizing: border-box;
}

.invoice-description-textarea,
.invoice-carton-info-textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--wb-text-primary);
  font: inherit;
  font-size: var(--wb-fs-13);
  line-height: 1.35;
  padding: 2px 4px;
  resize: none;
  overflow: hidden;
}

.invoice-description-textarea:hover,
.invoice-carton-info-textarea:hover {
  border-color: var(--wb-border);
  background: var(--wb-input-bg);
}

.invoice-description-textarea:focus,
.invoice-carton-info-textarea:focus {
  border-color: var(--wb-accent);
  background: var(--wb-input-bg);
  box-shadow: inset 0 0 0 1px var(--wb-accent);
  outline: none;
}

.qc-text-value {
  display: block;
  min-height: 18px;
}

.qc-text-empty {
  color: var(--wb-text-placeholder);
}

.calc-cell {
  background: var(--wb-surface);
}

/* 命令排 / 样式排：照 5177 发票样式:744-840（页面本身在 0.70 缩放区内，px 直接照抄） */
.invoice-product-toolbar .btn {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--wb-border-strong);
  border-radius: 6px;
  font-size: 22px;
  font-weight: var(--wb-fw-800);
}

.invoice-cell-style-toolbar {
  font-size: 16px;
  font-weight: var(--wb-fw-800);
  gap: 6px;
}

.invoice-cell-style-toolbar .qc-style-item {
  gap: 6px;
  color: var(--wb-text-primary);
  font-size: 22px;
  font-weight: var(--wb-fw-800);
}

.invoice-cell-style-toolbar input[type="number"] {
  width: 86px;
  height: 42px;
  padding: 5px 8px;
  border: 1px solid var(--wb-border-strong);
  border-radius: 5px;
  font-size: 22px;
}

.invoice-cell-style-toolbar input[type="color"] {
  width: 44px;
  height: 42px;
  padding: 2px;
  border: 1px solid var(--wb-border-strong);
  border-radius: 5px;
}

.invoice-cell-style-toolbar button {
  min-height: 42px;
  padding: 5px 12px;
  border: 1px solid var(--wb-border-strong);
  border-radius: 5px;
  font-size: 22px;
  font-weight: var(--wb-fw-800);
}

.invoice-cell-style-toolbar .invoice-cell-align-button {
  min-width: 88px;
}

.qc-calc-value {
  text-align: center;
  color: var(--wb-invoice-panel-ink);
}

.desc-cell {
  align-items: start;
  justify-items: stretch;
  align-content: start;
  padding-top: 1px;
  padding-left: 1px;
  text-align: left;
}

.item-number {
  text-align: center;
}

.qc-item-no {
  text-align: center;
}

/* Item 列：选择资料 / 历史报价（5177 发票样式:5241-5284；在缩放区内，px 直接照抄） */
.invoice-item-number-stack {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  min-width: 0;
  width: 100%;
}

.invoice-excel-preview .item-number .invoice-item-product-description-select,
.invoice-excel-preview .item-number .invoice-item-history-reorder-button {
  max-width: none;
  min-width: 0;
  min-height: 28px;
  margin-top: 0;
  border: 1px solid var(--wb-item-source-border);
  border-radius: 6px;
  background: var(--wb-item-source-bg);
  color: var(--wb-item-source-ink);
  cursor: pointer;
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-850);
  line-height: 1.2;
  padding: 4px 8px;
  white-space: nowrap;
}

.invoice-excel-preview .item-number .invoice-item-history-reorder-button {
  border-color: var(--wb-item-source-history-border);
  background: var(--wb-item-source-history-bg);
  color: var(--wb-item-source-history-ink);
}

.invoice-excel-preview .item-number .invoice-item-product-description-select:hover,
.invoice-excel-preview .item-number .invoice-item-product-description-select:focus-visible,
.invoice-excel-preview .item-number .invoice-item-history-reorder-button:hover,
.invoice-excel-preview .item-number .invoice-item-history-reorder-button:focus-visible {
  border-color: var(--wb-item-source-hover-border);
  background: var(--wb-item-source-hover-bg);
  outline: none;
}

/* 选择资料 / 历史报价弹窗（5177 宽体两栏结构，先选目录再选产品） */
.qc-overlay-backdrop .freight-modal.qc-source-modal {
  display: grid;
  width: min(1040px, calc(100vw - 40px));
  max-height: 88vh;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--wb-border);
  border-radius: 12px;
  background: var(--wb-surface);
  box-shadow: var(--wb-shadow-modal);
}

/* 选择产品资料：1:1 复刻 5177 product-description-dialog.is-library-select
 * （5177 quote-library-product-list.css:258-291：宽 min(1920px, 100vw-16px)、
 *   高 calc(100vh - 32px)、三段 grid 行。5177 用 zoom:1/0.70 抵消父级缩放后净渲染 1:1，
 *   客户版该弹窗挂在 .wb-overlay（不在 .card 缩放区内），同样净 1:1 → 直接取 5177 原始值。
 *   客户版此弹窗由 renderOverlay 直接挂进 #quoteOverlay（wb-overlay），
 *   不在 qc-overlay-backdrop 里，上面的前缀选择器对它不生效，故单列一条。 */
.wb-overlay > .freight-modal.qc-source-modal.qc-material-picker {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1920px, calc(100vw - 16px));
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  gap: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--wb-qc-material-modal-border);
  border-radius: 8px;
  background: var(--wb-surface);
  box-shadow: var(--wb-qc-material-modal-shadow);
}

.qc-source-modal h3 {
  margin: 0;
  color: var(--wb-page-ink);
  font-size: var(--wb-fs-18);
  font-weight: var(--wb-fw-900);
}

.qc-source-two-column {
  display: grid;
  grid-template-columns: minmax(360px, 440px) minmax(320px, 1fr);
  gap: 16px;
  min-height: 420px;
  max-height: 62vh;
}

/* 宽体弹窗内覆盖通用两栏：5177 是 430px 固定侧栏 + 自适应详情（quote-library-product-list.css:493） */
.wb-overlay > .qc-source-modal.qc-material-picker > .qc-source-two-column {
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 16px;
  min-height: 0;
  max-height: none;
  overflow: hidden;
}

.qc-source-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  height: 100%;
}

.qc-source-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.qc-source-category-select {
  font-weight: var(--wb-fw-700);
  width: 100%;
}

.qc-source-list {
  display: grid;
  gap: 6px;
  flex: 1 1 auto;
  overflow: auto;
  padding-right: 4px;
}

.qc-source-row {
  display: flex;
  align-items: center;
  gap: var(--wb-space-3);
  text-align: left;
  padding: 8px 12px;
  border: 1px solid var(--wb-border);
  border-radius: 8px;
  background: var(--wb-surface);
  color: var(--wb-text-primary);
  cursor: pointer;
  transition: all 0.1s ease;
}

.qc-source-row.is-active,
.qc-source-row:hover,
.qc-source-row:focus-visible {
  border-color: var(--wb-accent);
  background: var(--wb-accent-soft);
  outline: none;
}

.qc-source-row-thumb {
  width: 44px;
  height: 44px;
  min-width: 44px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--wb-panel-bg-soft);
  border: 1px solid var(--wb-border);
}

.qc-source-row-info {
  display: grid;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.qc-source-row strong {
  font-size: var(--wb-fs-14);
}

/* 右侧详情预览区（5177 product-description-library-editor） */
.qc-source-empty-guide {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 40px 14px;
  text-align: center;
}

.qc-source-detail-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--wb-border);
  border-radius: 8px;
  background: var(--wb-panel-bg-soft);
  overflow: auto;
}

.qc-source-detail-empty {
  display: grid;
  place-items: center;
  height: 100%;
  text-align: center;
  padding: 40px 10px;
}

.qc-source-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid var(--wb-border);
  padding-bottom: 8px;
}

.qc-source-detail-title-group {
  display: grid;
  gap: 2px;
}

.qc-source-detail-title-group h4 {
  margin: 0;
  font-size: var(--wb-fs-12);
  color: var(--wb-accent);
  font-weight: var(--wb-fw-900);
  text-transform: uppercase;
  letter-spacing: var(--wb-tracking-wide);
}

.qc-source-detail-head strong {
  font-size: var(--wb-fs-16);
  color: var(--wb-text-primary);
}

.qc-source-cat-badge {
  font-size: var(--wb-fs-11);
  color: var(--wb-text-secondary);
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: 4px;
  padding: 2px 6px;
}

.qc-source-detail-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
}

.qc-source-detail-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 140px;
  background: var(--wb-surface);
  border: 1px solid var(--wb-border);
  border-radius: 6px;
  overflow: hidden;
}

.qc-source-detail-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.qc-source-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  font-size: var(--wb-fs-12);
}

.qc-source-detail-grid div {
  display: grid;
  gap: 2px;
  background: var(--wb-surface);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--wb-border);
}

.qc-source-detail-grid small {
  color: var(--wb-text-secondary);
  font-size: 11px;
}

.qc-source-detail-grid span {
  font-weight: var(--wb-fw-700);
  color: var(--wb-text-primary);
}

.qc-source-apply-btn {
  width: 100%;
  margin-top: auto;
}

/* 5177 选择产品资料（级联多栏 + 产品列表 + 右侧产品细则）
 * 表头/底栏/字体取 5177 quote-library-product-list.css:435-475/2922-2932 的原始值。 */
.qc-material-picker > .product-description-dialog-header.qc-material-picker-header {
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--wb-qc-material-header-line);
}

.qc-material-picker-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.qc-material-picker-header p {
  margin: 0;
  color: var(--wb-price-list-empty-ink);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.5;
  max-width: none;
}

.qc-material-picker-header h3 {
  flex: 0 0 auto;
  white-space: nowrap;
  color: var(--wb-page-ink);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.2;
}

.qc-material-picker-close {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border: 1px solid var(--wb-item-source-border);
  border-radius: 8px;
  background: var(--wb-surface);
  color: var(--wb-qc-material-ink);
  cursor: pointer;
  font-size: 29px;
  line-height: 1;
  padding: 0;
}

.qc-material-picker-close:hover,
.qc-material-picker-close:focus-visible {
  border-color: var(--wb-qc-material-close-hover-border);
  background: var(--wb-qc-material-close-hover-bg);
  outline: none;
}

/* 弹窗基座照 5177 quote-library-product-list.css:258-274（颜色走令牌） */
.product-description-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1920px, calc(100vw - 16px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--wb-qc-material-modal-border);
  border-radius: var(--wb-radius-button);
  background: var(--wb-surface);
  box-shadow: var(--wb-qc-material-modal-shadow);
  overflow: hidden;
  container-name: product-description-dialog;
  container-type: inline-size;
}

.product-description-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--wb-qc-material-header-line);
}

.product-description-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-top: 1px solid var(--wb-qc-material-header-line);
  background: var(--wb-item-source-bg);
}

/* 底栏按钮照 5177 quote-library-product-list.css:2922-2947 */
.qc-material-picker > .product-description-dialog-footer button {
  min-height: 34px;
  border: 1px solid var(--wb-price-list-editor-footer-btn-border);
  border-radius: 8px;
  background: var(--wb-surface);
  color: var(--wb-price-list-editor-footer-btn-ink);
  cursor: pointer;
  font-size: 17px;
  font-weight: 850;
  padding: 8px 18px;
}

.qc-material-picker > .product-description-dialog-footer .primary-action {
  border-color: var(--wb-price-list-editor-footer-primary);
  background: var(--wb-price-list-editor-footer-primary);
  color: var(--wb-ink-on-accent);
}

.qc-material-picker > .product-description-dialog-footer button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.qc-material-picker .product-description-selected-count {
  color: var(--wb-qc-material-ink);
  font-size: 16px;
  font-weight: 400;
}

.product-description-library-body {
  display: grid;
  grid-template-columns: 430px minmax(0, 1fr);
  gap: 14px;
}

.product-description-library-sidebar {
  min-width: 0;
}

.product-description-library-editor {
  min-width: 0;
  margin: 0;
  padding: 0;
}

.product-description-filter {
  display: grid;
  gap: 10px;
}

.product-description-record-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.product-description-apply-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 148px;
  gap: 12px;
  align-items: start;
}

.product-description-apply-content {
  min-width: 0;
}

.product-description-muted {
  color: var(--wb-text-secondary);
}

.product-description-category-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 6px;
}

.invoice-side-profit-exchange-reference {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 10px;
  min-width: 0;
  color: var(--wb-text-secondary);
  font-size: .8em;
  font-weight: var(--wb-fw-800);
}

.invoice-side-profit-exchange-reference [data-qc-exchange-rate-disclaimer] {
  color: var(--wb-text-secondary);
  font-weight: var(--wb-fw-700);
}

.qc-source-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.product-cascade-trigger {
  min-height: 34px;
  border: 1px solid var(--wb-border);
  border-radius: 6px;
  background: var(--wb-surface);
  color: var(--wb-text-primary);
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-800);
  padding: 5px 10px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
}

.product-cascade-trigger.has-value {
  border-color: var(--wb-accent);
  background: var(--wb-accent-soft);
  color: var(--wb-accent-strong);
}

.product-description-category-cascade {
  display: grid;
  gap: 8px;
  width: 100%;
}

.product-cascade-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(110px, 1fr));
  gap: 6px;
  max-height: 240px;
  border: 1px solid var(--wb-border);
  border-radius: 8px;
  background: var(--wb-surface);
  padding: 6px;
  overflow: hidden;
}

.product-cascade-column {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  max-height: 228px;
  overflow-y: auto;
  border-right: 1px solid var(--wb-border);
  padding-right: 6px;
}

.product-cascade-column:last-child {
  border-right: none;
  padding-right: 0;
}

.product-cascade-option {
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--wb-text-primary);
  cursor: pointer;
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-700);
  padding: 4px 8px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-cascade-option:hover {
  background: var(--wb-item-source-hover-bg);
}

.product-cascade-option.active {
  border-color: var(--wb-accent);
  background: var(--wb-accent-soft);
  color: var(--wb-accent);
  font-weight: var(--wb-fw-900);
}

.product-cascade-node {
  border-bottom: 1px solid var(--wb-border);
  border-radius: 4px;
  background: var(--wb-panel-bg-soft);
  color: var(--wb-text-secondary);
  font-weight: var(--wb-fw-800);
  margin-bottom: 2px;
}

.product-cascade-empty {
  font-size: var(--wb-fs-11);
  color: var(--wb-text-secondary);
  padding: 8px 6px;
}

.product-cascade-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 4px;
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-800);
  color: var(--wb-text-secondary);
}

/* ==================================================================
 * 选择产品资料弹窗 · 级联内控件 —— 按 5177 生效规则逐条对齐
 * （来源：CDP getMatchedStyles 实测 5177 quote-library-product-list.css，
 *   选择器都收在 .qc-material-picker 下，不影响价目表模块的同名类）
 * ================================================================== */

/* 触发条：.product-description-category-cascade .product-cascade-trigger */
.qc-material-picker .product-description-category-cascade .product-cascade-trigger {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--wb-qc-material-control-border);
  border-radius: 6px;
  background: var(--wb-surface);
  color: var(--wb-qc-material-ink);
  font-size: 18px;
  font-weight: 800;
  padding: 8px 12px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qc-material-picker .product-cascade-trigger.has-value {
  border-color: var(--wb-qc-material-trigger-has-value-border);
  background: var(--wb-qc-material-trigger-has-value-bg);
}

/* 级联面板（filter 作用域）：quote-library-product-list.css:1749-1762 + 3012-3032 */
.qc-material-picker .product-description-filter .product-description-category-picker {
  position: static;
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(88px, max-content));
  width: max-content;
  max-width: min(980px, calc(100vw - 96px));
  height: min(720px, calc(100vh - 190px));
  max-height: min(720px, calc(100vh - 190px));
  margin-top: 4px;
  border: 1px solid var(--wb-qc-material-cascade-border);
  border-radius: 8px;
  background: var(--wb-surface);
  box-shadow: var(--wb-qc-material-cascade-shadow);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0;
  gap: 0;
}

/* 列：quote-library-product-list.css:3021-3032 + 1764-1775 + 实测 max-width 280 / padding 8 */
.qc-material-picker .product-description-category-picker .product-cascade-column {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 88px;
  width: auto;
  max-width: 280px;
  height: auto;
  max-height: none;
  border-right: 1px solid var(--wb-qc-material-column-line);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
}

.qc-material-picker .product-description-category-picker .product-cascade-column:last-child {
  border-right: none;
}

/* 选项：实测 .product-description-category-picker .product-cascade-option = 36px / 16px / 850 / 7px 9px */
.qc-material-picker .product-description-category-picker .product-cascade-option,
.qc-material-picker .product-description-category-picker .product-cascade-clear {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--wb-qc-material-ink);
  cursor: pointer;
  font-size: 16px;
  font-weight: 850;
  padding: 7px 9px;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qc-material-picker .product-description-category-picker .product-cascade-option:hover,
.qc-material-picker .product-description-category-picker .product-cascade-option.active {
  border-color: var(--wb-qc-material-option-hover-border);
  background: var(--wb-item-source-hover-bg);
  color: var(--wb-qc-material-option-hover-ink);
}

/* 清除钮（黄底）：quote-library-product-list.css:3105-3109 */
.qc-material-picker .product-description-category-picker .product-cascade-clear {
  border-color: var(--wb-qc-material-clear-border);
  background: var(--wb-qc-material-clear-bg);
  color: var(--wb-qc-material-clear-ink);
}

/* 当前类目节点：缩进 7px（quote-library-product-list.css:3099-3101） */
.qc-material-picker .product-description-category-picker .product-cascade-node {
  padding-left: 7px;
}

/* 空态：quote-library-product-list.css:3133-3138 */
.qc-material-picker .product-description-category-picker .product-cascade-empty {
  color: var(--wb-price-list-empty-ink);
  font-size: 16px;
  font-weight: 800;
  padding: 7px;
}

/* 「+ 新增类目」：quote-library-product-list.css:3072-3090 + picker 作用域覆盖（实测 34px / 28px / 透明虚线框） */
.qc-material-picker .product-description-category-picker .product-cascade-add {
  width: 100%;
  min-height: 34px;
  margin-top: 6px;
  border: 1px dashed transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--wb-qc-material-add-ink);
  cursor: pointer;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  padding: 2px 8px 5px;
  text-align: center;
}

.qc-material-picker .product-description-category-picker .product-cascade-add:hover,
.qc-material-picker .product-description-category-picker .product-cascade-add:focus-visible {
  border-color: var(--wb-qc-material-add-hover-border);
  background: var(--wb-qc-material-add-hover-bg);
  outline: none;
}

.qc-material-picker .product-description-category-picker .product-cascade-add:disabled {
  opacity: .58;
  cursor: not-allowed;
}

/* 新增类目内联表单（IGW:28196-28207 的 product-cascade-add-form） */
.qc-material-picker .product-cascade-add-form {
  display: grid;
  gap: 6px;
}

.qc-material-picker .product-cascade-add-form input {
  width: 100%;
  border: 1px solid var(--wb-qc-material-control-border);
  border-radius: 6px;
  background: var(--wb-surface);
  color: var(--wb-qc-material-ink);
  font-size: 16px;
  padding: 7px 9px;
  box-sizing: border-box;
}

.qc-material-picker .product-cascade-add-form > span {
  color: var(--wb-qc-material-error-ink);
  font-size: 14px;
  font-weight: 750;
}

.qc-material-picker .product-cascade-add-form > div {
  display: flex;
  gap: 8px;
}

/* 确认行：quote-library-product-list.css:1785-1826（sticky 底部、上边线、浅蓝底） */
.qc-material-picker .product-description-category-confirm-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  bottom: 0;
  z-index: 2;
  min-width: 0;
  border-top: 1px solid var(--wb-qc-material-confirm-row-line);
  background: var(--wb-qc-material-confirm-row-bg);
  padding: 10px 12px;
}

.qc-material-picker .product-description-category-confirm-row span {
  min-width: 0;
  color: var(--wb-qc-material-confirm-row-ink);
  font-size: 14px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qc-material-picker .product-description-category-confirm-row button {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--wb-qc-material-confirm-primary);
  border-radius: 7px;
  background: var(--wb-qc-material-confirm-primary);
  color: var(--wb-ink-on-accent);
  cursor: pointer;
  font: inherit;
  font-size: 16px;
  font-weight: 850;
  padding: 8px 16px;
}

.qc-material-picker .product-description-category-confirm-row button:disabled {
  border-color: var(--wb-qc-material-disabled-border);
  background: var(--wb-qc-material-disabled-bg);
  cursor: not-allowed;
}

/* 搜索框：quote-library-product-list.css:1837-1851 */
.qc-material-picker .product-description-filter input[type="search"] {
  width: 100%;
  border: 1px solid var(--wb-qc-material-control-border);
  border-radius: 6px;
  background: var(--wb-surface);
  box-sizing: border-box;
  color: var(--wb-qc-material-ink);
  font-size: 18px;
  padding: 9px 12px;
}

/* 记录列表：quote-library-product-list.css:2245-2249 */
.qc-material-picker .product-description-record-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.product-description-record-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--wb-border);
  border-radius: 8px;
  background: var(--wb-surface);
  cursor: pointer;
  text-align: left;
}

.product-description-record-card.active,
.product-description-record-card:hover {
  border-color: var(--wb-accent);
  background: var(--wb-accent-soft);
}

.product-description-record-thumb {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 4px;
  background: var(--wb-panel-bg-soft);
  border: 1px solid var(--wb-border);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: var(--wb-fs-11);
  color: var(--wb-text-secondary);
}

.product-description-record-thumb img {
  width: 100%;
  height: 100%;
  /* 2026-10-27 方案 A：和 5177 一样留白，不裁边 */
  object-fit: contain;
}

.product-description-record-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1 1 auto;
}

.product-description-record-main strong {
  font-size: var(--wb-fs-13);
  color: var(--wb-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-description-record-main small {
  font-size: var(--wb-fs-11);
  color: var(--wb-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-description-select-hint {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 30px 16px;
  text-align: center;
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-13);
}

.product-description-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}

.product-description-detail-hero {
  border: 1px solid var(--wb-border);
  border-radius: 8px;
  background: var(--wb-surface);
  padding: 10px;
}

.product-description-detail-hero-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-description-detail-image {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border-radius: 6px;
  border: 1px solid var(--wb-border);
  background: var(--wb-panel-bg-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: var(--wb-fs-11);
  color: var(--wb-text-secondary);
}

.product-description-detail-image img {
  width: 100%;
  height: 100%;
  /* 2026-10-27 方案 A：和 5177 一样留白，不裁边 */
  object-fit: contain;
}

.product-description-detail-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.product-description-detail-title strong {
  font-size: var(--wb-fs-15);
  color: var(--wb-text-primary);
}

.product-description-detail-title span {
  font-size: var(--wb-fs-12);
  color: var(--wb-accent);
  font-weight: var(--wb-fw-700);
}

.product-description-detail-title em {
  font-style: normal;
  font-size: var(--wb-fs-11);
  color: var(--wb-text-secondary);
}

.product-description-detail-section {
  border: 1px solid var(--wb-border);
  border-radius: 8px;
  background: var(--wb-surface);
  padding: 10px;
}

.product-description-detail-section b {
  display: block;
  font-size: var(--wb-fs-12);
  color: var(--wb-text-secondary);
  margin-bottom: 4px;
}

.product-description-detail-section p {
  margin: 0;
  font-size: var(--wb-fs-12);
  line-height: 1.5;
  color: var(--wb-text-primary);
  white-space: pre-line;
}

.product-description-main-image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--wb-border);
  border-radius: 8px;
  background: var(--wb-surface);
  padding: 10px;
}

.product-description-main-image-card {
  display: grid;
}

.product-description-main-image-candidate {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 2px solid var(--wb-accent);
  border-radius: 6px;
  background: var(--wb-accent-soft);
  cursor: pointer;
}

.product-description-main-image-candidate img {
  width: 60px;
  height: 60px;
  /* 2026-10-27 方案 A：和 5177 一样留白（5177-CSS-PL:2793-2799 是 contain） */
  object-fit: contain;
  border-radius: 4px;
}

.product-description-main-image-candidate span {
  font-size: var(--wb-fs-11);
  font-weight: var(--wb-fw-800);
  color: var(--wb-accent);
}

.product-description-main-image-add {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  border: 1px dashed var(--wb-border);
  border-radius: 6px;
  background: var(--wb-panel-bg-soft);
  align-items: center;
  text-align: center;
  flex: 1 1 140px;
}

.product-description-main-image-paste {
  display: grid;
  gap: 2px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--wb-accent);
}

.product-description-main-image-paste strong {
  font-size: var(--wb-fs-12);
}

.product-description-main-image-paste small {
  font-size: var(--wb-fs-11);
  color: var(--wb-text-secondary);
}

.product-description-main-image-upload {
  padding: 3px 8px;
  border: 1px solid var(--wb-border);
  border-radius: 4px;
  background: var(--wb-surface);
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-11);
  cursor: pointer;
}

.product-description-main-image-drop-hint {
  font-size: var(--wb-fs-11);
  color: var(--wb-text-secondary);
}

.product-description-selected-count {
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-800);
  color: var(--wb-text-secondary);
}

.qc-source-history {
  display: grid;
  gap: 8px;
}

.qc-source-modal .wb-modal-actions {
  gap: 8px;
}

/* 行拖动重排（IGW:36747-36902）：序号格是拖动手柄，整行给落点提示 */
.item-number[draggable="true"] {
  cursor: grab;
}

.item-number[draggable="true"]:active {
  cursor: grabbing;
}

/* 2026-11-06 起产品行换指针拖拽：pointer-sort 给被拖格加 .dragging */
.qc-grid-cell.is-dragging,
.qc-grid-cell.dragging {
  opacity: var(--wb-disabled-opacity);
}

.qc-grid-cell.is-drop-before {
  box-shadow: inset 0 2px 0 0 var(--wb-accent);
}

.qc-grid-cell.is-drop-after {
  box-shadow: inset 0 -2px 0 0 var(--wb-accent);
}

.invoice-image-picker {
  display: grid;
  grid-template-rows: minmax(42px, 1fr) auto;
  gap: 0;
  width: 100%;
  height: 100%;
  min-height: 72px;
  border: 1px dashed var(--wb-invoice-image-picker-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-invoice-image-picker-bg);
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

.invoice-image-paste {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px dashed var(--wb-invoice-image-picker-border);
  border-radius: 0;
  background: var(--wb-surface);
  color: var(--wb-invoice-image-picker-ink);
  padding: 4px;
  font-size: var(--wb-fs-11);
  font-weight: var(--wb-fw-800);
  cursor: pointer;
  text-align: center;
  box-sizing: border-box;
  outline: none;
}

.invoice-image-paste:focus-visible,
.invoice-image-paste.is-selected {
  background: var(--wb-table-row-selected-bg);
  outline: 2px solid var(--wb-accent);
}

.invoice-product-thumb {
  display: block;
  max-width: 100%;
  max-height: 52px;
  object-fit: contain;
}

.invoice-image-delete-button {
  position: absolute;
  top: 3px;
  right: 3px;
  z-index: 5;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: var(--wb-radius-pill);
  background: var(--wb-danger);
  color: var(--wb-surface);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.invoice-image-file-button {
  width: 100%;
  min-height: 24px;
  border: 0;
  border-radius: 0;
  background: var(--wb-invoice-image-picker-bg);
  color: var(--wb-invoice-image-picker-ink);
  padding: 4px 6px;
  font-size: var(--wb-fs-11);
  font-weight: var(--wb-fw-800);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}

.invoice-image-file-button:hover {
  background: var(--wb-accent-soft);
  color: var(--wb-accent-strong);
}

.invoice-charge-label-cell .qc-cell-input {
  font-weight: var(--wb-fw-700);
}

/* 单位价/费用金额的币种前缀：5177 发票样式:3449-3500 */
.invoice-cell-editor-with-prefix {
  display: inline-grid;
  grid-template-columns: auto minmax(82px, max-content);
  column-gap: 2px;
  align-items: center;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 1px;
  background: var(--wb-input-bg);
  color: inherit;
  overflow: visible;
  justify-self: center;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.invoice-cell-with-currency-prefix > .invoice-currency-prefix {
  padding-left: 0;
  padding-right: 0;
  font-weight: var(--wb-fw-800);
  line-height: 1;
  white-space: nowrap;
}

.invoice-cell-editor-with-prefix > .qc-cell-input.qc-inline-number-box {
  padding-left: 1px;
}

.invoice-total-carton-info-label-cell {
  font-weight: 400;
}

.invoice-total-summary-cell {
  font-weight: var(--wb-fw-700);
  color: var(--wb-invoice-panel-ink);
  background: var(--wb-surface);
}

/* 付款汇总 / 总金额：5177 发票样式:5387-5449 */
.invoice-payment-summary-label-cell {
  background: var(--wb-surface);
  text-align: right;
  justify-items: end;
  justify-content: end;
  padding-right: 12px;
  font-size: var(--wb-invoice-payment-summary-font);
  font-weight: var(--wb-fw-900);
}

.invoice-payment-summary-label-text {
  justify-self: end;
  text-align: right;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.1;
}

.invoice-payment-summary-value-cell {
  background: var(--wb-surface);
  color: var(--wb-invoice-panel-ink);
  text-align: center;
  font-size: var(--wb-invoice-payment-summary-font);
  font-weight: var(--wb-fw-900);
  white-space: nowrap;
}

.invoice-total-summary-cell.invoice-payment-summary-total-value,
.invoice-payment-summary-value-cell.invoice-payment-summary-invoice-value {
  background: var(--wb-invoice-total-highlight-bg);
  color: var(--wb-invoice-total-highlight-ink);
  font-weight: var(--wb-fw-900);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.invoice-payment-summary-total-value .invoice-payment-summary-value-text {
  font-weight: var(--wb-fw-800);
}

/* 备注格：绝对铺满，照 发票样式:5508-5525 */
.remarks-cell {
  padding: 0;
  align-items: stretch;
  justify-items: stretch;
  align-content: stretch;
}

.remarks-cell > .qc-cell-input.invoice-table-textarea {
  position: absolute;
  inset: 2px 3px;
  width: auto;
  height: calc(100% - 4px);
  min-height: calc(100% - 4px);
  margin: 0;
  border-radius: 4px;
  padding-top: calc(0.5em + 3px);
  padding-bottom: calc(0.5em + 3px);
  resize: none;
}

/* 银行信息：发票样式:5703-5714 / 5783-6104 */
.invoice-preview-bank {
  height: auto;
  line-height: 1.18;
  font-weight: var(--wb-fw-800);
}

.invoice-bank-cell {
  display: grid;
  gap: 2px;
  position: relative;
  width: 100%;
  min-height: 0;
  align-content: center;
}

.invoice-bank-edit {
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  padding: 1px 28px 1px 2px;
  font: inherit;
  line-height: 1.18;
  font-weight: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  align-content: center;
  outline: 0;
}

.invoice-bank-edit:focus {
  border-color: var(--wb-invoice-input-border);
  background: var(--wb-input-bg);
}

.invoice-bank-corner-picker {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--wb-invoice-panel-line);
  border-radius: 4px;
  background: var(--wb-input-bg);
  overflow: visible;
  z-index: 45;
}

.invoice-bank-corner-picker::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--wb-invoice-input-ink);
  border-bottom: 2px solid var(--wb-invoice-input-ink);
  transform: rotate(45deg);
  pointer-events: none;
}

.invoice-bank-select.invoice-bank-corner-select {
  position: absolute;
  inset: 0;
  width: 24px;
  height: 24px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: transparent;
  font-size: var(--wb-fs-12);
  cursor: pointer;
  appearance: none;
  opacity: 1;
  overflow: visible;
}

.invoice-bank-select.invoice-bank-corner-select option {
  color: var(--wb-invoice-panel-ink);
  font-size: var(--wb-fs-13);
}

.invoice-cell-required-marker {
  /* 5177-CSS:3200-3214：右上角红色圆点，不是行内文字感叹号。 */
  position: absolute;
  top: 3px;
  right: 4px;
  z-index: 3;
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: var(--wb-radius-pill);
  background: var(--wb-danger);
  color: var(--wb-btn-primary-ink);
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-900);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.invoice-date-input {
  min-height: 30px;
}

/* PI NO. 那格：输入框 + 「生成新合同号」按钮（发票样式:3337-3379） */
.qc-pi-no-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding-right: 104px;
}

.qc-pi-no-field .qc-cell-input {
  display: flex;
  align-items: center;
  height: 100%;
  padding-right: 6px;
  line-height: 1.2;
}

.invoice-pi-no-refresh-button {
  position: absolute;
  top: 50%;
  right: 12px;
  z-index: 4;
  display: inline-grid;
  place-items: center;
  width: 88px;
  max-width: calc(100% - 16px);
  height: 24px;
  border: 1px solid var(--wb-invoice-pi-btn-border);
  border-radius: 5px;
  background: var(--wb-invoice-pi-btn-bg);
  color: var(--wb-invoice-pi-btn-ink);
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-900);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transform: translateY(-50%);
}

.invoice-pi-no-refresh-button:hover {
  border-color: var(--wb-invoice-align-active-ring);
  background: var(--wb-invoice-align-active-bg);
}

/* 拖动把手 */
.invoice-grid-column-resizer {
  cursor: col-resize;
  justify-self: end;
  width: 6px;
  margin-right: -3px;
  z-index: 3;
}

.invoice-grid-row-resizer {
  cursor: row-resize;
  align-self: end;
  height: 6px;
  margin-bottom: -3px;
  z-index: 3;
}

/* ---------------- 右侧利润核算栏（发票样式:1015-1900；IGW:16012-16200） ---------------- */

.qc-profit-panel {
  display: grid;
  grid-template-rows: var(--invoice-grid-row-template);
  width: max-content;
  min-width: 360px;
  max-width: none;
  border: 0;
  border-radius: 0 var(--wb-radius-control) var(--wb-radius-control) 0;
  background: var(--wb-invoice-panel-bg);
  color: var(--wb-invoice-panel-ink);
  /* 规格 3：字号变量 --side-profit-font-size，默认 20px（面板内 1em/0.9em 都按它缩放） */
  font-size: var(--qc-profit-font-size, var(--wb-invoice-profit-font, 20px));
  overflow: visible;
}

.invoice-exchange-rate-trend {
  display: grid;
  place-items: start;
  position: relative;
  width: auto;
  min-width: 0;
  max-width: 100%;
  padding: 7px 10px 2px;
  box-sizing: border-box;
  background: var(--wb-invoice-panel-bg);
  border-bottom: 1px solid var(--wb-invoice-grid-border);
  overflow: hidden;
}

.invoice-side-profit-rate-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 18px;
  width: auto;
  min-width: 0;
  padding: 6px 12px;
  box-sizing: border-box;
  background: var(--wb-invoice-toolbar-bg);
  color: var(--wb-invoice-toolbar-ink);
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-800);
}

.qc-profit-rate-contract,
.qc-profit-rate-live {
  color: var(--wb-invoice-toolbar-ink);
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-800);
  white-space: nowrap;
}

.invoice-side-profit-exchange-rate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--wb-invoice-toolbar-ink);
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-800);
  white-space: nowrap;
}

.invoice-side-profit-exchange-rate-input,
.qc-rate-input {
  width: 100px;
  min-width: 90px;
  height: 35px;
  border: 1px solid var(--wb-invoice-cost-border);
  border-radius: 4px;
  background: var(--wb-invoice-cost-bg);
  padding: 4px 8px;
  color: var(--wb-invoice-input-ink);
  font: inherit;
  font-weight: var(--wb-fw-900);
  text-align: center;
  box-sizing: border-box;
}

.qc-profit-rate-block {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  background: var(--wb-invoice-panel-bg);
  overflow: hidden;
  box-sizing: border-box;
}

.qc-profit-rate-disclaimer {
  margin: 0;
  padding: 4px 12px 6px;
  background: var(--wb-invoice-toolbar-bg);
  border-bottom: 1px solid var(--wb-invoice-grid-border);
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-11);
  line-height: 1.4;
}

/* 抬头：标题 30px + 八项指标；不再绑定左侧行高，按右侧内容自然撑开 */
.invoice-side-profit-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-sizing: border-box;
  padding: 4px 12px 0;
  background: var(--wb-invoice-head-fill);
  border-bottom: 0;
  text-align: left;
  overflow: hidden;
}

.qc-profit-head-top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
}

.qc-profit-default-rate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--wb-profit-ink);
  font-size: 20px;
  font-weight: var(--wb-fw-900);
  white-space: nowrap;
}

/* 2026-10-26：利润栏头部改成两行——「本月默认汇率」只读一行 + 「计算汇率」输入一行，
   输入框只回显本单自己的值（留空＝跟默认走），免得客户以为单据里锁死了旧汇率。 */
.qc-profit-rate-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.qc-profit-rate-month {
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-700);
  line-height: 1.3;
  white-space: nowrap;
}

.qc-rate-reset {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--wb-accent-ink);
  font: inherit;
  font-size: var(--wb-fs-12);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.qc-profit-default-rate-input {
  width: 120px;
  height: 40px;
  border: 1px solid var(--wb-invoice-cost-border);
  border-radius: 4px;
  background: var(--wb-invoice-cost-bg);
  padding: 4px 8px;
  color: var(--wb-invoice-input-ink);
  font-size: 20px;
  font-weight: var(--wb-fw-900);
  text-align: center;
  box-sizing: border-box;
}

.invoice-side-profit-head h4 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 950;
  white-space: nowrap;
}

.qc-profit-head-note {
  margin: 0;
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-12);
  line-height: 1.4;
}

/* 八项指标（IGW:16012-16030：三行 3 + 3 + 2） */
.qc-profit-metrics {
  display: grid;
  flex: 1 1 auto;
  box-sizing: border-box;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--wb-profit-frame-border);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: var(--wb-profit-frame-bg);
  font-size: 24px;
  align-content: space-evenly;
}

.qc-profit-metric-row {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  column-gap: 3em;
  align-items: center;
}

.qc-profit-metric-row-rates {
  grid-template-columns: repeat(2, max-content);
}

.qc-profit-metric {
  display: grid;
  grid-template-columns: max-content minmax(72px, max-content);
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.qc-profit-metric strong {
  color: var(--wb-profit-ink);
  font-size: 1.12em;
  font-weight: var(--wb-fw-900);
  white-space: nowrap;
}

.qc-profit-metric-label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--wb-profit-ink);
  font-size: .8em;
  font-weight: var(--wb-fw-900);
  white-space: nowrap;
}

/* 计算口径小标（5177 `.auto-calc-marker`，发票样式:1062-1076） */
.auto-calc-marker,
.auto-calc-header-marker {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid var(--wb-invoice-metric-frame);
  border-radius: var(--wb-radius-pill);
  background: var(--wb-invoice-metric-frame-bg);
  color: var(--wb-invoice-metric-ink);
  font-size: 10px;
  font-weight: var(--wb-fw-800);
  line-height: 1;
  cursor: help;
  vertical-align: middle;
  margin-left: 3px;
}

/* 计算口径浮层：鼠标悬停 / 键盘聚焦立即显示，位置 fixed 不受表格裁剪 */
.qc-calc-tooltip {
  position: fixed;
  z-index: var(--wb-z-toast);
  max-width: 360px;
  padding: 6px 10px;
  border: 1px solid var(--wb-border);
  border-radius: 6px;
  background: var(--wb-surface);
  color: var(--wb-text-primary);
  box-shadow: var(--wb-shadow-toast);
  font-size: 13px;
  font-weight: var(--wb-fw-500);
  line-height: 1.5;
  white-space: normal;
  pointer-events: none;
}

/* 每一行的利润块 */
.qc-profit-lines {
  display: flex;
  flex-direction: column;
}

/* ---------------- 每一行的利润块（2026-10-29 按 5177 发票样式:1740-2100 1:1） ----------------
   主表 46/54、字号 .9em/1em、颜色取 tokens（toolbar-ink / summary-ink）、边框取 cell-line。
   规格文档：《客户版-报价合同-利润核算-1比1实现规格》第 4/6/7/10 节。 */

.qc-profit-row,
.invoice-side-profit-row {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 4px;
  align-items: center;
  align-content: center;
  min-height: 0;
  box-sizing: border-box;
  padding: 3px 6px;
  background: var(--wb-surface);
  font-size: 1em;
  overflow: visible;
}

/* 主表：表头一行 + 数值一行；列宽由 --qc-profit-columns 逐列给 */
.invoice-side-profit-table {
  display: grid;
  grid-template-rows: minmax(46px, auto) minmax(54px, auto);
  width: max-content;
  min-width: 100%;
  position: relative;
}

.invoice-side-profit-table-head,
.invoice-side-profit-table-values {
  display: grid;
  grid-template-columns: var(--qc-profit-columns);
  grid-column: 1 / -1;
  min-width: 0;
}

.invoice-side-profit-table-head { grid-row: 1; }
.invoice-side-profit-table-values { grid-row: 2; }

.invoice-side-profit-table-cell {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--wb-invoice-cell-line);
  border-bottom: 1px solid var(--wb-invoice-cell-line);
  box-sizing: border-box;
  padding: 3px 5px;
  text-align: center;
}

.invoice-side-profit-table-head .invoice-side-profit-table-cell {
  border-top: 1px solid var(--wb-invoice-cell-line);
  background: var(--wb-invoice-soft-fill);
  color: var(--wb-invoice-toolbar-ink);
  font-size: .9em;
  font-weight: 800;
  line-height: 1.15;
}

.invoice-side-profit-table-values .invoice-side-profit-table-cell {
  background: var(--wb-surface);
  color: var(--wb-invoice-summary-ink);
  font-size: 1em;
  font-weight: 800;
  line-height: 1.15;
}

.invoice-side-profit-table-cell:first-child {
  border-left: 1px solid var(--wb-invoice-cell-line);
}

/* 表头文字一律不换行（「实际报价(RMB)」不许折成两行；规格 11.6） */
.invoice-side-profit-plain-header {
  white-space: nowrap;
}

.invoice-side-profit-value-cell strong {
  display: block;
  max-width: 100%;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  white-space: nowrap;
}

/* 「总成本」表头：标签 + 税开关 + 成本类型选择器（单品才给税开关，套装由配件各自汇总） */
.invoice-side-profit-cost-header-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.invoice-side-profit-cost-header-cell .invoice-side-profit-cost-label {
  white-space: nowrap;
}

.invoice-side-profit-cost-header-cell .invoice-side-profit-cost-options {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.invoice-side-profit-cost,
.invoice-side-profit-cost-kind {
  width: 100%;
  min-width: 0;
  height: 24px;
  border: 1px solid var(--wb-invoice-cost-border);
  border-radius: 4px;
  background: var(--wb-invoice-cost-bg);
  padding: 2px 4px;
  color: var(--wb-invoice-panel-ink);
  text-align: center;
  font: inherit;
  font-size: .88em;
  font-weight: 800;
  line-height: 1.1;
  box-sizing: border-box;
}

.invoice-side-profit-cost-kind {
  width: auto;
  min-width: 62px;
}

.invoice-side-profit-cost[readonly] {
  color: var(--wb-invoice-muted-ink);
  background: var(--wb-invoice-soft-fill);
}

.invoice-side-profit-tax-toggle {
  flex: 0 0 auto;
  width: 24px;
  min-width: 24px;
  height: 24px;
  border: 1px solid var(--wb-invoice-panel-line);
  border-radius: 4px;
  background: var(--wb-surface);
  color: var(--wb-invoice-placeholder-ink);
  padding: 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.invoice-side-profit-tax-toggle.is-tax {
  border-color: var(--wb-invoice-cost-border);
  background: var(--wb-invoice-tax-on-bg);
  color: var(--wb-invoice-tax-on-ink);
}

/* EXW 输入框：28px 黄底（规格 4.3） */
.invoice-side-profit-exw-input {
  width: 100%;
  min-width: 0;
  height: 28px;
  box-sizing: border-box;
  border: 1px solid var(--wb-invoice-cost-border);
  border-radius: 4px;
  background: var(--wb-invoice-cost-bg);
  color: var(--wb-invoice-panel-ink);
  text-align: center;
  font: inherit;
  font-weight: 800;
}

/* 列宽拖动热区：右移 5px 压在两列交界上（规格 4.2） */
.invoice-side-profit-column-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  width: 10px;
  cursor: col-resize;
}

/* 套装配件表：580px、左缘对齐「总成本」列（--qc-profit-cost-offset 由面板按 EXW 列宽给） */
.invoice-side-profit-cost-details {
  width: 580px;
  max-width: calc(100% - var(--qc-profit-cost-offset, 0px));
  margin-top: -4px;
  color: var(--wb-invoice-toolbar-ink);
  font-size: .9em;
  line-height: 1.1;
}

.invoice-side-profit-cost-detail-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--wb-invoice-toolbar-ink);
}

.invoice-side-profit-cost-detail-table th {
  height: 28px;
  padding: 0 4px;
  border: 1px solid var(--wb-invoice-cell-line);
  background: var(--wb-invoice-soft-fill);
  color: var(--wb-invoice-toolbar-ink);
  font-size: .95em;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.invoice-side-profit-cost-detail-table td {
  height: 32px;
  padding: 0 4px;
  border: 1px solid var(--wb-invoice-cell-line);
  background: var(--wb-surface);
  text-align: center;
}

.invoice-side-profit-cost-detail-table td input {
  width: 100%;
  height: 26px;
  min-width: 0;
  box-sizing: border-box;
  padding: 1px 4px;
  border: 1px solid var(--wb-invoice-cost-border);
  border-radius: 4px;
  background: var(--wb-invoice-cost-bg);
  color: var(--wb-invoice-panel-ink);
  text-align: center;
  font: inherit;
  font-weight: 800;
}

.invoice-side-profit-cost-detail-table .invoice-side-profit-cost-detail-name input {
  text-align: left;
}

.invoice-side-profit-cost-detail-table .invoice-side-profit-cost-detail-tax {
  width: 24px;
  height: 24px;
  min-width: 0;
  padding: 0;
  border: 1px solid var(--wb-invoice-panel-line);
  border-radius: 4px;
  background: var(--wb-surface);
  color: var(--wb-invoice-placeholder-ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.invoice-side-profit-cost-detail-table .invoice-side-profit-cost-detail-tax.is-tax {
  border-color: var(--wb-invoice-cost-border);
  background: var(--wb-invoice-tax-on-bg);
  color: var(--wb-invoice-tax-on-ink);
}

.invoice-side-profit-cost-detail-table .invoice-side-profit-cost-detail-subtotal {
  color: var(--wb-invoice-summary-ink);
  font-weight: 900;
}

.invoice-side-profit-cost-detail-table .invoice-side-profit-cost-detail-remove button {
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--wb-invoice-remove-ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.invoice-side-profit-cost-detail-table tfoot td {
  height: 28px;
  padding: 0 8px;
  background: var(--wb-invoice-panel-bg);
  text-align: left;
}

.invoice-side-profit-cost-detail-table .invoice-side-profit-cost-detail-add {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--wb-invoice-toolbar-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

/* 运费表：FOB/CIF 五列、DDP/DDU 七列；表头 46、数值 54，与主表同款（规格 7.3） */
.invoice-side-profit-freight-table {
  border-collapse: collapse;
  table-layout: fixed;
  color: var(--wb-invoice-toolbar-ink);
  font-size: 1em;
  line-height: 1.1;
}

.invoice-side-profit-freight-table th {
  height: 46px;
  padding: 2px 6px;
  border: 1px solid var(--wb-invoice-cell-line);
  background: var(--wb-invoice-soft-fill);
  color: var(--wb-invoice-toolbar-ink);
  font-size: .9em;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
}

.invoice-side-profit-freight-table td {
  height: 54px;
  padding: 2px 6px;
  border: 1px solid var(--wb-invoice-cell-line);
  background: var(--wb-surface);
  text-align: center;
  font-weight: 800;
}

.invoice-side-profit-freight-table td input {
  width: 100%;
  height: 32px;
  min-width: 0;
  box-sizing: border-box;
  padding: 1px 6px;
  border: 1px solid var(--wb-invoice-panel-line);
  border-radius: 4px;
  background: var(--wb-surface);
  color: var(--wb-invoice-panel-ink);
  text-align: center;
  font: inherit;
  font-weight: 800;
}

.invoice-side-profit-freight-table .invoice-side-profit-freight-calc {
  color: var(--wb-invoice-summary-ink);
  font-weight: 900;
  white-space: nowrap;
}

/* 备注行（规格 3）：字号 1.3em，输入框 30–78px 自适应 */
.invoice-side-profit-note-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 5px;
  width: 100%;
  min-width: 0;
  color: var(--wb-invoice-toolbar-ink);
  font-size: 1.3em;
  font-weight: 800;
  line-height: 1.25;
}

.invoice-side-profit-note-row > span {
  padding-top: 6px;
  white-space: nowrap;
}

.invoice-side-profit-note-row textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  max-height: 78px;
  field-sizing: content;
  resize: none;
  overflow-y: auto;
  border: 1px solid var(--wb-invoice-panel-line);
  border-radius: 4px;
  padding: 4px 7px;
  background: var(--wb-surface);
  color: var(--wb-invoice-panel-ink);
  font: inherit;
  font-weight: 500;
  line-height: 1.35;
}

.invoice-side-profit-note-row textarea:focus {
  border-color: var(--wb-invoice-input-border);
  outline: 2px solid color-mix(in srgb, var(--wb-invoice-input-border) 25%, transparent);
  outline-offset: 0;
}

/* 顶部汇总（规格 9）：浅绿底、边框取 metric-frame、圆角 5、内边距 1px 6px、行距 3px */
.qc-profit-metrics {
  display: grid;
  flex: 1 1 auto;
  box-sizing: border-box;
  gap: 3px;
  padding: 1px 6px;
  border: 1px solid var(--wb-invoice-metric-frame);
  border-radius: 5px;
  background: var(--wb-invoice-metric-frame-bg);
  color: var(--wb-invoice-summary-ink);
  font-size: 1em;
  align-content: space-evenly;
  overflow: hidden;
}

/* ---------------- 汇率区（IGW:16227-16251：走势 → 汇率条 → 免责说明，摆在利润抬头之上） ---------------- */

.qc-exchange-rate-block {
  display: grid;
  gap: 4px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--wb-invoice-panel-line);
  background: var(--wb-invoice-soft-fill);
}

.invoice-exchange-rate-trend {
  display: grid;
  gap: 2px;
}

.invoice-exchange-rate-trend-status {
  margin: 0;
}

.invoice-exchange-rate-trend-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 132px;
}

.invoice-exchange-rate-trend-axis {
  stroke: var(--wb-invoice-panel-line);
  stroke-width: 1;
}

.invoice-exchange-rate-trend-line {
  fill: none;
  stroke: var(--wb-invoice-metric-ink);
  stroke-width: 2;
  stroke-linejoin: round;
}

.invoice-exchange-rate-trend-dot {
  fill: var(--wb-invoice-metric-ink);
}

.invoice-exchange-rate-trend-point-active .invoice-exchange-rate-trend-dot {
  fill: var(--wb-invoice-cost-border);
}

.invoice-exchange-rate-trend-hit {
  fill: transparent;
}

.invoice-exchange-rate-trend-year {
  fill: var(--wb-invoice-muted-ink);
  font-size: 13px;
}

.qc-exchange-rate-disclaimer {
  margin: 0;
}

/* ---------------- 最近报价（IGW:20900-20955） ---------------- */

.qc-recent-list,
.qk-recent-list {
  display: flex;
  flex-direction: column;
  gap: var(--wb-space-4);
}

/* ---------------- 最近报价（IGW:20900-20955 / 发票样式:4460-4750 左右并排） ---------------- */

.qc-recent-list,
.qk-recent-list {
  display: flex;
  flex-direction: column;
  gap: var(--wb-space-4);
  align-items: flex-start;
}

.qk-recent-card.invoice-recent-card {
  display: grid;
  grid-template-columns: var(--invoice-recent-draft-width, 760px) var(--invoice-recent-files-width, 520px);
  justify-self: start;
  column-gap: 8ch;
  width: calc(var(--invoice-recent-draft-width, 760px) + var(--invoice-recent-files-width, 520px) + 8ch + 28px);
  max-width: none;
  box-sizing: border-box;
  align-items: stretch;
  border: 1px solid var(--wb-recent-card-border);
  border-radius: 6px;
  background: var(--wb-recent-card-bg);
  padding: 14px;
  font-size: 16px;
  /* 2026-10-27：整卡可点 + 与订单档案草稿卡同一组悬停/聚焦令牌 */
  cursor: pointer;
  transition: background-color .15s, border-color .15s;
}

.qk-recent-card.invoice-recent-card:hover,
.qk-recent-card.invoice-recent-card:focus-visible {
  border-color: var(--wb-oa-emphasis-border);
  background: var(--wb-oa-emphasis-bg);
  outline: 0;
}

.qk-recent-card.invoice-recent-card.active {
  border-color: var(--wb-oa-emphasis-border);
  background: var(--wb-oa-emphasis-bg);
}

.invoice-recent-draft {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 168px;
  gap: 14px;
  min-width: 0;
  align-items: start;
}

.qc-recent-summary,
.invoice-recent-summary {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.qc-recent-summary p {
  margin: 0;
}

.invoice-recent-main {
  display: grid;
  gap: 14px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--wb-text-primary);
  padding: 0;
  text-align: left;
  font-size: 19px;
  line-height: 1.35;
  cursor: pointer;
}

.invoice-recent-main:hover .invoice-recent-title-line strong,
.invoice-recent-main:focus-visible .invoice-recent-title-line strong {
  color: var(--wb-accent);
  outline: none;
}

.invoice-recent-meta {
  margin: 0;
  color: var(--wb-text-primary);
  font-size: 19px;
  font-weight: var(--wb-fw-700);
  line-height: 1.35;
}

.invoice-recent-card-actions {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 10px;
  flex: 0 0 auto;
}

.invoice-recent-card-actions .btn,
.invoice-recent-card-actions .btn.btn-primary,
.invoice-recent-card-actions .btn.primary-action {
  width: auto;
  min-width: 80px;
  min-height: 34px;
  justify-content: center;
  border: 1px solid var(--wb-recent-action-border);
  border-radius: 6px;
  background: var(--wb-surface);
  color: var(--wb-text-primary);
  padding: 7px 12px;
  font-size: 18px;
  font-weight: var(--wb-fw-800);
}

.invoice-recent-card-actions .btn:hover,
.invoice-recent-card-actions .btn:focus-visible {
  border-color: var(--wb-recent-action-hover);
  color: var(--wb-recent-action-hover-ink);
  outline: 0;
}

.invoice-recent-card-actions .btn.is-feature-locked {
  color: var(--wb-text-secondary);
  border-style: dashed;
}

/* 正式文件区（5177 发票样式:4580-4700）：右侧独立一栏，左边线隔开。 */
/* 2026-11-06：正式文件区是"选它做上传/粘贴目标"，不是"打开合同"，别给 pointer 光标 */
.qc-recent-formal-files {
  cursor: default;
}

.qc-recent-formal-files,
.invoice-recent-files {
  position: relative;
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  border: 0;
  border-left: 1px solid var(--wb-invoice-panel-line);
  border-radius: 7px;
  padding: 0 0 0 16px;
  background: transparent;
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.qc-recent-formal-files.is-selected,
.qc-recent-formal-files.is-dragover {
  border-left-color: var(--wb-recent-selected-border);
  background: var(--wb-recent-selected-bg);
  outline-color: var(--wb-recent-selected-outline);
}

/* 两条宽度拖拽把手：中线改左侧草稿宽度，右边缘改正式文件宽度 */
.invoice-recent-draft-resizer,
.invoice-recent-files-resizer {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 16px;
  cursor: ew-resize;
  touch-action: none;
}

.invoice-recent-draft-resizer {
  left: -8px;
}

.invoice-recent-files-resizer {
  right: -8px;
}

.invoice-recent-draft-resizer::after,
.invoice-recent-files-resizer::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 999px;
  background: var(--wb-invoice-panel-line);
}

.invoice-recent-draft-resizer::after {
  left: 7px;
}

.invoice-recent-files-resizer::after {
  right: 7px;
}

.qc-recent-formal-files:hover .invoice-recent-draft-resizer::after,
.qc-recent-formal-files:hover .invoice-recent-files-resizer::after,
.invoice-recent-draft-resizer.is-active::after,
.invoice-recent-files-resizer.is-active::after {
  background: var(--wb-accent);
}

.qc-recent-formal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--wb-recent-file-ink);
  font-size: 19px;
  font-weight: var(--wb-fw-900);
}

.qc-recent-formal-head strong {
  color: var(--wb-recent-file-ink);
  font-size: 19px;
  font-weight: var(--wb-fw-900);
}

.qc-recent-formal-head span {
  color: var(--wb-recent-file-muted);
  font-size: 18px;
  font-weight: var(--wb-fw-900);
}

.qc-recent-formal-list {
  display: grid;
  gap: 8px;
}

.qc-recent-formal-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--wb-recent-file-ink);
  font-size: 18px;
  font-weight: var(--wb-fw-800);
}

.qc-recent-formal-kind {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--wb-recent-kind-border);
  border-radius: 999px;
  background: var(--wb-recent-kind-bg);
  color: var(--wb-recent-kind-ink);
  padding: 4px 9px;
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
}

.qc-recent-formal-kind.is-excel {
  position: relative;
  width: 48px;
  height: 48px;
  min-width: 48px;
  border: 0;
  border-radius: 5px;
  background: var(--wb-recent-excel-bg);
  color: var(--wb-invoice-tab-active-ink);
  padding: 0;
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  overflow: hidden;
}

.qc-recent-formal-kind.is-excel::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-top: 13px solid var(--wb-recent-excel-fold-line);
  border-left: 13px solid var(--wb-recent-excel-fold);
}

.qc-recent-formal-name {
  min-width: 0;
  overflow: hidden;
  color: var(--wb-recent-file-ink);
  font-size: 18px;
  font-weight: var(--wb-fw-800);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qc-recent-formal-time {
  flex: 0 0 auto;
  color: var(--wb-recent-file-muted);
  font-size: 18px;
  font-weight: var(--wb-fw-800);
}

.qc-recent-formal-open,
.qc-recent-formal-delete {
  min-height: 34px;
  border: 1px solid var(--wb-recent-action-border);
  border-radius: 5px;
  background: var(--wb-surface);
  color: var(--wb-text-primary);
  padding: 5px 10px;
  font-size: 18px;
  font-weight: var(--wb-fw-900);
}

.qc-recent-formal-delete {
  border-color: var(--wb-recent-file-delete-border);
  color: var(--wb-recent-file-delete-ink);
}

.qc-recent-formal-empty,
.qc-recent-formal-hint {
  color: var(--wb-recent-file-muted);
  font-size: 18px;
  font-weight: var(--wb-fw-800);
}

.qc-recent-formal-empty {
  margin: 0;
}

.qc-recent-formal-hint {
  border: 1px dashed var(--wb-recent-hint-border);
  border-radius: 6px;
  padding: 8px 10px;
  text-align: center;
}

/* 标题行：左标题右利润（IGW:21179-21183） */
.invoice-recent-title-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: baseline;
  gap: 20px;
}

.invoice-recent-title-line strong {
  min-width: 0;
  color: var(--wb-text-primary);
  font-size: 22px;
  line-height: 1.3;
  font-weight: var(--wb-fw-900);
}

.invoice-recent-profit {
  flex: 0 0 auto;
  color: var(--wb-recent-profit-ink);
  font-size: 20px;
  font-weight: var(--wb-fw-900);
  white-space: nowrap;
}

/* 状态行：产品资料徽标（IGW:21185-21189） */
.invoice-recent-summary-statuses {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
}

.invoice-recent-description-saved,
.invoice-recent-description-pending {
  border: 1px solid var(--wb-recent-kind-border);
  border-radius: 999px;
  background: var(--wb-surface);
  color: var(--wb-recent-kind-ink);
  padding: 6px 12px;
  font-size: 19px;
  font-weight: var(--wb-fw-900);
}

.invoice-recent-description-pending {
  border-color: var(--wb-recent-hint-border);
  color: var(--wb-text-secondary);
  cursor: pointer;
}

/* ---------------- 右键菜单 / 弹窗 ---------------- */

.qc-row-context-menu {
  position: fixed;
  z-index: var(--wb-z-menu);
  display: flex;
  flex-direction: column;
  min-width: 168px;
  padding: var(--wb-space-2);
  border: 1px solid var(--wb-menu-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-menu-bg);
  box-shadow: var(--wb-shadow-menu);
}

.invoice-context-submenu-trigger {
  position: relative;
  padding: var(--wb-space-2) var(--wb-space-3);
  font-size: var(--wb-fs-12);
  cursor: default;
}

.invoice-context-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  min-width: 168px;
  padding: var(--wb-space-2);
  border: 1px solid var(--wb-menu-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-menu-bg);
  box-shadow: var(--wb-shadow-menu);
  flex-direction: column;
  z-index: var(--wb-z-menu);
}

.invoice-context-submenu-trigger:hover .invoice-context-submenu {
  display: flex;
}

.qc-overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--wb-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--wb-overlay-bg);
}

.qc-overlay-backdrop .freight-modal {
  width: min(560px, 92vw);
  max-height: 86vh;
  overflow: auto;
  padding: var(--wb-space-7);
  border: 1px solid var(--wb-modal-border);
  border-radius: var(--wb-radius-lg);
  background: var(--wb-panel-bg);
  box-shadow: var(--wb-shadow-modal);
}

/* 「其他费用管理」：按 5177 的 0.70 等效尺寸对齐（2026-10-23 细节对照）。
 * 客户版弹窗不做反向 zoom，所以这里直接用 5177 的 CSS 值 × 0.70。 */
.qc-overlay-backdrop:has(.invoice-charge-edit-modal) {
  background: var(--wb-overlay-bg-charge);
}

.qc-overlay-backdrop .invoice-charge-edit-modal {
  display: block;
  width: min(350px, 92vw);
  max-height: 86vh;
  padding: 16.8px 19.6px;
  gap: 0;
  border: 0;
  border-radius: 8.4px;
  background: var(--wb-surface);
}

.invoice-charge-edit-modal h3 {
  margin: 0 0 8.4px;
  color: var(--wb-page-ink);
  font-size: 13.1px;
  font-weight: var(--wb-fw-700);
  line-height: 19.66px;
}

.invoice-charge-edit-modal .invoice-charge-edit-rows {
  margin-top: 12.6px;
}

.invoice-charge-edit-modal .wb-table {
  font-size: 11.2px;
  line-height: 16.8px;
}

.invoice-charge-edit-modal .wb-table th,
.invoice-charge-edit-modal .wb-table td {
  height: auto;
  padding: 2.8px 5.6px;
  border: 0;
  background: transparent;
}

.invoice-charge-edit-modal .wb-table thead th {
  padding: 4.2px 5.6px;
  border-bottom: 1.4px solid var(--wb-invoice-charge-rule);
  color: var(--wb-page-ink);
  font-size: 9.1px;
  font-weight: var(--wb-fw-700);
  line-height: 13.65px;
}

.invoice-charge-edit-modal .wb-table input {
  width: 100%;
  height: 34.2px;
  min-height: 34.2px;
  padding: 7.7px 8.4px;
  border: 1px solid var(--wb-border);
  border-radius: 4.2px;
  box-shadow: none;
  font-size: 11.2px;
  line-height: 16.8px;
}

.invoice-charge-edit-modal .wb-modal-actions {
  gap: 5.6px;
  margin-top: 8.4px;
}

.invoice-charge-edit-modal .wb-modal-actions .btn {
  height: 32.8px;
  padding: 7px 8.4px;
  border-radius: 5.6px;
  font-size: 11.2px;
}

.invoice-charge-edit-modal .invoice-charge-delete {
  width: 22.4px;
  height: 22.4px;
  min-height: 0;
  padding: 0;
  border: 1px solid var(--wb-border);
  border-radius: 999px;
  font-size: 12.6px;
  line-height: 1;
}

/* 「未保存离开」与「保存当前报价分流」：5177 挂在 document.body，实际不缩放。
 * 5177：发票样式:271-365；420px 宽、18px padding、17px 标题、16px 正文、40px 按钮。 */
.qc-overlay-backdrop:has(.invoice-unsaved-dialog) {
  padding: 20px;
  background: var(--wb-overlay-bg-unsaved);
}

.qc-overlay-backdrop .freight-modal.invoice-unsaved-dialog {
  display: grid;
  width: min(420px, 100%);
  padding: 18px;
  gap: 12px;
  border: 1px solid var(--wb-unsaved-border);
  border-radius: 8px;
  background: var(--wb-surface);
  color: var(--wb-page-ink);
  box-shadow: var(--wb-unsaved-shadow);
}

.qc-overlay-backdrop .invoice-unsaved-dialog h3 {
  margin: 0;
  color: var(--wb-page-ink);
  font-size: 17px;
  font-weight: var(--wb-fw-700);
  line-height: 1.5;
}

.qc-overlay-backdrop .invoice-unsaved-dialog p {
  margin: 0;
  color: var(--wb-unsaved-ink);
  font-size: 16px;
  line-height: 1.6;
}

.qc-overlay-backdrop .invoice-unsaved-dialog .invoice-unsaved-error {
  color: var(--wb-danger);
  font-weight: var(--wb-fw-800);
}

.qc-overlay-backdrop .invoice-unsaved-dialog .wb-modal-actions {
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.qc-overlay-backdrop .invoice-unsaved-dialog .wb-modal-actions .btn {
  flex: 0 0 auto;
  min-height: 34px;
  height: auto;
  padding: 7px 12px;
  border: 1px solid var(--wb-unsaved-button-border);
  border-radius: 6px;
  background: var(--wb-surface);
  color: var(--wb-page-ink);
  font-size: 16px;
  font-weight: var(--wb-fw-900);
  line-height: 1.5;
  white-space: nowrap;
}

.qc-overlay-backdrop .invoice-unsaved-dialog .wb-modal-actions .btn-primary {
  border-color: var(--wb-accent);
  background: var(--wb-accent);
  color: var(--wb-surface);
}

/* 「定金/尾款」：按 5177 的 0.70 等效值对齐（2026-10-23 细节对照）。
 * 5177：发票样式:5458-5492；460px 宽、22px padding、17px 标题、16px 正文、34px 按钮。 */
.qc-overlay-backdrop:has(.invoice-payment-dialog) {
  background: var(--wb-overlay-bg-deposit);
}

.qc-overlay-backdrop .freight-modal.invoice-payment-dialog {
  display: block;
  width: min(322px, calc(100vw - 22.4px));
  padding: 15.4px;
  border: 1px solid var(--wb-deposit-border);
  border-radius: 8.4px;
  background: var(--wb-surface);
  box-shadow: var(--wb-deposit-shadow);
}

.invoice-payment-dialog h3 {
  margin: 0 0 12.6px;
  color: var(--wb-page-ink);
  font-size: 13.1px;
  font-weight: var(--wb-fw-700);
  line-height: 19.66px;
}

.invoice-payment-dialog label,
.invoice-payment-dialog .invoice-required-term-row {
  display: grid;
  align-items: stretch;
  gap: 5.6px;
  color: var(--wb-page-ink);
  font-size: 9.1px;
  font-weight: var(--wb-fw-800);
  line-height: 1.5;
}

.invoice-payment-dialog .invoice-required-term-row > span {
  min-width: 0;
  color: var(--wb-page-ink);
  font-size: 9.1px;
  font-weight: var(--wb-fw-800);
}

.invoice-payment-dialog select {
  width: 105px;
  height: 27.6px;
  padding: 6.3px 7.7px;
  border: 1px solid var(--wb-border);
  border-radius: 5.6px;
  background: var(--wb-surface);
  color: var(--wb-page-ink);
  box-shadow: none;
  font: inherit;
  font-size: 9.1px;
  font-weight: var(--wb-fw-800);
}

.invoice-payment-dialog p {
  margin: 0 0 11.2px;
  color: var(--wb-deposit-ink);
  font-size: 11.2px;
  line-height: 1.5;
}

.invoice-payment-dialog .wb-modal-actions {
  gap: 7px;
}

.invoice-payment-dialog .wb-modal-actions .btn {
  min-height: 0;
  height: auto;
  padding: 6.3px 9.8px;
  font-size: 11.2px;
  line-height: 1.5;
}

.invoice-payment-dialog .wb-modal-actions .btn-primary {
  border-color: var(--wb-deposit-primary);
  background: var(--wb-deposit-primary);
  color: var(--wb-surface);
}

.invoice-required-term-list {
  display: flex;
  flex-direction: column;
  gap: var(--wb-space-3);
}

.invoice-required-term-row {
  display: flex;
  align-items: center;
  gap: var(--wb-space-3);
  font-size: var(--wb-fs-13);
}

.invoice-required-term-row > span {
  min-width: 96px;
  color: var(--wb-text-secondary);
}

.qc-new-charge-row {
  display: flex;
  gap: var(--wb-space-3);
}

/* ---------------- 打印（用页面打印单据；5177 无打印按钮，见 print.js） ---------------- */

@media print {
  body[data-qc-print="quote-contract"] {
    background: var(--wb-surface);
  }

  body[data-qc-print="quote-contract"] #siteSidebar,
  body[data-qc-print="quote-contract"] #siteNav,
  body[data-qc-print="quote-contract"] #siteHeader,
  body[data-qc-print="quote-contract"] .invoice-quote-command-row,
  body[data-qc-print="quote-contract"] .qc-command-row,
  body[data-qc-print="quote-contract"] .qc-style-toolbar,
  body[data-qc-print="quote-contract"] .invoice-document-tabs,
  body[data-qc-print="quote-contract"] .invoice-workbench-heading-title,
  body[data-qc-print="quote-contract"] .invoice-pi-no-refresh-button,
  body[data-qc-print="quote-contract"] .invoice-company-picker,
  body[data-qc-print="quote-contract"] .invoice-grid-column-resizer,
  body[data-qc-print="quote-contract"] .invoice-grid-row-resizer,
  body[data-qc-print="quote-contract"] .qc-profit-panel,
  body[data-qc-print="quote-contract"] #quoteMessage,
  body[data-qc-print="quote-contract"] #quoteStatusLine,
  body[data-qc-print="quote-contract"] .invoice-remark-images-toggle,
  body[data-qc-print="quote-contract"] [data-view]:not([data-view="quote-contract"]) {
    display: none;
  }

  body[data-qc-print="quote-contract"] .qc-workarea {
    overflow: visible;
  }

  body[data-qc-print="quote-contract"] .qc-workarea-inner {
    display: block;
    width: auto;
    min-width: 0;
  }

  body[data-qc-print="quote-contract"] .qc-table-host {
    overflow: visible;
  }

  body[data-qc-print="quote-contract"] .qc-cell-input {
    border: none;
    box-shadow: none;
  }
}

/* 付款汇总值：继承所在单元格的字号/字重（发票样式:5445-5449）。 */
.invoice-payment-summary-value-text {
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.1;
}

/* 单元格编辑：5177 invoice-cell-editor.invoice-table-input（发票样式:3261-3278）
   白底 + 可见描边 + 3px 8px 内边距；聚焦蓝边 + 内嵌环（发票样式:3388-3391）。 */
/* 2026-10-27 业务方：买方/地址、PI号/日期、备注输入内容左对齐；描述/规格本来就是左对齐 */
.qc-cell-input.qc-buyer-name-input,
.invoice-preview-meta-cell [data-qc-field="buyerAddress"],
.invoice-preview-meta-cell [data-qc-field="piNo"],
.invoice-preview-meta-cell [data-qc-field="quoteDate"],
.remarks-cell > .qc-cell-input.invoice-table-textarea {
  text-align: left;
}

.qc-cell-input.invoice-table-input,
.qc-cell-input.invoice-table-textarea {
  box-sizing: border-box;
  width: calc(100% - 6px);
  min-height: 24px;
  margin: 1px 3px;
  padding: 3px 8px;
  border: 1px solid var(--wb-invoice-input-border);
  border-radius: 7px;
  background: var(--wb-input-bg);
  color: var(--wb-invoice-cell-editor-ink);
  line-height: 1.35;
  box-shadow: var(--wb-input-shadow);
  cursor: text;
}

.qc-cell-input.invoice-table-input:focus,
.qc-cell-input.invoice-table-textarea:focus {
  border-color: var(--wb-caret);
  box-shadow: inset 0 0 0 1px var(--wb-invoice-cell-focus-ring);
  caret-color: var(--wb-caret);
  outline: 0;
}

/* 数量/单价/费用金额：5177 `.invoice-cell-editor.invoice-inline-number-box`
   （发票样式:3412-3446）。JS 给宽度 82px，费用金额最小 104px（发票样式:3515-3517）。 */
.qc-cell-input.qc-inline-number-box {
  box-sizing: border-box;
  justify-self: center;
  align-self: center;
  width: 82px;
  min-width: 82px;
  max-width: calc(100% - 6px);
  min-height: 32px;
  height: 32px;
  margin: 0 auto;
  padding: 4px 8px;
  border: 1px solid var(--wb-invoice-number-box-border);
  border-radius: 7px;
  background: var(--wb-input-bg);
  box-shadow: var(--wb-input-shadow);
  color: var(--wb-invoice-cell-editor-ink);
  font: inherit;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow-wrap: normal;
  cursor: text;
}

.qc-cell-input.qc-inline-number-box:focus {
  border-color: var(--wb-caret);
  box-shadow: inset 0 0 0 1px var(--wb-invoice-cell-focus-ring);
  caret-color: var(--wb-caret);
  outline: 0;
}

.qc-cell-input.invoice-charge-amount-input.qc-inline-number-box {
  min-width: 104px;
}

/* 空值编辑态（发票样式:3395-3408）：假光标闪烁 + 2px 蓝环，聚焦时隐藏 placeholder。 */
.qc-cell-input.qc-inline-number-box:focus:placeholder-shown,
.qc-cell-input.qc-buyer-name-input:focus:placeholder-shown {
  background-image: linear-gradient(var(--wb-caret), var(--wb-caret));
  background-repeat: no-repeat;
  background-position: center;
  background-size: 3px 1.25em;
  box-shadow: inset 0 0 0 2px var(--wb-invoice-empty-focus-ring);
  animation: qc-empty-editor-caret 1s steps(1, end) infinite;
}

.qc-cell-input.qc-inline-number-box:focus::placeholder,
.qc-cell-input.qc-buyer-name-input:focus::placeholder {
  color: transparent;
}

@keyframes qc-empty-editor-caret {
  0%, 45% { background-size: 3px 1.25em; }
  50%, 100% { background-size: 0 0; }
}

/* ---------------- 最近报价工具栏与搜索（照 5177 发票样式:4329-4401） ---------------- */

.invoice-recent-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: var(--wb-space-3);
}

.invoice-recent-search-tools {
  display: flex;
  align-items: center;
  gap: var(--wb-space-2);
  width: 100%;
  max-width: 680px;
}

.invoice-recent-search {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--wb-panel-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-panel-bg);
  color: var(--wb-text-primary);
  padding: 6px 10px;
  font: inherit;
  font-size: var(--wb-fs-13);
}

.invoice-recent-search:focus {
  outline: none;
  border-color: var(--wb-accent);
}

/* ---------------- 归档到订单弹窗（照 5177 发票样式:4848-4960） ---------------- */

.invoice-recent-transfer-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--wb-z-modal);
  display: grid;
  place-items: center;
  background: var(--wb-overlay-bg);
  padding: 24px;
}

.invoice-recent-transfer-dialog {
  display: grid;
  gap: 14px;
  width: min(680px, calc(100vw - 48px));
  max-height: min(720px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--wb-panel-border);
  border-radius: var(--wb-radius-panel);
  background: var(--wb-panel-bg);
  padding: 18px;
  box-shadow: var(--wb-shadow-modal);
}

.invoice-recent-transfer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  cursor: grab;
  user-select: none;
}
.invoice-recent-transfer-head button { cursor: pointer; user-select: auto; }

.invoice-recent-transfer-head div {
  display: grid;
  gap: 2px;
}

.invoice-recent-transfer-head span {
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-700);
}

.invoice-recent-transfer-head strong {
  color: var(--wb-text-primary);
  font-size: var(--wb-fs-18);
  font-weight: var(--wb-fw-900);
}

.invoice-recent-transfer-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--wb-panel-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-panel-bg);
  color: var(--wb-text-primary);
  font-size: var(--wb-fs-18);
  font-weight: var(--wb-fw-900);
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.invoice-recent-transfer-close:hover {
  background: var(--wb-table-row-hover-bg);
}

.invoice-recent-transfer-source {
  margin: 0;
  color: var(--wb-text-primary);
  font-size: var(--wb-fs-14);
  font-weight: var(--wb-fw-700);
  padding: 6px 10px;
  background: var(--wb-panel-bg-soft);
  border-radius: var(--wb-radius-control);
}

.invoice-recent-transfer-create-actions {
  display: flex;
  gap: 10px;
}

.invoice-recent-transfer-create-actions button {
  min-height: 34px;
}

.invoice-recent-transfer-dialog input[type="search"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--wb-panel-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-panel-bg);
  color: var(--wb-text-primary);
  padding: 6px 10px;
  font: inherit;
  font-size: var(--wb-fs-13);
}

.invoice-recent-transfer-dialog input[type="search"]:focus {
  outline: none;
  border-color: var(--wb-accent);
}

.invoice-recent-transfer-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.invoice-recent-transfer-list button {
  display: grid;
  gap: 4px;
  border: 1px solid var(--wb-panel-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-panel-bg-soft);
  padding: 10px 12px;
  color: var(--wb-text-primary);
  text-align: left;
  cursor: pointer;
}

.invoice-recent-transfer-list button:hover:not(:disabled),
.invoice-recent-transfer-list button:focus-visible {
  border-color: var(--wb-accent);
  background: var(--wb-table-row-hover-bg);
  outline: 0;
}

.invoice-recent-transfer-list button:disabled {
  opacity: .55;
  cursor: default;
}

.invoice-recent-transfer-list strong {
  font-size: var(--wb-fs-14);
  color: var(--wb-text-primary);
}

.invoice-recent-transfer-list span {
  font-size: var(--wb-fs-12);
  color: var(--wb-text-secondary);
}

.invoice-recent-transfer-list small {
  font-size: var(--wb-fs-11);
  color: var(--wb-text-secondary);
}

.invoice-recent-transfer-error {
  margin: 0;
  color: var(--wb-danger);
  font-size: var(--wb-fs-12);
}

/* ---------------- 最近报价卡片 2026-10-24 对齐 5177（标题行/利润/徽标/筛选/分页） ----------------
   5177 发票样式:4343-4470（卡片）、21157-21162（筛选下拉）、21155-21195（卡片结构）。 */

.invoice-recent-search-tools select {
  flex: 0 0 auto;
  min-height: 36px;
  border: 1px solid var(--wb-panel-border);
  border-radius: var(--wb-radius-control);
  background: var(--wb-panel-bg);
  color: var(--wb-text-primary);
  padding: 6px 8px;
  font: inherit;
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-700);
}

.invoice-recent-search-tools select:focus {
  outline: none;
  border-color: var(--wb-accent);
}

/* 分页（IGW:21116-21140 renderRecentQuotePagination） */
.invoice-recent-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wb-space-4);
  width: min(100%, 980px);
  margin-top: var(--wb-space-3);
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-12);
  font-weight: var(--wb-fw-700);
}

.invoice-recent-pagination div {
  display: inline-flex;
  align-items: center;
  gap: var(--wb-space-2);
}

/* ---------------- 最近报价批量管理与操作条（方案 3：多选批量归档到订单） ---------------- */
.invoice-recent-batch-tools {
  display: flex;
  align-items: center;
  gap: var(--wb-space-2);
  margin-left: auto;
}

.qk-recent-card.invoice-recent-card.is-batch-selected {
  border-color: var(--wb-oa-emphasis-border);
  background: var(--wb-oa-emphasis-bg);
  box-shadow: var(--wb-focus-ring);
}

.invoice-recent-checkbox-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--wb-space-1);
}

.invoice-recent-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--wb-accent);
}

.invoice-recent-batch-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: var(--wb-z-modal);
  display: flex;
  align-items: center;
  gap: var(--wb-space-4);
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  transform: translateX(-50%);
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius-pill);
  background: var(--wb-panel-bg);
  box-shadow: var(--wb-shadow-modal);
}

.invoice-recent-batch-count {
  color: var(--wb-text-primary);
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-700);
  white-space: nowrap;
}

.invoice-recent-batch-actions {
  display: flex;
  align-items: center;
  gap: var(--wb-space-2);
}

/* 2026-11-06 walk20 B1：导出被守卫挡住时的浮层提示（固定定位，不受页面滚动影响） */
.qc-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: var(--wb-z-toast);
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 48px));
  border: 1px solid var(--wb-border-strong);
  border-radius: var(--wb-radius-panel);
  background: var(--wb-panel-bg);
  padding: 10px 14px;
  color: var(--wb-text-primary);
  box-shadow: var(--wb-shadow-modal);
  font-size: var(--wb-fs-13);
  font-weight: var(--wb-fw-800);
  line-height: 1.45;
  pointer-events: none;
}

.qc-toast.is-ok {
  border-color: var(--wb-success);
  color: var(--wb-success);
}

.qc-toast.is-error {
  border-color: var(--wb-danger);
  color: var(--wb-danger);
}

/* 2026-11-06 A4：序号格左侧的独立拖拽抓手（客户能明确"在哪拖"） */
.qc-grid-cell.item-number {
  position: relative;
}

.invoice-row-grip {
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  /* 作用域内还有工作台缩放：CSS 16px ≈ 视觉 10–11px（验收看 getBoundingClientRect） */
  width: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--wb-radius-pill);
  color: var(--wb-text-secondary);
  font-size: var(--wb-fs-12);
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.invoice-row-grip:hover {
  background: var(--wb-accent-soft);
  color: var(--wb-text-primary);
}

.invoice-row-grip:active {
  cursor: grabbing;
}
