:root {
  --brand: #2f7f93;
  --brand-dark: #23606f;
  --brand-soft: #e3f1f4;
  --accent: #c0392b;
  --bg: #f4f6f8;
  --card: #fff;
  --line: #dde3e8;
  --text: #1f2a33;
  --muted: #7a8792;
  --disabled: #b9c1c8;
  --rec: #e67e22;
  --radius: 10px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
button { font: inherit; cursor: pointer; }
input { font: inherit; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px; padding: 10px 24px;
  background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 8px;
  background: #fff; color: var(--brand); font-weight: 700; font-size: 15px;
}
.brand h1 { margin: 0; font-size: 18px; }
.brand p { margin: 0; font-size: 12px; opacity: .85; }
.search { position: relative; flex: 1; max-width: 560px; margin-left: auto; }
.search input {
  width: 100%; padding: 9px 14px; border: 0; border-radius: 20px; outline: none;
}
#search-results {
  position: absolute; left: 0; right: 0; top: 44px; margin: 0; padding: 6px 0; list-style: none;
  background: #fff; color: var(--text); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  max-height: 420px; overflow: auto;
}
#search-results li { padding: 8px 14px; cursor: pointer; }
#search-results li:hover, #search-results li.active { background: var(--brand-soft); }
#search-results .path { font-size: 12px; color: var(--muted); }
#search-results mark { background: #ffe58f; color: inherit; }

/* 布局 */
.layout { display: grid; grid-template-columns: 1fr 400px; gap: 20px; padding: 20px 24px; align-items: start; }
.panel, .sel-card, .cart {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.panel { padding: 16px 18px; margin-bottom: 16px; }
.step-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.step-title small { font-weight: 400; color: var(--muted); }
span.num {  /* 步骤编号圆点；表格数字列也叫 num，所以限定为 span */
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 12px;
}
.empty { padding: 48px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--radius); }

/* 大类 */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cat {
  position: relative; text-align: left; padding: 12px 14px; border: 2px solid var(--line);
  border-radius: var(--radius); background: #fff; transition: .15s;
}
.cat:hover { border-color: var(--brand); }
.cat .icon { font-size: 22px; }
.cat b { display: block; margin-top: 4px; }
.cat span { font-size: 12px; color: var(--muted); }
.cat.on { border-color: var(--brand); background: var(--brand-soft); }
.cat.on::after {
  content: "✓"; position: absolute; top: 8px; right: 10px; color: var(--brand); font-weight: 700;
}

/* 每个大类的选型卡 */
.sel-card { margin-bottom: 16px; overflow: hidden; }
.sel-card > header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px; background: var(--brand-soft); border-bottom: 1px solid var(--line);
}
.sel-card > header h3 { margin: 0; font-size: 16px; color: var(--brand-dark); }
.sel-card .body { padding: 6px 18px 16px; }
.step { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.step:last-child { border-bottom: 0; }
.step .label { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; font-weight: 600; }
.step .label small { font-weight: 400; color: var(--muted); }
.step.locked { opacity: .45; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.group { margin-bottom: 8px; }
.group-name { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.chip {
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff;
  color: var(--text); transition: .12s; white-space: nowrap;
}
.chip em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 4px; }
/* 选中的不变色：手机上点过后 :hover 会一直留着，选中项的字会和底色一样看不见 */
.chip:not(.on):hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on em { color: #d8eef3; }
.chip:disabled {
  color: var(--disabled); background: #f6f7f8; border-style: dashed; cursor: not-allowed;
}
.chip .tag { font-size: 11px; margin-left: 4px; padding: 0 4px; border-radius: 3px; background: #fdebd0; color: var(--rec); }
.chip.on .tag { background: rgba(255,255,255,.25); color: #fff; }
.brand-meter { font-size: 12px; color: var(--muted); }
.brand-meter b { color: var(--brand); }
.reset { border: 0; background: none; color: var(--brand); font-size: 13px; }
.note-box {
  white-space: pre-wrap; font-size: 12px; color: #6b5b2a; background: #fffbe6;
  border: 1px solid #ffe58f; border-radius: 6px; padding: 8px 10px; margin-bottom: 10px; max-height: 120px; overflow: auto;
}

/* 型号卡片 */
.models { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.model {
  position: relative; text-align: left; padding: 10px 12px; border: 2px solid var(--line);
  border-radius: 8px; background: #fff;
}
.model:hover { border-color: var(--brand); }
.model.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.model .m-name { font-weight: 700; }
.model .m-price { color: var(--accent); font-weight: 700; margin-top: 4px; }
.model .m-meta { font-size: 12px; color: var(--muted); }
.model .m-param { font-size: 12px; margin-top: 4px; color: #4a5763; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 3px; margin-left: 4px; vertical-align: 1px; }
.badge.rec { background: var(--rec); color: #fff; }
.badge.imp { background: #e8eaf6; color: #3949ab; }

/* 详情 */
.detail { margin-top: 12px; border: 1px solid var(--brand); border-radius: 8px; overflow: hidden; }
.detail table { width: 100%; border-collapse: collapse; }
.detail th, .detail td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.detail th { width: 96px; background: #f7fafb; color: var(--muted); font-weight: 400; white-space: nowrap; }
.detail .price { color: var(--accent); font-size: 18px; font-weight: 700; }
.detail-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; background: #f7fafb; }
.stepper { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.stepper button { width: 30px; border: 0; background: #f0f3f5; }
.stepper input { width: 48px; border: 0; text-align: center; padding: 5px 0; }
.price-mode label { margin-right: 12px; }

button.primary {
  padding: 8px 18px; border: 0; border-radius: 6px; background: var(--brand); color: #fff; font-weight: 600;
}
button.primary:hover:not(:disabled) { background: var(--brand-dark); }
button.primary:disabled { background: var(--disabled); cursor: not-allowed; }
button.ghost { padding: 8px 18px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
button.link { border: 0; background: none; color: rgba(255,255,255,.85); }

/* 报价清单 */
.cart { position: sticky; top: 82px; display: flex; flex-direction: column; max-height: calc(100vh - 102px); overflow: hidden; }
.cart-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--brand); color: #fff; }
.cart-head h2 { margin: 0; font-size: 16px; }
.cart-items { flex: 1; overflow: auto; padding: 4px 0; min-height: 80px; }
.edit-banner { padding: 8px 16px; background: #fff7e6; border-bottom: 1px solid #ffd591; color: #874d00; font-size: 13px; position: relative; }
.edit-banner .hint { font-size: 12px; margin-top: 2px; }
.edit-banner [data-act="cancel-edit"] { position: absolute; right: 12px; top: 8px; font-size: 12px; }
.cart-empty { padding: 32px 16px; text-align: center; color: var(--muted); }
.cart-group { padding: 6px 16px 0; font-size: 12px; color: var(--brand-dark); font-weight: 700; }
.line { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.line .l-top { display: flex; justify-content: space-between; gap: 8px; }
.line .l-name { font-weight: 600; }
.line .l-sub { font-size: 12px; color: var(--muted); }
.line .l-del { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; }
.line .l-del:hover { color: var(--accent); }
.line .l-ctrl { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.line .l-ctrl input.price { width: 100px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; text-align: right; }
.line .l-ctrl input.fac { width: 90px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; }
.line .l-amt { margin-left: auto; font-weight: 700; }
.line .stepper input { width: 36px; }
.line .stepper button { width: 24px; }
.line .tbd { color: var(--rec); font-size: 12px; }
.cart-sum { padding: 12px 16px 16px; border-top: 1px solid var(--line); background: #fafbfc; }
.cart-sum .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.cart-sum .row b { color: var(--text); font-weight: 600; }
.cart-sum .total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.cart-sum .total b { color: var(--accent); font-size: 22px; }
.cart-sum .upper { font-size: 12px; color: var(--muted); text-align: right; margin-bottom: 10px; }
.cart-sum .primary { width: 100%; padding: 10px; font-size: 15px; }
.warn { margin-top: 6px; font-size: 12px; color: var(--rec); }

/* 导出对话框 */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: 0 16px 48px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20, 30, 40, .45); }
dialog form { padding: 20px 22px; }
dialog h3 { margin: 0 0 4px; }
.muted { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
dialog label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
dialog input { display: block; width: 100%; margin-top: 4px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

#toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 50;
  padding: 10px 18px; border-radius: 20px; background: rgba(31, 42, 51, .92); color: #fff;
}

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; padding: 16px; }
  .cart { position: static; max-height: none; }
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .search { max-width: none; flex-basis: 100%; }
}

/* 顶栏用户菜单 */
.usernav { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.usernav a { color: rgba(255,255,255,.85); text-decoration: none; padding: 6px 10px; border-radius: 6px; }
.usernav a:hover, .usernav a.on { background: rgba(255,255,255,.15); color: #fff; }
.usernav .menu { position: relative; }
.usernav .who { border: 0; background: rgba(255,255,255,.15); color: #fff; padding: 6px 12px; border-radius: 6px; }
.usernav .who small { opacity: .75; }
.usernav .drop {
  display: none; position: absolute; right: 0; top: 38px; min-width: 120px; padding: 6px 0;
  background: #fff; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 30;
}
.usernav .menu.open .drop { display: block; }
.usernav .drop button { display: block; width: 100%; padding: 8px 16px; border: 0; background: none; text-align: left; color: var(--text); }
.usernav .drop button:hover { background: var(--brand-soft); }

/* 表单补充 */
dialog select, dialog textarea {
  display: block; width: 100%; margin-top: 4px; padding: 7px 10px; border: 1px solid var(--line);
  border-radius: 6px; color: var(--text); font: inherit; background: #fff;
}
dialog label.check { display: flex; align-items: center; gap: 6px; color: var(--text); }
dialog label.check input { display: inline; width: auto; margin: 0; }
.form-err { color: var(--accent); font-size: 13px; margin-bottom: 8px; }

/* 普通页面（报价记录、管理后台） */
.page { max-width: 1280px; margin: 0 auto; padding: 20px 24px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type=search], .toolbar select {
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff;
}
.toolbar input[type=search] { width: 280px; }
.toolbar .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.tabs button { border: 0; background: none; padding: 10px 18px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tabs button.on { color: var(--brand); border-color: var(--brand); font-weight: 700; }
.table-wrap { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.grid th { background: #f7fafb; color: var(--muted); font-weight: 600; position: sticky; top: 0; white-space: nowrap; }
table.grid tr:hover td { background: #fafcfd; }
table.grid tr.off td { color: var(--disabled); }
table.grid .num { text-align: right; white-space: nowrap; }
table.grid .ops { white-space: nowrap; }
table.grid .ops button { border: 0; background: none; color: var(--brand); padding: 0 4px; }
table.grid .ops button.danger { color: var(--accent); }
.pill { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 12px; background: var(--brand-soft); color: var(--brand-dark); }
.pill.gray { background: #eee; color: var(--muted); }
.pill.red { background: #fdecea; color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); }
.card-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.card-box h3 { margin: 0 0 6px; }
.prod-form { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.prod-form label.wide { grid-column: 1 / -1; }
dialog.wide { width: min(860px, calc(100vw - 32px)); }

/* 登录页 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); padding: 16px; }
.login-card { width: min(380px, 100%); background: #fff; border-radius: 14px; padding: 32px 28px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.login-card h1 { margin: 0 0 4px; font-size: 22px; color: var(--brand-dark); }
.login-card label { display: block; font-size: 13px; color: var(--muted); margin-top: 14px; }
.login-card input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.login-card button { width: 100%; margin-top: 20px; padding: 11px; font-size: 15px; }

@media (max-width: 960px) {
  .usernav { flex-wrap: wrap; }
  .prod-form { grid-template-columns: 1fr; }
  .toolbar input[type=search] { width: 100%; }
}

/* 整单折扣 */
.cart-sum .discount { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.cart-sum .discount input { width: 64px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; text-align: center; }
.cart-sum .discount input.bad { border-color: var(--accent); background: #fdecea; }
.cart-sum .rate { color: var(--rec); }
.cart-sum .rate b { color: var(--accent); }

/* 规格型号 / 方法 互相筛选 */
.spec { display: grid; gap: 14px; }
.sub-title { font-size: 13px; font-weight: 600; color: var(--brand-dark); margin-bottom: 6px; }
.sub-title small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.spec-methods { padding: 10px 12px; background: #f7fafb; border-radius: 8px; }
.model-group { margin-bottom: 10px; }
.model-group > .group-name { font-size: 13px; color: var(--text); font-weight: 600; margin-bottom: 6px; }
.model-group.dim > .group-name { color: var(--disabled); }
.model.dim { opacity: .4; border-style: dashed; }
.model.dim:hover { opacity: .75; }
.model .m-method { color: var(--brand); }

/* 型号多选 */
.model .tick {
  position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border-radius: 4px;
  border: 1.5px solid var(--line); background: #fff; color: #fff; font-size: 12px; line-height: 15px; text-align: center;
}
.model.on .tick { background: var(--brand); border-color: var(--brand); }
.chip.mark:not(.on) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); color: var(--brand-dark); }
.picked-box { padding: 0; }
.picked-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 12px; background: var(--brand-soft); border-bottom: 1px solid var(--line);
}
.picked-head .ghost, .pick .ghost { padding: 6px 12px; }
.picked-head .primary { padding: 6px 14px; }
.pick { border-bottom: 1px solid var(--line); }
.pick:last-child { border-bottom: 0; }
.pick-head { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px 4px; }
.pick-head .price { color: var(--accent); font-weight: 700; white-space: nowrap; }
.pick-info { display: grid; grid-template-columns: 72px 1fr; gap: 2px 10px; margin: 0; padding: 2px 12px 8px; font-size: 13px; }
.pick-info dt { color: var(--muted); }
.pick-info dd { margin: 0; }
.pick .detail-actions { padding: 8px 12px; }
/* 已选设备里改单价：改过价以改后的金额为准 */
.pick-price { display: inline-flex; align-items: center; gap: 6px; }
.pick-price .lbl { color: var(--muted); font-size: 13px; }
.pick-price input.price-input { width: 96px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 4px; text-align: right; }
.pick-price input.price-input.mod { border-color: var(--accent); color: var(--accent); font-weight: 600; background: #fff8ee; }
.pick-head .price s { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 6px; }
.mod-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--accent);
  background: #fff4e6; border: 1px solid #ffd8a8; border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.mod-tag button.link { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 12px; padding: 0; }
.line .l-ctrl input.price.mod { border-color: var(--accent); color: var(--accent); font-weight: 600; background: #fff8ee; }

/* 报价公司 / 报价人 */
.cart-sum .seller { display: grid; gap: 6px; margin-bottom: 10px; }
.cart-sum .seller label { display: grid; grid-template-columns: 64px 1fr; align-items: center; font-size: 13px; color: var(--muted); }
.cart-sum .seller select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; min-width: 0; }
.cart-sum .seller .term-amount { display: flex; align-items: center; gap: 4px; color: var(--muted); }
.cart-sum .seller .term-amount input { flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; color: var(--text, inherit); }

.pick-bar {
  position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  flex-wrap: wrap; margin: 8px -18px 0; padding: 10px 18px; background: rgba(255,255,255,.96);
  border-top: 2px solid var(--brand); box-shadow: 0 -4px 12px rgba(0,0,0,.08);
}
.pick-bar b { color: var(--brand); font-size: 16px; }
.pick-bar .ghost, .pick-bar .primary { padding: 6px 14px; }
/* overflow:hidden 会让 sticky 失效，clip 只裁圆角 */
.sel-card { overflow: clip; }

/* 报价清单按钮 */
.cart-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.cart-actions button { padding: 10px; font-size: 15px; }
.cart-sum .cart-actions .primary { width: auto; }

/* 报价单预览（仿 Excel 模板版式） */
dialog.preview-dlg { width: min(980px, calc(100vw - 24px)); }
dialog.preview-dlg form { padding: 16px 18px; }
.pv-bar { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pv-bar h3 { margin: 0; }
.qp { border: 1px solid #333; font-size: 12px; overflow-x: auto; }
.qp table { width: 100%; border-collapse: collapse; }
.qp td, .qp th { border: 1px solid #555; padding: 5px 6px; text-align: center; vertical-align: middle; }
.qp-head { display: grid; grid-template-columns: 1fr 1fr; background: #2f7f93; color: #fff; }
.qp-title { font-size: 34px; font-weight: 800; letter-spacing: 6px; display: grid; place-items: center; padding: 10px; }
.qp-co { font-size: 15px; font-weight: 700; display: grid; place-items: center; text-align: center; padding: 10px; }
.qp-info td { text-align: left; }
.qp-info td.k { width: 70px; color: #444; }
.qp-tip { text-align: center; padding: 6px; border-top: 1px solid #555; border-bottom: 1px solid #555; }
.qp-items th { background: #92cddc; font-weight: 700; }
.qp-items .r { text-align: right; white-space: nowrap; }
.qp-items .l { text-align: left; padding-left: 12px; }
.qp-items tr.sum td { background: #f2f2f2; font-weight: 700; }
.qp-items tr.disc td { font-weight: 700; }
.qp-items .neg, .qp-items .red { color: #c00000; font-weight: 700; }
.qp-items tr.tot td { font-weight: 700; font-size: 13px; }
.qp-items tr.tot td:first-child { background: #ddebf7; }
.qp-notes td { text-align: left; }
.qp-notes td.k { width: 40px; text-align: center; font-weight: 700; }
.qp .warn { padding: 6px 10px; margin: 0; }
.qp-items .pos { color: #c00000; font-weight: 700; }
/* 预览里的「隐藏」列：只在预览出现，不属于报价单 */
.qp td.pv-op, .qp th.pv-op { border: 0; border-left: 1px solid #555; background: #f5f9fa !important; width: 52px; padding: 2px 4px; font-weight: 400; font-size: 12px; color: var(--muted); white-space: nowrap; }
.qp td.pv-op label { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; }
.qp tr.hid td:not(.pv-op) { color: #9aa5ad; background: repeating-linear-gradient(135deg, #fafafa 0 6px, #f0f0f0 6px 12px); }
.qp tr.hid td.neg, .qp tr.hid td.pos { color: #9aa5ad; }
.qp tr.hid small { color: var(--muted); font-weight: 400; }
.pv-notes { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px; }
.pv-notes-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pv-notes-head [data-add-note] { margin-left: auto; }
.pv-note { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pv-note input { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.preview-tip { margin: 6px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.hide-pill { display: inline-block; font-size: 11px; font-weight: 400; color: #8a5a00; background: #fff4dc; border-radius: 4px; padding: 0 5px; vertical-align: 1px; }

/* 表单分组标题、印章预览、合同 */
.form-section { grid-column: 1 / -1; font-weight: 700; color: var(--text); margin: 6px 0 8px; padding-top: 6px; border-top: 1px dashed var(--line); font-size: 13px; }
.form-section:first-child { border-top: 0; padding-top: 0; }
.prod-form label.check { align-self: end; }
.prod-form .wide { grid-column: 1 / -1; }
.pill { white-space: nowrap; }
.pill[hidden] { display: none; }
dialog input[hidden], dialog label[hidden] { display: none; }
.choice-group { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 4px 0 12px; }
.choice-title { font-weight: 700; font-size: 13px; margin-bottom: 6px; color: var(--text); }
dialog label.choice { display: flex; gap: 8px; align-items: flex-start; color: var(--text); margin: 0; padding: 6px 4px; border-radius: 6px; cursor: pointer; line-height: 1.5; }
dialog label.choice:hover { background: var(--brand-soft); }
dialog label.choice input { display: inline; width: auto; margin: 4px 0 0; flex: none; }
.tbl-edit { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.tbl-edit summary { padding: 8px 12px; cursor: pointer; font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.tbl-edit summary .hint { font-weight: 400; }
.tbl-edit .tbl-body { padding: 0 10px 10px; }
.tbl-scroll { overflow-x: auto; max-height: 360px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; }
.tbl-edit table { border-collapse: collapse; width: 100%; font-size: 12px; }
.tbl-edit th { position: sticky; top: 0; background: #f6f8f9; font-weight: 600; padding: 5px 4px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; z-index: 1; }
.tbl-edit td { padding: 2px 3px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
.tbl-edit td input, .tbl-edit td select { margin: 0; padding: 3px 5px; font-size: 12px; min-width: 70px; border-radius: 4px; }
.tbl-edit td.seq input { width: 46px; min-width: 46px; }
.tbl-edit td.mark select { width: 84px; min-width: 84px; }
.tbl-edit th.mark, .tbl-edit td.mark { white-space: nowrap; }
.tbl-edit .link { border: 0; background: none; color: var(--brand); padding: 0 4px; cursor: pointer; font-size: 12px; }
.tbl-edit .link.danger { color: var(--accent); }
.tbl-ops { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.choice-help { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); line-height: 1.7; }
.seal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin: 12px 0; }
.seal-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; text-align: center; }
.seal-card img { width: 140px; height: 140px; object-fit: contain; background: repeating-conic-gradient(#f3f3f3 0 25%, #fff 0 50%) 0 0 / 16px 16px; border-radius: 6px; }
.seal-card .ops { display: flex; gap: 8px; justify-content: center; margin-top: 8px; flex-wrap: wrap; }
.warn-box { background: #fff7e6; border: 1px solid #ffd591; color: #874d00; border-radius: 6px; padding: 8px 10px; font-size: 13px; margin: 4px 0 12px; }
.prod-form input.need-fill { background: #fffbe0; border-color: #e6b800; box-shadow: 0 0 0 2px rgba(230,184,0,.18); }
.contract-list { margin-top: 4px; font-size: 12px; }
.contract-list a { color: var(--brand); cursor: pointer; }
.field-list { columns: 3; font-size: 13px; line-height: 1.9; }
.field-list code { background: #f5f5f5; padding: 1px 4px; border-radius: 3px; }
@media (max-width: 720px) { .seal-grid { grid-template-columns: 1fr; } .field-list { columns: 1; } }

/* ===== 统一的按钮与表单样式 ===== */
:root { --focus: 0 0 0 3px rgba(47, 127, 147, .18); --ctl-h: 34px; }
button { transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s; }
button:focus-visible { outline: none; box-shadow: var(--focus); }

/* 主按钮 / 次按钮 / 普通按钮（没写 class 的按钮按次按钮显示；:where 不加权重，不影响各处已有的专用样式） */
button.primary, button.ghost, :where(dialog, .toolbar, .card-box, .seal-card, .tbl-ops) :where(button:not([class])), button.danger:not(.link):not(table.grid .ops button) {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--ctl-h); padding: 6px 16px; border-radius: 6px; font-weight: 500; line-height: 1.4; white-space: nowrap;
}
button.primary { border: 1px solid var(--brand); font-weight: 600; box-shadow: 0 1px 2px rgba(35, 96, 111, .25); }
button.primary:hover:not(:disabled) { border-color: var(--brand-dark); }
button.primary:active:not(:disabled) { transform: translateY(1px); }
button.primary:disabled { border-color: var(--disabled); box-shadow: none; }
button.ghost, :where(dialog, .toolbar, .card-box, .seal-card, .tbl-ops) :where(button:not([class])) { border: 1px solid #cfd8de; background: #fff; color: var(--text); }
button.ghost:hover:not(:disabled), :where(dialog, .toolbar, .card-box, .seal-card, .tbl-ops) :where(button:not([class]):hover:not(:disabled)) {
  border-color: var(--brand); color: var(--brand); background: #f6fbfc;
}
button.ghost:disabled, :where(dialog, .toolbar, .card-box, .seal-card, .tbl-ops) :where(button:not([class]):disabled) { color: var(--disabled); background: #f6f7f8; cursor: not-allowed; }
button.danger:not(.link):not(table.grid .ops button) { border: 1px solid #f1b8b1; background: #fff; color: var(--accent); }
button.danger:not(.link):not(table.grid .ops button):hover { background: #fdecea; border-color: var(--accent); }
.cart-sum .cart-actions .ghost, .cart-sum .cart-actions .primary { min-height: 42px; }

/* 输入框、下拉框：统一高度和聚焦效果 */
dialog input:not([type=radio]):not([type=checkbox]):not([type=file]), dialog select,
.toolbar input[type=search], .toolbar select, .login-card input { min-height: var(--ctl-h); }
input, select, textarea { transition: border-color .15s, box-shadow .15s; }
dialog input:focus, dialog select:focus, dialog textarea:focus, .toolbar input:focus, .toolbar select:focus,
.login-card input:focus, .line .l-ctrl input:focus, .pick-price input:focus, .cart-sum select:focus, .cart-sum .discount input:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--focus);
}
dialog input:hover:not(:focus), dialog select:hover:not(:focus), dialog textarea:hover:not(:focus) { border-color: #b8c4cc; }

/* 表格里的行操作：小号描边按钮 */
table.grid .ops { white-space: nowrap; }
table.grid .ops br { display: none; }
table.grid .ops button {
  display: inline-flex; align-items: center; margin: 2px 4px 2px 0; padding: 3px 10px; min-height: 26px;
  border: 1px solid #d3e5ea; border-radius: 5px; background: #fff; color: var(--brand-dark); font-size: 12px;
}
table.grid .ops button:hover { background: var(--brand-soft); border-color: var(--brand); }
table.grid .ops button.danger { border-color: #f3c6c0; color: var(--accent); }
table.grid .ops button.danger:hover { background: #fdecea; border-color: var(--accent); }
table.grid .ops button[data-act="contract"] { background: var(--brand); border-color: var(--brand); color: #fff; }
table.grid .ops button[data-act="contract"]:hover { background: var(--brand-dark); }
table.grid td { vertical-align: middle; }
table.grid td:has(> .contract-list), table.grid td:has(br) { vertical-align: top; }
table.grid tbody tr:last-child td { border-bottom: 0; }
.table-wrap { box-shadow: 0 1px 3px rgba(20, 40, 50, .04); }

/* 标签页 */
.tabs button { border-radius: 6px 6px 0 0; font-weight: 500; }
.tabs button:hover:not(.on) { color: var(--brand); background: #eef5f7; }

/* 对话框：标题更醒目，底部按钮固定在可见区域（长表单不用滚到底） */
dialog { max-height: calc(100vh - 48px); }
dialog h3 { font-size: 18px; color: var(--brand-dark); }
dialog form > h3 + .muted { padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.dlg-actions {
  position: sticky; bottom: 0; z-index: 2; margin: 12px -22px -20px; padding: 12px 22px;
  background: #fff; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px;
}
dialog.preview-dlg .dlg-actions { margin: 12px -18px -16px; padding: 12px 18px; }
.dlg-actions button { min-width: 88px; }

/* 生成合同对话框里的小按钮 */
.tbl-ops button:not(.link) { min-height: 30px; padding: 4px 12px; font-size: 13px; }
.tbl-edit summary:hover { background: #f6fbfc; border-radius: 8px; }
.tbl-edit[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.choice-group { background: #fcfdfd; }
dialog label.choice:has(input:checked) { background: var(--brand-soft); }
dialog label.choice:has(input:checked) b { color: var(--brand-dark); }
/* 未审批时“生成合同”置灰 */
table.grid .ops button:disabled, table.grid .ops button[data-act="contract"]:disabled {
  background: #f3f5f6; border-color: var(--line); color: var(--disabled); cursor: not-allowed;
}
table.grid .ops button[data-act="approval"] { border-style: dashed; }

/* ===== 钉钉审批 ===== */
.pill.warn { background: #fff4e0; color: #b25e00; }
/* 开关（产品限价） */
.switch { position: relative; display: inline-block; width: 34px; height: 18px; vertical-align: middle; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 9px; background: #ccc; transition: background .15s; }
.switch span::after { content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
a.link-sm { font-size: 12px; color: var(--brand); cursor: pointer; }
a.link-sm:hover { text-decoration: underline; }
.appr-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.appr-sum > div { background: #f7fafb; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.appr-sum span { display: block; font-size: 12px; color: var(--muted); }
.appr-sum b { font-size: 15px; }
.appr-sum b.deal { color: var(--accent); }
.appr-sum b.disc { color: var(--brand-dark); font-size: 18px; }
.appr-sum em { font-style: normal; font-size: 12px; color: var(--rec); margin-left: 6px; }
table.appr-rows { width: 100%; border-collapse: collapse; font-size: 12px; }
table.appr-rows th { position: sticky; top: 0; background: #f6f8f9; text-align: left; padding: 6px 8px; font-weight: 600; white-space: nowrap; }
table.appr-rows td { padding: 5px 8px; border-top: 1px solid #f0f0f0; }
table.appr-rows .num { text-align: right; white-space: nowrap; }
.appr-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.appr-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
ol.timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--brand-soft); }
ol.timeline li { position: relative; padding: 4px 0 4px 8px; font-size: 13px; }
ol.timeline li::before { content: ""; position: absolute; left: -20px; top: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
@media (max-width: 720px) { .appr-sum { grid-template-columns: 1fr 1fr; } }
.req { color: var(--accent); }

/* 合同预览 */
dialog.contract-preview { width: min(1000px, calc(100vw - 24px)); }
.docx-box { background: #e9edf0; border-radius: 8px; padding: 8px; max-height: calc(100vh - 240px); overflow: auto; min-height: 200px; }
.docx-box .docx-wrapper { background: transparent; padding: 12px 0; }
.docx-box .docx-wrapper > section.docx { box-shadow: 0 2px 10px rgba(0,0,0,.15); margin-bottom: 16px; }
/* 整表删除 */
.tbl-edit summary .tbl-drop { margin-left: auto; }
.tbl-edit summary .tbl-nodrop { margin-left: auto; font-weight: 400; font-size: 12px; }
.tbl-edit.dropped { background: #fafafa; border-style: dashed; }
.tbl-edit.dropped summary .tbl-name { text-decoration: line-through; color: var(--muted); }
.tbl-edit.dropped summary { cursor: default; }

/* ===================== 手机版：商城式布局（≤768px） =====================
   底部导航（选型 / 报价清单 / 报价记录 / 管理 / 我的）+ 悬浮结算条 + 报价清单底部弹层。电脑上这些元素都隐藏。 */
.tabbar, .cart-bar, .cart-close { display: none; }
.cart-mask[hidden], .cart-bar[hidden] { display: none !important; }
.badge-num {
  position: absolute; top: -6px; right: -12px; min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font: 700 10px/17px system-ui, sans-serif; text-align: center; border: 2px solid #fff;
}
.badge-num.bump { animation: bump .45s ease; }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.5); } 100% { transform: scale(1); } }
dialog.sheet button { all: unset; }

@media (max-width: 768px) {
  /* clip 和 hidden 一样裁掉横向溢出，但不会让顶栏、导航栏的吸顶（sticky）失效；老浏览器退回 hidden */
  html, body { overflow-x: hidden; overflow-x: clip; }
  body.has-tabbar { padding-bottom: calc(58px + env(safe-area-inset-bottom)); }
  body.has-tabbar.has-cartbar { padding-bottom: calc(126px + env(safe-area-inset-bottom)); }
  body.sheet-open { overflow: hidden; }

  /* 顶栏：只留小 logo + 搜索框 */
  .topbar { flex-wrap: nowrap; gap: 10px; padding: 8px 12px; }
  .usernav { display: none; }
  .topbar:has(.search) .brand > div { display: none; }   /* 选型页：只留 logo + 搜索；其他页面显示页面标题 */
  .brand h1 { font-size: 16px; }
  .brand p { font-size: 11px; }
  .logo { width: 34px; height: 34px; font-size: 12px; border-radius: 8px; }
  .search { flex: 1; min-width: 0; max-width: none; margin: 0; flex-basis: auto; }
  .search input { padding: 8px 14px; font-size: 14px; }
  #search-results { top: 42px; max-height: 60vh; }

  /* 底部导航 */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255,255,255,.97); border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(0,0,0,.05);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 11px; color: var(--muted); text-decoration: none; -webkit-tap-highlight-color: transparent;
  }
  .tabbar a.on { color: var(--brand); font-weight: 600; }
  .tabbar .ic { position: relative; display: block; width: 24px; height: 24px; }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

  /* 选型区 */
  .layout { display: block; padding: 10px; }
  .panel { padding: 12px; margin-bottom: 10px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .cat { padding: 10px 4px 8px; text-align: center; }
  .cat .icon { font-size: 26px; }
  .cat b { font-size: 13px; }
  .cat span { display: none; }
  .cat.on::after { top: 4px; right: 6px; }
  .sel-card > header { padding: 10px 12px; }
  .sel-card .body { padding: 4px 12px 12px; }
  .models { grid-template-columns: 1fr; }
  .chip { padding: 7px 12px; }
  .pick-bar { margin: 8px -12px 0; padding: 10px 12px; bottom: calc(56px + env(safe-area-inset-bottom)); }
  body.has-cartbar .pick-bar { bottom: calc(124px + env(safe-area-inset-bottom)); }
  .empty { padding: 32px 16px; }

  /* 悬浮结算条 */
  .cart-bar {
    display: flex; align-items: center; gap: 12px; position: fixed; z-index: 45;
    left: 10px; right: 10px; bottom: calc(64px + env(safe-area-inset-bottom));
    padding: 6px 6px 6px 10px; border-radius: 30px; background: #27323b; color: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,.25);
  }
  .cb-icon { all: unset; position: relative; display: grid; place-items: center; width: 44px; height: 44px; margin-top: -14px;
    border-radius: 50%; background: var(--brand); border: 3px solid #27323b; cursor: pointer; }
  .cb-icon svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
  .cb-icon .badge-num { top: -4px; right: -6px; border-color: #27323b; }
  .cb-sum { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; line-height: 1.25; }
  .cb-sum b { font-size: 17px; color: #ffd36b; }
  .cb-sum small { font-size: 11px; color: #aab6bf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cart-bar .primary { min-height: 40px; padding: 0 22px; border-radius: 22px; font-size: 15px; }

  /* 报价清单：底部弹层 */
  .cart {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 70;
    height: 88vh; height: 88dvh; max-height: none; margin: 0; border-radius: 16px 16px 0 0; border: 0;
    transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
    box-shadow: 0 -10px 40px rgba(0,0,0,.25); padding-bottom: env(safe-area-inset-bottom);
  }
  .cart.open { transform: none; }
  .cart-head { border-radius: 16px 16px 0 0; position: relative; padding-top: 16px; }
  .cart-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: rgba(255,255,255,.5); }
  .cart-head-ops { display: flex; align-items: center; gap: 6px; }
  .cart-close { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; font-size: 14px; }
  .cart-mask { position: fixed; inset: 0; z-index: 65; background: rgba(15, 25, 35, .45); }
  .cart-items { -webkit-overflow-scrolling: touch; }
  .line { padding: 12px 14px; }
  .line .stepper button { width: 34px; }
  .line .stepper input { width: 42px; padding: 7px 0; }
  .line .l-ctrl input.price { width: 110px; padding: 7px 8px; }
  .line .l-ctrl input.fac { width: 100%; padding: 7px 8px; }
  .line .l-del { font-size: 22px; padding: 0 4px; }
  /* 整个弹层一起滚动（原来合计区固定占一半屏，清单只露出一两行）；标题吸顶，预览/导出按钮吸底 */
  .cart { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .cart-head { position: sticky; top: 0; z-index: 2; }
  .cart-items { flex: none; overflow: visible; min-height: 0; }
  .cart-sum { padding: 10px 14px 0; flex: none; }
  .cart-sum .cart-actions { position: sticky; bottom: 0; z-index: 2; margin: 10px -14px 0;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fafbfc; border-top: 1px solid var(--line); }  .line .l-amt { flex-basis: 100%; text-align: right; }
  .cart-sum .seller { grid-template-columns: 1fr 1fr; }
  .cart-sum .seller label { grid-template-columns: 1fr; gap: 2px; }

  /* 弹窗：从底部弹出，铺满宽度 */
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 92vh; }
  dialog.wide, dialog.preview-dlg, dialog.contract-preview { width: 100vw; }
  dialog form { padding: 16px 14px; }
  .dlg-actions { margin: 12px -14px -16px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .two { grid-template-columns: 1fr; gap: 0; }
  #toast { bottom: calc(140px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); text-align: center; }

  /* “我的”菜单：底部动作面板 */
  dialog.sheet form { padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
  dialog.sheet .sheet-who { padding: 12px 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
  dialog.sheet button { display: block; padding: 14px 8px; text-align: center; font-size: 16px; color: var(--text); border-bottom: 1px solid var(--line); cursor: pointer; }
  dialog.sheet .danger-text { color: var(--accent); }
  dialog.sheet .sheet-cancel { border: 0; margin-top: 8px; background: #f3f5f6; border-radius: 10px; }

  /* 报价单预览：按 A4 报价单原样排版，手机上横向滑动查看，不把列挤成一个字一行 */
  .qp > * { min-width: 900px; }
  .qp { -webkit-overflow-scrolling: touch; }

  /* 报价记录 / 管理页：表格横向滚动，工具栏换行 */
  .page { padding: 12px 10px; }
  .table-wrap > table.grid:not(.quote-table) { min-width: 720px; }
  .table-wrap > table.grid:not(.quote-table) td { word-break: keep-all; }
  .toolbar { gap: 8px; }
  .tabs { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .tabs button { padding: 10px 12px; flex: none; }

  /* 报价记录：手机上每条报价是一张“订单卡片” */
  .table-wrap:has(.quote-table) { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  table.quote-table, table.quote-table tbody { display: block; }
  table.quote-table thead { display: none; }
  table.quote-table tr {
    display: grid; grid-template-columns: 1fr auto; column-gap: 10px;
    grid-template-areas: "cust appr" "time time" "who who" "items items" "amt con" "ops ops";
    background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(20,40,50,.05);
  }
  table.quote-table tr:hover td { background: transparent; }
  table.quote-table td { display: block; border: 0; padding: 2px 0; }
  table.quote-table td:nth-child(1) { grid-area: time; font-size: 12px; color: var(--muted); white-space: normal !important; }
  table.quote-table td:nth-child(2) { grid-area: cust; font-size: 16px; font-weight: 700; }
  table.quote-table td:nth-child(3) { grid-area: who; font-size: 12px; color: var(--muted); }
  table.quote-table td:nth-child(3) br { display: none; }
  table.quote-table td:nth-child(3) .hint { margin-left: 6px; font-size: 12px; }
  table.quote-table td:nth-child(4) { grid-area: items; margin: 6px 0; padding: 8px 10px; background: #f7fafb; border-radius: 8px; font-size: 13px; }
  table.quote-table td:nth-child(5) { grid-area: amt; text-align: left; font-size: 18px; font-weight: 700; color: var(--accent); align-self: center; }
  table.quote-table td:nth-child(5) .hint { font-size: 12px; font-weight: 400; margin-left: 4px; }
  table.quote-table td:nth-child(5) br { display: none; }
  table.quote-table td:nth-child(6) { grid-area: appr; text-align: right; }
  table.quote-table td:nth-child(6) br, table.quote-table td:nth-child(6) .hint { display: none; }
  table.quote-table td:nth-child(7) { grid-area: con; text-align: right; align-self: center; font-size: 12px; }
  table.quote-table td:nth-child(7) > .hint { display: none; }
  table.quote-table td.ops { grid-area: ops; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end;
    border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 10px; white-space: normal; }
  table.quote-table td.ops button { margin: 0; min-height: 34px; padding: 4px 14px; font-size: 13px; border-radius: 17px; }
  table.quote-table td[colspan] { grid-column: 1 / -1; }
}

.pv-kind { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin: 0; }
.pv-kind select { width: auto; padding: 4px 8px; }

/* 导出报价单：询价方下拉搜索客户库 */
.req { color: var(--accent); font-weight: 400; margin-left: 2px; }
.cust-pick { position: relative; }
.cust-list {
  position: absolute; left: 0; right: 0; top: 58px; z-index: 5; margin: 0; padding: 4px 0; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15);
  max-height: 240px; overflow: auto;
}
.cust-list li { padding: 7px 12px; cursor: pointer; line-height: 1.4; }
.cust-list li:hover, .cust-list li.active { background: var(--brand-soft); }
.cust-list .sub { font-size: 12px; color: var(--muted); }
.cust-list .empty { color: var(--muted); cursor: default; font-size: 13px; }
.cust-list .empty:hover { background: none; }
.cust-tip { margin: -6px 0 10px; font-size: 12px; color: var(--muted); }
.cust-tip.new { color: #b26a00; }
.cust-tip.hit { color: #2e7d32; }

/* 选型页导航：大类卡片的标题栏吸顶，栏里是本大类各步的跳转；右下角「目录」跨大类跳转 */
.picker { min-width: 0; }
.sel-card > header { position: sticky; top: var(--topbar-h, 64px); z-index: 6; gap: 10px; flex-wrap: wrap; }
.sel-card > header h3 { white-space: nowrap; }
.card-nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.card-ops { display: flex; gap: 4px; white-space: nowrap; }
.nv { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 13px;
  color: var(--muted); background: #fff; border: 1px solid var(--line); text-decoration: none; white-space: nowrap; }
.nv:hover { border-color: var(--brand); color: var(--brand); }
.nv.done { color: var(--brand); border-color: #b9dbe3; }
.nv.hot { background: var(--brand); border-color: var(--brand); color: #fff; }
.nv-val { color: var(--text); font-size: 12px; max-width: 10em; overflow: hidden; text-overflow: ellipsis; }
.nv.hot .nv-val { color: #fff; }
[id^="sec-"] { scroll-margin-top: calc(var(--topbar-h, 64px) + 64px); }
.sel-card[id^="sec-"] { scroll-margin-top: calc(var(--topbar-h, 64px) + 10px); }

/* 目录按钮放在卡片底部「已勾选 / 全部加入报价单」条的上方，不挡按钮 */
.toc { position: fixed; right: 24px; bottom: 76px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.toc-btn { border: 0; border-radius: 22px; padding: 10px 18px; background: var(--brand); color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,.2); cursor: pointer; }
.toc-list { display: none; width: 300px; max-height: min(70vh, 520px); overflow: auto; padding: 8px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.toc.open .toc-list { display: block; }
.toc-top { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); font-weight: 600; text-decoration: none; }
.toc-top:hover, .toc-name:hover { background: var(--brand-soft); color: var(--brand); }
.toc-cat { padding: 6px 0; border-top: 1px dashed var(--line); }
.toc-name { display: block; padding: 4px 10px; border-radius: 8px; color: var(--brand-dark); font-weight: 600; text-decoration: none; }
.toc-steps { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 10px 2px; }
/* 桌面两栏：目录按钮放在左侧选型区的右下角，不压住右边的报价清单 */
@media (min-width: 961px) { .toc { right: calc(24px + 400px + 20px + 16px); } }
@media (max-width: 768px) {
  .sel-card > header .card-nav { order: 3; flex-basis: 100%; }
  .toc { right: 12px; bottom: calc(120px + env(safe-area-inset-bottom)); }
  body.has-cartbar .toc { bottom: calc(188px + env(safe-area-inset-bottom)); }
  .toc-btn { padding: 8px 14px; font-size: 13px; }
  .toc-list { width: min(300px, calc(100vw - 24px)); }
}
.ops-spec .sub-title { margin: 4px 0 8px; }
.ops-spec .chips { margin-bottom: 12px; }
.mode-chip { padding: 8px 16px; font-weight: 600; }

/* 报价记录：表头筛选 / 排序 */
.quote-table th { white-space: nowrap; }
.th-sort { cursor: pointer; user-select: none; }
.th-sort:hover { color: var(--brand-dark); }
.sort-arrow { margin-left: 3px; font-size: 11px; color: #b8c4cc; }
.sort-arrow.on { color: var(--brand); }
.th-filter { margin-left: 4px; padding: 0 4px; min-height: 0; height: 18px; line-height: 16px; font-size: 11px; border: 1px solid transparent;
  border-radius: 4px; background: transparent; color: #8a99a6; cursor: pointer; vertical-align: 1px; }
.th-filter:hover { border-color: var(--line); color: var(--text); }
.th-filter.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.filter-pop { position: absolute; z-index: 50; width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12); padding: 8px; font-size: 13px; }
.filter-pop .fp-search { width: 100%; margin-bottom: 6px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; }
.filter-pop .fp-list { max-height: 260px; overflow: auto; }
.filter-pop label { display: flex; align-items: center; gap: 6px; padding: 4px 2px; cursor: pointer; }
.filter-pop label[hidden] { display: none; }
.filter-pop label span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-pop label em { font-style: normal; color: var(--muted); font-size: 12px; }
.filter-pop .fp-ops { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.filter-pop .fp-ops .spacer { flex: 1; }
#view { min-height: var(--ctl-h); padding: 0 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.filter-pop .fp-ops .primary { min-height: 28px; padding: 3px 14px; }
.filter-pop button.link, #clear-filters { color: var(--brand); background: none; border: 0; padding: 0 2px; cursor: pointer; font-size: 13px; }
.filter-pop button.link:hover, #clear-filters:hover { text-decoration: underline; }
/* 报价记录：行操作按钮竖排，操作列不撑宽表格（只在电脑上；手机上是订单卡片底部的一排按钮） */
@media (min-width: 769px) {
  table.quote-table td.ops { white-space: normal; width: 1%; }
  table.quote-table td.ops button { display: flex; width: 100%; min-width: 92px; justify-content: center; margin: 0 0 6px; white-space: nowrap; }
  table.quote-table td.ops button:last-child { margin-bottom: 0; }
}
/* 页面内确认 / 提示框 */
dialog.ui-dialog { width: min(420px, calc(100vw - 32px)); }
dialog.ui-dialog .ui-msg { font-size: 14px; line-height: 1.7; margin: 4px 0 16px; white-space: normal; }
.pv-notes button.link { color: var(--brand); background: none; border: 0; padding: 0 2px; cursor: pointer; font-size: 13px; }
.pv-note button.link { color: var(--muted); }

/* ---------- 手机选型（方案 C：筛选 + 结果列表，web/mpick.js）。电脑上不显示 ---------- */
.mpick { display: none; }
@media (max-width: 768px) {
  .picker, .toc { display: none !important; }
  .mpick { display: block; margin: -10px -10px 0; }   /* 抵消 .layout 的内边距，列表铺满宽度 */
  .mp-head { position: sticky; top: var(--topbar-h, 50px); z-index: 30; background: #fff; box-shadow: 0 1px 0 var(--line); }
  .mp-bar { display: flex; }
  .mp-bar button { flex: 1; min-width: 0; border: 0; background: transparent; padding: 11px 4px 9px; font: inherit; font-size: 14px;
    color: #4b5a64; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
  .mp-bar button::after { content: " ▾"; font-size: 10px; color: #a3b0b9; }
  .mp-bar button.open::after { content: " ▴"; }
  .mp-bar button.set, .mp-bar button.set::after { color: var(--brand); font-weight: 700; }
  .mp-quick { display: flex; gap: 6px; overflow-x: auto; padding: 0 10px 9px; scrollbar-width: none; }
  .mp-quick::-webkit-scrollbar { display: none; }
  .mp-quick .chip { flex: none; padding: 4px 11px; font-size: 13px; }
  .mp-mask { position: fixed; inset: 0; z-index: 1; background: rgba(15, 25, 35, .42); }
  .mp-bar, .mp-quick { position: relative; z-index: 2; background: #fff; }
  .mp-sheet { position: absolute; left: 0; right: 0; top: 100%; z-index: 3; background: #fff;
    border-radius: 0 0 14px 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
  .mp-opts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px; max-height: 55vh; overflow-y: auto; overscroll-behavior: contain; }
  .mp-opts .chip { white-space: normal; text-align: left; }
  .mp-note { margin: 10px 10px 0; }
  .mp-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 6px; font-size: 12px; color: var(--muted); }
  .mp-tools { display: flex; align-items: center; gap: 8px; }
  .mp-tools .chip { padding: 3px 10px; font-size: 12px; }
  .mp-mode { display: inline-flex; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
  .mp-mode button { border: 0; background: transparent; padding: 3px 10px; font: inherit; font-size: 12px; color: #4b5a64; cursor: pointer; }
  .mp-mode button.on { background: var(--brand); color: #fff; }
  .mp-list { background: #fff; border-top: 1px solid var(--line); }
  .mp-list .empty { border: 0; padding: 40px 16px; }
  .mp-card { display: flex; gap: 10px; align-items: center; padding: 12px; border-bottom: 1px solid #edf1f3; }
  .mp-main { flex: 1; min-width: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .mp-name { font-weight: 600; line-height: 1.4; }
  .mp-sub { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
  .mp-price { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 5px; }
  .mp-price b { color: var(--accent); font-size: 15px; font-variant-numeric: tabular-nums; }
  .mp-price small { color: var(--muted); font-size: 11px; }
  .mp-price .badge { margin: 0; }
  .mp-price .tbd { color: var(--rec); font-weight: 600; font-size: 13px; }
  .mp-lead { font-size: 11px; color: #8a99a6; }
  .mp-info { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 8px 0 0; padding: 8px 10px; background: #f7fafb; border-radius: 8px; font-size: 12px; }
  .mp-info dt { color: var(--muted); }
  .mp-info dd { margin: 0; word-break: break-word; }
  .mp-ctl { flex: none; align-self: center; }
  .mp-plus { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--brand); color: #fff; font-size: 20px; line-height: 32px; cursor: pointer; }
  .mp-step { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; }
  .mp-step button { width: 30px; height: 30px; padding: 0; border: 0; background: #f3f6f8; color: var(--brand); font-size: 17px; cursor: pointer; }
  .mp-step b { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }
}
