/* 询盘管理 SPA —— 严格套用规格 §2.2 设计令牌（Bootstrap 3 主题色体系） */
/* Bootstrap 5.3.8 已本地 vendor（static/vendor/bootstrap），本文件在其之后加载：
   §3.1 主题变量覆盖层 → §3.2 组件参数覆盖 → 业务规则（BS 未覆盖的部分） */

:root {
  --bg: #fafafa;
  --nav-bg: #f8f8f8;
  --nav-border: #e7e7e7;
  --text: #333;
  --muted: #777;
  --line: #d4d4d4;
  --primary: #337ab7;
  --primary-border: #2e6da4;
  --danger: #d9534f;
  --danger-border: #d43f3a;
  --success: #5cb85c;
  --info: #5bc0de;
  --warning: #f0ad4e;
  --link: #337ab7;
  --path-bar: #d9edf7;
}

/* ── Bootstrap 5.3.8 主题覆盖层（规格 §3.1：把 §2.2 令牌映射到 --bs-*）── */
:root, [data-bs-theme=light] {
  /* BS3 色系：让 bg-*、text-*、border-*、链接、焦点环全部落到项目配色 */
  --bs-blue: #337ab7; --bs-indigo: #6610f2; --bs-purple: #6f42c1; --bs-pink: #d63384;
  --bs-red: #d9534f; --bs-orange: #f0ad4e; --bs-yellow: #f0ad4e; --bs-green: #5cb85c;
  --bs-teal: #20c997; --bs-cyan: #5bc0de; --bs-white: #fff; --bs-gray: #777; --bs-gray-dark: #333;
  --bs-primary: #337ab7; --bs-primary-rgb: 51, 122, 183;
  --bs-secondary: #999; --bs-secondary-rgb: 153, 153, 153;
  --bs-success: #5cb85c; --bs-success-rgb: 92, 184, 92;
  --bs-info: #5bc0de; --bs-info-rgb: 91, 192, 222;
  --bs-warning: #f0ad4e; --bs-warning-rgb: 240, 173, 78;
  --bs-danger: #d9534f; --bs-danger-rgb: 217, 83, 79;
  --bs-light: #f8f8f8; --bs-light-rgb: 248, 248, 248;
  --bs-dark: #333; --bs-dark-rgb: 51, 51, 51;
  /* 正文：14px 基准 + 行高 1.42857 + 项目字体（rem 基准由下面 html{font-size:14px} 决定） */
  --bs-body-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --bs-body-font-size: 1rem; --bs-body-line-height: 1.42857;
  --bs-body-color: #333; --bs-body-color-rgb: 51, 51, 51;
  --bs-body-bg: #fafafa; --bs-body-bg-rgb: 250, 250, 250;
  --bs-emphasis-color: #333; --bs-emphasis-color-rgb: 51, 51, 51;
  --bs-secondary-color: rgba(119, 119, 119, .75); --bs-secondary-color-rgb: 119, 119, 119;
  --bs-tertiary-color: rgba(119, 119, 119, .5); --bs-tertiary-color-rgb: 170, 170, 170;
  --bs-secondary-bg: #e9e9e9; --bs-secondary-bg-rgb: 233, 233, 233;
  --bs-tertiary-bg: #f5f5f5; --bs-tertiary-bg-rgb: 245, 245, 245;
  /* 链接：无下划线，hover 深蓝（现状 a 规则不变） */
  --bs-link-color: #337ab7; --bs-link-color-rgb: 51, 122, 183;
  --bs-link-hover-color: #2e6da4; --bs-link-hover-color-rgb: 46, 109, 164;
  /* 边框 / 圆角 / 阴影：1px #d4d4d4、3px 圆角、无阴影（规格 §2.2） */
  --bs-border-width: 1px; --bs-border-color: #d4d4d4; --bs-border-color-translucent: rgba(0, 0, 0, .15);
  --bs-border-radius: 3px; --bs-border-radius-sm: 3px; --bs-border-radius-lg: 4px;
  --bs-box-shadow-sm: 0 1px 3px rgba(0, 0, 0, .1);
  /* 规格无蓝色光环：focus-ring 与表单焦点阴影清零 */
  --bs-focus-ring-width: 0; --bs-focus-ring-color: transparent;
  --bs-box-shadow-inset: none;
  /* 灰阶对齐项目色板（bg-* 与 text-* 工具类、半透明边框会取用） */
  --bs-gray-100: #f8f8f8; --bs-gray-200: #e7e7e7; --bs-gray-300: #d4d4d4; --bs-gray-400: #ced4da;
  --bs-gray-500: #adb5bd; --bs-gray-600: #777; --bs-gray-700: #555; --bs-gray-800: #333; --bs-gray-900: #333;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.42857;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── BS 组件参数覆盖：按钮（§2.2 btn：14px/6px 12px/圆角 4px/白底 #d4d4d4 边）── */
.btn {
  --bs-btn-padding-y: 6px; --bs-btn-padding-x: 12px; --bs-btn-font-size: 14px; --bs-btn-line-height: 1.42857;
  --bs-btn-color: #333; --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); --bs-btn-border-radius: 4px;
  --bs-btn-hover-color: #333; --bs-btn-hover-bg: #e6e6e6; --bs-btn-hover-border-color: #adadad;
  --bs-btn-active-color: #333; --bs-btn-active-bg: #e0e0e0; --bs-btn-active-border-color: #adadad;
  --bs-btn-disabled-color: #333; --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: var(--line);
  --bs-btn-box-shadow: none; --bs-btn-disabled-opacity: .55; --bs-btn-focus-shadow-rgb: 51, 122, 183;
  /* 按钮里常有图标 + 文字，保留业务的 inline-flex 间距 */
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.btn:disabled { cursor: not-allowed; }
/* 原 .btn-block 已换成 w-100 工具类，居中仍要靠 flex */
.btn.w-100 { justify-content: center; }
/* = 原 .btn-xs 密度（规格 §3.2）；注意：迁移前 JS 里的 btn-sm 是无样式类，此处按规格取紧凑口径 */
.btn-sm {
  --bs-btn-padding-y: 1px; --bs-btn-padding-x: 5px; --bs-btn-font-size: 12px; --bs-btn-border-radius: 3px;
}
/* BS 编译产物里 .btn-primary/-danger/-success 的 --bs-btn-* 是字面色值，必须逐类覆盖 */
.btn-primary {
  --bs-btn-color: #fff; --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary-border);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--primary-border); --bs-btn-hover-border-color: #285e8e;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #285e8e; --bs-btn-active-border-color: #204d74;
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary-border);
}
.btn-danger {
  --bs-btn-color: #fff; --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger-border);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #c9302c; --bs-btn-hover-border-color: #ac2925;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #ac2925; --bs-btn-active-border-color: #ac2925;
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--danger); --bs-btn-disabled-border-color: var(--danger-border);
}
.btn-success {
  --bs-btn-color: #fff; --bs-btn-bg: var(--success); --bs-btn-border-color: #4cae4c;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #449d44; --bs-btn-hover-border-color: #398439;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #398439; --bs-btn-active-border-color: #398439;
  --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: var(--success); --bs-btn-disabled-border-color: #4cae4c;
}

/* ── BS 组件参数覆盖：表单控件（§2.2：高 30px、13px、圆角 3px、焦点 #66afe9 无光晕）── */
.form-control, .form-select {
  /* 实测：BS 的 .form-control{width:100%} 在本页对这些 input/textarea 未生效，
     控件退回 UA 固有宽度（size=20 ≈186px）并顶穿 .field/.ta-wrap，被 .col 裁掉。
     这里显式声明 width + max-width + min-width:0（三者缺一即回归，已在 5288 实测确认）。 */
  width: 100%; max-width: 100%; min-width: 0;
  height: 30px; padding: 0 8px; font-size: 13px; line-height: 1.5; color: #555;
  background-color: #fff; border: 1px solid var(--line); border-radius: 3px;
}
textarea.form-control { height: 66px; padding: 5px 8px; resize: vertical; }
/* 现状 select/筛选下拉均为浏览器原生外观，关掉 BS 的自绘箭头 */
select.form-control, .form-select {
  appearance: auto; -webkit-appearance: auto; background-image: none; padding-right: 8px;
}
/* BS focus 为 #86b7fe + 0.25rem 蓝光晕，规格 §2.2 是 #66afe9 无阴影 */
.form-control:focus, .form-select:focus {
  border-color: #66afe9; box-shadow: none; outline: 0; color: #555; background-color: #fff;
}
.form-control::placeholder { color: #999; opacity: 1; }
.form-control[readonly] { background: #f5f5f5; }
.form-control:disabled, .form-select:disabled { background: #eee; cursor: not-allowed; }
/* 原 .filt 密度（表头筛选/紧凑筛选输入） */
.form-control-sm { height: 26px; padding: 0 6px; font-size: 12px; min-height: 0; }
/* 字段小标题：12px #777（原 .field label） */
.form-label { display: block; margin-bottom: 2px; font-size: 12px; color: #777; }
/* 复选框组：原 .checkbox-inline 的行内排布，不采用 BS 的 1.5em 缩进 */
.form-check { padding-left: 0; min-height: 0; margin-bottom: 0; }
.form-check .form-check-input { float: none; margin-left: 0; }
.form-check-input {
  width: 13px; height: 13px; margin-top: 0; float: none;
  border: 1px solid var(--line); background-color: #fff;
}
/* 保留原生勾选外观（现状为浏览器原生控件，规格 §2.2 无自绘勾选） */
.form-check-input { appearance: auto; -webkit-appearance: auto; background-image: none; }
.form-check-input:focus { border-color: #66afe9; box-shadow: none; outline: 0; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary-border); }
.form-check-input[disabled] { opacity: .55; cursor: not-allowed; }
.form-check-inline {
  display: inline-flex; align-items: center; gap: 5px; margin-right: 12px;
  font-size: 13px; color: #555; cursor: pointer;
}
.form-check-inline .form-check-input { margin: 0; float: none; }

/* ── BS 组件参数覆盖：徽章（§2.2：10.5px/700/圆角 2.6px/padding 5px/白字）── */
.badge {
  --bs-badge-padding-x: 5px; --bs-badge-padding-y: 5px; --bs-badge-font-size: 10.5px;
  --bs-badge-font-weight: 700; --bs-badge-color: #fff; --bs-badge-border-radius: 2.6px;
  /* 默认底色保持现状；状态类走 bg-* 与 text-dark 工具类（自带 !important） */
  background-color: var(--info);
}
.badge.ghost { background: #ccc; color: #666; }
.badge.converted { background: #8a6d3b; }
.badge.ok { background: var(--success); }

/* ── BS 组件参数覆盖：input-group（原 .search-group，尺寸按业务作用域保留）── */
.toolbar .input-group { max-width: 420px; width: auto; flex: 0 0 auto; }
.toolbar .input-group > input, .toolbar .input-group > .form-control {
  width: 300px; flex: 0 0 auto; height: 34px; border: 1px solid var(--line); border-right: 0;
  border-radius: 4px 0 0 4px; padding: 0 10px; font-size: 14px; outline: none; background-color: #fff;
}
.toolbar .input-group .btn { border-radius: 0 4px 4px 0; height: 34px; }

/* ── BS 组件参数覆盖：分页（原 .q-pages button）── */
.pagination {
  --bs-pagination-padding-x: 11px; --bs-pagination-padding-y: 5px; --bs-pagination-font-size: 13px;
  --bs-pagination-border-radius: 4px; --bs-pagination-color: var(--link);
  --bs-pagination-bg: #fff; --bs-pagination-border-color: var(--line); --bs-pagination-hover-bg: #eaeaea;
  --bs-pagination-hover-color: var(--link); --bs-pagination-active-bg: var(--primary);
  --bs-pagination-active-border-color: var(--primary-border); --bs-pagination-active-color: #fff;
  --bs-pagination-disabled-color: #bbb; --bs-pagination-disabled-bg: #f5f5f5;
  --bs-pagination-disabled-border-color: var(--line); --bs-pagination-focus-box-shadow: none;
  --bs-pagination-focus-color: var(--link); --bs-pagination-focus-bg: #eaeaea;
}
.pagination .page-link { cursor: pointer; }
/* JS 可能用 .page-item.disabled 或 button disabled 属性，两种都要落回现状灰态 */
.page-item.disabled .page-link, .page-link:disabled { cursor: not-allowed; }

/* ── BS 组件参数覆盖：下拉（原 .dropdown-menu 基础规则）── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  --bs-dropdown-min-width: 160px; --bs-dropdown-padding-y: 3px; --bs-dropdown-font-size: 12px;
  --bs-dropdown-border-radius: 4px; --bs-dropdown-border-color: rgba(0, 0, 0, .15);
  --bs-dropdown-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); --bs-dropdown-item-padding-x: 12px;
  --bs-dropdown-item-padding-y: 4px; --bs-dropdown-link-hover-bg: #f0f7fc; --bs-dropdown-link-hover-color: #333;
  --bs-dropdown-link-color: #333; --bs-dropdown-bg: #fff; --bs-dropdown-zindex: 70;
  left: 0; top: 24px;
}
.dropdown-item { cursor: pointer; }
.dropdown-item.off { color: #ccc; cursor: not-allowed; background: transparent; }

/* 分组栅格：迁移前 .row-3/.row-2 是 grid + gap:6px，这里的子元素是 .field/.btn 等非 .col，
   消化不了 BS 的负边距（表现为 3px 左侵与 6px 标签重叠），故用 grid 精确复刻原口径。 */
.row.row-cols-3.g-1, .row.row-cols-2.g-1 { display: grid; gap: 6px; margin: 0; }
.row.row-cols-3.g-1 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row.row-cols-2.g-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row.row-cols-3.g-1 > *, .row.row-cols-2.g-1 > * {
  width: auto; max-width: none; margin-top: 0; padding: 0; min-width: 0;
}

/* ── 模态框 shim（§3.6：自建 .modal-mask，不加载 BS JS）── */
.modal-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 500;
  display: flex; align-items: stretch; justify-content: center; }
/* BS .modal 默认 display:none + position:fixed，这里还原成现状的铺满 flex 容器 */
.modal-mask .modal {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  width: 100%; height: 100%; max-width: none; margin: 0; overflow: hidden;
  background: #fff; border: 0; border-radius: 0; box-shadow: 0 3px 9px rgba(0, 0, 0, .3);
}
.modal-header {
  --bs-modal-header-padding: 10px 15px; --bs-modal-header-border-color: #e5e5e5;
  flex-wrap: nowrap; gap: 8px; background: #f8f8f8;
}
.modal-header .title { font-size: 18px; font-weight: 500; margin-right: 6px; }
.modal-header .close {
  margin-left: auto; font-size: 22px; line-height: 1; color: #000; opacity: .2;
  background: none; border: 0; cursor: pointer; padding: 0 4px;
}
.modal-header .close:hover { opacity: .6; }
/* 三栏（markup: modal-body row g-0 > .col）*/
/* body 同时带 .row，BS 的 .row>* 会把子栏按内容撑高、.modal-body 的 flex 基线又不可收缩，
   三栏会被拉到内容高度后由 overflow:hidden 永久裁掉。这里显式允许收缩 + min-height:0，
   并改用 grid 复刻迁移前的三栏等分（全项目仅询盘详情用 .modal-body）。 */
.modal-body {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0; margin: 0; padding: 0; overflow: hidden;
}
.modal-body > .col { width: auto; max-width: none; margin-top: 0; min-width: 0; }
.col { padding: 12px 15px; border-right: 1px solid #eee; overflow: auto; }
.col:last-child { border-right: 0; }
.col h4 { font-size: 14px; font-weight: 700; margin: 4px 0 10px; color: #555; }
.col h4 .sum { font-weight: 400; color: var(--primary); margin-left: 6px; }
.modal-footer {
  --bs-modal-footer-gap: 0px; padding: 10px 15px; gap: 8px;
  background: #f8f8f8; border-top: 1px solid #e5e5e5;
}

/* ── 顶部导航（高约 51px，bg #f8f8f8，下边框浅灰）──────────────────── */
.navbar {
  height: 51px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  display: flex; align-items: center;
  /* BS .navbar 会给 wrap/space-between，现状为不换行左对齐 */
  flex-wrap: nowrap; justify-content: flex-start;
  padding: 0 15px;
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
}
.navbar .brand { font-size: 16px; font-weight: 500; margin-right: 8px; color: #777; }
.navbar .ver { font-size: 11px; color: #aaa; margin-right: 18px; }
.navbar .nav-items { display: flex; gap: 2px; flex: 1; }
.navbar .nav-item {
  padding: 8px 12px; color: #777; font-size: 14px; border-radius: 3px; cursor: pointer;
  background: transparent; border: 0;
}
.navbar .nav-item:hover { color: #333; background: #e7e7e7; text-decoration: none; }
.navbar .nav-item.active { color: #333; background: #e7e7e7; }
.navbar .user-box { display: flex; align-items: center; gap: 10px; color: #777; }
.navbar .avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.caret { display: inline-block; width: 0; height: 0; margin-left: 4px; vertical-align: middle;
  border-top: 4px dashed; border-right: 4px solid transparent; border-left: 4px solid transparent; }

.container-fluid { padding: 66px 15px 20px; }

h1.page-title { font-size: 30px; font-weight: 500; margin: 18px 0 14px; color: var(--text); }

/* ── 工具条 ─────────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }

/* ── 表格（1px #d4d4d4 外框，无圆角无阴影，行高 30px，单元格 padding 5px）── */
.grid-wrap { border: 1px solid var(--line); background: #fff; overflow: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: 14px; table-layout: fixed; }
table.grid th, table.grid td {
  border: 1px solid var(--line); padding: 5px; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
table.grid thead th {
  background: #f5f5f5; font-weight: 700; height: 30px; position: relative; user-select: none;
}
table.grid thead tr.filter-row th { background: #fafafa; height: 32px; padding: 4px 5px; font-weight: 400; }
table.grid tbody tr { height: 30px; }
table.grid tbody tr:nth-child(even) { background: #fbfbfb; }
table.grid tbody tr:hover { background: #f0f7fc; }
.col-sort { cursor: pointer; }
.col-sort .sort-ind { color: #bbb; margin-left: 4px; font-size: 11px; }
.col-sort.sorted .sort-ind { color: var(--primary); }
.col-menu { float: right; color: #bbb; cursor: pointer; font-size: 11px; padding: 0 2px; }
.col-menu:hover { color: var(--primary); }
/* 残留选择器改写：原 .filt 的 22px 紧凑口径（现类名 form-control form-control-sm） */
.filter-row .form-control, .filter-row .form-select,
.q-fcell .form-control, .q-fcell .form-select {
  height: 22px; padding: 0 4px; font-size: 12px; border-radius: 0; width: 100%;
}
.filt-range { display: flex; gap: 3px; }
.cell-link { color: var(--link); font-family: "SFMono-Regular", Consolas, monospace; font-size: 13px; }
.cell-actions { display: flex; gap: 4px; }
.empty-row td { text-align: center; color: var(--muted); height: 60px; background: #fff; }

/* 列显隐菜单 */
.pop {
  position: absolute; z-index: 300; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 2px 6px rgba(0,0,0,.15); padding: 6px 0; min-width: 180px; font-size: 13px;
}
.pop label { display: block; padding: 3px 12px; cursor: pointer; }
.pop label:hover { background: #f0f7fc; }

/* ── 分页条（grid.js 自建裸标签，不走 BS 分页）─────────────────────── */
.pager {
  display: flex; align-items: center; gap: 8px; padding: 8px 6px;
  background: #fff; border: 1px solid var(--line); border-top: 0; font-size: 13px; color: #555;
}
.pager input { width: 46px; height: 26px; text-align: center; border: 1px solid var(--line); }
.pager select { height: 26px; border: 1px solid var(--line); }
.pager button {
  height: 26px; min-width: 26px; border: 1px solid var(--line); background: #fff; cursor: pointer;
  border-radius: 3px; color: #337ab7;
}
.pager button:hover:not([disabled]) { background: #eaeaea; }
.pager button[disabled] { color: #bbb; cursor: not-allowed; }
.pager .total { margin-left: auto; }

.readonly-hint { color: var(--danger); font-size: 13px; }

/* 表单控件 */
.field { margin-bottom: 8px; }
.field label { display: block; font-size: 12px; color: #777; margin-bottom: 2px; }
.field .req { color: var(--danger); }
/* 原 .input.input-sm（.input-sm 无样式）= 30px/13px 口径，迁移后按容器复位 */
.wb-copyq .form-control, .q-up .form-control { height: 30px; padding: 0 8px; font-size: 13px; }
.row-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 6px; }
.slash { display: grid; grid-template-columns: 1fr 10px 1fr 10px 1fr; align-items: center; gap: 2px; }
.slash .sep { text-align: center; color: #bbb; }
/* 根因：input 的 UA 固有宽度（size=20 ≈186px）会作为 grid/flex 项的 auto 最小尺寸下限，
   使 .slash/.price-row 等多列字段组的总宽超过栏宽而被裁（商品编码曾裁 174px）。
   显式 min-width:0 后轨道才按分数收缩。迁移前同样溢出，本轮一并修。 */
.slash > *, .vol-row > *, .price-row > *, .row-2-1 > *, .wb-cols > * { min-width: 0; }
/* 同理：.field/.ta-wrap 作为栅格项、.quote-item 作为 .q-c 栅格项，
   min-width:auto 会以内部控件的固有宽度为下限顶穿轨道。 */
.field, .ta-wrap, .quote-item, .inl, .inl .form-control { min-width: 0; }
.services { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }
.path-bar {
  background: var(--path-bar); border: 1px solid #bce8f1; color: #31708f;
  padding: 6px 8px; border-radius: 3px; margin: 8px 0; font-size: 13px;
}
.path-bar input { border: 1px solid #bce8f1; height: 28px; border-radius: 3px; padding: 0 8px; width: 100%; }

/* 货量动态行 */
.vol-rows { margin-bottom: 8px; }
.vol-row { display: grid; grid-template-columns: 26px 1fr 1.2fr; gap: 5px; margin-bottom: 5px; }
.vol-row .del {
  border: 1px solid var(--danger-border); background: var(--danger); color: #fff;
  border-radius: 3px; cursor: pointer; height: 30px; line-height: 1;
}
.vol-row .del:hover { background: #c9302c; }

/* typeahead */
.ta-wrap { position: relative; }
.ta-list {
  position: absolute; z-index: 400; left: 0; right: 0; top: 100%; max-height: 220px; overflow: auto;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.ta-list div { padding: 4px 8px; cursor: pointer; font-size: 13px; }
.ta-list div:hover, .ta-list div.on { background: #f0f7fc; }

/* 报价列表 */
.quote-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.quote-table th, .quote-table td { border: 1px solid #eee; padding: 4px; text-align: left; }
.quote-table th { background: #f7f7f7; font-weight: 600; color: #666; }
.quote-empty { color: #999; font-size: 13px; padding: 12px; text-align: center; border: 1px dashed var(--line); }
.quote-item { border: 1px solid #e3e3e3; border-radius: 3px; padding: 8px; margin-bottom: 8px; background: #fcfcfc; }
.quote-item .qh { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; font-size: 13px; }
/* flex 项默认 min-width:auto 会顶破 296px 列宽把末尾按钮挤出边框；只让报价号收缩，
   徽章和按钮保持原尺寸（否则文字会被裁） */
.quote-item .qh > b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-row { display: grid; grid-template-columns: 1.1fr 1fr .8fr .7fr .8fr 26px; gap: 4px; margin-bottom: 4px; }
/* 残留选择器改写：.price-row .input/.select → form-control/form-select */
.price-row .form-control, .price-row .form-select { height: 26px; font-size: 12px; }
.price-row .del {
  border: 1px solid var(--danger-border); background: var(--danger); color: #fff;
  border-radius: 3px; cursor: pointer; height: 26px; line-height: 1; font-size: 12px;
}
.price-row .del:hover { background: #c9302c; }
.price-row.price-head span { font-size: 11px; color: #8a8a8a; align-self: center; }
.ttl { font-size: 13px; color: #555; margin: 6px 0; }
.ttl b { color: var(--primary); }

/* 附件 */
.att-list { font-size: 12px; }
.att-list li { display: flex; gap: 6px; align-items: center; padding: 3px 0; list-style: none; }
.att-list ul { margin: 0; padding: 0; }

/* 消息条 + layui 风格确认框 */
.toast-zone { position: fixed; right: 15px; top: 60px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  /* BS .toast 会强制 width:350px 并加一圈半透明边框，这里还原成随文案收缩的无边条 */
  width: auto; border: 0;
  min-width: 240px; max-width: 420px; padding: 10px 14px; border-radius: 3px; color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.2); font-size: 13px; animation: slidein .2s ease-out;
}
.toast.ok { background: var(--success); }
.toast.err { background: var(--danger); }
.toast.warn { background: var(--warning); }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.confirm-mask { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 900;
  display: flex; align-items: center; justify-content: center; }
.confirm { background: #fff; width: 380px; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.confirm .hd { padding: 10px 15px; border-bottom: 1px solid #eee; font-weight: 700; }
.confirm .bd { padding: 16px 15px; font-size: 13px; color: #555; }
.confirm .bd input, .confirm .bd textarea { margin-top: 8px; }
.confirm .ft { padding: 10px 15px; border-top: 1px solid #eee; text-align: right; }

/* 登录页 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 340px; background: #fff; border: 1px solid var(--line); padding: 24px; }
.login-card h2 { margin: 0 0 16px; font-size: 20px; font-weight: 500; }

/* 审计 */
.audit-table { width: 100%; border-collapse: collapse; font-size: 12px; background: #fff; }
.audit-table th, .audit-table td { border: 1px solid var(--line); padding: 4px 6px; }
.audit-table th { background: #f5f5f5; }

/* ══ 报价管理（《报价管理模块逆向规格.md》§2.1 卡片列表 / §2.2 三栏工作台）══════ */
.beta {
  display: inline-block; vertical-align: super; margin-left: 6px; padding: 1px 6px;
  font-size: 11px; font-weight: 400; color: #fff; background: var(--info); border-radius: 8px;
}
.grid-error { color: #a94442; font-size: 13px; background: #f2dede; border: 1px solid #ebccd1; padding: 6px 10px; border-radius: 3px; }
.kv { display: flex; gap: 5px; line-height: 1.6; }
.kv-k { color: #999; flex: 0 0 auto; }
.kv-v { color: #333; word-break: break-all; }

/* ── 列表页：卡片行富文本表格（规格 §2.1，区别于询盘页的普通网格）── */
.q-filter { display: none; background: #fff; border: 1px solid var(--line); margin-bottom: 10px; }
.q-filter.open { display: block; }
.q-fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; padding: 10px 12px; }
.q-fcell label { display: block; font-size: 12px; color: #777; margin-bottom: 2px; }
.q-fbar {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  border-top: 1px solid #eee; background: #fcfcfc; font-size: 12px; color: #777;
}
.q-card-wrap { border: 1px solid var(--line); background: #fff; overflow-x: auto; }
table.q-card { border-collapse: collapse; width: 100%; min-width: 1400px; font-size: 12px; table-layout: fixed; }
.q-card thead th {
  background: linear-gradient(#fff, #f6f6f6); border: 1px solid #ddd; border-width: 0 1px 1px 0;
  padding: 7px 8px; text-align: left; font-weight: 700; color: #555; white-space: nowrap;
}
.q-card tbody tr { border-bottom: 1px solid #eee; }
.q-card tbody tr:hover { background: #f7fbfe; }
.q-card td { border-right: 1px solid #f0f0f0; padding: 7px 8px; vertical-align: top; }
.q-card-cell .kv { display: flex; gap: 5px; line-height: 1.6; }
.q-card-cell .kv-k { color: #999; flex: 0 0 auto; }
.q-card-cell .kv-v { color: #333; word-break: break-all; }
.q-h { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.q-no { font-family: Consolas, monospace; font-weight: 700; }
.q-ops { white-space: nowrap; }
.q-opline { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 3px; }
.q-link { color: var(--link); cursor: pointer; font-size: 12px; }
.q-link:hover { text-decoration: underline; }
.q-link.off { color: #c5c5c5; cursor: not-allowed; text-decoration: none; }
.q-ttl .ttl-line { display: flex; justify-content: space-between; gap: 6px; line-height: 1.7; }
.q-ttl .ttl-line > .kv-v { text-align: right; }
.q-ttl .ttl-total { font-weight: 700; color: var(--primary); border-top: 1px dashed #ddd; margin-top: 2px; }
.q-prices .q-prow { display: flex; gap: 6px; line-height: 1.6; }
.q-ptype { color: #777; flex: 0 0 auto; }
.q-ptype:after { content: ' '; }
.q-pval { color: #333; font-family: Consolas, monospace; font-size: 11px; word-break: break-all; }
.q-svcs { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.q-empty { color: #aaa; font-size: 12px; }

/* Bootstrap 分页 + 规格要求的英文计数文案（分页按钮样式见上面 .pagination 覆盖层） */
.q-pager-wrap { margin-top: 10px; }
.q-pager { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.q-showing { color: #777; font-size: 13px; }

/* ── 内联编辑（规格 §2.2：同一时刻仅一个字段处于编辑态）── */
.inl { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; cursor: text; border-radius: 3px; }
.inl.block { display: flex; width: 100%; }
.inl.wide { min-height: 40px; }
.inl:hover { background: #f0f7fc; box-shadow: inset 0 0 0 1px #bcdcf0; }
.inl-text { color: #333; white-space: pre-wrap; word-break: break-all; flex: 1; }
.inl-text.ph { color: #bbb; }
.inl-pencil { color: #ccc; font-size: 11px; }
.inl:hover .inl-pencil { color: var(--primary); }
.inl .inl-input { flex: 1; height: 26px; }
/* attachTa 会把 input 包进 .ta-wrap，此时 .inl 的直接子项变成 wrap，
   flex:1 传不到 input，编辑器会退回固有宽（实测 186px，只读态为 243px）。
   让 wrap 撑满、input 再 width:100% 即可与只读态对齐。 */
.inl > .ta-wrap { flex: 1; }
.inl textarea.inl-input { height: auto; }
.ta-list { z-index: 60; }

/* ── 工作台（整页三栏，非模态框）── */
.wb { padding-top: 60px; overflow-x: auto; }
/* 三栏不再硬撑 1180px：窄视口下靠 minmax 下限收缩，页面级横滚只在极端宽度下才出现 */
.wb-title { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.wb-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wb-h h1 { font-size: 22px; font-weight: 500; margin: 0; }
.wb-h .q-no { font-size: 15px; }
.wb-dirty { color: var(--warning); font-size: 12px; }
.wb-acts { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.wb-close {
  width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 50%;
  font-size: 18px; line-height: 1; color: #777; cursor: pointer;
}
.wb-close:hover { color: var(--danger); border-color: var(--danger); }
.wb-cols { display: grid; grid-template-columns: minmax(240px, 280px) minmax(260px, 300px) minmax(460px, 1fr); gap: 10px; align-items: start; }
/* 视口装不下三栏（280+300+460+间距 ≈ 1060）时，改为「左右两栏 + 明细整行」：
   既不产生页面级横滚，也不会把右列挤到 <400px —— 实测那样 q-grid 表头会互相压字、
   金额数字会折行。原方案 min-width:1180px 是靠整页横滚换取宽度，现由堆叠取代。 */
@media (max-width: 1119.98px) {
  .wb-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wb-cols > .wb-right { grid-column: 1 / -1; }
}
.wb-col { background: #fff; border: 1px solid var(--line); padding: 8px 10px 12px; overflow: auto; max-height: calc(100vh - 130px); }
.wb-hd {
  font-size: 13px; font-weight: 700; color: #555; margin: 10px 0 6px;
  padding-bottom: 3px; border-bottom: 1px solid #eee;
}
.wb-hd:first-child { margin-top: 0; }
.wb-f { margin-bottom: 6px; }
.wb-f > label { display: block; font-size: 11px; color: #999; margin-bottom: 1px; }
.wb-li { font-size: 12px; color: #555; line-height: 1.7; }
.wb-nums { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 4px 0; }
.wb-nums .kv { display: flex; gap: 4px; font-size: 12px; }
.wb-nums .kv-k { color: #999; }
.quote-nums { display: flex; gap: 12px; font-size: 12px; }
.wb-svcs { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0 6px; }
.wb-mfield { margin-bottom: 7px; }
.wb-flabel { font-size: 11px; color: #999; }
.wb-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wb-copyq { position: relative; margin-bottom: 8px; }
/* 原 -8px 依赖 .wb-sum 的 8px 下边距抵消，但 markup 里没有 .wb-ttl 祖先（该选择器为空转），
   标签条会压住汇总块最后一行，故取消负上边距。 */
.wb-tabs { display: flex; border-bottom: 2px solid var(--primary); margin: 0 -10px 8px; padding: 0 10px; }
.wb-tab {
  padding: 7px 14px; cursor: pointer; font-size: 13px; color: #555;
  border: 1px solid transparent; border-bottom: 0; border-radius: 4px 4px 0 0; margin-bottom: -2px;
}
.wb-tab:hover { color: var(--primary); }
.wb-tab.on { background: var(--primary); color: #fff; font-weight: 700; }
/* 汇总块：原写成 .wb-ttl .wb-sum，但业务工作台（guide-work.js）的 .wb-sum 没有 .wb-ttl 祖先，
   规则空转（15px 与 8px 间距从未生效）；改为直接作用于 .wb-sum，两个工作台口径一致。
   b 同理：kv() 生成的是 .kv-v span，故关键金额在 JS 里显式包 <b>（见下）。 */
.wb-sum { font-size: 15px; color: #555; margin: 8px 0; }
.wb-sum b { color: var(--primary); font-size: 18px; }
.wb-remark { display: flex; gap: 8px; padding: 3px 0; border-bottom: 1px dashed #f0f0f0; font-size: 12px; }
.wb-remark .kv-k { flex: 0 0 40%; color: #999; }

/* 费用表 */
.q-grid { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.q-grid th, .q-grid td { border: 1px solid #eee; padding: 3px 5px; text-align: left; vertical-align: top; }
.q-grid thead th { background: #f7f7f7; color: #666; font-weight: 600; white-space: nowrap; }
.q-grid tbody tr:hover { background: #fbfdff; }
.q-grid .empty-row td { text-align: center; color: #bbb; }
.q-qty { white-space: nowrap; }
.q-qty .inl { min-width: 34px; }
.row-note { color: #999; font-size: 11px; font-style: italic; margin-top: 2px; }
/* 裸按钮（无 .btn 类），保持原声明 */
.btn-del {
  border: 0; background: transparent; color: var(--danger); font-size: 15px;
  line-height: 1; cursor: pointer; padding: 0 2px;
}
.btn-del:hover:not([disabled]) { color: #a94442; }
.btn-del[disabled] { color: #ddd; cursor: not-allowed; }
.grp-bar {
  display: flex; align-items: center; gap: 6px; margin: 10px 0 4px; padding: 4px 8px;
  background: var(--path-bar); border: 1px solid #bce8f1; border-radius: 3px;
}
.grp-name { font-weight: 700; color: #31708f; font-size: 12px; }
.grp-add { background: #fff; }
/* 业务按钮态改写为 --bs-btn-* 变量（否则会被 .btn 的变量机制盖掉） */
.btn-trial {
  --bs-btn-color: #fff; --bs-btn-bg: var(--info); --bs-btn-border-color: #46b8da;
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #31b0d5; --bs-btn-hover-border-color: #269cb3;
  --bs-btn-active-color: #fff; --bs-btn-active-bg: #269cb3; --bs-btn-active-border-color: #1f8499;
  --bs-btn-padding-y: 0; --bs-btn-padding-x: 14px;
  height: 32px;
}
.btn-trial-s {
  --bs-btn-color: #31708f; --bs-btn-bg: #fff; --bs-btn-border-color: #bce8f1;
  --bs-btn-hover-color: #31708f; --bs-btn-hover-bg: var(--path-bar); --bs-btn-hover-border-color: #bce8f1;
  --bs-btn-active-color: #31708f; --bs-btn-active-bg: var(--path-bar); --bs-btn-active-border-color: #bce8f1;
  --bs-btn-disabled-color: #31708f; --bs-btn-disabled-bg: #fff; --bs-btn-disabled-border-color: #bce8f1;
  margin-left: 4px;
}
.faded { opacity: .55; }

/* 报价单预览 / 打印 */
.sheet-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 800; overflow: auto; padding: 20px; }
.sheet { width: 860px; max-width: 100%; margin: 0 auto; background: #fff; box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.sheet-act { display: flex; gap: 8px; justify-content: flex-end; padding: 8px 12px; background: #f5f5f5; border-bottom: 1px solid #ddd; }
.sheet-body { padding: 22px 28px 30px; font-size: 12px; color: #222; }
.sh-hd { display: flex; justify-content: space-between; gap: 20px; border-bottom: 2px solid #333; padding-bottom: 10px; }
.sh-name { font-size: 17px; font-weight: 700; }
.sh-mut { color: #666; line-height: 1.6; }
.sh-meta { text-align: right; }
.sh-title { font-size: 20px; font-weight: 700; letter-spacing: 2px; margin-bottom: 4px; }
.sh-kv, .sh-tbl { width: 100%; border-collapse: collapse; margin-top: 12px; }
.sh-kv td { padding: 2px 6px; vertical-align: top; }
.sh-kv td:first-child { color: #666; width: 90px; white-space: nowrap; }
.sh-tbl th, .sh-tbl td { border: 1px solid #999; padding: 4px 6px; }
.sh-tbl th { background: #eee; text-align: left; }
.sh-grp td { background: var(--path-bar); font-weight: 700; color: #31708f; }
.sh-ttl td { background: #f6f6f6; font-weight: 700; }
.sh-note { margin-top: 12px; padding: 8px 10px; background: #fcf8e3; border: 1px solid #faebcc; color: #8a6d3b; }

/* 删除确认页 */
.q-del { max-width: 640px; }
.q-delcard { background: #fff; border: 1px solid var(--line); margin-top: 6px; }
.q-delhd { padding: 12px 16px; font-size: 16px; font-weight: 500; border-bottom: 1px solid #eee; }
.q-delbd { padding: 14px 16px; font-size: 13px; color: #555; }
.q-delbd ul { margin: 6px 0 0; padding-left: 20px; }
.q-delbd li { line-height: 1.8; }
.q-delhint { color: #8a6d3b; background: #fcf8e3; border: 1px solid #faebcc; padding: 8px 10px; border-radius: 3px; }
.q-delft { padding: 12px 16px; border-top: 1px solid #eee; text-align: right; }
.q-delft .btn { margin-left: 8px; }

/* 云文件 */
.q-att { font-size: 12px; }
.q-attrow { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed #eee; }
.q-attrow > span:first-child { flex: 0 0 110px; color: #777; }
.q-attsize { color: #aaa; }
.q-up { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eee; }
.file-input { font-size: 12px; }
.form-row { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; margin-bottom: 7px; }
.form-row label { font-size: 12px; color: #777; text-align: right; }

/* 打印：只保留报价单正文 */
@media print {
  body.printing #app, body.printing .navbar, body.printing .toast-zone,
  body.printing .sheet-act, body.printing .confirm-mask { display: none !important; }
  body.printing .sheet-mask { position: static; background: none; padding: 0; overflow: visible; }
  body.printing .sheet { width: auto; margin: 0; box-shadow: none; }
  body.printing .sheet-body { padding: 0; }
  body.printing { background: #fff; }
}
