[hidden] { display: none !important; }

:root {
  --ink: #0b1220;
  --ink-2: #111b2e;
  --canvas: #f2f4f8;
  --card: #ffffff;
  --line: #e7eaf0;
  --line-soft: #f0f2f6;
  --text: #141a24;
  --subtle: #5b6472;
  --muted: #9099a7;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --primary-soft: #eff4ff;
  --accent: #e11d48;
  --accent-soft: #fff1f3;
  --green: #16a34a;
  --amber: #b45309;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow: 0 8px 24px -12px rgba(16, 24, 40, 0.18);
  --shadow-lg: 0 24px 64px -24px rgba(16, 24, 40, 0.28);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ============ 顶栏 ============ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}
.header-inner {
  max-width: 1560px;
  margin: 0 auto;
  height: 62px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb 55%, #7c3aed);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}
.brand-text {
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.site-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.site-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}
.site-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.18);
}
.site-chip.ok .dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
.site-chip.warn .dot { background: #f43f5e; box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.18); }
.site-chip .mini {
  border: none;
  background: transparent;
  color: #93c5fd;
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
}
.site-chip .mini:disabled { color: #64748b; cursor: default; }
button.wps-chip { cursor: pointer; font: inherit; }
.wps-chip.is-off .dot { background: #94a3b8; box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18); }
.wps-chip.is-ok .dot { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
.wps-chip.is-err .dot { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }
.wps-chip.is-err { color: #b42318; background: #fef3f2; border-color: #fecdca; }
.top-actions { margin-left: auto; display: flex; gap: 10px; }

/* ============ 按钮 ============ */
.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn .ico { width: 15px; height: 15px; fill: currentColor; flex: none; }
.btn.primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.7);
}
.btn.primary:hover { background: linear-gradient(180deg, #2563eb, #1d4ed8); }
.btn.primary.lg { height: 42px; padding: 0 24px; font-size: 14px; border-radius: 10px; }
.btn.accent {
  background: linear-gradient(180deg, #f43f5e, #e11d48);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(225, 29, 72, 0.6);
}
.btn.accent:hover { background: linear-gradient(180deg, #e11d48, #be123c); }
.btn.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--subtle);
}
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn.ghost-light {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
}
.btn.ghost-light:hover { background: rgba(255, 255, 255, 0.12); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.linkbtn {
  border: none;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
}
.linkbtn:hover { text-decoration: underline; }

/* ============ Hero ============ */
.hero {
  background:
    radial-gradient(1200px 280px at 18% -40%, rgba(37, 99, 235, 0.16), transparent 60%),
    radial-gradient(900px 240px at 82% -50%, rgba(124, 58, 237, 0.12), transparent 60%),
    linear-gradient(180deg, #f7f9ff 0%, var(--canvas) 78%);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: 1560px;
  margin: 0 auto;
  padding: 16px 28px 14px;
}
.hero h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #0f172a;
}
.hero p {
  margin: 0;
  color: var(--subtle);
  font-size: 13.5px;
}

/* ============ 主区域 ============ */
main {
  max-width: 1560px;
  margin: 0 auto 56px;
  padding: 20px 28px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.query-card,
.result-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.query-card { padding: 14px 20px 16px; }

.query-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.card-title { font-size: 15px; font-weight: 700; }
.hint { color: var(--muted); font-size: 12px; margin-top: 0; }
.query-count {
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.query-row { display: flex; gap: 12px; align-items: stretch; justify-content: flex-start; }

/* 输入框下方：查询站点 + 状态 + 按钮（固定一行） */
.query-bottom {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.query-bottom .spacer { flex: 1; }
.query-actions-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  margin-right: 28%;
}
.query-bottom .btn.lg { height: 38px; }
#search-btn:disabled { opacity: 0.7; cursor: wait; }

/* 查询进行中：状态点 + 呼吸动画 */
.status.busy {
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status.busy::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: status-pulse 0.9s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.25; transform: scale(0.55); }
}

#query-input {
  width: 100%;
  min-height: 160px;
  max-height: 320px;
  resize: vertical;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: "JetBrains Mono", Consolas, "Microsoft YaHei", monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text);
  background: #fbfcfe;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#query-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  background: #fff;
}
.query-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.site-filter { display: flex; align-items: center; gap: 12px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfd; }
.site-filter .filter-label { color: var(--muted); font-size: 12px; }
.site-filter .chk { font-size: 12px; }
.status { color: var(--muted); font-size: 12px; margin-left: 2px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ 结果卡 ============ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: var(--sticky-header, 62px);
  z-index: 55;
  background: var(--card);
  transform: translateY(var(--toolbar-exit, 0px));
}
.toolbar-title { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 700; }
.count-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 2px 10px;
}
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.chk { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--subtle); font-size: 13px; }
.chk input { accent-color: var(--primary); width: 15px; height: 15px; }
.chk.strategy select { height: 30px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line); font-size: 12.5px; color: var(--text); background: #fff; }

/* ============ 矩阵表 ============ */
.table-wrap { overflow: visible; }
.matrix-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
.matrix-table thead th {
  position: sticky;
  top: var(--sticky-thead, 169px);
  z-index: 45;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.3px;
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.matrix-table tbody td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.matrix-row { transition: background 0.12s ease; }
.matrix-row:hover { background: #fafcff; }
.matrix-row.unchecked { opacity: 0.45; }
.w-exp { width: 60px; }
.w-prod { width: 180px; }
.w-model { width: 140px; }
.w-qty { width: 104px; }
.w-sup { width: auto; }
.w-sub { width: 70px; }
.w-best { width: 74px; }
.w-op { width: 74px; }
.op-cell { white-space: nowrap; }

/* 产品信息列（学工控猫：品牌/品名/包装规格/参数/市场价） */
.prod-cell { padding-top: 12px !important; }
.prod-brand {
  font-size: 11px;
  font-weight: 700;
  color: #1a7f37;
  margin-bottom: 2px;
}
.prod-name { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.35; margin-bottom: 2px; }
.prod-sub { font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.seq { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }

.expander {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  white-space: nowrap;
  width: 46px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  border-radius: 6px;
  padding: 4px 4px;
  margin: 3px 0 2px;
  transition: all 0.15s;
}
.expander .chev { font-size: 12px; }
.expander .exp-label { font-size: 10px; }
.expander:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}
.model-cell .model {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.1px;
  color: #0f172a;
}
.model-cell .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.model-cell .sub.brand-line b { color: var(--text); font-weight: 600; }
.split-line { color: var(--amber); font-weight: 600; }
.model-cell .name {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 报价卡：保持单行紧凑，长仓库名靠悬停滚动查看 */
.offer-cell { padding: 8px 6px !important; }
.offer {
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: 0.14s ease;
  box-sizing: border-box;
}
.offer:hover { background: #f8faff; border-color: var(--line); box-shadow: var(--shadow-sm); }
.offer.chosen {
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.06);
}
.offer input[type="radio"] { accent-color: var(--primary); width: 14px; height: 14px; margin: 0; flex: none; }
.offer-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; width: 100%; }
.offer .price {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  padding-right: 28px;
}
.offer .meta {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.offer .meta b { color: var(--accent); font-weight: 700; }
.offer .wh {
  font-size: 11px;
  color: #7c8794;
  margin-top: 2px;
  white-space: normal;
  line-height: 1.4;
  word-break: break-all;
}
.offer .wh.inferred { color: var(--amber); }
.is-best .offer .price { color: var(--accent); }
.badge-best {
  position: absolute;
  top: 6px;
  right: 6px;
  margin-left: 0;
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(225, 29, 72, 0.22);
  border-radius: 999px;
  padding: 2px 9px;
}
/* 型号行内编辑（悬停型号单元格才显示“修改”） */
.model-cell { position: relative; }
/* A9 Pro 对照表中的可替换型号：红叹号提示 */
.a9-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(220, 38, 38, 0.35);
}
.model-cell > .a9-mark {
  position: absolute;
  top: 1px;
  right: 1px;
  z-index: 2;
  cursor: help;
}
.model-edit {
  display: block;
  margin: 6px 0 0 auto;
  border: none;
  background: #dc2626;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  cursor: pointer;
  padding: 7px 16px;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, background 0.12s ease;
}
.model-cell:hover .model-edit,
.model-cell:focus-within .model-edit {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.model-edit:hover { background: #b91c1c; }
.model-cell:has(.model-edit-input) .model-edit { display: none; }
.model-cell:has(.model-fix-box) .model-edit { display: none; }

/* 单元格内修改框（仿工控猫）：订货号 / 型号 + 右下角红色“修改” */
.model-fix-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  position: relative;
  padding-bottom: 26px;
  min-width: 220px;
}
.model-fix-box label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}
.model-fix-box label span { flex: none; width: 46px; }
.model-fix-box input {
  flex: 1;
  min-width: 0;
  height: 26px;
  padding: 0 6px;
  font-size: 12px;
}
.model-fix-ok {
  position: absolute;
  right: 0;
  bottom: 0;
  border: none;
  border-radius: 4px;
  background: #dc2626;
  color: #fff;
  font-size: 12px;
  padding: 4px 16px;
  cursor: pointer;
}
.model-fix-ok:hover { background: #b91c1c; }
/* 边输入边模糊查找的结果 */
.model-fix-sug {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: min(560px, 78vw);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  max-height: 230px;
  overflow-y: auto;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  z-index: 30;
}
.model-fix-sug .sug-tip { padding: 6px 8px; font-size: 11.5px; color: var(--muted); }
.model-fix-sug .sug-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-top: 1px solid #f1f5f9;
  font-size: 11.5px;
}
.model-fix-sug .sug-row:first-child { border-top: none; }
.model-fix-sug .sug-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.model-fix-sug .sug-model,
.model-fix-sug .sug-sku {
  flex: none;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.model-fix-sug .sug-sku { color: var(--primary); }
.model-fix-sug .sug-ok {
  flex: none;
  border: none;
  border-radius: 4px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  padding: 3px 10px;
  cursor: pointer;
}
.model-fix-sug .sug-ok:hover { background: #b91c1c; }
/* 手机/平板没有 hover：直接显示“修改” */
@media (hover: none) {
  .model-cell .model-edit { opacity: 1; visibility: visible; pointer-events: auto; }
}
.model-edit-box {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}
.model-edit-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--primary);
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 11px;
  outline: none;
}
.model-edit-ok,
.model-edit-cancel {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 5px;
  font-size: 10.5px;
  padding: 2px 6px;
  cursor: pointer;
  white-space: nowrap;
}
.model-edit-ok { background: var(--primary); color: #fff; border-color: var(--primary); }
.cell-fix {
  display: inline-block;
  margin-left: 4px;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 10px;
  cursor: pointer;
  padding: 0;
}
.cell-fix:hover { text-decoration: underline; }
.empty-cell { text-align: center; }
.empty-hint { font-size: 11px; color: #b0b7c3; cursor: help; }
.retry-cell {
  display: block;
  margin: 4px auto 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary);
  font-size: 10.5px;
  border-radius: 4px;
  padding: 1px 7px;
  cursor: pointer;
}
.retry-cell:hover { border-color: var(--primary); background: var(--primary-soft); }
.dash { color: #cbd5e1; }

.best-cell { white-space: nowrap; }
.best-price {
  display: block;
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}
.best-site { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }

/* 明细行 */
.detail-row td { background: #fafbfd !important; padding: 0 !important; border-bottom: 1px solid var(--line); }
.detail-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.detail-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: #f4f6fa;
  white-space: nowrap;
}
.detail-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.detail-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.detail-table .sell { color: var(--accent); font-weight: 700; }
.name-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ============ 模糊查找 ============ */
.fuzzy-card .toolbar { flex-wrap: wrap; }
.fuzzy-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line-soft);
}
.fuzzy-bar input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--text);
  background: #fbfcfe;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fuzzy-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  background: #fff;
}
.fuzzy-table td { vertical-align: middle; }
.fuzzy-name {
  color: var(--muted);
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fuzzy-offer {
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: 0.12s;
}
.fuzzy-offer:hover { background: var(--primary-soft); border-color: rgba(37, 99, 235, 0.25); }
.fo-sku { font-size: 13px; font-weight: 700; color: var(--primary); }
.fo-price { font-size: 13px; margin-top: 3px; color: #0f172a; font-weight: 600; font-variant-numeric: tabular-nums; }
.fo-stock { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 5px; }

/* ============ 纠错建议 ============ */
.correction-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: #fffaf0;
  border-bottom: 1px solid #fde8c4;
}
.correction-title { color: var(--amber); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.corr-list { display: flex; gap: 8px; flex-wrap: wrap; }
.corr-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #f5d9a8;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  transition: 0.12s;
}
.corr-chip:hover { border-color: var(--amber); box-shadow: 0 2px 8px rgba(180, 83, 9, 0.12); }
.corr-chip.active { background: #fff3e0; border-color: var(--amber); }
.corr-site { color: var(--muted); }
.corr-model { font-weight: 600; }
.corr-price { color: var(--accent); font-weight: 600; }
.corr-stock { color: var(--muted); }
.badge-fuzzy {
  display: inline-block;
  margin-left: 4px;
  font-size: 10.5px;
  color: var(--amber);
  background: #fff7e6;
  border: 1px solid #f5d9a8;
  border-radius: 999px;
  padding: 0 6px;
  vertical-align: middle;
}

/* ============ 未找到型号 / 纠错 ============ */
.matrix-row.unmatched { background: #fffafa; }
.matrix-row.unmatched .model { color: var(--accent); }
.badge-unmatched {
  display: inline-block;
  font-size: 10.5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(225, 29, 72, 0.25);
  border-radius: 999px;
  padding: 0 7px;
  margin-right: 6px;
}
.corr-open {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 11.5px;
  cursor: pointer;
  padding: 0 2px;
}
.corr-open:hover { text-decoration: underline; }
.cand-row td { background: #fbfcfe !important; padding: 10px 18px !important; }
.cand-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cand-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
}
.cand-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.cand-chip b { font-weight: 700; color: var(--text); }
.cand-chip span { color: var(--muted); }
.cand-price { color: var(--accent) !important; font-weight: 700; }

/* ============ 选仓策略按钮组 / 渠道筛选 ============ */
.strategy-label { color: var(--muted); font-size: 12px; }
.strategy-wrap { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.strategy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
}
.strategy-toggle:hover { border-color: var(--primary); color: var(--primary); }
#strategy-current { color: var(--primary); font-weight: 600; }
.strategy-caret { color: var(--muted); font-size: 10px; }
.strategy-pop {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: static;
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.strategy-pop .strategy-group {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.strategy-pop .strategy-btn { flex: 0 0 auto; padding: 6px 10px; border-bottom: 0; }
.strategy-pop .strategy-btn:last-child { border-right: 0; }
.strategy-default {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
.strategy-default input { accent-color: var(--primary); }
.strategy-group {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  background: #fafbfd;
}
.strategy-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-size: 12.5px;
  color: var(--subtle);
  cursor: pointer;
  white-space: nowrap;
  border-right: 1px solid var(--line);
}
.strategy-btn:last-child { border-right: none; }
.strategy-btn:hover { color: var(--primary); background: var(--primary-soft); }
.strategy-btn.active { background: var(--primary); color: #fff; font-weight: 600; }
.filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 22px;
  border-bottom: 1px solid var(--line-soft);
  background: #fbfcfe;
  position: sticky;
  top: var(--sticky-filter, 131px);
  z-index: 50;
}
/* 比价结果全部滚过去后，渠道栏不再吸顶，随内容一起上滑 */
.filter-bar.is-past-results {
  position: static;
  top: auto;
  z-index: auto;
}

/* 进入销售报价单后，释放渠道栏和矩阵表头；比价工具栏继续吸顶，
   与报价单头栏上下相连。 */
.result-card.is-quote-mode .filter-bar,
.result-card.is-quote-mode .matrix-table thead th {
  position: static;
  top: auto;
  z-index: auto;
}
.filter-bar .filter-label { font-size: 12px; color: var(--muted); }

.badge-replace {
  display: inline-block;
  font-size: 9.5px;
  color: #b45309;
  background: #fff7e6;
  border: 1px solid #f5d9a8;
  border-radius: 3px;
  padding: 0 4px;
  margin-left: 3px;
  vertical-align: middle;
}
.alt-btn {
  align-self: flex-start;
  margin-top: 3px;
  border: 1px solid #f5d9a8;
  background: #fffaf0;
  color: #b45309;
  font-size: 10px;
  border-radius: 4px;
  padding: 1px 6px;
  cursor: pointer;
}
.alt-btn:hover { border-color: var(--amber); }
.alt-list { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.alt-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 5px;
  padding: 3px 6px;
  cursor: pointer;
  text-align: left;
}
.alt-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.alt-chip b { font-size: 10.5px; color: var(--text); }
.alt-chip span { color: var(--muted); }
.alt-price { color: var(--accent) !important; font-weight: 700; }
.alt-stock { color: #16a34a !important; }

/* ============ 行内数量 / 小计 / 删除 ============ */
.matrix-table tbody td.qty-cell { padding-left: 8px !important; padding-right: 8px !important; }
.qty-cell { white-space: nowrap; }
.qty-ctl {
  display: inline-flex;
  align-items: center;
  width: 88px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.qty-ctl button {
  width: 22px;
  height: 30px;
  flex: none;
  border: none;
  background: #f7f9fc;
  color: var(--subtle);
  font-size: 15px;
  cursor: pointer;
}
.qty-ctl button:hover { background: var(--primary-soft); color: var(--primary); }
.qty-ctl input {
  width: auto;
  min-width: 0;
  flex: 1 1 auto;
  height: 30px;
  border: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  outline: none;
  font-variant-numeric: tabular-nums;
}
.qty-ctl input::-webkit-outer-spin-button,
.qty-ctl input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sub-cell { font-weight: 800; color: var(--text); font-size: 14px; }
.op-cell { text-align: center; }
.row-del {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.row-del:hover { color: var(--accent); background: var(--accent-soft); }
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 22px;
  border-top: 1px solid var(--line-soft);
  background: #fbfcfe;
}
#bulk-delete:hover { color: var(--accent); border-color: var(--accent); }

/* ============ 查询完成提示（toast + 结果刷新闪光） ============ */
.toast {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translate(-50%, -14px);
  z-index: 300;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: #16a34a;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(22, 163, 74, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast::before { content: '✓'; font-size: 14px; }

.table-wrap.refreshed { animation: result-flash 2.2s ease; }
@keyframes result-flash {
  0% { box-shadow: inset 0 0 0 3px rgba(37, 99, 235, 0.45); background: rgba(37, 99, 235, 0.04); }
  70% { box-shadow: inset 0 0 0 2px rgba(37, 99, 235, 0.18); background: rgba(37, 99, 235, 0.02); }
  100% { box-shadow: inset 0 0 0 0 rgba(37, 99, 235, 0); background: transparent; }
}

/* ============ 查询中的奔跑小马（四蹄、从左往右） ============ */
.pony-track {
  display: none;
  align-items: flex-end;
  position: relative;
  width: 118px;
  height: 40px;
  margin-left: 2px;
  overflow: hidden;
}
body.querying .pony-track { display: inline-flex; }
.pony {
  position: absolute;
  left: 0;
  bottom: -2px;
  filter: drop-shadow(0 2px 3px rgba(37, 99, 235, 0.28));
  animation: pony-run 1.5s linear infinite;
}
.pony-body { animation: pony-bob 0.32s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
.pony .leg { transform-box: fill-box; transform-origin: 50% 0%; animation: pony-leg 0.32s ease-in-out infinite alternate; }
.pony .l1 { animation-delay: 0s; }
.pony .l2 { animation-delay: 0.16s; }
.pony .l3 { animation-delay: 0.08s; }
.pony .l4 { animation-delay: 0.24s; }
.pony .tail { transform-box: fill-box; transform-origin: 90% 0%; animation: pony-tail 0.32s ease-in-out infinite alternate; }
.pony-dust {
  position: absolute;
  left: 2px;
  bottom: 5px;
  font-size: 13px;
  animation: pony-dust 0.75s ease-out infinite;
}
.pony-track::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: repeating-linear-gradient(90deg, #c7d2fe 0 6px, transparent 6px 12px);
  animation: pony-ground 0.35s linear infinite;
}
@keyframes pony-run {
  0% { transform: translateX(-64px); }
  100% { transform: translateX(112px); }
}
@keyframes pony-bob {
  from { transform: translateY(0) rotate(-1deg); }
  to { transform: translateY(-3px) rotate(1deg); }
}
@keyframes pony-leg {
  from { transform: rotate(-28deg); }
  to { transform: rotate(30deg); }
}
@keyframes pony-tail {
  from { transform: rotate(-8deg); }
  to { transform: rotate(10deg); }
}
@keyframes pony-dust {
  0% { transform: translateX(4px) scale(0.7); opacity: 0.8; }
  100% { transform: translateX(-10px) translateY(-6px) scale(1.3); opacity: 0; }
}
@keyframes pony-ground {
  from { background-position: 0 0; }
  to { background-position: -12px 0; }
}

/* 查询站点未勾选时隐藏对应列（5=工控猫 6=和稽 7=工品汇） */
#matrix-table.hide-gongkongmall th:nth-child(5),
#matrix-table.hide-gongkongmall td:nth-child(5),
#matrix-table.hide-mro520 th:nth-child(6),
#matrix-table.hide-mro520 td:nth-child(6),
#matrix-table.hide-vipmro th:nth-child(7),
#matrix-table.hide-vipmro td:nth-child(7) { display: none; }

.offer-cell { cursor: pointer; }

/* 表头平台列：一键全选本平台推荐仓库 */
.matrix-table thead th.site-head { cursor: pointer; user-select: none; }
.matrix-table thead th.site-head:hover { color: var(--primary); background: #eef4ff; }
.site-pick {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  opacity: 0.7;
}
.matrix-table thead th.site-head:hover .site-pick { opacity: 1; }

/* ============ 可复制报价单 ============ */
.quote-box {
  border-top: 1px solid var(--line-soft);
  padding: 12px 22px 14px;
  background: #fcfdff;
}
.quote-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: var(--quote-head-top, calc(var(--sticky-header, 62px) + 79px));
  z-index: 44;
  margin: -12px -22px 8px;
  padding: 10px 22px;
  background: #fcfdff;
  border-bottom: 1px solid var(--line-soft);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.05);
}
.qopt.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.discount-wrap { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.discount-wrap input { width: 84px; height: 28px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; font-size: 12px; }
/* 报价表头也要跟着报价头一起固定在导航下方：
   这里不能再用 overflow-x:auto，否则 thead 会失去 sticky 的滚动容器。 */
.quote-body { overflow-x: visible; max-width: 100%; }
.quote-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.quote-table th,
.quote-table td {
  border: 1px solid var(--line-soft);
  padding: 5px 8px;
  text-align: left;
  white-space: nowrap;
}
.quote-table th { background: #f3f6fb; font-weight: 600; color: var(--ink-2); }
/* 报价单列头在报价区内吸顶，位置紧随销售报价单头栏 */
.quote-table thead th {
  position: sticky;
  top: var(--quote-cols-top, calc(var(--sticky-header, 62px) + 140px));
  z-index: 43;
  background: #f3f6fb;
  box-shadow: inset 0 -1px 0 var(--line-soft), inset 0 1px 0 var(--line-soft);
}
.quote-table td.num { text-align: right; }
.quote-table tr.total td { font-weight: 700; background: #fffaf0; }
/* 总金额行跟随销售报价单吸底：滚动报价单时始终贴在窗口底部 */
.quote-total-bar {
  position: sticky;
  bottom: 0;
  z-index: 46;
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  background: #fffaf0;
  border: 1px solid var(--line-soft);
  border-top: none;
  box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.07);
}
.quote-total-bar .total-label {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
}
.quote-total-bar .total-amount {
  font-size: 20px;
  font-weight: 800;
  color: #dc2626;
  letter-spacing: 0.3px;
}
.quote-table tr.total .total-label {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-2);
  padding-right: 12px;
}
.quote-table tr.total .total-amount {
  text-align: left;
  font-size: 20px;
  font-weight: 800;
  color: #dc2626;
  letter-spacing: 0.3px;
  padding-left: 8px;
}
.quote-table .out { color: #b91c1c; }
.quote-table .few { color: #b45309; }
.quote-table .in { color: #15803d; }

/* 渠道行右侧的导出按钮：不常用，做成灰色小按钮 */
.filter-bar #export-btn { height: 26px; padding: 0 8px; font-size: 11px; border-radius: 7px; }
.filter-bar #export-btn .ico { width: 12px; height: 12px; }

/* 导入图片/表格/文档（手机友好） */
.import-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.import-bar .btn { min-height: 34px; }
.import-bar .query-count { margin-left: auto; }

/* 粘贴图片：输入框内预览 + 识别状态 */
.query-input-wrap { position: relative; }
.ocr-preview {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  width: 132px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
  z-index: 6;
}
.query-input-wrap.has-preview #query-input { padding-left: 154px; }
.ocr-preview.show { display: block; animation: ocr-pop 0.18s ease; }
.ocr-preview img { width: 100%; max-height: 96px; object-fit: contain; border-radius: 6px; display: block; background: #f8fafc; }
.ocr-preview-tip { margin-top: 4px; font-size: 10.5px; color: var(--primary); text-align: center; }
.ocr-preview-close {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  z-index: 3;
}
.ocr-preview-close:hover { background: var(--accent); }
@keyframes ocr-pop {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.ocr-inline-status { font-size: 12px; font-weight: 600; color: var(--primary); }
.ocr-inline-status.busy { animation: ocr-blink 1s ease-in-out infinite; }
.ocr-inline-status.done { color: #15803d; }
.ocr-inline-status.error { color: #b91c1c; }
@keyframes ocr-blink { 50% { opacity: 0.45; } }

/* ============ 汇总 ============ */
.totals {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 28px;
  flex-wrap: wrap;
  padding: 12px 22px;
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  /* 跟随比价结果：在表格区域内始终吸在窗口底部，滚过表格后随页面离开 */
  position: sticky;
  bottom: 0;
  z-index: 45;
  box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.07);
}
.total-item { display: flex; align-items: baseline; gap: 8px; }
.total-item span { color: var(--muted); font-size: 12.5px; }
.total-item b {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}
.total-item b.accent-text { color: var(--accent); }
.total-item b.profit-text { color: var(--green); }

/* ============ 空状态 ============ */
.empty { padding: 64px 0; text-align: center; color: var(--muted); }
.empty-icon {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
}
.empty-icon svg { width: 22px; height: 22px; fill: var(--primary); opacity: 0.8; }

/* ============ 原始结果 ============ */
.panes-row { display: flex; flex-direction: column; gap: 10px; }
.pane {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: var(--shadow-sm);
}
.pane summary { cursor: pointer; padding: 2px 0; }
.pane .table-wrap { max-height: 320px; margin-top: 10px; border-top: 1px solid var(--line-soft); }
.sup-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--subtle);
  background: #f2f5fa;
  border: 1px solid var(--line-soft);
}
.err { color: var(--accent); font-size: 12px; }

/* ============ 弹窗 ============ */
dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  width: min(680px, 92vw);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(9, 14, 26, 0.5); }
dialog h2 { margin: 0 0 18px; font-size: 17px; letter-spacing: -0.2px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 14px; margin-bottom: 16px; }
.settings-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
select, input[type="number"], input[type="text"] {
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select:focus, input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
details { margin-bottom: 14px; }
summary { color: var(--primary); cursor: pointer; font-size: 13px; margin-bottom: 8px; font-weight: 600; }
#cfg-suppliers { display: flex; flex-direction: column; gap: 9px; }
.sup-row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text); }
.sup-row input { width: 155px; }
.cfg-categories { display: flex; gap: 9px; align-items: center; margin-bottom: 9px; }
#cfg-cat-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
#cfg-cat-list li { display: flex; gap: 10px; align-items: center; padding: 4px 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 修改型号弹窗（仿工控猫） */
#fix-dialog { width: min(380px, 92vw); padding: 20px 22px; }
#fix-dialog h2 { margin-bottom: 14px; font-size: 15px; }
#fix-dialog .fix-grid { display: flex; flex-direction: column; gap: 10px; }
#fix-dialog label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text); }
#fix-dialog label span { width: 58px; flex: none; color: var(--muted); font-size: 12px; }
#fix-dialog input { flex: 1; min-width: 0; height: 34px; }
#fix-dialog .dialog-actions { margin-top: 16px; }
#fix-ok { background: #dc2626; border-color: #dc2626; color: #fff; }
#fix-ok:hover { background: #b91c1c; border-color: #b91c1c; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: #d3d9e3;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: #b9c1cf; background-clip: content-box; }

/* ============ 图片 OCR ============ */
.ocr-panel {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfe;
  overflow: hidden;
}
.ocr-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  background: #f6f8fc;
}
.ocr-title { font-size: 13px; font-weight: 700; }
.ocr-text {
  max-height: 180px;
  overflow: auto;
  padding: 12px 14px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--text);
}
.ocr-loading { color: var(--muted); }
.paste-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.paste-hint b { color: var(--primary); font-weight: 600; }
.query-card.drag-over { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12); }

/* ============ 报价卡内联选仓：单行紧凑，超长内容悬停滚动 ============ */
.wh-list { display: flex; flex-direction: column; gap: 0; margin-top: 3px; max-height: none; overflow: visible; }
.wh-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9.5px;
  line-height: 14px;
  color: #7c8794;
  cursor: pointer;
  padding: 0 2px;
  border-radius: 3px;
}
.wh-row:hover { background: rgba(37, 99, 235, 0.06); }
.wh-row.checked { color: var(--text); background: rgba(37, 99, 235, 0.05); }
.wh-row > input[type="checkbox"] { width: 11px; height: 11px; margin: 0; accent-color: var(--primary); flex: none; }
.wh-nm { flex: 1 1 auto; min-width: 22px; }
.wh-scroll { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-scroll-text { display: inline-block; white-space: nowrap; }
.wh-row:hover .wh-scroll.is-overflow { text-overflow: clip; }
.wh-q { flex: none; font-size: 9px; color: #a0a8b4; }
.wh-eta { flex: 0 1 auto; max-width: 64px; font-size: 9px; color: #6b7280; }
.wh-p {
  flex: 0 0 44px;
  width: 44px;
  text-align: left;
  white-space: nowrap;
  font-size: 9px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.wh-p.cheap { background: var(--accent-soft); border-radius: 3px; padding: 0 3px; font-weight: 700; }
.wh-self {
  flex: none;
  font-size: 8.5px;
  line-height: 12px;
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.35);
  border-radius: 3px;
  padding: 0 2px;
}
.wh-local {
  flex: none;
  font-size: 8.5px;
  line-height: 12px;
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 3px;
  padding: 0 2px;
}
.wh-disc { flex: none; font-size: 9px; color: #94a3b8; font-variant-numeric: tabular-nums; }
.wh-row input[type="number"] {
  width: 32px;
  height: 15px;
  padding: 0 2px;
  font-size: 10px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 3px;
  flex: none;
}
.wh-row input[type="number"]:disabled { opacity: 0.4; }
.alloc-tag { display: block; font-size: 10px; color: var(--primary); margin-top: 2px; line-height: 1.3; overflow-wrap: anywhere; }
.wh-more {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 9.5px;
  padding: 0;
  margin-top: 1px;
  cursor: pointer;
}
.wh-more:hover { text-decoration: underline; }

@keyframes wh-marquee {
  0%, 12% { transform: translateX(0); }
  88%, 100% { transform: translateX(var(--wh-shift, 0px)); }
}
@media (hover: hover) {
  .wh-row:hover .wh-scroll.is-overflow .wh-scroll-text {
    animation: wh-marquee var(--wh-duration, 3s) ease-in-out infinite alternate;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wh-row:hover .wh-scroll.is-overflow .wh-scroll-text { animation: none; }
}

/* ============ 选仓分配 ============ */
.alloc-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow: auto; margin-bottom: 12px; }
.alloc-row {
  display: grid;
  grid-template-columns: 28px 1fr 120px 110px;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}
.alloc-row.checked { border-color: var(--primary); background: var(--primary-soft); }
.alloc-row .wh-name { font-size: 13px; font-weight: 600; }
.alloc-row .wh-city { font-size: 11.5px; color: var(--muted); }
.alloc-row .wh-stock { font-size: 12px; color: var(--muted); text-align: right; }
.alloc-row input[type="number"] { width: 100%; height: 30px; text-align: center; }
.alloc-summary {
  display: flex;
  gap: 18px;
  justify-content: flex-end;
  font-size: 13px;
  color: var(--subtle);
  padding: 8px 2px;
  border-top: 1px solid var(--line-soft);
}
.alloc-summary b { color: var(--text); font-size: 15px; }
.alloc-summary b.sell { color: var(--accent); }
.alloc-btn {
  margin-top: 4px;
  padding: 1px 8px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--primary);
  cursor: pointer;
}
.alloc-btn:hover { border-color: var(--primary); }
.alloc-tag { font-size: 11px; color: var(--primary); margin-top: 3px; display: block; }

/* ============ 收货地 ============ */
.ship-to {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfd;
}
.ship-to .ship-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ship-to .chk { font-size: 12.5px; }
.ship-to input[type="radio"] { accent-color: var(--primary); width: 13px; height: 13px; }

/* ============ 利润率实时控件 ============ */
.margin-ctl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfd;
}
.margin-label { font-size: 12px; color: var(--subtle); white-space: nowrap; }
.step-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: 0.12s;
}
.step-btn:hover { border-color: var(--primary); color: var(--primary); }
.margin-ctl input {
  width: 58px;
  height: 26px;
  padding: 0 6px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: #fff;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.margin-ctl input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.margin-ctl .pct { font-size: 12px; color: var(--subtle); margin-left: -2px; }
.icon-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  border-radius: 6px;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }

/* ============ 模式切换 ============ */
.mode-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #e9edf4;
  border-radius: 10px;
  align-self: flex-start;
}
.mode-tab {
  border: none;
  background: transparent;
  color: var(--subtle);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.15s;
}
.mode-tab:hover { color: var(--text); }
.mode-tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}

/* ============ 手机端卡片视图 ============ */
.mobile-list { display: none; }
.m-card { border-bottom: 1px solid var(--line-soft); padding: 14px 16px; }
.m-head { display: flex; gap: 10px; align-items: flex-start; }
.m-chk-wrap { padding-top: 2px; }
.m-model { min-width: 0; flex: 1; }
.m-title { font-size: 14.5px; font-weight: 700; color: #0f172a; }
.m-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.m-name { font-size: 11.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-best { margin-left: auto; text-align: right; font-size: 11px; color: var(--muted); white-space: nowrap; flex: none; }
.m-best b { display: block; color: var(--accent); font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.m-offers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.m-offer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  text-align: left;
  cursor: pointer;
  transition: 0.12s;
}
.m-offer.chosen { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08); }
.m-offer.empty { opacity: 0.5; }
.m-sup { font-size: 11px; color: var(--muted); }
.m-price { font-size: 15.5px; font-weight: 800; color: #0f172a; font-variant-numeric: tabular-nums; letter-spacing: -0.2px; }
.m-offer.chosen .m-price { color: var(--primary); }
.m-meta { font-size: 10.5px; color: var(--muted); line-height: 1.35; word-break: break-all; }
.fuzzy-card-m .m-offers { grid-template-columns: 1fr; }
.fuzzy-card-m .m-price { font-size: 13px; color: var(--primary); }

/* ============ 响应式 ============ */
@media (max-width: 1180px) {
  .hero h1 { font-size: 22px; }
  .header-inner { gap: 14px; }
  .site-badges { display: none; }
  .totals { gap: 18px; }
  /* 三平台并排时给供应商列留足宽度，窄屏改为表格内部横向滚动 */
  .result-card .table-wrap { overflow-x: auto; }
  .matrix-table { min-width: 1260px; }
  .matrix-table thead th { position: static; }
}

@media (max-width: 1600px) {
  /* 有折扣的仓库优先显示折扣；时效移到 hover 的 title 里，避免把名称挤没 */
  .wh-row.has-disc .wh-eta { display: none; }
}
@media (max-width: 1350px) {
  .wh-self {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #16a34a;
    font-size: 0;
    line-height: 0;
  }
}
@media (max-width: 1180px) {
  .wh-eta { max-width: 52px; }
}

@media (max-width: 760px) {
  .header-inner { height: 54px; padding: 0 14px; gap: 10px; }
  .brand-mark { width: 26px; height: 26px; font-size: 13px; }
  .brand-text { font-size: 14px; }
  .top-actions { gap: 8px; }
  .top-actions .btn { height: 32px; padding: 0 10px; font-size: 12px; }
  .top-actions .btn .ico { width: 13px; height: 13px; }
  .hero-inner { padding: 10px 14px 9px; }
  .hero h1 { font-size: 18px; }
  main { padding: 12px 12px 0; margin-bottom: 28px; gap: 12px; }
  .query-card { padding: 12px; }
  .query-top { gap: 8px; }
  .query-row { flex-direction: column; }
  #query-input { min-height: 120px; font-size: 14px; padding: 12px; }
  .import-bar { flex-direction: column; align-items: stretch; gap: 6px; }
  .import-bar .btn { width: 100%; height: 40px; font-size: 13px; }
  .import-bar .muted.small { font-size: 10.5px; line-height: 1.4; }
  .query-bottom { gap: 8px; }
  .query-bottom .spacer { display: none; }
  .query-actions-right { margin-right: 0; width: 100%; }
  .query-bottom .site-filter { width: 100%; justify-content: space-between; }
  .query-bottom .btn { flex: 1; justify-content: center; height: 40px; }
  .site-filter { width: 100%; justify-content: space-between; padding: 6px 10px; }
  .status { width: 100%; font-size: 11.5px; white-space: normal; max-width: none; }
  .toolbar { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .toolbar .hint { display: none; }
  .chk.strategy { order: 3; width: 100%; }
  .chk.strategy select { flex: 1; }
  .result-card .table-wrap { overflow-x: auto; }
  .result-card .toolbar,
  .result-card .filter-bar,
  .matrix-table thead th { position: static; }
  /* 窄屏报价表允许横向滑动，列头不再吸顶 */
  .quote-body { overflow-x: auto; }
  .quote-table thead th { position: static; }
  .mobile-list { display: block; }
  .totals {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 12px 14px;
    text-align: left;
  }
  .total-item { display: flex; flex-direction: column; gap: 2px; }
  .total-item span { font-size: 11px; }
  .total-item b { font-size: 15px; }
  .fuzzy-bar { padding: 12px 14px; }
  .fuzzy-bar input { height: 40px; font-size: 14px; }
  .fuzzy-bar .btn { height: 40px; }
  /* 手机端顺序：询价 → 比价结果 → 模糊查找 → 原始结果 */
  main { display: flex; }
  .query-card { order: 0; }
  .result-card:not(.fuzzy-card) { order: 1; }
  .fuzzy-card { order: 2; }
  .panes-row { order: 3; }
  .show-more { width: 100%; height: 40px; margin: 6px 0 4px; }
  .pane { padding: 10px 12px; }
  dialog { width: 94vw; padding: 18px; }
  .settings-grid { grid-template-columns: 1fr; }
}


/* ============ 合同 / 送货单弹窗 ============ */
.doc-dialog {
  width: min(720px, 94vw);
  max-width: 720px;
  height: 90vh;
  height: 90dvh;
  max-height: 94vh;
  max-height: 94dvh;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
}
.doc-dialog[open] {
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  right: auto;
  bottom: auto;
  margin: 0;
  z-index: 200;
}
.doc-min {
  margin-left: auto;
  flex: none;
  width: 30px;
  height: 26px;
  padding: 0 0 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 18px;
  cursor: pointer;
}
.doc-min:hover { background: var(--line-soft); color: var(--text); }
.doc-dialog.minimized { height: auto; width: 190px !important; max-width: 90vw; }
.doc-dialog.minimized .doc-body,
.doc-dialog.minimized .doc-footer { display: none; }
.doc-dialog.minimized h2 { padding: 8px 10px; font-size: 13.5px; gap: 4px; white-space: nowrap; overflow: hidden; }
.doc-dialog.minimized .doc-sub { display: none; }
.doc-dialog.dragging { user-select: none; }
.doc-dialog h2 { cursor: move; touch-action: none; }
.doc-dialog:not([open]) { display: none; }
.doc-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.doc-dialog h2 {
  margin: 0;
  padding: 16px 20px 10px;
  font-size: 16.5px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.doc-sub { font-size: 12px; font-weight: 400; color: var(--muted); }
.doc-x {
  margin-left: 0;
  flex: none;
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 26px;
  cursor: pointer;
}
.doc-x:hover { background: var(--line-soft); color: var(--text); }
.doc-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 20px 10px;
  border-bottom: 1px solid var(--line);
}
.doc-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--subtle);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 13px;
  cursor: pointer;
}
.doc-tab.active {
  background: var(--primary-soft);
  border-color: #c7d7fe;
  color: var(--primary-2);
  font-weight: 600;
}
.doc-section { padding: 10px 20px 2px; }
.doc-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--subtle);
  margin-bottom: 8px;
}
.doc-db {
  margin-left: auto;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--primary);
  cursor: pointer;
}
.doc-db:hover { text-decoration: underline; }
.doc-db[hidden], .doc-db-edit[hidden] { display: none !important; }
.doc-smart { padding-top: 12px; }
.doc-smart textarea {
  width: 100%;
  min-height: 54px;
  max-height: 150px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
}
.doc-smart textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.15);
  border-color: var(--primary);
}
.doc-smart-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  flex-wrap: wrap;
}
.doc-cands { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.doc-cand {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  background: #fff;
  color: var(--text);
}
.doc-cand:hover { border-color: #c7d7fe; background: var(--primary-soft); color: var(--primary-2); }
.doc-db-edit {
  font-weight: 400;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
}
.doc-db-edit:hover { color: var(--primary); border-color: #c7d7fe; }
.doc-search-wrap { position: relative; }
.doc-search-wrap input { width: 100%; }
.doc-sug {
  position: absolute;
  z-index: 8;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 260px;
  overflow: auto;
}
.doc-sug-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.doc-sug-item:last-child { border-bottom: none; }
.doc-sug-item:hover { background: var(--primary-soft); }
.doc-sug-item b { font-weight: 600; font-size: 13px; }
.doc-sug-item span { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px 12px;
  margin-top: 8px;
}
.doc-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--subtle);
}
.doc-grid input, .doc-grid select {
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 12.5px;
  background: #fff;
}
.doc-grid input:focus, .doc-grid select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.15);
  border-color: var(--primary);
}
.doc-span2 { grid-column: span 2; }
.doc-span3 { grid-column: 1 / -1; }
.doc-rows {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: auto;
  max-height: 200px;
}
.doc-row {
  display: grid;
  grid-template-columns: 26px minmax(90px, 1fr) minmax(100px, 1.15fr) minmax(80px, 0.95fr) 44px 62px;
  gap: 6px;
  align-items: center;
  padding: 6px 9px;
  font-size: 12px;
  border-bottom: 1px solid var(--line-soft);
}
.doc-row:last-child { border-bottom: none; }
.doc-row.head {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11.5px;
  z-index: 1;
}
.doc-row .r { text-align: right; }
.doc-row .c { text-align: center; }
.doc-row .ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-cell {
  width: 100%;
  min-width: 0;
  height: 24px;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  font-size: 12px;
  color: var(--text);
}
.doc-cell:hover { border-color: var(--line); background: #fff; }
.doc-cell:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
}
.doc-promise {
  width: 100%;
  min-height: 46px;
  max-height: 110px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  font-family: inherit;
}
.doc-promise:focus { outline: none; border-color: var(--primary); }
.doc-footer {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  margin-top: 12px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.doc-footer select { height: 30px; font-size: 12.5px; max-width: 126px; }
.doc-footer .chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--subtle); white-space: nowrap; flex: none; }
.doc-format { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--subtle); white-space: nowrap; flex: none; }
.doc-msg { padding: 0 20px 10px; font-size: 12px; color: var(--accent); min-height: 4px; }
.doc-msg:empty { display: none; }
@media (max-width: 640px) {
  .doc-dialog { width: 100vw; max-width: 100vw; max-height: 94vh; max-height: 94dvh; border-radius: 14px 14px 0 0; }
  .doc-grid { grid-template-columns: 1fr; }
  .doc-span2, .doc-span3 { grid-column: auto; }
  .doc-row { grid-template-columns: 22px 1fr 1.1fr 44px; }
  .doc-row .col-sku, .doc-row .col-price { display: none; }
  .doc-footer { flex-wrap: wrap; }
  #doc-hint { display: none; }
  .doc-tab { white-space: nowrap; padding: 5px 14px; }
  .doc-section-title { flex-wrap: wrap; gap: 4px 8px; }
  .doc-section-title > .muted { display: none; }
  .doc-db { margin-left: 0; width: 100%; }
  .doc-footer .btn { flex: none; }
}

.doc-rows-wrap { border: 1px solid var(--line); border-radius: 9px; overflow: auto; max-height: 260px; }
.doc-rows-table { width: 100%; border-collapse: collapse; font-size: 11.5px; table-layout: fixed; }
.doc-rows-table th { position: sticky; top: 0; z-index: 1; background: #f8fafc; color: var(--muted); font-weight: 500; text-align: left; padding: 5px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.doc-rows-table td { padding: 3px 3px; border-bottom: 1px solid var(--line-soft); }
.doc-rows-table tr:last-child td { border-bottom: none; }
.doc-rows-table td.c, .doc-rows-table th.c { text-align: center; }
.doc-rows-table .doc-cell { height: 28px; }
.doc-del { border: none; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 4px; }
.doc-del:hover { color: var(--accent); }
.doc-empty { color: var(--muted); padding: 14px; text-align: center; }
.doc-mini { margin-left: 8px; border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 2px 8px; font-size: 11.5px; color: var(--primary); cursor: pointer; }
.doc-mini:hover { background: var(--primary-soft); }
.doc-more { margin-top: 8px; }
.doc-more summary { cursor: pointer; font-size: 12px; color: var(--subtle); }
.doc-cols { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 8px 0 2px; font-size: 12px; color: var(--subtle); }
.doc-cols label { display: inline-flex; align-items: center; gap: 4px; }
.doc-merge-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; flex: 1 1 100%; min-width: 0; }
.doc-merge { flex: 0 0 auto; }
.doc-head-toggle { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; color: var(--subtle); cursor: pointer; }
.doc-order-no { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--subtle); }
.doc-order-no input { width: 116px; height: 24px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font: inherit; color: var(--text); background: #fff; }
.doc-export-name { display: flex; flex-direction: column; gap: 4px; max-width: 360px; margin: 0 0 9px; font-size: 12px; color: var(--subtle); }
.doc-export-name input { height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 12.5px; color: var(--text); background: #fff; }
.doc-export-name input:focus { outline: 2px solid rgba(37, 99, 235, 0.15); border-color: var(--primary); }
.doc-merge-line .doc-a9pro { margin-left: auto; }
.doc-clauses { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.doc-clause { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--subtle); }
.doc-clause textarea { width: 100%; min-height: 42px; max-height: 90px; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; font-size: 12px; font-family: inherit; resize: vertical; }

.doc-rows-table .col-idx { width: 20px; }
.doc-rows-table .col-brand { width: 50px; }
.doc-rows-table .col-name { width: 88px; }
.doc-rows-table .col-model { width: 146px; }
.doc-rows-table .col-order_no { width: 96px; }
.doc-rows-table .col-unit { width: 38px; }
.doc-rows-table .col-qty { width: 38px; }
.doc-rows-table .col-price { width: 46px; }
.doc-rows-table .col-period { width: 46px; }
.doc-rows-table .col-note { width: 108px; }
.doc-rows-table .col-customer_order { width: 112px; }
.doc-rows-table .col-del { width: 22px; }
.doc-rows-table .doc-cell { font-size: 11.5px; }

/* ============ 登录 / 账号管理 ============ */
.header-user { display: flex; align-items: center; gap: 8px; margin-right: 10px; }
.header-user[hidden] { display: none; }
.header-username { color: #475569; font-size: 12.5px; white-space: nowrap; }
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 20px 54px; overflow: hidden;
  background-color: #0a1424;
  background-image:
    linear-gradient(180deg, rgba(4, 11, 23, 0.16) 0%, rgba(4, 11, 23, 0.32) 46%, rgba(4, 11, 23, 0.68) 100%),
    url("assets/everest-panorama.jpg?v=20261105b");
  background-position: center, center 44%;
  background-size: cover, cover;
  background-repeat: no-repeat;
}
.login-overlay[hidden] { display: none; }
/* 未登录/验证登录态时，页面内容不可见，且不能被 Tab 聚焦 */
body.login-locked { overflow: hidden; }
/* 未登录时只保留登录层：页面、弹窗、提示条全部不可见/不可操作 */
body.login-locked > *:not(.login-overlay) {
  visibility: hidden !important;
  pointer-events: none !important;
}
.login-card {
  position: relative; z-index: 1;
  width: min(360px, 92vw); border-radius: 16px;
  padding: 26px 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.58);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
  box-shadow: 0 30px 80px rgba(1, 8, 20, 0.5), 0 2px 8px rgba(1, 8, 20, 0.18);
  display: flex; flex-direction: column; gap: 12px;
}
.login-credit {
  position: absolute; left: 16px; right: 16px; bottom: 14px;
  text-align: center; color: rgba(255, 255, 255, 0.6);
  font-size: 11px; line-height: 1.6; letter-spacing: 0.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.login-credit a {
  color: rgba(255, 255, 255, 0.78); text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}
.login-credit a:hover { color: #fff; border-bottom-color: rgba(255, 255, 255, 0.6); }
@media (max-width: 760px) {
  .login-overlay {
    padding: 20px 16px 44px;
    background-image:
      linear-gradient(180deg, rgba(4, 11, 23, 0.12) 0%, rgba(4, 11, 23, 0.28) 48%, rgba(4, 11, 23, 0.64) 100%),
      url("assets/everest-panorama-mobile.jpg?v=20261105b");
    background-position: center, center top;
  }
  .login-card { width: min(360px, 94vw); padding: 24px 20px; }
  .login-credit { left: 10px; right: 10px; font-size: 10px; }
}
.login-brand { font-size: 20px; font-weight: 700; text-align: center; color: #0f172a; }
.login-sub { text-align: center; color: #64748b; font-size: 12.5px; margin-top: -8px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: #64748b; }
.login-card input { height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 14px; }
.login-card input:focus { outline: none; border-color: var(--primary); }
.login-card .btn { height: 38px; }
.login-error { color: var(--accent); font-size: 12px; min-height: 16px; text-align: center; }
.users-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; margin-bottom: 12px; }
.user-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.user-name { font-weight: 600; }
.user-role { font-size: 11px; border-radius: 999px; background: #f1f5f9; color: #475569; padding: 1px 8px; }
.user-role.admin { background: #eff6ff; color: #1d4ed8; }
.user-add { display: flex; gap: 6px; flex-wrap: wrap; }
.user-add input[type="text"], .user-add input[type="password"], .user-add select { height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; font-size: 12.5px; }
.user-add input[type="text"], .user-add input[type="password"] { width: 130px; }
.user-add input[type="checkbox"], .perm-box input[type="checkbox"] { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); }
.users-msg { color: var(--green); font-size: 12px; min-height: 16px; margin-top: 8px; }
.btn.danger { color: var(--accent); }

.user-perms { font-size: 11px; color: #64748b; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perm-box { display: flex; flex-wrap: wrap; gap: 4px 12px; width: 100%; font-size: 12px; color: #475569; margin: 4px 0; }
.perm-box label { display: inline-flex; align-items: center; gap: 4px; }

#copy-text {
  width: 100%;
  height: 240px;
  margin: 8px 0 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  background: #f8fafc;
}

/* ===== 合同弹窗紧凑化 ===== */
.doc-section { padding: 8px 16px 2px; }
.doc-grid { gap: 5px 10px; margin-top: 6px; }
.doc-grid label { font-size: 11.5px; gap: 2px; }
.doc-grid input, .doc-grid select { height: 28px; font-size: 12px; }
.doc-fold { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 4px; }
.doc-fold > summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--subtle); padding: 3px 0; }
.doc-fold[open] > summary { margin-bottom: 4px; }
.doc-fold.doc-smart textarea { min-height: 44px; }
.doc-sum { display: flex; justify-content: flex-end; align-items: baseline; gap: 14px; padding: 7px 4px 3px; border-top: 1px dashed var(--line); font-size: 12px; color: var(--subtle); }
.doc-sum b { color: var(--accent); font-size: 15px; }
.doc-sum .sum-pay b { font-size: 18px; }
.doc-rows-wrap { max-height: 230px; }

.doc-grid-3 { grid-template-columns: repeat(3, 1fr); }
.doc-db-row { display: flex; justify-content: flex-end; gap: 8px; font-size: 11px; margin: 0 0 2px; }
.doc-smart textarea { min-height: 64px; }
.doc-svg { display: none; }
.doc-pv { width: min(760px, 94vw); max-height: 88vh; }
.doc-pv h2 { margin: 0 0 10px; }
.doc-pv-body { max-height: 66vh; overflow: auto; font-size: 12.5px; line-height: 1.55; }
.doc-pv-body h3 { margin: 4px 0 6px; font-size: 16px; }
.doc-pv-meta { color: #475569; margin-bottom: 6px; }
.doc-pv-table { width: 100%; border-collapse: collapse; font-size: 12px; margin: 6px 0; }
.doc-pv-table th, .doc-pv-table td { border: 1px solid var(--line); padding: 3px 6px; }
.doc-pv-table th { background: #f8fafc; font-weight: 500; color: var(--subtle); }
.doc-pv-table .pv-note { width: 118px; max-width: 140px; overflow-wrap: anywhere; }
.doc-pv-table .pv-customer_order { width: 108px; max-width: 132px; overflow-wrap: anywhere; }
.doc-pv-table .pv-model { min-width: 120px; }
.doc-pv-total { text-align: right; font-size: 13px; margin-top: 6px; }
.doc-pv-total b { color: var(--accent); font-size: 17px; }

/* ===== 销售报价单可编辑 ===== */
.quote-table .qcell {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 3px 4px;
  font: inherit;
  color: inherit;
  border-radius: 4px;
}
.quote-table .qcell:hover { border-color: var(--line); background: #fff; }
.quote-table .qcell:focus { outline: none; border-color: var(--primary); background: #fff; }
.quote-table .qcell.loss { color: var(--accent); font-weight: 600; border-color: rgba(225, 29, 72, .45); background: #fff1f3; }
/* 缺货货期：单元格做浅红背景提示，并在输入框上方给出可执行建议 */
.quote-table td.lead-cell { min-width: 86px; vertical-align: middle; }
.quote-table td.lead-cell.stockout {
  background:
    repeating-linear-gradient(135deg, rgba(225, 29, 72, .045) 0 5px, rgba(225, 29, 72, .09) 5px 10px),
    #fff5f5;
}
.quote-table td.lead-cell.stockout .qcell {
  color: #b91c1c;
  border-color: rgba(225, 29, 72, .35);
  background: rgba(255, 255, 255, .82);
  font-weight: 700;
}
.quote-table .lead-advice {
  display: block;
  margin-bottom: 2px;
  color: #b91c1c;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
  letter-spacing: .1px;
}
.quote-table tr.qrow-edited td { background: #fffbe6; }
.quote-table .merged-col .qcell { min-width: 240px; }
.quote-table .qdel-cell { width: 26px; text-align: center; }
.quote-table .qdel { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; padding: 0 4px; }
.quote-table .qdel:hover { color: var(--accent); }
.quote-col-menu {
  position: absolute;
  z-index: 2000;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 4px;
  min-width: 190px;
}
.quote-col-menu[hidden] { display: none; }
.quote-col-menu button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 6px 10px;
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 5px;
}
.quote-col-menu button:hover { background: var(--primary-soft); }

/* ===== 报价单三个主按钮 ===== */
.quote-actions { display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; }
.doc-action {
  height: 34px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.doc-contract { background: linear-gradient(135deg, #3b82f6, #1d4ed8); box-shadow: 0 4px 12px rgba(37, 99, 235, .32); }
.doc-delivery { background: linear-gradient(135deg, #10b981, #047857); box-shadow: 0 4px 12px rgba(5, 150, 105, .30); }
.doc-action:hover { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(15, 23, 42, .24); }
.quote-copy-btn {
  height: 42px;
  padding: 0 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #fb7185, #e11d48 55%, #be123c);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(225, 29, 72, .38);
  transition: transform .12s ease, box-shadow .12s ease;
}
.quote-copy-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(225, 29, 72, .45); }
@media (max-width: 640px) {
  .quote-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; margin: 6px 0 0; }
  .quote-copy-btn { height: 40px; font-size: 14px; padding: 0 18px; }
}

.doc-more > summary { position: relative; }
.doc-fold-toggle {
  float: right;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--primary);
  cursor: pointer;
}
.doc-fold-toggle:hover { background: var(--primary-soft); }
.doc-dialog select { transition: none; }

/* ===== 自绘下拉 ===== */
.cdrop { position: relative; display: block; }
.cdrop-native { display: none !important; }
.cdrop-btn {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.cdrop-btn > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cdrop-btn:hover { border-color: #cbd5e1; }
.cdrop-btn.open { border-color: var(--primary); }
.cdrop-menu {
  position: fixed;
  z-index: 99999;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .18);
  padding: 4px;
}
.cdrop-menu[hidden] { display: none; }
.cdrop-item {
  display: block;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  padding: 6px 10px;
  font-size: 12.5px;
  color: var(--text);
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.cdrop-item:hover { background: var(--primary-soft); }
.cdrop-item.active { color: var(--primary); font-weight: 600; background: var(--primary-soft); }

.doc-smart .doc-section-title { flex-wrap: wrap; row-gap: 2px; }
.doc-smart .doc-section-title .doc-db { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 合同小猫 / 做送货单 卡片 ===== */
.doc-card-face { display: none; }
.doc-dialog.minimized {
  width: 156px !important;
  height: auto !important;
  left: auto !important;
  top: auto;
  right: 18px;
  bottom: auto;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.doc-dialog.minimized h2 {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  margin: 0;
  gap: 0;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .7);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .25);
  cursor: pointer;
  transform-origin: right center;
  transition: transform .18s ease, box-shadow .18s ease;
  user-select: none;
}
.doc-dialog.minimized .doc-title,
.doc-dialog.minimized .doc-sub,
.doc-dialog.minimized .doc-min { display: none; }
.doc-dialog.minimized .doc-card-face { display: block; }
.doc-card-face img { display: block; width: 100%; height: auto; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.doc-card-label {
  display: block;
  text-align: center;
  padding: 5px 0 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
}
.doc-dialog.minimized.doc-c h2 { background: linear-gradient(160deg, #60a5fa, #1d4ed8); }
.doc-dialog.minimized.doc-d h2 { background: linear-gradient(160deg, #34d399, #047857); }
.doc-dialog.minimized.doc-c:hover h2 { transform: translateY(-10px) scale(1.08); box-shadow: 0 20px 42px rgba(37, 99, 235, .5); }
.doc-dialog.minimized.doc-d:hover h2 { transform: translateY(-10px) scale(1.08); box-shadow: 0 20px 42px rgba(5, 150, 105, .5); }
.doc-dialog.minimized .doc-x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(15, 23, 42, .28);
  color: #fff;
  font-size: 13px;
  z-index: 2;
}
.doc-dialog.minimized .doc-x:hover { background: rgba(15, 23, 42, .55); }

.doc-dialog.minimized:hover .doc-card-face img { animation: catHoverJump .55s cubic-bezier(.2, .8, .3, 1); }
@keyframes catHoverJump {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-7px) scale(1.05); }
  65% { transform: translateY(-2px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}

/* ===== 生成成功提示 ===== */
.gen-success {
  width: min(430px, 92vw);
  padding: 24px 24px 20px;
  text-align: center;
  border-radius: 18px;
}
.gs-check {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 8px 20px rgba(5, 150, 105, .35);
}
.gen-success h2 { margin: 0 0 8px; font-size: 19px; }
.gs-file {
  font-size: 12.5px;
  color: #475569;
  word-break: break-all;
  background: #f8fafc;
  border: 1px solid var(--line);
  padding: 8px 10px;
  border-radius: 8px;
  margin: 8px 0;
}
.gs-actions { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.btn.success {
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 6px 16px rgba(5, 150, 105, .3);
}
.btn.success:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(5, 150, 105, .4); }

.brand-logo {
  height: 42px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .35));
}
@media (max-width: 640px) {
  .brand-logo { height: 34px; }
}

/* ===== 顶栏更大气 + 透明磨砂 ===== */
.app-header {
  background: rgba(242, 244, 248, .62) !important;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(148, 163, 184, .18);
  box-shadow: none;
}
.header-inner { height: 78px; padding: 0 34px; gap: 28px; }
.brand-logo { height: 52px; }
.brand-text { font-size: 18px; letter-spacing: .5px; }
.site-chip { font-size: 13px; padding: 6px 13px; }
.top-actions .btn.accent { height: 42px; padding: 0 20px; font-size: 14px; }
.matrix-table thead th { font-weight: 700; color: #0f172a; font-size: 12px; }
@media (max-width: 640px) {
  .header-inner { height: 64px; padding: 0 16px; gap: 14px; }
  .brand-logo { height: 38px; }
  .brand-text { font-size: 16px; }
}

/* ===== 品牌金色流光 ===== */
.brand { gap: 12px; }
.brand-logo-wrap { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; }
.brand-logo { height: 58px; display: block; }
.header-inner { height: 84px; }

.logo-shine {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(105deg,
    rgba(255, 255, 255, 0) 38%,
    rgba(255, 236, 170, .18) 45%,
    rgba(255, 215, 0, .78) 49%,
    rgba(255, 250, 220, .95) 51%,
    rgba(255, 215, 0, .62) 54%,
    rgba(255, 255, 255, 0) 62%);
  background-size: 300% 100%;
  background-position: 200% 0;
  background-repeat: no-repeat;
  -webkit-mask: url('/assets/fuhairui-logo.png') center / contain no-repeat;
  mask: url('/assets/fuhairui-logo.png') center / contain no-repeat;
  mix-blend-mode: screen;
  animation: logoGoldSweep 6.5s linear infinite;
}

.brand-text {
  position: relative;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding-bottom: 3px;
  background-image: linear-gradient(105deg,
    #0f172a 0%, #0f172a 40%,
    #a16207 46%, #facc15 49%, #fff7cc 51%, #facc15 53%, #a16207 57%,
    #0f172a 65%, #0f172a 100%);
  background-size: 300% 100%;
  background-position: 200% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: brandGoldSweep 6.5s linear infinite;
}

.brand-text::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(202, 138, 4, .55), transparent);
}

@keyframes brandGoldSweep {
  0%, 10% { background-position: 200% 0; }
  52%, 100% { background-position: -100% 0; }
}
@keyframes logoGoldSweep {
  0%, 10% { background-position: 200% 0; }
  52%, 100% { background-position: -100% 0; }
}

@media (max-width: 640px) {
  .brand-logo { height: 44px; }
  .brand-text { font-size: 18px; letter-spacing: .8px; }
  .header-inner { height: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-shine, .brand-text { animation: none; }
}

/* 去掉品牌金色流光，恢复干净的深墨字 */
.logo-shine { display: none !important; }
.brand-text {
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  color: #0f172a !important;
  -webkit-text-fill-color: currentColor !important;
  animation: none !important;
  padding-bottom: 0 !important;
}
.brand-text::after { display: none !important; }

/* ===== 全局 UI 优化：字大一点、留白舒服一点 ===== */
html, body { font-size: 14.5px; line-height: 1.5; }
.card-title { font-size: 17px; letter-spacing: -.2px; }
.hint { font-size: 13px; line-height: 1.55; }
.query-card { padding: 18px 22px 18px; }
.query-top { margin-bottom: 12px; }
.query-count { font-size: 13px; padding: 4px 11px; }
.site-filter .chk { font-size: 13.5px; }
.status { font-size: 13px; }

.btn { font-size: 14px; border-radius: 10px; }
.btn.small { font-size: 12.5px; }
select, input[type="text"], input[type="number"], textarea { font-size: 14px; }
#query-input { font-size: 13.5px; line-height: 1.8; }

.matrix-table { font-size: 13.5px; }
.matrix-table thead th { font-size: 13px; padding: 12px 12px; }
.matrix-table tbody td { padding: 12px 12px; }
.matrix-table .model { font-size: 14px; }
.matrix-table .prod-name { font-size: 13px; }
.matrix-table .prod-brand { font-size: 12px; }
.offer .price { font-size: 21px; }
.offer .meta, .offer .sub { font-size: 12px; }

.quote-table { font-size: 13px; }
.quote-table th { font-size: 12.5px; padding: 7px 9px; }
.quote-table td { padding: 7px 9px; }
.quote-head { font-size: 13px; }
.total-label { font-size: 14px; }
.total-amount { font-size: 24px; }

.toolbar .chk, .filter-bar .chk { font-size: 13.5px; }
.strategy-label { font-size: 13px; }
.chk.strategy select { font-size: 13px; height: 32px; }

.doc-dialog { font-size: 13.5px; }
.doc-dialog h2 { font-size: 19px; }
.doc-section-title { font-size: 14px; }
.doc-grid label { font-size: 12.5px; }
.doc-grid input, .doc-grid select { font-size: 13px; height: 32px; }
.doc-rows-table { font-size: 12.5px; }
.cdrop-btn { height: 32px; font-size: 13px; }
.doc-sum { font-size: 13px; }

@media (max-width: 640px) {
  html, body { font-size: 13.5px; }
}

/* ===== UI 细节：再大一号 + 悬停反馈 ===== */
.matrix-table { font-size: 14px; }
.matrix-table thead th { font-size: 13.5px; }
.matrix-table .model { font-size: 14.5px; }
.matrix-table .prod-name { font-size: 13.5px; }
.quote-table { font-size: 13.5px; }
.site-chip { font-size: 13.5px; }
.status { font-size: 13.5px; }

.matrix-row > td { transition: background .15s ease; }
.matrix-row:hover > td { background: #f8fbff; }
.offer-card {
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.offer-card:hover {
  border-color: #bfdbfe;
  box-shadow: 0 5px 16px rgba(37, 99, 235, .10);
  background: #fbfdff;
}
.query-card, .result-card { transition: box-shadow .2s ease, border-color .2s ease; }
.query-card:hover, .result-card:hover { box-shadow: 0 8px 26px rgba(15, 23, 42, .07); }

.doc-dialog .doc-cell { font-size: 13px; }
.doc-dialog .doc-section-title { letter-spacing: .2px; }

/* ===== 全选左置 + 删除按钮强化 ===== */
.totals .total-select-all {
  margin-right: auto;
  font-size: 13.5px;
  font-weight: 700;
  color: #334155;
}
.total-select-all input { width: 16px; height: 16px; }

.row-del,
.qdel {
  border: 1px solid rgba(225, 29, 72, .28);
  background: #fff1f3;
  color: #e11d48;
  font-size: 13.5px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.row-del:hover,
.qdel:hover {
  background: #e11d48;
  border-color: #e11d48;
  color: #fff;
}
.quote-table .qdel-cell { width: 66px; text-align: center; }
.matrix-table .w-op { width: 62px; }

.quote-table .qdel {
  border: 1px solid rgba(225, 29, 72, .28);
  background: #fff1f3;
  color: #e11d48;
  font-size: 13.5px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 8px;
}
.quote-table .qdel:hover {
  background: #e11d48;
  border-color: #e11d48;
  color: #fff;
}

/* ===== 已选行：全选 / 反选 / 删除选中 ===== */
.totals-actions { display: flex; align-items: center; gap: 16px; margin-right: auto; }
.totals-actions .total-select-all { margin-right: 0; }
.total-action {
  border: none;
  background: none;
  padding: 0;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
}
.total-action:hover { color: var(--primary); }
.total-action.a9pro-action {
  color: #b91c1c;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 999px;
  padding: 4px 12px;
  line-height: 1.2;
}
.total-action.a9pro-action:hover { color: #fff; background: #dc2626; border-color: #dc2626; }
.total-action.a9pro-action:disabled { opacity: .55; cursor: wait; }
.total-action[hidden] { display: none; }

/* A9 Pro：表格行内的红叹号（合同/送货单） */
.doc-rows-table td.a9-hit { position: relative; }
.doc-rows-table td.a9-hit .doc-cell { padding-right: 22px; }
.doc-rows-table td.a9-hit .a9-mark {
  position: absolute;
  top: 4px;
  right: 3px;
  z-index: 2;
  cursor: help;
}
.doc-a9pro { color: #b91c1c !important; border-color: #fecdd3 !important; background: #fff1f2 !important; }
.doc-a9pro[hidden] { display: none !important; }

/* ===== 利润率红色醒目 + 清空按钮同尺寸 ===== */
.margin-ctl {
  gap: 9px;
  padding: 5px 11px;
  background: #fff5f7;
  border-color: #fecdd3;
}
.margin-label {
  font-size: 15px;
  font-weight: 800;
  color: #e11d48;
  letter-spacing: .2px;
}
.margin-ctl input {
  width: 66px;
  height: 34px;
  font-size: 20px;
  font-weight: 800;
  color: #e11d48;
  border-color: #fecdd3;
}
.margin-ctl .pct {
  font-size: 15px;
  font-weight: 800;
  color: #e11d48;
}
.margin-ctl .step-btn {
  width: 32px;
  height: 32px;
  font-size: 18px;
  font-weight: 700;
  color: #be123c;
  border-color: #fecdd3;
}
.margin-ctl .step-btn:hover { background: #ffe4e6; border-color: #fb7185; }
.margin-ctl .icon-btn { width: 32px; height: 32px; font-size: 16px; }

.btn.ghost.lg {
  height: 42px;
  padding: 0 24px;
  font-size: 14px;
  border-radius: 10px;
}
.query-bottom .btn.ghost.lg { height: 38px; }
#clear-btn { min-width: 128px; }

/* ===== 利润率过低提示 ===== */
.low-margin-dialog {
  width: min(420px, 92vw);
  padding: 24px;
  text-align: center;
  border-radius: 18px;
}
.lm-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  box-shadow: 0 8px 20px rgba(217, 119, 6, .3);
}
.low-margin-dialog h2 { margin: 0 0 8px; font-size: 19px; }
.low-margin-dialog p { margin: 0 0 6px; color: #475569; font-size: 13.5px; }
.low-margin-dialog p b { color: #e11d48; font-size: 17px; }

/* ===== 最小化卡片：无动图小卡 ===== */
.doc-card-face img { display: none !important; }
.doc-dialog.minimized .doc-card-label {
  font-size: 15px;
  padding: 16px 10px;
  letter-spacing: 1px;
}
.doc-dialog.minimized.doc-c:hover h2,
.doc-dialog.minimized.doc-d:hover h2 {
  transform: translateY(-6px) scale(1.04);
}

/* 手机：底部固定槽位，不依赖 JS 计算，绝不会叠在一起 */
body.cards-bottom .doc-dialog.minimized.doc-c {
  top: auto !important;
  bottom: 18px !important;
  right: 18px !important;
}
body.cards-bottom .doc-dialog.minimized.doc-d {
  top: auto !important;
  bottom: 93px !important;
  right: 18px !important;
}

/* ===== 复制报价图片 ===== */
.quote-img-btn {
  height: 42px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(99, 102, 241, .32);
  transition: transform .12s ease, box-shadow .12s ease;
}
.quote-img-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(99, 102, 241, .4); }

.quote-img-dialog {
  width: min(860px, 94vw);
  max-height: 92vh;
  padding: 20px;
  text-align: center;
}
.quote-img-dialog h2 { margin: 0 0 12px; font-size: 18px; }
.quote-img-dialog img {
  max-width: 100%;
  max-height: 62vh;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.quote-img-dialog .dialog-actions { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }

/* ===== 数量/单价/金额/货期居中 ===== */
.quote-table th.center,
.quote-table td.center { text-align: center !important; }
.quote-table .qcell.num { text-align: center; }

.doc-rows-table th.col-unit,
.doc-rows-table td.col-unit,
.doc-rows-table th.col-qty,
.doc-rows-table td.col-qty,
.doc-rows-table th.col-price,
.doc-rows-table td.col-price,
.doc-rows-table th.col-amount,
.doc-rows-table td.col-amount,
.doc-rows-table th.col-period,
.doc-rows-table td.col-period { text-align: center; }
.doc-rows-table td.col-unit input,
.doc-rows-table td.col-qty input,
.doc-rows-table td.col-price input,
.doc-rows-table td.col-period input { text-align: center; }
.doc-rows-table td.col-amount { font-weight: 600; color: #0f172a; }
/* 总金额往左让出删除列 */
.quote-total-bar { padding-right: 86px; }

/* ===== 手机聚焦输入框不自动放大 ===== */
@media (pointer: coarse) {
  input[type="text"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;
  }
  .margin-ctl input { font-size: 20px !important; }
}

/* ===== 合同成本利润行 ===== */
.doc-cost-sum {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 16px;
  padding: 6px 4px 2px;
  font-size: 12.5px;
  color: #64748b;
}
.doc-cost-sum b { color: #0f172a; font-size: 14px; }
.doc-cost-sum .profit-up { color: #15803d; }
.doc-cost-sum .profit-down { color: #dc2626; }

/* ===== 低利润单价红色单元格 ===== */
.doc-rows-table td.low-margin-cell { background: #fff1f3 !important; }
.doc-rows-table td.low-margin-cell input {
  color: #e11d48 !important;
  background: #fff1f3 !important;
  border-color: #fb7185 !important;
  font-weight: 800;
}
.quote-table td.low-margin-cell { background: #fff1f3 !important; }
.quote-table .qcell.low-margin {
  color: #e11d48 !important;
  background: #fff1f3 !important;
  border-color: #fb7185 !important;
  font-weight: 800;
}

/* ===== 库存不足红色提示 ===== */
.toast.toast-error {
  background: #fff1f2;
  color: #dc2626;
  border: 1px solid #fecdd3;
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.22);
}
.toast.toast-error::before { display: none; content: none; }

/* ===== 报价操作按钮统一高级样式 + 大跳动 ===== */
.quote-actions .btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  height: 42px;
  min-width: 112px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.28s cubic-bezier(0.2, 1.8, 0.4, 1), box-shadow 0.28s ease, filter 0.28s ease;
}
.quote-actions .btn > * { position: relative; z-index: 1; }
.quote-actions .btn::after {
  content: '';
  position: absolute;
  top: -40%;
  left: -80%;
  width: 55%;
  height: 180%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-18deg);
  transition: left 0.55s ease;
  z-index: 0;
  pointer-events: none;
}
.quote-actions .btn:hover {
  animation: quote-btn-pop 0.55s cubic-bezier(0.2, 1.8, 0.4, 1) both;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  filter: saturate(1.12);
}
.quote-actions .btn:hover::after { left: 130%; }
.quote-actions .btn:active {
  animation: none;
  transform: translateY(-1px) scale(0.99);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.22);
}
@keyframes quote-btn-pop {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-10px) scale(1.07); }
  58% { transform: translateY(-5px) scale(1.035); }
  78% { transform: translateY(-8px) scale(1.05); }
  100% { transform: translateY(-6px) scale(1.045); }
}
.quote-actions .doc-contract {
  background: linear-gradient(135deg, #60a5fa, #2563eb 55%, #1d4ed8);
}
.quote-actions .doc-delivery {
  background: linear-gradient(135deg, #34d399, #059669 55%, #047857);
}
.quote-actions .quote-img-btn {
  background: linear-gradient(135deg, #a78bfa, #7c3aed 55%, #6366f1);
}
.quote-actions .quote-copy-btn {
  background: linear-gradient(135deg, #fb7185, #e11d48 55%, #be123c);
}
@media (max-width: 640px) {
  .quote-actions .btn { height: 40px; min-width: 100px; padding: 0 16px; font-size: 13.5px; }
}
.quote-actions .btn { width: 146px; min-width: 146px; padding: 0 12px; }

/* ===== 压缩报价单工具栏，四个操作按钮同一行 ===== */
.quote-head { gap: 6px; row-gap: 6px; }
.quote-head .qopt { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.quote-head .discount-wrap { font-size: 12px; gap: 4px; }
.quote-head .discount-wrap input { width: 56px; height: 28px; font-size: 12px; padding: 0 6px; }
.quote-head #quote-add-row { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 7px; }
.quote-actions { gap: 6px; margin-left: 0; }
.quote-actions .btn { width: 132px; min-width: 132px; height: 40px; padding: 0 8px; font-size: 13px; }

/* ===== 工具栏进一步压缩：四个操作按钮与筛选项同一行 ===== */
.quote-head { gap: 4px; row-gap: 4px; }
.quote-head .qopt { padding: 0 8px; }
.quote-head .discount-wrap input { width: 54px; }
.quote-head #quote-add-row { padding: 0 8px; }
.quote-actions { gap: 4px; margin-left: auto; }
.quote-actions .btn { width: 120px; min-width: 120px; }
/* 报价版本切换：紧贴操作按钮右侧，竖向 1/2/3，默认版本 1 */
.quote-ver-switch {
  display: inline-flex;
  flex: 0 0 24px;
  width: 24px;
  flex-direction: column;
  gap: 2px;
  padding: 2px;
  margin-left: 2px;
  align-self: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  box-sizing: border-box;
}
.quote-ver-switch button {
  width: 100%;
  height: 17px;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #fff;
  color: #64748b;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.quote-ver-switch button:hover { border-color: #94a3b8; color: #0f172a; transform: translateX(-1px); }
.quote-ver-switch button.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, .28);
}
@media (max-width: 1400px) {
  .quote-head > .muted.small { display: none; }
  .quote-actions .btn { width: 104px; min-width: 104px; font-size: 12px; padding: 0 5px; }
}

/* 优惠金额与运费之间的加粗竖线 */
.quote-sep {
  display: inline-block;
  width: 0;
  height: 20px;
  border-left: 1px dashed #94a3b8;
  font-size: 0;
  color: transparent;
  padding: 0;
  user-select: none;
}

/* ===== 费用字段小胶囊：取消竖线，用分组区分优惠/运费 ===== */
.quote-head .fee-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 7px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 11.5px;
  color: #64748b;
  white-space: nowrap;
}
.quote-head .fee-field input {
  width: 44px !important;
  height: 22px !important;
  padding: 0 4px;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #fff;
  font-size: 12px;
  text-align: right;
}

/* ===== 四个操作按钮：整组波浪抬起 + 单按钮轻浮起（替代各自乱跳） ===== */
.quote-actions .btn {
  transition:
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.36s ease,
    opacity 0.36s ease;
  will-change: transform;
}
/* 鼠标进入整组：四个按钮依次轻轻抬起，形成波浪 */
.quote-actions:hover .btn {
  transform: translateY(-2px) scale(0.992);
  opacity: 0.9;
  filter: saturate(0.95);
}
.quote-actions:hover .btn:nth-child(1) { transition-delay: 0ms; }
.quote-actions:hover .btn:nth-child(2) { transition-delay: 35ms; }
.quote-actions:hover .btn:nth-child(3) { transition-delay: 70ms; }
.quote-actions:hover .btn:nth-child(4) { transition-delay: 105ms; }
/* 当前悬停的按钮抬得更高，其他三个轻微退后 */
.quote-actions .btn:hover {
  animation: none !important;
  transform: translateY(-7px) scale(1.03);
  opacity: 1;
  filter: saturate(1.14) brightness(1.035);
  transition-delay: 0ms !important;
  z-index: 3;
  box-shadow:
    0 18px 32px rgba(15, 23, 42, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.quote-actions:hover .btn:not(:hover) {
  filter: saturate(0.9) brightness(0.98);
}
.quote-actions .btn:active {
  animation: none !important;
  transform: translateY(-2px) scale(0.985) !important;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.2) !important;
  transition-duration: 0.12s;
}
.quote-actions .btn:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 3px;
}
@media (hover: none) {
  .quote-actions:hover .btn,
  .quote-actions .btn:hover { transform: none; opacity: 1; filter: none; }
}

/* 候选型号多时内部滚动，不把页面撑太高 */
.cand-list {
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

/* 批量询价“清空”按钮：居中 + 浅灰 */
#clear-btn {
  justify-content: center;
  text-align: center;
  min-width: 84px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  box-shadow: none;
}
#clear-btn:hover {
  background: #e2e8f0;
  color: #475569;
  border-color: #cbd5e1;
}

/* 合同名称一行 + 清空还原 */
.doc-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.doc-name-row label { flex: 1; min-width: 0; }
.doc-reset { white-space: nowrap; }
.doc-more-mini {
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

/* 列设置改为常显，无下拉图标 */
.doc-cols-static {
  padding: 5px 0 2px;
}

/* ===== 合同对话框：固定头部 + 压缩信息区 + 更宽名称 ===== */
.doc-dialog.doc-c {
  width: min(840px, 94vw);
  max-width: 840px;
}
.doc-fixed-head {
  position: sticky;
  top: 0;
  z-index: 25;
  background: #fff;
  padding-bottom: 2px;
  border-bottom: 1px solid #eef2f7;
  box-shadow: 0 8px 14px -14px rgba(15, 23, 42, 0.25);
}
.doc-c .doc-fixed-head .doc-smart {
  padding-top: 6px;
  padding-bottom: 4px;
}
.doc-c .doc-smart textarea {
  height: 54px;
  min-height: 54px;
}
.doc-c .doc-smart-actions { margin-top: 4px; }
.doc-c .doc-fixed-head .doc-section { padding-top: 6px; }
.doc-c .doc-name-row { gap: 8px; }
.doc-c .doc-name-label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
  color: var(--subtle);
}
.doc-c .doc-name-label input {
  width: 100%;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 13px;
  background: #fff;
}
/* 合同信息压缩 */
.doc-c .doc-grid { gap: 4px 10px; margin-top: 4px; }
.doc-c .doc-grid label { font-size: 11px; gap: 2px; }
.doc-c .doc-grid input,
.doc-c .doc-grid select { height: 27px; padding: 0 7px; font-size: 12px; }
.doc-c .doc-section { padding-top: 6px; }
.doc-c .doc-section-title { margin-bottom: 5px; font-size: 12px; }
.doc-c .doc-rows-wrap { max-height: 320px; }
.doc-c .doc-cost-sum {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 8px;
  padding: 7px 10px;
  margin-top: 4px;
}

/* 成本暂缺时的占位文字 */
.doc-cost-sum .cost-pending {
  color: #94a3b8;
  font-weight: 600;
  font-size: 12.5px;
}
.doc-cost-sum .cost-empty {
  color: #94a3b8;
  font-size: 12px;
}

/* 合同/送货单清空按钮：红色、加高 */
.doc-clear {
  color: #dc2626 !important;
  border-color: #fecdd3 !important;
  background: #fff7f8;
}
.doc-clear:hover {
  background: #fff1f2 !important;
  border-color: #fda4af !important;
}
.doc-reset {
  height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 7px;
}

/* 合同名称与清空还原：同高、底边对齐 */
.doc-name-row {
  align-items: flex-end;
}
.doc-c .doc-name-label input {
  height: 34px;
  line-height: 34px;
}
.doc-reset {
  height: 34px;
  line-height: 34px;
  padding: 0 14px;
  margin-left: 0;
  align-self: flex-end;
}

/* 智能识别操作：上传靠左，识别/清空靠右且等宽 */
.doc-smart-actions .doc-smart-main {
  width: 104px;
  min-width: 104px;
  padding: 0 8px;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
}

/* 合同/送货单智能识别操作区 */
.doc-smart-actions-shift {
  padding-right: 72px;
}
/* ===== 比价结果序号列：选中 + 序号 + 明细，紧凑整齐 ===== */
.w-exp {
  width: 64px;
  text-align: center;
  vertical-align: middle !important;
  padding: 8px 2px !important;
}
.row-select {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 5px;
}
.row-chk {
  width: 15px;
  height: 15px;
  accent-color: #2563eb;
  cursor: pointer;
  margin: 0;
}
.seq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  margin: 0;
}
.expander {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: auto;
  min-width: 44px;
  padding: 2px 5px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: #94a3b8;
  font-size: 10.5px;
  line-height: 1.2;
  cursor: pointer;
}
.expander .chev { font-size: 11px; }
.expander .exp-label { font-size: 10.5px; }
.expander:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: transparent;
}

/* 仓库行最右侧：成本价/市场价折扣（单行太挤时默认收起，价格悬停里仍可看） */
.wh-disc {
  display: inline-block;
  flex: none;
  margin-left: 2px;
  padding: 0 4px;
  border-radius: 3px;
  background: #fff1f3;
  color: #e11d48;
  font-size: 9px;
  line-height: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ===== 型号悬浮：工控猫产品资料 ===== */
.gk-info-pop {
  position: fixed;
  z-index: 400;
  width: min(440px, calc(100vw - 24px));
  display: none;
  padding: 10px 12px 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 18px 44px -16px rgba(15, 23, 42, 0.32);
  font-size: 12px;
  color: #334155;
}
.gk-info-pop.show { display: block; }
.gk-info-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
}
.gk-info-head b { font-size: 13px; color: #0f172a; }
.gk-info-head span { color: #64748b; font-size: 11.5px; }
.gk-info-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.gk-info-table td {
  border: 1px solid #eef2f7;
  padding: 4px 7px;
  vertical-align: top;
  word-break: break-word;
}
.gk-info-table td.gk-k { width: 72px; background: #f8fafc; color: #64748b; font-weight: 500; }
.gk-info-foot { margin-top: 6px; color: #94a3b8; font-size: 10.5px; text-align: right; }
.gk-info-loading { padding: 14px 8px; color: #94a3b8; text-align: center; }

/* 比价结果操作列：给删除按钮留足空间，避免溢出表格右边缘 */
.matrix-table .w-op { width: 74px; }
.matrix-table .op-cell {
  padding-left: 5px !important;
  padding-right: 5px !important;
}
.matrix-table .op-cell .row-del {
  max-width: 100%;
  box-sizing: border-box;
}

/* ---- 访问指数 / 操作统计 ---- */
.user-dept {
  display: inline-flex;
  align-items: center;
  max-width: 130px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.analytics-section {
  margin: 26px auto 12px;
  width: 100%;
}
.an-shell {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.07);
}
.an-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 25px 28px 21px;
  color: #fff;
  background:
    radial-gradient(900px 280px at 86% -20%, rgba(56, 189, 248, 0.28), transparent 60%),
    linear-gradient(118deg, #0b1b31 0%, #102d4c 58%, #0f3d52 100%);
}
.an-eyebrow {
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}
.an-head h2 {
  margin: 7px 0 6px;
  font-size: 24px;
  letter-spacing: 0.01em;
}
.an-sub {
  max-width: 760px;
  margin: 0;
  color: #b9cbe0;
  font-size: 12px;
  line-height: 1.7;
}
.an-head-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
}
.an-body[hidden] { display: none !important; }
.an-head [hidden] { display: none !important; }
.analytics-section.is-collapsed .an-head {
  align-items: center;
  padding: 16px 24px;
}
.analytics-section.is-collapsed .an-sub { display: none; }
.analytics-section.is-collapsed .an-head h2 { margin: 4px 0 0; font-size: 20px; }
.analytics-section.is-collapsed .an-eyebrow { font-size: 10px; }
.an-live {
  color: #a9c4dd;
  font-size: 11px;
  white-space: nowrap;
}
.an-head .btn.ghost {
  color: #dcecff;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
}
.an-filterbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 14px;
  padding: 13px 24px;
  border-bottom: 1px solid #eaf0f6;
  background: #fbfdff;
  color: #64748b;
  font-size: 12px;
}
.an-filterbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.an-filterbar input[type="date"],
.an-filterbar select {
  height: 31px;
  padding: 0 8px;
  border: 1px solid #dbe5ef;
  border-radius: 7px;
  background: #fff;
  color: #334155;
  font: inherit;
}
.an-filterbar input[type="date"] { width: 130px; }
.an-quick { display: inline-flex; gap: 3px; padding: 3px; border-radius: 8px; background: #eef4fa; }
.an-quick button {
  border: 0;
  border-radius: 6px;
  padding: 5px 9px;
  color: #52657a;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.an-quick button.active { color: #0b3a61; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1); }
.an-tabs {
  display: flex;
  gap: 2px;
  padding: 0 24px;
  border-bottom: 1px solid #e8eef5;
  background: #fff;
}
.an-tabs button {
  position: relative;
  padding: 13px 15px 12px;
  border: 0;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.an-tabs button.active { color: #0b4f7a; font-weight: 700; }
.an-tabs button.active::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: #0ea5e9;
}
.an-content { padding: 20px 24px 24px; background: #f8fbfe; }
.an-kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.an-kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.an-kpi {
  min-width: 0;
  padding: 14px 15px 12px;
  border: 1px solid #e6eef6;
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.028);
}
.an-kpi.is-green { border-top: 3px solid #22c55e; }
.an-kpi.is-amber { border-top: 3px solid #f59e0b; }
.an-kpi.is-red { border-top: 3px solid #ef4444; }
.an-kpi-label { color: #718096; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-kpi-value { margin-top: 7px; color: #14283d; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.an-kpi-meta { display: flex; align-items: center; gap: 7px; min-height: 18px; margin-top: 5px; color: #94a3b8; font-size: 10.5px; white-space: nowrap; overflow: hidden; }
.an-kpi-sub { overflow: hidden; text-overflow: ellipsis; }
.an-delta { flex: 0 0 auto; font-weight: 700; font-size: 10.5px; }
.an-delta.up { color: #15803d; }
.an-delta.down { color: #dc2626; }
.an-delta.flat { color: #94a3b8; }
.an-grid { display: grid; gap: 12px; margin-bottom: 12px; }
.an-grid-main { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.75fr); }
.an-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.an-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.an-span-2 { grid-column: span 2; }
.an-card {
  min-width: 0;
  padding: 15px 16px 14px;
  border: 1px solid #e6eef6;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(15, 23, 42, 0.03);
}
.an-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.an-card-head h3 { margin: 0; color: #20364e; font-size: 13px; font-weight: 700; }
.an-hint { color: #9aa9b9; font-size: 10.5px; line-height: 1.5; }
.an-line { display: block; width: 100%; height: auto; overflow: visible; }
.an-axis { fill: #a0aec0; font-size: 9px; }
.an-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 3px; color: #64748b; font-size: 10.5px; }
.an-legend span { display: inline-flex; align-items: center; gap: 5px; }
.an-legend i { width: 8px; height: 8px; border-radius: 50%; }
.an-chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  border: 1px dashed #dce7f1;
  border-radius: 9px;
  color: #9aa9b9;
  font-size: 12px;
  text-align: center;
}
.an-funnel { display: grid; gap: 12px; padding: 7px 0 2px; }
.an-funnel-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) 88px; align-items: center; gap: 8px; }
.an-funnel-label { color: #52657a; font-size: 11.5px; }
.an-funnel-track { height: 16px; overflow: hidden; border-radius: 4px; background: #eef3f8; }
.an-funnel-fill { height: 100%; border-radius: 4px; background: #38bdf8; transition: width .3s ease; }
.an-funnel-fill.f1 { background: #2dd4bf; }
.an-funnel-fill.f2 { background: #fbbf24; }
.an-funnel-fill.f3 { background: #a78bfa; }
.an-funnel-val { display: flex; align-items: baseline; justify-content: flex-end; gap: 5px; font-size: 11px; }
.an-funnel-val b { color: #20364e; font-size: 14px; }
.an-funnel-val span { color: #94a3b8; font-size: 10px; }
.an-rank { display: grid; gap: 7px; padding-top: 2px; }
.an-rank-row { display: grid; grid-template-columns: 17px minmax(0, 1fr) 80px 46px; align-items: center; gap: 7px; min-height: 19px; }
.an-rank-no { color: #aebdcc; font-size: 10px; text-align: center; }
.an-rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #52657a; font-size: 11px; }
.an-rank-bar { height: 6px; overflow: hidden; border-radius: 999px; background: #edf3f8; }
.an-rank-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #38bdf8, #0ea5e9); }
.an-rank-count { color: #20364e; font-size: 11px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.an-table-wrap { width: 100%; overflow-x: auto; }
.an-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.an-table th { padding: 7px 8px; border-bottom: 1px solid #e3ecf4; color: #8496a8; font-weight: 500; text-align: left; white-space: nowrap; }
.an-table td { padding: 8px; border-bottom: 1px solid #f0f4f8; color: #40556b; font-variant-numeric: tabular-nums; }
.an-table tr:last-child td { border-bottom: 0; }
.an-badge { display: inline-flex; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.an-badge.green { color: #15803d; background: #ecfdf3; }
.an-badge.amber { color: #b45309; background: #fffbeb; }
.an-badge.red { color: #b91c1c; background: #fef2f2; }
.an-nowrap { white-space: nowrap; }
.an-ellipsis { display: block; max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-banner {
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid #bae6fd;
  border-radius: 9px;
  color: #0369a1;
  background: #f0f9ff;
  font-size: 12px;
}
.an-empty { padding: 54px 20px; color: #8b9bad; font-size: 13px; text-align: center; }
.an-error { color: #b91c1c; }
.an-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 11px 24px 13px;
  border-top: 1px solid #eaf0f6;
  color: #93a4b5;
  background: #fff;
  font-size: 10.5px;
}
.an-foot code { padding: 1px 4px; border-radius: 4px; background: #f1f5f9; color: #64748b; }
.an-archives { color: #7d8fa1; }
.an-archives b { color: #52657a; font-weight: 600; }

@media (max-width: 1320px) {
  .an-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .an-grid-main { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.8fr); }
}
@media (max-width: 1050px) {
  .an-grid-main, .an-grid-2, .an-grid-3 { grid-template-columns: 1fr; }
  .an-span-2 { grid-column: auto; }
}
@media (max-width: 760px) {
  .analytics-section { margin-top: 18px; }
  .an-head { padding: 18px 16px 16px; flex-direction: column; gap: 12px; }
  .an-head h2 { font-size: 20px; }
  .an-head-actions { align-self: flex-end; }
  .an-filterbar { padding: 11px 14px; gap: 8px 10px; }
  .an-filterbar input[type="date"] { width: 122px; }
  .an-quick { order: -1; width: 100%; }
  .an-quick button { flex: 1; padding: 5px 4px; }
  .an-tabs { padding: 0 10px; overflow-x: auto; }
  .an-tabs button { flex: 0 0 auto; padding: 11px 9px; font-size: 12px; }
  .an-content { padding: 13px 12px 16px; }
  .an-kpis, .an-kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an-kpi { padding: 11px 12px 10px; }
  .an-kpi-value { font-size: 21px; }
  .an-card { padding: 13px 12px; }
  .an-funnel-row { grid-template-columns: 44px minmax(0, 1fr) 75px; }
  .an-foot { padding: 10px 14px; }
}

/* ===== 手机端顶栏换行，避免统计看板整页横向滚动 ===== */
@media (max-width: 760px) {
  .header-inner { height: auto !important; min-height: 64px; padding: 8px 12px; flex-wrap: wrap; row-gap: 8px; gap: 8px; }
  .brand-logo { height: 34px; }
  .brand-text { font-size: 15px; }
  .site-badges { flex: 1 1 100%; order: 3; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
  .top-actions { flex: 1 1 auto; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }
  .top-actions .btn { height: 34px; padding: 0 10px; font-size: 12px; }
}

/* ===== 设备待验证登录页 ===== */
.login-card.login-card[hidden], #login-form[hidden], #login-pending[hidden] { display: none !important; }
.pending-card { width: min(420px, 94vw); }
.pending-device { margin: 12px 0 6px; padding: 12px 14px; border: 1px solid #dbe3ee; border-radius: 10px; background: #f8fafc; }
.pending-device-name { font-size: 14px; font-weight: 600; color: #0f172a; word-break: break-all; }
.pending-device-meta { margin-top: 4px; font-size: 12px; color: #64748b; }
.pending-note { font-size: 11.5px; line-height: 1.55; color: #7890a8; margin: 6px 0 8px; }
.pending-status { min-height: 34px; font-size: 12.5px; line-height: 1.55; color: #475569; }
.pending-status.ok { color: #047857; }
.pending-status.bad { color: #b91c1c; }
.pending-actions { display: flex; gap: 8px; margin-top: 10px; }
.pending-actions .btn { flex: 1; }

/* ===== 账号状态/类型 ===== */
.user-status { font-size: 11px; border-radius: 999px; padding: 1px 8px; background: #f1f5f9; color: #475569; white-space: nowrap; }
.user-status.pending { background: #fff7ed; color: #c2410c; }
.user-status.rejected, .user-status.disabled { background: #fef2f2; color: #b91c1c; }
.user-status.approved { background: #ecfdf5; color: #047857; }
.user-type { font-size: 11px; color: #64748b; white-space: nowrap; }

/* ===== 安全中心 ===== */
.security-dialog { width: min(1080px, 94vw); max-height: 88vh; padding: 0; overflow: hidden; border-radius: 14px; }
.security-dialog[open] { display: flex; flex-direction: column; }
.sec-head { display: flex; align-items: baseline; gap: 12px; padding: 20px 22px 14px; border-bottom: 1px solid var(--line); }
.sec-head h2 { margin: 0; font-size: 19px; }
.sec-tabs { display: flex; gap: 4px; padding: 10px 20px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.sec-tab { border: 0; background: transparent; padding: 9px 13px; font-size: 13px; color: #64748b; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.sec-tab b { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: #eef2f7; color: #64748b; font-size: 11px; line-height: 17px; text-align: center; font-weight: 600; }
.sec-tab.is-active { color: #1d4ed8; border-bottom-color: #1d4ed8; font-weight: 600; }
.sec-tab.is-active b { background: #dbeafe; color: #1d4ed8; }
.sec-panel { flex: 1; min-height: 120px; overflow: auto; padding: 14px 20px; }
.sec-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; background: #fff; }
.sec-main { grid-column: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.sec-sub { grid-column: 1; font-size: 11.5px; color: #64748b; word-break: break-all; }
.sec-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 6px; }
.sec-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #f1f5f9; color: #475569; font-size: 11px; font-weight: 500; }
.sec-tag.ok { background: #ecfdf5; color: #047857; }
.sec-tag.warn { background: #fff7ed; color: #c2410c; }
.sec-tag.bad { background: #fef2f2; color: #b91c1c; }
.sec-tag.muted { color: #64748b; }
.sec-empty { padding: 28px 8px; text-align: center; color: #94a3b8; font-size: 12.5px; }
.sec-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 9px; max-height: 54vh; }
.sec-table { width: 100%; border-collapse: collapse; font-size: 11.5px; white-space: nowrap; }
.sec-table th { position: sticky; top: 0; background: #f8fafc; color: #475569; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-weight: 600; }
.sec-table td { padding: 7px 10px; border-bottom: 1px solid #eef2f7; color: #334155; }
.sec-table tr:last-child td { border-bottom: 0; }
.sec-filter { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.sec-filter input { flex: 1; max-width: 320px; height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; font-size: 12px; }
.sec-msg { min-height: 18px; padding: 0 22px; color: #047857; font-size: 12px; }
.sec-msg.bad { color: #b91c1c; }
.security-dialog .dialog-actions { padding: 12px 22px 18px; margin-top: 0; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .security-dialog { width: 96vw; max-height: 92vh; }
  .sec-head { padding: 15px 14px 11px; }
  .sec-head .muted { display: none; }
  .sec-tabs { padding: 8px 10px 0; }
  .sec-panel { padding: 10px 10px; }
  .sec-row { grid-template-columns: 1fr; gap: 7px; }
  .sec-actions { grid-column: 1; grid-row: auto; flex-wrap: wrap; }
  .sec-filter { flex-wrap: wrap; }
  .sec-filter input { max-width: none; width: 100%; }
  .sec-table-wrap { max-height: 48vh; }
  .security-dialog .dialog-actions { padding: 10px 14px 14px; }
}
/* 网站资料库 */
html.site-grayscale { filter: grayscale(1) !important; }
.lib-lock { max-width: 520px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.lib-lock-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.lib-password-row { display: flex; gap: 8px; margin-top: 10px; }
.lib-password-row input { flex: 1; height: 34px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; font-size: 13px; }
.lib-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.lib-gray { margin-left: auto; font-size: 12px; color: #334155; white-space: nowrap; }
.lib-gray input { vertical-align: -2px; }
.lib-pw-panel { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 9px; padding: 9px 10px; margin-bottom: 10px; font-size: 12px; }
.lib-pw-panel input { height: 30px; border: 1px solid #fdba74; border-radius: 6px; padding: 0 8px; font-size: 12px; }
.lib-pw-panel input#lib-sec-answer { width: 170px; }
.lib-pw-panel input#lib-new-password { width: 210px; }
.lib-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 12px; }
.lib-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; background: #fff; }
.lib-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.lib-files { max-height: 300px; overflow: auto; border: 1px solid #eef2f7; border-radius: 8px; }
.lib-file { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid #eef2f7; font-size: 12px; }
.lib-file:last-child { border-bottom: 0; }
.lib-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-file .sec-tag { flex: none; }
.lib-file button { flex: none; }
.lib-upload { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.lib-upload input[type=file] { max-width: 210px; font-size: 11px; }
.lib-vault { max-height: 300px; overflow: auto; }
.lib-vault-row { display: grid; grid-template-columns: 90px 1fr 1fr 1.1fr 22px; gap: 4px; margin-bottom: 5px; align-items: center; }
.lib-vault-row input { min-width: 0; height: 27px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: 11.5px; }
.lib-vault-row .lib-vault-del { border: 0; background: transparent; color: #ef4444; cursor: pointer; font-size: 15px; }
.lib-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 9px; }
.lib-msg { min-height: 18px; margin-top: 8px; color: #047857; font-size: 12px; }
.lib-msg.bad { color: #b91c1c; }
@media (max-width: 760px) {
  .lib-grid { grid-template-columns: 1fr; }
  .lib-vault-row { grid-template-columns: 70px 1fr 1fr; }
  .lib-vault-row input:nth-child(4) { grid-column: 1 / -1; }
  .lib-vault-row .lib-vault-del { grid-column: 3; grid-row: 1; justify-self: end; }
  .lib-gray { margin-left: 0; width: 100%; }
}
.lib-vault-row { display: grid; grid-template-columns: minmax(72px,1fr) minmax(80px,1fr) minmax(70px,0.9fr) minmax(90px,1.2fr) 22px; gap: 4px; margin-bottom: 5px; align-items: center; }
.lib-vault-row input[type=hidden] { display: none; }
.lib-vault-row input { min-width: 0; height: 27px; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: 11.5px; }
.lib-vault-row .lib-vault-del { border: 0; background: transparent; color: #ef4444; cursor: pointer; font-size: 15px; padding: 0; }
@media (max-width: 760px) {
  .lib-vault-row { grid-template-columns: 1fr 1fr 22px; }
  .lib-vault-row input[data-vk="name"] { grid-column: 1 / 3; grid-row: 1; }
  .lib-vault-row input[data-vk="username"] { grid-column: 1; grid-row: 2; }
  .lib-vault-row input[data-vk="password"] { grid-column: 2; grid-row: 2; }
  .lib-vault-row input[data-vk="note"] { grid-column: 1 / 3; grid-row: 3; }
  .lib-vault-row .lib-vault-del { grid-column: 3; grid-row: 1; justify-self: end; }
}

/* 近期合同/送货单记录 */
.records-section { max-width: none; width: 100%; margin: 0 auto 18px; background: #fff; border: 1px solid var(--line-soft); border-radius: 12px; box-shadow: var(--shadow-soft); overflow: hidden; }
.records-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.records-head b { font-size: 15px; }
.rec-filter, .rec-search { height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; background: #fff; font-size: 12px; }
.rec-search { width: 180px; }
.rec-filter-sm { width: 112px; flex: 0 0 112px; }
.rec-filter-date { width: 132px; min-width: 132px; max-width: 132px; flex: 0 0 132px; box-sizing: border-box; }
.records-toggle { flex: 0 0 auto; }
.records-section.is-collapsed .records-head { border-bottom: 0; }
.records-section.is-collapsed .rec-filter,
.records-section.is-collapsed .rec-search,
.records-section.is-collapsed #records-refresh,
.records-section.is-collapsed .records-msg,
.records-section.is-collapsed .records-table-wrap { display: none; }
.records-msg { min-height: 20px; padding: 8px 16px 0; font-size: 12px; color: var(--muted); }
.records-msg.is-bad { color: #b42318; }
.records-table-wrap { overflow-x: auto; }
.records-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.records-table th, .records-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
.records-table th { color: var(--muted); font-weight: 600; background: #f8fafc; }
.records-table tr:hover td { background: #fbfdff; }
.rec-type { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #eef4ff; color: #2452a8; }
.rec-actions { display: flex; gap: 5px; }
.rec-actions .btn { padding: 3px 8px; }
.records-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 12px; }
.record-dialog { width: min(980px, 96vw); max-height: 92vh; padding: 0; border: 0; border-radius: 12px; }
.record-dialog .rec-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.record-dialog .rec-head h2 { margin: 0; font-size: 17px; }
.rec-meta { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px 16px; padding: 12px 16px; font-size: 12px; }
.rec-meta div { display: flex; gap: 6px; min-width: 0; }
.rec-meta span { color: var(--muted); flex: 0 0 auto; }
.rec-meta b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.rec-view-actions { display: flex; gap: 8px; padding: 0 16px 10px; flex-wrap: wrap; }
.record-preview-dialog { width: min(1040px, 96vw); }
.rec-preview-body { padding: 14px 16px 20px; overflow: auto; max-height: 78vh; }
.rec-pv-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 16px; margin-bottom: 10px; font-size: 12px; }
.rec-pv-meta div { display: flex; gap: 6px; min-width: 0; }
.rec-pv-meta span { color: var(--muted); flex: 0 0 auto; }
.rec-pv-meta b { font-weight: 500; overflow-wrap: anywhere; }
.rec-pv-sub { margin: 6px 0 12px; padding: 8px 10px; border-radius: 8px; background: #f8fafc; color: var(--subtle); font-size: 12px; }
.rec-pv-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.rec-pv-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.rec-pv-table th, .rec-pv-table td { border-bottom: 1px solid var(--line-soft); padding: 7px 8px; text-align: left; vertical-align: top; }
.rec-pv-table th { background: #f3f6fb; color: var(--subtle); font-weight: 600; white-space: nowrap; }
.rec-pv-table tr:last-child td { border-bottom: 0; }
.rec-pv-remark { margin-top: 10px; color: var(--subtle); font-size: 12px; }
@media (max-width: 760px) {
  .rec-pv-meta { grid-template-columns: 1fr 1fr; }
}
.rec-wps-view { margin: 0 16px 12px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 8px; background: #f8fafc; }
.rec-wps-view p { margin: 0; }
.rec-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; padding: 0 16px 12px; }
.rec-edit label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.rec-edit input { height: 32px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; color: var(--ink); }
.rec-edit-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.rec-note-line { padding: 0 16px 14px; }
@media (max-width: 760px) {
  .records-section { border-radius: 10px; }
  .records-head { align-items: flex-start; }
  .rec-search { width: 100%; }
  .rec-meta { grid-template-columns: 1fr 1fr; }
  .rec-edit { grid-template-columns: 1fr; }
  .record-dialog { width: 98vw; }
  .rec-frame-wrap iframe { height: 55vh; }
}
.wps-config { padding: 14px 4px; }
.wps-url-label { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; font-size: 12px; color: var(--muted); }
.wps-url-label input { height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; color: var(--ink); font-size: 13px; }
.wps-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.wps-health { margin: 2px 0 8px; }
.wps-health.is-ok { color: #067647; }
.wps-health.is-bad { color: #b42318; }
.wps-health.is-cached { color: #667085; }
.records-section { width: 100%; box-sizing: border-box; }
