/* ============================================================
 * 组件层：按钮 / 卡片 / 表格 / 表单 / 弹层 / Combo / 业务卡片
 * ============================================================ */

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: var(--r);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  transition: .15s;
  white-space: nowrap;
  color: var(--t1);
}
.btn:hover { border-color: var(--pri); color: var(--pri); background: var(--pri-w2); }
.btn:active { transform: translateY(.5px); }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.pri:hover { background: var(--pri-h); border-color: var(--pri-h); color: #fff; }
/* 删除类按钮（红色描边） */
.btn.dng { border-color: #f0a8a8; color: #d03939; }
.btn.dng:hover { background: #fdf0f0; border-color: #d03939; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { background: #12b47d; color: #fff; }
.btn.danger { color: var(--err); border-color: #f8c8c8; }
.btn.danger:hover { background: var(--err-w); border-color: var(--err); color: var(--err); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn.lg { padding: 10px 18px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn:disabled:hover { border-color: var(--line-2); color: var(--t1); background: var(--surface); }

.icon-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  border-radius: var(--r);
  cursor: pointer; color: var(--t3);
  transition: .15s; flex: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--t1); }
.icon-btn.danger:hover { background: var(--err-w); color: var(--err); }

/* 清单行操作：价格上报 + 删除并排。禁用态（未匹配产品库的行）灰掉不可点。 */
.row-ops { white-space: nowrap; }
.row-ops .icon-btn { width: 26px; height: 26px; }
.row-ops .icon-btn:disabled { opacity: .3; cursor: not-allowed; }
.row-ops .icon-btn:disabled:hover { background: transparent; color: var(--t3); }
/* 上报按钮给一点常驻淡蓝底：这一列在最右边、平时容易被横向滚动挡在外面，
   滚到时有底色，用户才知道这里有个可点的东西（纯 hover 变化发现不了）。 */
.row-ops .pr-btn { color: var(--pri); opacity: .72; }
.row-ops .pr-btn:hover { background: var(--pri-w); color: var(--pri); opacity: 1; }
.row-ops .pr-btn:disabled { color: var(--t3); opacity: .3; }

/* ---------- 价格上报弹窗：产品库现值 vs 你的新值 ---------- */
.pr-compare {
  margin-top: 10px; border: 1px solid var(--line-2);
  border-radius: var(--r); background: var(--surface-2); overflow: hidden;
}
.pr-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; font-size: 13px;
}
.pr-row + .pr-row { border-top: 1px solid var(--line-soft); }
.pr-row .pr-k { width: 92px; flex: none; color: var(--t3); font-size: 12px; }
.pr-row .pr-v { color: var(--t1); }
.pr-row .pr-v.b { font-weight: 600; color: var(--t1); }
.pr-diff {
  margin-left: 8px; font-size: 12px; font-weight: 600;
  padding: 1px 6px; border-radius: 999px;
}
.pr-diff.up { color: #c0392b; background: #fdecea; }
.pr-diff.down { color: #1e8449; background: #eafaf1; }

/* ---------- 价格上报弹窗（2026-09-20 第五轮）：一次填多个价 ----------
   表头 + 4 行，每行「项目 / 产品库现值 / 清单里当前 / 你填的新值」。
   用 grid 而不是 table：列宽可控、窄屏能整体退化成两列，不用横向滚动。 */
.pr-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1.35fr) 1fr 1fr 1.15fr;
  gap: 0; border: 1px solid var(--line-2);
  border-radius: var(--r); background: var(--surface);
  overflow: hidden;
}
.pr-gh {
  padding: 8px 12px; font-size: 12px; font-weight: 600; color: var(--t3);
  background: var(--surface-3); border-bottom: 1px solid var(--line-2);
}
.pr-gl {
  display: flex; flex-direction: column; justify-content: center;
  padding: 9px 12px; font-size: 13px; color: var(--t1);
  border-top: 1px solid var(--line-soft);
}
.pr-gl .small { font-size: 11px; line-height: 1.3; margin-top: 1px; }
.pr-gv {
  display: flex; align-items: center;
  padding: 9px 12px; font-size: 13px;
  border-top: 1px solid var(--line-soft);
}
.pr-gi {
  display: flex; align-items: center;
  padding: 6px 10px; border-top: 1px solid var(--line-soft);
}
.pr-gi .inp { width: 100%; }
/* 第二列起每条竖线（表头也在内），视觉上把行切开 */
.pr-grid > *:nth-child(4n+2),
.pr-grid > *:nth-child(4n+3),
.pr-grid > *:nth-child(4n) { border-left: 1px solid var(--line-soft); }
/* 窄屏：退成「项目 + 输入」两列堆叠，现值放小字附在项目下 */
@media (max-width: 639px) {
  .pr-grid { grid-template-columns: 1fr 1.2fr; }
  .pr-gh:nth-child(2), .pr-gh:nth-child(3) { display: none; }
  .pr-gv { display: none; }
  .pr-gl { border-top: 1px solid var(--line-soft); }
}
/* 价格差异文字色：涨用红、跌用绿（国内报价习惯） */
.c-up { color: #c0392b; font-weight: 600; }
.c-down { color: #1e8449; font-weight: 600; }

/* ============ 加载指示 ============ */
.spinner {
  width: 15px; height: 15px;
  border: 2px solid var(--line-2);
  border-top-color: var(--pri);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
.spinner.lg { width: 26px; height: 26px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 全屏忙碌遮罩 */
.busy-mask {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(255, 255, 255, .6);
  display: flex; align-items: center; justify-content: center;
}
.busy-box {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 20px 28px;
  box-shadow: var(--sh-2);
  font-size: 13.5px; color: var(--t2);
}

/* ============ 卡片 ============ */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.card-h {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.card-h h3 { font-size: 14.5px; font-weight: 600; }
.card-h .sub { font-size: 12px; color: var(--t3); font-weight: 400; margin-left: 8px; }
.card-b { padding: 16px; }
.card-b.flush { padding: 0; }

/* ============ 徽章 ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1.5px 7px; border-radius: 5px;
  font-size: 11.5px; font-weight: 500; line-height: 1.6;
  white-space: nowrap;
}
.b-blue { background: var(--pri-w); color: var(--pri); }
.b-green { background: var(--ok-w); color: var(--ok); }
.b-orange { background: var(--warn-w); color: var(--warn); }
.b-red { background: var(--err-w); color: var(--err); }
.b-purple { background: var(--pur-w); color: var(--pur); }
.b-gray { background: var(--surface-3); color: var(--t2); }

/* ============ 清单体检 ============ */
.chk-sec { border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 8px; background: var(--surface); }
.chk-sec > summary {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; cursor: pointer; list-style: none;
}
.chk-sec > summary::-webkit-details-marker { display: none; }
.chk-sec > summary b { font-size: 13.5px; font-weight: 600; }
.chk-sec > summary small { color: var(--t2); font-size: 12px; }
.chk-hint { padding: 0 12px 8px; color: var(--t2); font-size: 12.5px; line-height: 1.6; }
.chk-list { border-top: 1px dashed var(--line); max-height: 260px; overflow: auto; }
.chk-row {
  display: flex; gap: 10px; align-items: baseline;
  padding: 7px 12px; cursor: pointer; font-size: 13px;
}
.chk-row:hover { background: var(--surface-3); }
.chk-row .cn { flex: none; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chk-row .cd { color: var(--t2); font-size: 12.5px; }
/* 体检定位后高亮 1.8 秒 */
.row-flash { animation: rowflash 1.8s ease-out; }
@keyframes rowflash {
  0%, 55% { background: var(--pri-w); }
  100% { background: transparent; }
}

/* ============ 指标卡 ============ */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px 16px; }
.metric .lb { font-size: 12.5px; color: var(--t3); display: flex; align-items: center; gap: 5px; }
.metric .vl {
  font-size: 23px; font-weight: 600; margin-top: 5px;
  letter-spacing: -.4px; font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.metric .ex { font-size: 11.5px; color: var(--t4); margin-top: 2px; }
.metric.acc .vl { color: var(--pri); }
.metric.ok .vl { color: var(--ok); }
.metric.warn .vl { color: var(--warn); }

/* ============ 统计卡（点位结果） ============ */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--line); border-radius: var(--r); padding: 11px 13px; background: var(--surface); }
.stat .k { font-size: 11.5px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .v {
  font-size: 19px; font-weight: 700; margin-top: 3px;
  font-variant-numeric: tabular-nums; letter-spacing: -.2px;
}
.stat.acc .v { color: var(--pri); }
.stat.ok .v { color: var(--ok); }
.stat.warn .v { color: var(--warn); }

/* 设备标签块：点位设备 → 模板可引用的标签 + 统计值（点一下复制标签名） */
.devlab {
  margin-top: 14px; padding: 10px 12px 12px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface-2);
}
.devlab .dl-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 9px; font-size: 12.5px; }
.devlab .dl-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.devlab .dl-chip {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); transition: .12s; max-width: 100%;
}
.devlab .dl-chip:hover { border-color: var(--pri); background: var(--pri-w2); }
.devlab .dl-chip:active { transform: translateY(1px); }
.devlab .dl-chip .dn { font-size: 12px; color: var(--t1); }
.devlab .dl-chip:hover .dn { color: var(--pri); }
.devlab .dl-chip .dv {
  font-size: 11px; font-weight: 700; color: var(--pri);
  background: var(--pri-w); border-radius: 4px; padding: 2px 6px;
  min-width: 18px; text-align: center; font-variant-numeric: tabular-nums;
}
.devlab code.mono { font-size: 11px; }


/* 各网交换机明细表（自动统计结果卡内） */
.netsw { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 12.5px; }.netsw th, .netsw td { border: 1px solid var(--line-soft); padding: 6px 9px; text-align: center; white-space: nowrap; }
.netsw th { background: var(--surface-3); color: var(--t2); font-weight: 600; }
.netsw td.ng { text-align: left; color: var(--t1); font-weight: 600; }
.netsw tbody tr:hover { background: var(--surface-2); }
.netsw tr.t td { background: var(--surface-3); font-weight: 700; color: var(--t1); }
.netsw td[rowspan] { vertical-align: middle; background: var(--surface); }
.netsw td.est, .netsw th.est { background: #fff8e8; color: #8a6d1f; }
.netsw.sm { font-size: 11.5px; }
.netsw.sm th, .netsw.sm td { padding: 4px 7px; }

/* 点位表上方工具条：机柜口径切换 */
.pg-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 12px; border-bottom: 1px solid var(--line-soft); background: var(--surface-2);
}
.pg-bar-t { font-size: 12px; color: var(--t2); font-weight: 600; }
.pg-bar .seg button { padding: 3px 11px; font-size: 12px; }
.pg-bar .mut { font-size: 11.5px; }

/* ============ 分段控件 / Tab ============ */
.seg { display: inline-flex; background: var(--surface-3); padding: 3px; border-radius: var(--r); gap: 2px; }
.seg button {
  border: none; background: transparent;
  padding: 5px 13px; border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--t2);
  transition: .15s; font-weight: 500; white-space: nowrap;
  flex: 1;
}
.seg button.on { background: var(--surface); color: var(--pri); box-shadow: var(--sh-1); font-weight: 600; }
.seg.block { display: flex; width: 100%; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button {
  border: none; background: transparent;
  padding: 9px 15px; cursor: pointer; font-size: 13.5px;
  color: var(--t2); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: .15s; font-weight: 500;
  white-space: nowrap;
}
.tabs button:hover { color: var(--t1); }
.tabs button.on { color: var(--pri); border-bottom-color: var(--pri); font-weight: 600; }

/* ============ 工具栏 / 输入框 ============ */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.inp {
  padding: 6px 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
  font-size: 13.5px;
  transition: .15s;
  min-width: 0;
  width: 100%;
}
.inp:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-w); }
/* 表达式变量名写错（引用了不存在的变量）—— 生成清单会静默算成 0，必须显眼 */
.inp.bad, .inp.bad:focus {
  border-color: var(--warn);
  background: var(--warn-w);
  box-shadow: 0 0 0 3px var(--warn-w);
  color: #8a5300;
}
select.inp { cursor: pointer; }
.inp.mini { padding: 3px 7px; font-size: 12.5px; }
textarea.inp { width: 100%; resize: vertical; min-height: 96px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; }

.fld { display: block; margin-bottom: 15px; }
.fld > span { display: block; font-size: 12.5px; color: var(--t2); margin-bottom: 6px; font-weight: 500; }
.fld input, .fld select, .fld textarea { width: 100%; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 基础参数分组：带状布局 —— 左侧窄标题 + 右侧字段网格，尽量少占竖向空间 */
.param-grp { padding: 8px 12px; border: 1px solid var(--line-soft); border-radius: var(--r-l); margin-bottom: 8px; }
.param-grp-t {
  font-size: 12px; font-weight: 600; color: var(--t2);
  margin-bottom: 12px; padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
/* 紧凑参数表单：分组压成一行带，字段「标签在左、输入在右」，一屏多放 */
.card-b.compact .fld { margin-bottom: 9px; }
.card-b.compact .fld > span { font-size: 12px; margin-bottom: 3px; }
.card-b.compact .inp { padding: 4px 9px; font-size: 13px; }
.card-b.compact .param-grp {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 8px 12px; margin-bottom: 8px;
}
.card-b.compact .param-grp-t {
  flex: 0 0 92px; margin: 0; padding: 0; border: none;
  line-height: 28px; white-space: nowrap;
}
.card-b.compact .param-grp .grid { flex: 1; gap: 8px 12px; }
.card-b.compact .param-grp .fld {
  display: flex; align-items: center; gap: 8px; margin-bottom: 0; flex-wrap: wrap;
}
.card-b.compact .param-grp .fld > span {
  margin: 0; white-space: nowrap; flex: 0 1 auto; line-height: 28px;
}
.card-b.compact .param-grp .fld .inp { flex: 1 1 90px; min-width: 0; }
.card-b.compact .step-actions { margin-top: 10px; }

/* ============ 表格 ============ */
.tw {
  overflow: auto;
  border-radius: var(--r-l);
  border: 1px solid var(--line);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
table.tb { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
/* 清单表头固定：不再让 #itemWrap 自己滚动，表头随页面主滚动区(.view)吸顶 */
#itemWrap.tw { overflow: visible; }
/* 清单表头贴住主滚动区(.view, padding-top 20px)顶部，不留空隙 */
#itemWrap table.tb thead th { top: -20px; }
table.tb th {
  background: var(--surface-2);
  padding: 9px 11px;
  text-align: left;
  font-weight: 600;
  color: var(--t2);
  font-size: 12.5px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
table.tb td { padding: 8px 11px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.tb tbody tr:hover td { background: var(--pri-w2); }
table.tb tr.sel td { background: var(--pri-w); }
table.tb td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tb td.mid { text-align: center; }
table.tb tr.miss td { background: #fff7f7; }
table.tb tr.add-row td { background: var(--surface-2); }

/* 清单层级行 */
.tb .sys-title td {
  background: #fff7e0; font-weight: 700; color: var(--t1);
  border-left: 3px solid #f5c518; padding: 7px 10px;
}
.tb .grp-title td { background: var(--surface-3); padding: 6px 10px; font-weight: 600; color: var(--t2); }
.tb .grp-title .no { text-align: center; }
.tb .sub-row td { background: #f2f8ff; font-weight: 700; color: var(--t1); }
.tb .sys-tot td { background: #fdf3d8; font-weight: 800; color: #7c4a03; }
.tb .grp-row td { background: var(--surface-3); font-size: 12.5px; color: var(--t2); font-weight: 500; }
.tb .tot-row td { background: #fff2ea; font-weight: 700; font-size: 13.5px; }
.tb .tot-row td.num { color: #c2410c; }

/* 行内可编辑单元格 */
table.tb td.cell { padding: 0; }
table.tb td.cell input {
  width: 100%; border: 1px solid transparent; background: transparent;
  padding: 7px 10px; font-size: 13px; font-variant-numeric: tabular-nums;
}
table.tb td.cell input:hover { border-color: var(--line-2); background: var(--surface-2); }
table.tb td.cell input:focus {
  outline: none; border-color: var(--pri); background: var(--surface);
  box-shadow: 0 0 0 3px var(--pri-w); border-radius: 5px;
}

/* 文本型可编辑单元格 */
table.tb td input.nm {
  width: 100%; border: 1px solid transparent; background: transparent;
  padding: 6px 8px; font-size: 13px; border-radius: 5px;
}
table.tb td input.nm:hover { border-color: var(--line-2); background: var(--surface-2); }
table.tb td input.nm:focus {
  outline: none; border-color: var(--pri); background: var(--surface);
  box-shadow: 0 0 0 3px var(--pri-w);
}
table.tb td input.nm.mid { text-align: center; }
table.tb input.right { text-align: right; }

/* 单行截断单元格：品牌/型号/来源这类「短但不能换行」的列。
   之前靠固定 th 宽度硬扛，中文品牌（丰应子 3 字）在 88px 列里被折成三行，
   一屏只能看 6 条 —— 宁可截断 + 悬浮看全文，也不要把行高撑成豆腐块。 */
table.tb td .nowrap-cell,
table.tb td.nowrap-cell {
  white-space: nowrap;
}
table.tb td.ell-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 单价来源 = 河姆渡采集市场价：数字染红 + 极淡红底，提示"这不是你的成本价，是采集价"。
   （2026-10-04 用户：蓝色改红色。）刻意不用刺眼的整格填充 —— 一行十几条里可能
   只有一两条是市场价，重色会盖过金额本身。手工改过单价即清标记。 */
table.tb input.right.mkt {
  color: var(--err);
  font-weight: 600;
  background: var(--err-w);
  border-radius: 5px;
  padding: 2px 6px;
}

/* 产品库行内编辑：点单元格原地处编辑 */
.tb td.editing { padding: 2px 6px; background: var(--pri-w); }
.tb td .cell-ed {
  border: 1px solid var(--pri);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 13px;
  outline: none;
  box-shadow: 0 0 0 3px var(--pri-w);
  background: var(--surface);
  color: var(--t1);
}

/* 键盘导航时高亮当前编辑格（仿点位表） */
table.tb td.cell:focus-within,
table.tb td.spec-cell:focus-within { background: var(--pri-w); }

/* 技术参数 textarea：与行内 input 视觉一致，右下角可拖拽拉大拉小 */
table.tb td.spec-cell textarea.nm {
  display: block; width: 100%; border: 1px solid transparent; background: transparent;
  padding: 6px 8px; font-size: 13px; border-radius: 5px; font-family: inherit;
  resize: vertical; overflow-y: auto; vertical-align: middle;
}
table.tb td.spec-cell textarea.nm:hover { border-color: var(--line-2); background: var(--surface-2); }
table.tb td.spec-cell textarea.nm:focus {
  outline: none; border-color: var(--pri); background: var(--surface);
  box-shadow: 0 0 0 3px var(--pri-w);
}

/* 可排序表头：整格可点，右侧小箭头指示当前排序方向。
   未排序时箭头淡显（只在悬停时变实），避免表头一排箭头喧宾夺主。 */
table.tb th.sortable {
  cursor: pointer;
  user-select: none;
  /* 右侧给箭头留够位置：窄列（品牌/单位）也不会被箭头压住文字 */
  padding-right: 22px;
  position: relative;
}
table.tb th.sortable::after {
  content: '⇅';
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  font-size: 10px; line-height: 1;
  color: var(--t4);
  opacity: .5;
  transition: opacity .12s, color .12s;
}
table.tb th.sortable:hover { background: var(--surface-3); color: var(--t1); }
table.tb th.sortable:hover::after { opacity: 1; }
table.tb th.sortable.on { color: var(--pri); }
table.tb th.sortable.on::after {
  content: '↑'; opacity: 1; color: var(--pri); font-size: 12px; font-weight: 700;
}
table.tb th.sortable.on.desc::after { content: '↓'; }
/* 数值列表头本身右对齐，箭头改贴左侧，避免与数字挤在一起 */
table.tb th.sortable.num { text-align: right; padding-right: 11px; padding-left: 22px; }
table.tb th.sortable.num::after { right: auto; left: 6px; }

/* 当前排序状态胶囊：只在非默认排序时出现，点右侧 × 回默认序 */
.sort-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px 3px 9px;
  border: 1px solid var(--pri-w3, rgba(22,100,255,.28));
  border-radius: 999px;
  background: var(--pri-w);
  color: var(--pri);
  font-size: 12px; line-height: 1.5;
  white-space: nowrap; cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.sort-chip:hover { background: var(--pri-w2); }
.sort-chip b { font-weight: 600; }
/* × 独立成一个圆形热区，比单纯一个小 svg 好点得多 */
.sort-chip .sc-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; border-radius: 50%;
  background: rgba(22, 100, 255, .16);
  flex: none;
}
.sort-chip .sc-x svg { width: 10px; height: 10px; opacity: .95; }
.sort-chip:hover .sc-x { background: var(--pri); color: #fff; }
.sort-chip:hover .sc-x svg { opacity: 1; }

/* ============ 空状态 ============ */
.empty { padding: 52px 20px; text-align: center; color: var(--t3); }
.empty svg { width: 44px; height: 44px; color: var(--line-2); margin-bottom: 12px; }
.empty p { font-size: 13.5px; }
.empty .hint { font-size: 12.5px; color: var(--t4); margin-top: 5px; }

/* ============ 提示条 ============ */
.note { display: flex; gap: 9px; padding: 11px 13px; border-radius: var(--r); font-size: 12.5px; line-height: 1.65; }
.note.info { background: var(--pri-w2); color: #25406e; border: 1px solid #dbe7ff; }
.note.warn { background: var(--warn-w); color: #8a5300; border: 1px solid #ffe0bd; }
.note.ok { background: var(--ok-w); color: #007a54; border: 1px solid #b8e8d6; }
.note svg { margin-top: 1px; flex: none; }

/* ============ Toast ============ */
.toast-wrap {
  position: fixed; top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
  width: max-content; max-width: calc(100vw - 32px);
}
.toast {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); padding: 9px 16px;
  box-shadow: var(--sh-3); font-size: 13.5px;
  display: flex; gap: 8px; align-items: center;
  animation: tin .22s cubic-bezier(.2, .9, .3, 1.2);
  max-width: 520px;
}
.toast.out { opacity: 0; transform: translateY(-8px); transition: opacity .22s, transform .22s; }
/* Toast 上的操作按钮（撤销删除用）。
   注意 .toast-wrap 是 pointer-events:none（Toast 不该挡住页面内容），
   这个值会被子元素继承 —— 按钮必须显式打开 pointer-events，否则根本点不动。 */
.toast-act {
  pointer-events: auto;
  flex: none; margin-left: 2px; padding: 2px 8px;
  background: transparent; border: 1px solid var(--line);
  border-radius: 999px; color: var(--pri);
  font-size: 12px; line-height: 1.5; cursor: pointer;
}
.toast-act:hover:not(:disabled) { background: var(--pri-weak, #f0f4ff); }
.toast-act:disabled { color: var(--mut, #9aa0a6); cursor: default; }
.toast.ok svg { color: var(--ok); }
.toast.err svg { color: var(--err); }
.toast.info svg { color: var(--pri); }
.toast.warn svg { color: var(--warn); }
@keyframes tin { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }

/* ============ Modal ============ */
.modal-wrap {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-mask { position: absolute; inset: 0; background: rgba(29, 33, 41, .42); animation: fin .16s; }
@keyframes fin { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  width: 100%; max-width: 560px;
  max-height: 86vh; max-height: 86dvh;
  display: flex; flex-direction: column;
  animation: min .22s cubic-bezier(.2, .9, .3, 1.1);
}
.modal-box.wide { max-width: 900px; }
.modal-box.full { max-width: 1200px; }
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.modal-head h3 { font-size: 15.5px; font-weight: 600; }
.modal-body { padding: 20px; overflow: auto; flex: 1; -webkit-overflow-scrolling: touch; }
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap;
}
body.modal-open { overflow: hidden; }
.confirm-msg { font-size: 13.5px; line-height: 1.7; color: var(--t2); white-space: pre-line; }

/* 重复条目详情（新增产品命中四元组时）*/
.dup-detail { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 2px 0; }
.dup-detail > div {
  display: flex; gap: 10px; align-items: baseline;
  padding: 6px 10px; font-size: 13px; line-height: 1.6;
}
.dup-detail > div + div { border-top: 1px solid var(--line-soft); }
.dup-detail > div > span { flex: none; width: 106px; color: var(--t3); font-size: 12px; }
.dup-detail > div > b { font-weight: 500; color: var(--t1); word-break: break-all; }

/* ============ Combo ============ */
.combo { position: relative; width: 100%; cursor: pointer; }
.combo .ci {
  display: block;
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 8px;
  font-size: 13px;
  border-radius: 5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.combo:hover .ci { border-color: var(--line-2); background: var(--surface-2); }
.combo .ci.empty { color: var(--t3); font-style: italic; }

/* 就地输入：输入框直接落在单元格里，候选列表紧贴这一行的下沿 */
.combo .ci-inp {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 13px;
  color: var(--t1);
  background: #fff;
  border: 1px solid var(--pri);
  border-radius: 5px;
  padding: 5px 8px;
  outline: none;
  box-shadow: 0 0 0 3px var(--pri-w);
}
.combo .ci-inp::placeholder { color: var(--t3); font-style: italic; }
/* 正在编辑的那一行给一点底色，明确“输入的就是这一行” */
table.tb tr.row-editing td { background: var(--pri-w2); }
.combo-list.inline { max-width: 380px; }

.combo-list {
  position: fixed; z-index: 9200;
  min-width: 220px; max-width: 340px; max-height: 320px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  box-shadow: var(--sh-3);
  padding: 0;
  animation: min .14s ease-out;
}
.combo-list .search {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
  display: flex; align-items: center; gap: 6px;
}
.combo-list .search .ico { width: 14px; height: 14px; color: var(--t4); }
.combo-list .search input {
  flex: 1; min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px; padding: 5px 8px; font-size: 13px;
}
.combo-list .search input:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-w); }
.combo-list .it {
  padding: 6px 10px; font-size: 13px; cursor: pointer;
  display: flex; align-items: baseline; gap: 6px;
}
.combo-list .it .lb { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.combo-list .it small { color: var(--t3); font-size: 11px; margin-left: auto; flex: 0 1 auto; max-width: 58%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-list .it:hover, .combo-list .it.cur { background: var(--pri-w); }
.combo-list .it.on { background: var(--pri); color: #fff; }
.combo-list .it.on small { color: rgba(255, 255, 255, .8); }
.combo-list .combo-hint, .combo-list .combo-empty {
  padding: 12px 10px; color: var(--t3); font-size: 12px; text-align: center;
}
/* 列表末尾的静态说明（如「…共 26 个品牌」）：粘底显示，滚动时也看得见 */
.combo-list .combo-foot {
  position: sticky; bottom: 0; padding: 6px 10px; color: var(--t3);
  font-size: 11px; text-align: center; background: var(--surface-2);
  border-top: 1px solid var(--line-soft);
}
/* 搜索中：旧候选保留在视野里（不清空、不闪「加载中」），变淡+禁点，新结果到了整体替换 */
.combo-list.searching { opacity: .55; pointer-events: none; }
.combo-list.searching .it.cur { background: transparent; }

/* ============ 厂商目录采集弹窗（2.8.46 重做） ============ */
/* 原设计把厂商和品类都摊成平铺 checkbox，靠 24px 缩进暗示从属、靠 flex 自然换行，
   5 个品类一行会掉框。改成「厂商卡片 + 品类 chip」两级，勾选范围一眼看得全。 */
.vc-sum {
  font-size: 12px; color: var(--t2); margin: 0 0 10px;
  padding: 6px 10px; background: var(--surface-2);
  border: 1px solid var(--line-soft); border-radius: 6px;
}
.vc-cards { display: flex; flex-direction: column; gap: 8px; }
.vc-card {
  border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 10px 12px; background: var(--surface-1);
}
.vc-card-hd { display: flex; align-items: center; gap: 10px; }
.vc-card-hd label { cursor: pointer; }
.vc-card-hd b { font-size: 14px; font-weight: 500; }
/* 「库内 N 条」：让人在勾之前就知道这个厂商手里已经有多少货 */
.vc-have {
  font-size: 11px; color: var(--t2); background: var(--surface-2);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.vc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 0 22px; }
/* chip 用圆角胶囊而不是裸 checkbox：换行也不会掉框，勾选边界清楚 */
.vc-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 3px 9px 3px 7px; cursor: pointer;
  border: 1px solid var(--line-soft); border-radius: 999px; background: var(--surface-2);
}
.vc-chip:hover { border-color: var(--pri); }
.vc-chip small { color: var(--t3); font-size: 11px; }
.vc-chip:has(input:checked) { border-color: var(--pri); background: var(--pri-w); }
.vc-note { font-size: 11px; color: var(--t3); line-height: 1.55; margin: 8px 0 0 22px; }
/* 厂商未勾选 → 整卡变淡并禁用其品类（且同步取消勾选，避免传无效参数下去） */
.vc-card.off, .vc-chips.off { opacity: .45; }
.vc-chips.off .vc-chip { cursor: default; pointer-events: none; }

/* ============ 粘贴 / 上传区 ============ */
.paste-area {
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-l);
  padding: 18px; text-align: center;
  background: var(--surface-2);
  transition: .18s; cursor: pointer;
}
.paste-area:hover { border-color: var(--pri); background: var(--pri-w2); }
.paste-area svg { width: 32px; height: 32px; color: var(--pri); margin-bottom: 8px; }
.paste-area b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.paste-area small { color: var(--t4); font-size: 12px; }

/* ============ 点位网格 ============ */
.pgrid {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
  min-height: 260px;
  max-height: 72vh;
}
.pgrid-resizer {
  height: 12px; cursor: ns-resize; position: relative;
  display: flex; align-items: center; justify-content: center;
  color: var(--t3); user-select: none; touch-action: none;
  border-top: 1px solid var(--line-soft); margin-top: -1px;
}
.pgrid-resizer::after {
  content: '⋮⋮'; font-size: 11px; letter-spacing: 3px; color: var(--t3);
}
.pgrid-resizer:hover, .pgrid-resizer.dragging { color: var(--pri); background: var(--pri-w); }
.pgrid table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: auto; }
.pgrid tbody td { width: 58px; }   /* 数据列按数字宽度收紧 */
.pgrid input { min-width: 0; }      /* 去掉 input 固有宽度对列的撑开 */
.pgrid th {
  background: var(--surface-2);
  padding: 8px 8px; font-size: 11.5px; font-weight: 600; color: var(--t2);
  border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft);
  text-align: center; white-space: nowrap;
}
.pgrid th.gh { background: #eef2f7; color: var(--t2); }
/* 点位表头吸顶：三行表头在表区(#pgWrap)内滚动时固定
   第1行(网组/交换机大类) top:0；第2行(列名/交换机网名) 31px；第3行(交换机类型) 56px
   行高与 step-points.js 的 HR 结构对应（31/25/27 ≈ 56 累加） */
#pgWrap table thead th { position: sticky; background: var(--surface-2); z-index: 3; }
#pgWrap table thead tr:nth-child(1) th { top: 0; z-index: 4; }
#pgWrap table thead tr:nth-child(2) th { top: 31px; z-index: 3; }
#pgWrap table thead tr:nth-child(3) th { top: 56px; z-index: 3; }
/* 每网交换机列：一个「网 × 设备类型」一格，只放台数；该项为 0 时显示「—」且弱化 */
.pgrid td.sw-cell { text-align: center; min-width: 44px; padding: 6px 5px; font-variant-numeric: tabular-nums; }
.pgrid td.sw-cell.z { color: var(--t3); opacity: .5; font-weight: 400; }
.pgrid thead th.sw-h { white-space: nowrap; max-width: none; }
.pgrid thead th.sw-h-sum { border-left: 2px solid #f0e2bd; }
.pgrid thead th.sw-t { font-weight: 600; font-size: 11.5px; padding: 4px 5px; opacity: .92; }
.pgrid td { border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); padding: 0; }
.pgrid td, .pgrid th { min-width: 40px; }
/* 数据列按数字宽度收紧：表头允许折行，格宽随内容 */
.pgrid thead tr:nth-child(2) th { white-space: normal; max-width: 62px; line-height: 1.25; padding: 5px 4px; }
.pgrid th { padding: 6px 5px; }
.pgrid input {
  width: 100%; border: none; padding: 5px 6px;
  text-align: right; font-size: 12.5px; background: transparent;
  font-variant-numeric: tabular-nums;
}
.pgrid input:focus { outline: none; background: var(--pri-w); box-shadow: inset 0 0 0 2px var(--pri); }
.pgrid td:focus-within { background: var(--pri-w); }
.pgrid input.tx { text-align: left; }
.pgrid .rowsum {
  background: var(--surface-3); font-weight: 600; text-align: right;
  padding: 6px 9px; font-variant-numeric: tabular-nums;
}
/* 估算列（配线架/机柜/光配/交换机）浅黄底，与原始录入列区分 */
.pgrid .est-col {
  background: #fff8e8; color: #8a6d1f;
  border-left: 1px solid #f0e2bd; text-align: center; padding: 6px 4px;
}
.pgrid tbody td.est-col { width: 46px; text-align: right; padding: 6px 8px; }
.pgrid tbody td.est-col.sw-cell { width: auto; text-align: center; padding: 6px 5px; }
.pgrid tfoot td.est-col { font-weight: 700; text-align: right; }
.pgrid tfoot td.est-col.sw-cell { text-align: center; }

/* ============ 汇总条 ============ */
.sumbar {
  display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  background: var(--surface);
  margin-bottom: 10px;
}
.sumbar .si .k { font-size: 11px; color: var(--t3); line-height: 1.3; }
.sumbar .si .v { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.35; }
.sumbar .si.q .v { color: var(--pri); }
.sumbar .si.g .v { color: var(--ok); }
.sumbar-tog { gap: 6px; flex-wrap: wrap; align-items: center; }
.sumbar .sp { flex: 1; }

/* 快速切换按钮：延续 badge 外观，但可点击 */
.badge-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border: 0; border-radius: 11px;
  font-size: 11.5px; font-weight: 600; cursor: pointer;
  transition: .14s; font-family: inherit;
}
.badge-btn:hover { transform: translateY(-1px); box-shadow: var(--sh-1); }
.badge-btn:active { transform: translateY(0); }
.badge-btn:disabled { opacity: .5; cursor: not-allowed; }
.badge-btn.b-blue { background: var(--pri-w); color: var(--pri); }
.badge-btn.b-purple { background: #F3EBFF; color: #6633CC; }
.badge-btn.b-gray { background: var(--surface-3); color: var(--t2); }
.badge-btn.b-ghost {
  background: transparent; color: var(--t3);
  border: 1px dashed var(--line);
}

/* ============ 系统导航条 ============ */
.sysbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
}
.sysbar .sk {
  flex: 0 0 200px;
  font-size: 12.5px;
  padding: 4px 9px;
}
.sysbar .syslist {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.syspill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 13px;
  background: var(--surface-3);
  color: var(--t2);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: .14s;
  user-select: none;
  white-space: nowrap;
}
.syspill small { color: var(--t4); font-size: 11px; font-weight: 600; }
.syspill:hover { background: var(--surface-2); color: var(--t1); }
.syspill.on { background: var(--pri); color: #fff; }
.syspill.on small { color: rgba(255,255,255,.8); }

/* ============ 清单表格 ============ */
/* 系统行现在被拆成「首列 + 标签列 + 总价列 + … + 用户总价列」多个单元格
   （为的是把金额压到明细列上），所以黄色竖条只能落在行首一格 ——
   否则每个 td 都带 border-left，列缝里会冒出一排短黄线。 */
.tb .sys-title td {
  background: var(--pri-w);
  font-weight: 600;
  color: var(--pri);
  padding: 9px 12px;
  border-left: 0;
}
.tb .sys-title td:first-child { border-left: 3px solid #f5c518; }
.tb .sys-title .caret {
  display: inline-block;
  margin-right: 6px;
  width: 14px;
  color: var(--t3);
  cursor: pointer;
}
.tb .sys-title .caret:hover { color: var(--pri); }
/* ↑↓ 紧跟在系统名之后，保证横向滚动时也始终可点到 */
.tb .sys-title .sys-move-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 10px;
  vertical-align: middle;
}
.tb .sys-title .sys-move {
  font: inherit;
  font-size: 11.5px;
  line-height: 1;
  font-weight: 500;
  color: var(--t2);
  background: #fff;
  border: 1px solid var(--line-2);
  cursor: pointer;
  padding: 3px 9px;
  border-radius: 10px;
  transition: .14s;
}
.tb .sys-title .sys-move:hover:not(:disabled) {
  color: var(--pri);
  border-color: var(--pri);
  background: var(--pri-w2);
}
.tb .sys-title .sys-move:disabled {
  color: var(--t3);
  border-color: var(--line);
  background: transparent;
  opacity: .45;
  cursor: not-allowed;
}
.tb .sys-title .sys-del {
  float: right;
  color: var(--t3);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 10px;
  transition: .14s;
}
.tb .sys-title .sys-del:hover { color: #d33; background: rgba(221, 51, 51, .08); }

/* 系统行的成本 / 用户总价：各自单独占一格，压在明细表「总价」「用户总价」两列
   正下方 —— 与 小计 / 合计 / 项目总计 完全同列同口径，横向滚动也不会错位。
   成本用深色、用户总价沿用主色，保留原来的两色区分（仅界面展示，不导出）。 */
.tb .sys-title td.num { font-weight: 700; color: var(--t1); }
.tb .sys-title td[data-systotq] { color: var(--pri); }

.tb .grp-title td { background: #F8FAFD; font-weight: 500; padding: 6px 12px; }
.tb .grp-title td.no { color: var(--t3); }

/* 行内 + 号列 */
.tb td.add-cell {
  width: 30px;
  text-align: center;
  vertical-align: middle;
  padding: 0;
}
/* 常驻可见但弱化，hover 行时增强 */
.tb td.add-cell .add-btn {
  display: inline-flex;
  width: 22px; height: 22px;
  border: 0; background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--t3);
  opacity: .6;
  align-items: center; justify-content: center;
  transition: opacity .12s, background .12s, color .12s;
}
.tb tbody tr:hover td.add-cell .add-btn { opacity: 1; color: var(--pri); }
.tb td.add-cell .add-btn:hover { background: var(--pri-w); color: var(--pri); opacity: 1; }
.tb td.add-cell .add-btn svg { width: 12px; height: 12px; }

.tb .sub-row td { background: var(--surface-3); font-weight: 600; }
.tb .sys-tot td { background: #fdf3d8; font-weight: 800; color: #7c4a03; }
.tb .tot-row td { background: var(--pri-w); font-weight: 700; color: var(--pri); }

/* 详细参数模式：spec 列变高，行内自适应换行 */
.tb.tb-detail td.spec-cell .spec { min-height: 38px; height: auto; line-height: 1.45; }
.tb.tb-detail td.spec-cell .spec[value=""] { height: 28px; }

/* ============ 套餐卡片 ============ */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 20px 18px;
  position: relative; transition: .2s;
  display: flex; flex-direction: column;
}
.plan:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
.plan.feat { border: 2px solid var(--pri); box-shadow: 0 6px 22px rgba(22, 100, 255, .13); }
.plan .tag {
  position: absolute; top: -9px; left: 18px;
  background: var(--pri); color: #fff; font-size: 11px;
  padding: 2px 9px; border-radius: 10px; font-weight: 500;
}
.plan h4 { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.plan .desc { font-size: 12px; color: var(--t3); min-height: 34px; line-height: 1.5; }
.plan .price { font-size: 30px; font-weight: 600; margin: 12px 0 2px; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.plan .price small { font-size: 14px; font-weight: 400; color: var(--t2); margin-right: 2px; }
.plan .unit { font-size: 12px; color: var(--t4); }
.plan ul { list-style: none; margin: 14px 0 16px; padding: 0; flex: 1; }
.plan li { font-size: 12.5px; color: var(--t2); padding: 3.5px 0; display: flex; gap: 6px; align-items: flex-start; }
.plan li svg { width: 14px; height: 14px; color: var(--ok); margin-top: 3px; flex: none; }
.plan .cur { font-size: 11.5px; color: var(--ok); margin-bottom: 8px; font-weight: 500; text-align: center; }

.pay-row {
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
  align-items: flex-start;
}

/* ============ 项目卡片 ============ */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  padding: 16px; cursor: pointer; transition: .18s;
}
.pcard:hover { border-color: var(--pri); box-shadow: var(--sh-2); transform: translateY(-2px); }
.pcard .pt { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.pcard h4 { font-size: 15px; font-weight: 600; letter-spacing: -.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .pc-sub { font-size: 12px; color: var(--t3); margin-top: 2px; }
.pcard .pc-metrics { display: flex; gap: 16px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.pcard .pc-metrics div { flex: 1; min-width: 0; }
.pcard .pc-metrics .k { font-size: 11px; color: var(--t4); }
.pcard .pc-metrics .v { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 1px; }
.pcard .pc-metrics .v.q { color: var(--pri); }
.pcard .pc-foot {
  display: flex; gap: 6px; margin-top: 12px; align-items: center;
  font-size: 11.5px; color: var(--t4); justify-content: space-between; flex-wrap: wrap;
}

/* ============ 系统选择卡片 ============ */
.syspick { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.syscard {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 13px; cursor: pointer;
  transition: .16s; background: var(--surface);
}
.syscard:hover { border-color: var(--pri); background: var(--pri-w2); }
.syscard.on { border-color: var(--pri); background: var(--pri-w); box-shadow: inset 0 0 0 1px var(--pri); }
.syscard b { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13.5px; font-weight: 600; }
.syscard small { display: block; color: var(--t3); font-size: 11.5px; margin-top: 3px; }
.syscard .sv { color: var(--ok); flex: none; display: inline-flex; }
/* 名称 + 标签：名字过长时省略，标签永不被压缩 */
.syscard b .nm { display: flex; align-items: center; gap: 6px; min-width: 0; }
.syscard b .nm .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.syscard b .tags { display: inline-flex; gap: 4px; flex: none; }

/* 紧凑网格：系统选型页模板多，缩小卡片与间距，一屏装下更多 */
.syspick.dense { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px; }
.syspick.dense .syscard { padding: 9px 11px; }
.syspick.dense .syscard b { font-size: 13px; }
.syspick.dense .syscard small { margin-top: 2px; }

.sys-cat { margin-bottom: 18px; }
.sys-cat-t { font-size: 12.5px; font-weight: 600; color: var(--t2); margin-bottom: 8px; }

/* 系统选型表头吸顶：模板多时下滑仍能常驻看到「一键生成清单」等主操作。
   .view 是滚动容器，.card-h.sticky 相对它吸顶；须自带背景色避免内容透出。 */
.card-h.sticky {
  position: sticky; top: 0; z-index: 6;
  background: var(--surface);
  border-radius: var(--r-l) var(--r-l) 0 0;
}

/* 模板可见范围筛选条（公有 / 私人），与卡片区分层但同属一块 */
.toolbar.tpl-scope { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }

/* 导出类型选择（单列强调版） */
.picklist { display: grid; gap: 8px; }
.pickcard {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px 13px; cursor: pointer;
  transition: .16s; background: var(--surface);
}
.pickcard:hover { border-color: var(--pri); background: var(--pri-w2); }
.pickcard.on { border-color: var(--pri); background: var(--pri-w); box-shadow: inset 0 0 0 1px var(--pri); }
.pickcard b { display: block; font-size: 13.5px; font-weight: 600; }
.pickcard small { display: block; color: var(--t3); font-size: 11.5px; margin-top: 2px; }

/* ============ 登录页 ============ */
.auth-wrap {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; overflow: auto;
}
.auth-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(1100px 620px at 12% -10%, #e6efff 0%, transparent 58%),
    radial-gradient(900px 500px at 100% 110%, #eef0ff 0%, transparent 55%), #f7f8fa;
}
.auth-card {
  position: relative; width: 100%; max-width: 424px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  padding: 34px 34px 28px;
}
.auth-brand { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 24px; }
.auth-logo {
  width: 48px; height: 48px; border-radius: 13px;
  background: var(--pri); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(22, 100, 255, .28);
  flex: none;
}
.auth-logo svg { width: 26px; height: 26px; }
.auth-brand h1 { font-size: 19px; font-weight: 600; letter-spacing: -.2px; }
.auth-brand p { font-size: 12.5px; color: var(--t3); margin-top: 3px; line-height: 1.5; }
.auth-tabs { display: flex; gap: 2px; background: var(--surface-3); padding: 3px; border-radius: var(--r); margin-bottom: 22px; }
.at {
  flex: 1; border: none; background: transparent; padding: 7px;
  border-radius: 6px; cursor: pointer; font-size: 13.5px;
  color: var(--t2); transition: .16s; font-weight: 500;
}
.at.on { background: var(--surface); color: var(--t1); box-shadow: var(--sh-1); }
.auth-err { min-height: 20px; color: var(--err); font-size: 12.5px; margin-bottom: 6px; }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--t3); margin-top: 16px; }
.auth-foot b { color: var(--pri); font-weight: 600; }

/* ============ 额度盒 ============ */
.quota-box {
  background: linear-gradient(135deg, var(--pri-w2), #f5f8ff);
  border: 1px solid #dbe7ff;
  border-radius: var(--r-l);
  padding: 11px 12px;
  margin-bottom: 10px;
}
.qb-t { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--t2); }
.qb-t b { color: var(--pri); font-size: 15px; font-weight: 600; }
.qb-bar { height: 4px; background: #dfe8fb; border-radius: 3px; margin-top: 7px; overflow: hidden; }
.qb-bar i { display: block; height: 100%; background: var(--pri); border-radius: 3px; transition: .4s; }
.qb-x { font-size: 11px; color: var(--t3); }

.user-box { display: flex; align-items: center; gap: 9px; padding: 6px; border-radius: var(--r); transition: .15s; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--pri-w); color: var(--pri);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 13px; flex: none;
}
.u-info { flex: 1; min-width: 0; }
.u-info b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-info small { font-size: 11px; color: var(--t4); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#userPts { color: #d97706; font-weight: 600; cursor: pointer; }
#userPts:hover { text-decoration: underline; }

/* ============ 键值对 ============ */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 13px; align-items: baseline; }
.kv dt { color: var(--t3); white-space: nowrap; }
.kv dd { font-weight: 500; }

/* ============================================================
 * 响应式：组件层
 * ============================================================ */

/* —— 宽表格横向滚动 + 首列吸附 —— */
@media (max-width: 1023px) {
  .tw.responsive table.tb {
    width: max-content;
    min-width: 100%;
  }
  .tw.responsive th:first-child,
  .tw.responsive td:first-child {
    position: sticky; left: 0; z-index: 1;
  }
  .tw.responsive thead th:first-child { z-index: 3; }
  .tw.responsive tbody td:first-child {
    background: var(--surface);
    box-shadow: 1px 0 0 var(--line-soft);
  }
  .tw.responsive tr.sys-title td:first-child { background: var(--pri-w); }
  .tw.responsive tr.grp-title td:first-child { background: var(--surface-3); }
  .tw.responsive tr.sub-row td:first-child { background: #f2f8ff; }
  .tw.responsive tr.tot-row td:first-child { background: #fff2ea; }
  .tw.responsive tr.miss td:first-child { background: #fff7f7; }
  .tw.responsive tbody tr:hover td:first-child { background: var(--pri-w2); }
}

/* —— 平板 —— */
@media (max-width: 767px) {
  .modal-wrap { padding: 12px; align-items: flex-end; }
  .modal-box { max-height: 92vh; max-height: 92dvh; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 16px; }
  .modal-foot { padding: 12px 16px; }
  .modal-foot .btn { flex: 1; justify-content: center; }

  .fld-row { grid-template-columns: 1fr; }
  .card-b { padding: 14px; }
  .card-h { padding: 12px 14px; }

  .sumbar { gap: 12px; padding: 12px 14px; }
  .sumbar .si { min-width: calc(50% - 6px); }

  .metrics { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .metric { padding: 12px 14px; }
  .metric .vl { font-size: 20px; }

  .toolbar { gap: 8px; }
  .toolbar .inp { flex: 1 1 160px; }
  .pcards { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 6px; }

  .auth-card { padding: 26px 22px 22px; }
  .auth-wrap { padding: 16px; align-items: flex-start; }
}

/* —— 手机：浮层改为底部抽屉 —— */
@media (max-width: 639px) {
  /* Toast 移到底部，单手可达 */
  .toast-wrap {
    top: auto; bottom: 20px;
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
  .toast { max-width: calc(100vw - 32px); font-size: 13px; }
  @keyframes tin { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

  /* Modal 全宽贴底 */
  .modal-wrap { padding: 0; }
  .modal-box,
  .modal-box.wide,
  .modal-box.full {
    max-width: none;
    max-height: 94dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    animation: sheet-up .24s cubic-bezier(.2, .9, .3, 1.1);
  }
  .modal-box { margin-bottom: 0; }
  .modal-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  @keyframes sheet-up { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: none; } }

  /* Combo 底部抽屉 */
  .combo-list.as-sheet {
    position: fixed;
    left: 0 !important; right: 0; bottom: 0; top: auto !important;
    width: auto !important; max-width: none;
    max-height: 62dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: sheet-up .22s cubic-bezier(.2, .9, .3, 1.1);
  }
  .combo-list.as-sheet .it { padding: 11px 14px; font-size: 14px; }

  .tb-right .btn { flex: 1; justify-content: center; }
  .stat .v { font-size: 17px; }
  .plans { grid-template-columns: 1fr; }
  .syspick,
  .syspick.dense { grid-template-columns: 1fr; }
  .pcard .pc-metrics { gap: 10px; }
}

/* —— 超窄屏（≤380） —— */
@media (max-width: 379px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric .vl { font-size: 18px; }
  .statgrid { grid-template-columns: 1fr 1fr; }
}

/* ============ 点位网/列配置编辑器（步骤2弹层）============ */
.sch-layout { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }
.sch-pane { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); overflow: hidden; }
.sch-pane-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2); font-size: 13px; color: var(--t2);
}
.sch-groups, .sch-cols { padding: 8px; display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.sch-group {
  display: flex; align-items: center; gap: 6px; padding: 7px 9px;
  border: 1px solid var(--line-soft); border-radius: var(--r);
  cursor: pointer; transition: .12s;
}
.sch-group:hover { border-color: var(--pri); }
.sch-group.on { border-color: var(--pri); background: var(--pri-w2); box-shadow: inset 0 0 0 1px var(--pri); }
.sch-grow { flex: 1; min-width: 0; }
.sch-grow .inp { width: 100%; }
.sch-merge { flex: 0 0 118px; font-size: 12px; padding: 4px 6px; }
.sch-merge:disabled { opacity: .4; }
.sch-col { display: flex; align-items: center; gap: 6px; }
.sch-col .sch-key {
  flex: 0 0 34px; text-align: center; font-size: 11px; font-weight: 700;
  color: var(--t3); background: var(--surface-3); border-radius: 5px; padding: 3px 0;
}
.sch-col .inp { flex: 1; }
.sch-est-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; }
.sch-est { padding: 0 12px 12px; }
.sch-est .tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.sch-est .tbl th, .sch-est .tbl td { border: 1px solid var(--line-soft); padding: 6px 8px; text-align: right; white-space: nowrap; }
.sch-est .tbl th { background: var(--surface-2); color: var(--t2); font-weight: 600; text-align: center; }
.sch-est .tbl td:first-child { text-align: left; font-weight: 600; }
.sch-est .tbl tfoot td { background: var(--surface-3); font-weight: 700; }

@media (max-width: 720px) {
  .sch-layout { grid-template-columns: 1fr; }
}

/* ============ 第一步：信息点网络与列勾选区 ============ */
.net-grp { border: 1px solid var(--line-soft); border-radius: var(--r); padding: 10px 12px; margin-bottom: 10px; background: var(--surface); }
.net-grp-t { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.net-grp-t b { font-size: 13.5px; }
.net-grp-t .icon-btn { width: 24px; height: 24px; }
.net-cols { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 12.5px; cursor: pointer; transition: .12s; background: var(--surface);
}
.chip:hover { border-color: var(--pri); }
.chip input { accent-color: var(--pri); margin: 0; }
.chip.off { opacity: .5; background: var(--surface-2); }
.chip.off span { text-decoration: line-through; color: var(--t3); }
.chip .chip-x { font-size: 11px; color: var(--t3); margin-left: 2px; cursor: pointer; }
.chip .chip-x:hover { color: var(--danger, #d33); }
.t-type-grid { display: flex; flex-wrap: wrap; gap: 8px; max-height: 260px; overflow: auto; padding: 2px; }

/* ---- 产品管理：可点击的模板名称 ---- */
.tb .lk { color: var(--pri); cursor: pointer; }
.tb tr[data-tid]:hover td { background: var(--surface-2); }
/* 参数列收敛行高：超宽参数单行省略，悬停看全文 */
.tb td.ellip { max-width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 清单行：数量来自点位统计的标记 ---- */.qsrc {
  display: inline-block; margin-left: 4px; padding: 0 4px; border-radius: 4px;
  font-size: 10px; line-height: 15px; vertical-align: middle; cursor: help;
  background: var(--pri-w); color: var(--pri); border: 1px solid #dbe7ff;
}

/* ---- 模板编辑器：点位统计变量面板 ---- */.vars { margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.vars > summary {
  cursor: pointer; padding: 8px 12px; font-size: 12.5px; color: var(--t2);
  user-select: none; list-style: none;
}
.vars > summary::-webkit-details-marker { display: none; }
.vars > summary::before { content: '▸ '; }
.vars[open] > summary::before { content: '▾ '; }
.vars > summary:hover { color: var(--pri); }
.vbody { padding: 2px 12px 12px; max-height: 260px; overflow: auto; }
.vsec + .vsec { margin-top: 10px; }
/* 第一组「设备标签」重点突出：设备名 + 统计值 */
.vsec-key {
  padding: 9px 10px 10px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
}
.vsec-key .vttl { color: var(--pri); font-weight: 600; }
.vttl {
  font-size: 11.5px; color: var(--t3); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.vttl .vc {
  font-size: 10px; font-weight: 600; color: var(--t3);
  background: var(--surface-3); border-radius: 8px; padding: 1px 6px;
  font-variant-numeric: tabular-nums;
}
/* 机器别名组已从 UI 移除（接口不再下发），相关 .vadv 样式一并删除 */
.vgrid { display: flex; flex-wrap: wrap; gap: 6px; }
.vchip {
  font-family: var(--mono); font-size: 11.5px; line-height: 1;
  padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--surface); color: var(--t1); cursor: pointer; transition: .12s;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.vchip .vn { font-family: var(--mono); }
.vchip .vv {
  font-family: var(--sans, inherit); font-size: 11px; font-weight: 700;
  color: var(--pri); background: var(--pri-w); border-radius: 4px;
  padding: 2px 5px; min-width: 16px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.vchip:hover { border-color: var(--pri); color: var(--pri); background: var(--pri-w2); }
.vchip:active { transform: translateY(1px); }
/* 变量面板顶部：预览项目 + 搜索 + 过滤 */
.vbar {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px 8px; border-bottom: 1px dashed var(--line);
  flex-wrap: wrap;
}
.vbar .lbl { font-size: 11.5px; color: var(--t3); }
.vbar .inp.mini { max-width: 230px; font-size: 12px; padding: 4px 8px; }
.vbar .ck {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--t2); cursor: pointer; white-space: nowrap;
}
.vbar .ck input { margin: 0; accent-color: var(--pri); }
.vbar .sep { width: 1px; height: 16px; background: var(--line); }

/* ============ 清单配置：左侧栏布局（汇总+导航在侧，快速设置移到主区工具条） ============ */
.item-main { display: flex; flex-direction: column; gap: 12px; }
/* 顶部导航条：分两行 —— 第 1 行 汇总+快速设置；第 2 行 搜索+系统导航+操作 */
.item-topbar .card-b { padding: 8px 12px; }
.item-nav {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
.item-nav-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  min-width: 0;
}
.item-nav-row .sumbar.compact {
  display: flex; gap: 14px; align-items: center;
  padding: 0; background: none; border: none; margin: 0;
}
.item-nav-row .sumbar.compact .si {
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 1px; padding: 0; min-width: 0;
}
.item-nav-row .sumbar.compact .si .k {
  font-size: 11px; color: var(--t3); white-space: nowrap;
}
.item-nav-row .sumbar.compact .si .v {
  font-size: 13.5px; font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.item-nav-row .sumbar.compact .si.q .v { color: var(--pri); }
.item-nav-row .sumbar.compact .si.g .v { color: var(--ok); }
.item-nav-row .quick-tog { flex: 0 0 auto; }
/* 第 2 行：搜索 + 系统 pill 横向滚动条 + 操作按钮 */
/* sticky 吸顶：滚动页面时系统标签条固定可见，不被下方配置清单卡片遮挡 */
.sysbar-row {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px dashed var(--line-soft);
  padding-top: 7px;
  position: sticky; top: 0; z-index: 20;
  background: var(--surface);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-soft);
}
.sysbar-row .syslist {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-wrap: nowrap; gap: 5px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin;
  padding-bottom: 2px;
}
.sysbar-row .syslist::-webkit-scrollbar { height: 6px; }
.sysbar-row .syslist::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.sysbar-row .sys-actions {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 5px;
}
.sysbar-row .sys-actions .btn { padding: 4px 9px; font-size: 11.5px; }
/* 第 4 步「清单与报价」的「← 上一步」：放 sticky 系统条最左，方位与第 2/3 步的返回键一致、常驻可见。
   刻意不放进 .sys-actions —— 那里是"操作本页系统列表"，返回是"离开本页"，语义要分开。 */
.sysbar-row .back-step { flex: 0 0 auto; padding: 4px 9px; font-size: 11.5px; }
/* 「← 上一步」统一样式：各步的返回入口都放在该步工具条最左侧，位置一致、不被换行拆开。
   第 2 步（card-h 工具条）/ 第 3 步（card-h 工具条）/ 第 4 步（sticky 系统条）三处共用。 */
.back-step { white-space: nowrap; }
/* 主区顶部快速设置工具条 */
.quick-tog { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.quick-tog .viewseg-top { align-self: center; }
.quick-tog .viewseg-top button { padding: 5px 11px; font-size: 12px; line-height: 1.2; }
.quick-tog .badge-btn {
  padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--t2); font-size: 12px; opacity: 1;
}
.quick-tog .badge-btn:hover { border-color: var(--pri); color: var(--pri); transform: none; }

/* 项目设置下拉选择器：标签 + 当前值 + 箭头，点开为选项列表 */
.quick-tog .sel-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px 4px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--t2); font-size: 12px; font-family: inherit; cursor: pointer;
  transition: .14s;
}
.quick-tog .sel-btn:hover { border-color: var(--pri); }
.quick-tog .sel-btn .k { color: var(--t3); font-size: 11px; white-space: nowrap; }
.quick-tog .sel-btn .v { color: var(--t1); font-weight: 600; white-space: nowrap; }
.quick-tog .sel-btn .caret { color: var(--t3); flex: 0 0 auto; }
.quick-tog .sel-btn:hover .v,
.quick-tog .sel-btn:hover .caret { color: var(--pri); }
/* 系统导航 pill 紧凑化（顶部导航条用） */
.sysbar-row .syspill {
  padding: 2px 9px; font-size: 11.5px;
  background: var(--surface-3); color: var(--t2);
  flex: 0 0 auto;
}
.sysbar-row .syspill.on {
  background: var(--pri); color: #fff; font-weight: 600;
}

/* ===== 清单显示模式：系统标签显示（每个系统一个页面/标签） ===== */
/* 标签条：浏览器「页面标签」样式 —— 选中标签与内容区连体，横向滚动 + 吸顶 */
.view-tabs {
  position: sticky; top: 42px; z-index: 30;
  display: flex; flex-wrap: nowrap; gap: 3px;
  overflow-x: auto; overflow-y: hidden;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 7px 6px 0;
  scrollbar-width: thin;
}
.view-tabs::-webkit-scrollbar { height: 6px; }
.view-tabs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.view-tabs .vt {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 14px; font-size: 12.5px;
  background: var(--surface-3); color: var(--t2);
  border: 1px solid var(--line); border-bottom: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer; font-family: inherit; white-space: nowrap;
  position: relative; top: 1px;
}
.view-tabs .vt:hover { color: var(--pri); }
.view-tabs .vt.on {
  background: var(--surface); color: var(--pri); font-weight: 600;
  border-bottom: 1px solid var(--surface);
  top: 1px;
}
.view-tabs .vt .cnt {
  font-size: 10.5px; opacity: .85;
  background: rgba(0,0,0,.07); border-radius: 8px;
  padding: 0 5px; line-height: 1.5;
}
.view-tabs .vt.on .cnt { background: rgba(22,100,255,.12); }
/* 每个系统的独立表格块：与选中标签连体成「页面」 */
.sys-view {
  border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 8px 6px 10px;
  background: var(--surface);
}
.sys-view[hidden], .sys-view.hidden { display: none; }

/* 表格列宽拖拽：把手 + 调整时表格进入固定布局
   th 用 sticky（吸顶），sticky 同样是定位元素，.col-resizer 绝对定位仍然有效 */
table.tb.resizable th { position: sticky; }
/* 🔴 2026-10-08（用户要求）：表头加竖向隔线，列与列的边界一眼可见，
   想调列宽时能很快对准位置；隔线只加在表头，不干扰数据行 */
table.tb.resizable thead th {
  border-right: 1px solid var(--line-2);
}
table.tb.resizable thead th:last-child { border-right: none; }
table.tb.resizable th .col-resizer {
  position: absolute; right: -3px; top: 0; bottom: 0;
  width: 7px; cursor: col-resize;
  user-select: none;
}
/* 把手默认给一条居中的细握把线（比悬停才出现的更易发现），悬停/拖动时高亮 */
table.tb.resizable th .col-resizer::after {
  content: ''; position: absolute; left: 3px; top: 20%; bottom: 20%;
  width: 1px; background: var(--line-2);
}
table.tb.resizable th .col-resizer:hover,
table.tb.resizable th .col-resizer.drag { background: var(--pri); opacity: .5; }
table.tb.resizable th .col-resizer:hover::after,
table.tb.resizable th .col-resizer.drag::after { background: transparent; }

@media (max-width: 1100px) {
  .item-nav-row { gap: 8px; }
  .item-nav-row .sumbar.compact { gap: 10px; }
  .quick-tog { gap: 6px; }
  .quick-tog .badge-btn { padding: 4px 8px; font-size: 11.5px; }
  .quick-tog .sel-btn { padding: 3px 7px 3px 9px; font-size: 11.5px; }
}

@media (max-width: 860px) {
  /* 窄屏：只留当前值，省掉「价格/品牌/参数/取整」文字标签 */
  .quick-tog .sel-btn .k { display: none; }
  .quick-tog .sel-btn { padding: 4px 8px; gap: 4px; }
}

@media (max-width: 1023px) {
  .sysbar-row { flex-wrap: wrap; }
  .sysbar-row .sys-actions { width: 100%; justify-content: flex-end; }
}

/* 表格键盘导航活动格 */
.tb td.kb-cur, table.tb td.kb-cur { outline: 2px solid #2f6fed; outline-offset: -2px; box-shadow: inset 0 0 0 1px #2f6fed; cursor: cell; }

/* 模板配置：新插入行短暂高亮 */
.tb tr.tpl-new td { background: #e8f3ff !important; }

/* 侧栏：意见反馈固定按钮 */
.side-fb {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 14px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--t2); font-size: 13px; cursor: pointer;
  transition: background .15s, color .15s;
}
.side-fb:hover { background: var(--pri-w); color: var(--pri); border-color: var(--pri-soft); }
.side-fb svg { width: 15px; height: 15px; flex: none; }

/* ===== 别名词库：产品库自动归类 ===== */
.al-grp { border:1px solid #e3e8ef; border-radius:8px; margin-bottom:8px; }
.al-grp.folded .al-chips { display:none; }
.al-grp-h { display:flex; align-items:center; gap:10px; padding:8px 12px; background:#f7f9fc; border-radius:8px 8px 0 0; flex-wrap:wrap; }
.al-grp-h .al-fam { font-size:14px; }
.al-grp.folded .al-grp-h { border-radius:8px; }
.al-chips { padding:8px 12px; display:flex; flex-wrap:wrap; gap:6px; }
.al-chips .chip { background:#eef3fb; border:1px solid #d8e2f0; color:#31466b; border-radius:4px; padding:2px 8px; font-size:12px; }
.al-chips .chip.al-o { cursor:pointer; }
.al-chips .chip.al-o:hover { background:#dbe7f7; }
.al-others { margin-top:12px; padding-top:10px; border-top:1px dashed #dde3ec; }
.al-others b { display:block; margin-bottom:6px; }
/* 别名词库 · 叫法分组卡片 */
.al-cards-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:6px; }
.al-card { border:1px solid #e3e8ef; border-radius:6px; margin-bottom:0; display:flex; flex-direction:column; }
.al-card-h { display:flex; align-items:center; gap:6px; padding:3px 8px; background:#f2f7ff; border-radius:6px 6px 0 0; flex-wrap:nowrap; }
.al-card-h b { font-size:13px; color:#1d3a5f; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.al-card-h .mut, .al-card-h .al-prodcount { margin-left:auto; flex:none; }
.al-card-h .btn.sm { flex:none; }
.al-card-b { padding:4px 8px; display:flex; flex-wrap:wrap; gap:4px; align-items:center; flex:1; }
.al-card-b .chip { background:#eef3fb; border:1px solid #d8e2f0; color:#31466b; border-radius:4px; padding:0 6px; font-size:11.5px; line-height:19px; display:inline-flex; align-items:center; gap:2px; }
.al-card-h .btn.sm { padding:1px 8px; font-size:11.5px; }
.al-inp { padding:3px 8px; font-size:12px; height:26px; }
.al-prodcount { background:none; border:none; color:#2563eb; cursor:pointer; font-size:12px; padding:0; }
.al-prodcount:hover { text-decoration:underline; }
.al-prodlist { border-top:1px dashed #e0e6ef; background:#fafcff; }
.al-x { font-style:normal; color:#c0392b; cursor:pointer; font-weight:700; padding:0 2px; border-radius:3px; }
.al-x:hover { background:#f7d9d6; }
.rule-ex { background:#fff8e6; border:1px solid #f2e2b3; color:#7a5c00; border-radius:6px; padding:6px 10px; font-size:13px; display:inline-block; }
/* 别名词库：自动归类分组 */
.al-group { border:1px solid #e8edf4; border-radius:6px; margin-bottom:4px; overflow:hidden; }
.al-group-h { display:flex; align-items:center; gap:6px; padding:3px 8px; background:#f7f9fc; flex-wrap:wrap; }
.al-group-h b { font-size:13px; color:#1d3a5f; }
.al-group-h .mut { font-size:11.5px; }
.al-group-prods { padding:5px 10px; display:flex; flex-wrap:wrap; gap:4px; }
.chip.sm { font-size:11.5px; padding:1px 7px; border-radius:4px; background:#eef3fb; border:1px solid #d8e2f0; color:#31466b; }
.chip.sm.mut { background:#f4f5f7; border-color:#e2e4e8; color:#8a93a3; }
.fld.inline { display:flex; align-items:center; gap:6px; }

/* ===== 智能导入：解析中动画 ===== */
.mf-loading { display:flex; flex-direction:column; align-items:center; gap:10px; padding:48px 0; color:#667799; }
.mf-loading .spinner { width:34px; height:34px; border:3px solid #dbe3f2; border-top-color:#3b6fe0; border-radius:50%; animation:mfspin .8s linear infinite; }
@keyframes mfspin { to { transform:rotate(360deg); } }

/* ===== 工作台：项目卡片删除按钮 ===== */
.pcard { position:relative; }
.pcard-del { position:absolute; top:8px; right:8px; z-index:5; width:22px; height:22px; line-height:1;
  border:none; border-radius:50%; background:transparent; color:#9aa7bd; font-size:13px; cursor:pointer; }
.pcard-del:hover { background:#fde8e8; color:#d03939; }
/* 项目卡片「分享」按钮：放在标题行右侧（✕ 左侧） */
.pcard-share {
  margin-left:6px; padding:3px 10px; border:1px solid var(--line-2); border-radius:14px;
  background:var(--surface); color:#2563eb; font-size:12px; cursor:pointer; white-space:nowrap;
}
.pcard-share:hover { border-color:#2563eb; background:#eff5ff; }
/* 项目卡片「转为产品库」按钮：与「分享」同排，紫色区分（一次性沉淀操作） */
.pcard-toprod {
  margin-left:6px; padding:3px 10px; border:1px solid #d8c9f7; border-radius:14px;
  background:var(--surface); color:#7c3aed; font-size:12px; cursor:pointer; white-space:nowrap;
}
.pcard-toprod:hover { border-color:#7c3aed; background:#f6f0ff; }
.pcard-toprod:disabled { opacity:.55; cursor:default; }

/* ===== 智能导入复核表：行底色统一（不做状态着色，匹配情况看顶部统计数字） ===== */
#mfRows tr.grp td { background:#f6f8fc !important; }
#mfRows tr.grp2 td { padding:4px 12px !important; font-size:12.5px; color:#7a8aa3; }
#mfHead th { background:#f3f6fb; color:#4a5a76; font-weight:600; font-size:12.5px;
  padding:8px 6px; border-bottom:2px solid #dde4ee; text-align:center; }
#mfTable.grid { display:table !important; width:100%; border-collapse:collapse; table-layout:fixed; }
#mfTable.grid thead, #mfTable.grid tbody { display:table-row-group; }
#mfTable.grid tr { display:table-row; }
#mfTable.grid td { padding:6px; border-bottom:1px solid #eef1f6; vertical-align:middle; font-size:13px; }
#mfTable.grid td.ct { background:#fff; }
#mfRows tr[data-i]:hover td { background:#f7fafe; }
#mfRows tr[data-i].st-ok td { background:#f4fbf6; }
#mfRows tr[data-i].st-warn td { background:#fffaf0; }
#mfRows tr[data-i].st-err td { background:#fdf5f5; }
#mfRows tr[data-i] .cell-clamp { line-height:1.5; font-size:12.5px; color:#3d4c63; }
#mfRows tr[data-i] .cell-r { font-size:12.5px; color:#3d4c63; }

/* ===== 智能导入：系统标签页（per_system 文件） ===== */
#mfTabs { display:flex; gap:6px; flex-wrap:wrap; padding:8px 12px; border-bottom:1px solid #eef0f4; background:#fafbfd; position:sticky; top:0; z-index:5; }
#mfTabs .tab { padding:6px 14px; border:1px solid #e2e6ee; border-radius:6px; background:#fff; cursor:pointer; font-size:13px; color:#333; }
#mfTabs .tab:hover { border-color:#3a7afe; color:#3a7afe; }
#mfTabs .tab.on { background:#3a7afe; color:#fff; border-color:#3a7afe; }
#mfTabs .tab b { margin-left:6px; font-weight:600; opacity:.8; }

/* ===== 全局搜索（工作台顶部）：一个框 + 就地展开的结果面板 =====
   视觉取向：面板是「扫一眼 + 点进去」，所以每条只给 名称 / 副标题 / 归属三行，
   不做卡片阴影堆叠；选中态用主色左边条 + 淡蓝底，和全站 combo 的候选态一致。 */
.gsearch { position:relative; margin-bottom:16px; }
.gs-bar {
  display:flex; align-items:center; gap:8px;
  background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-l);
  padding:0 12px; height:42px;
  box-shadow:var(--sh-1);
  transition:border-color .15s, box-shadow .15s;
}
.gs-bar:focus-within { border-color:var(--pri); box-shadow:0 0 0 3px var(--pri-w); }
.gs-ico { width:16px; height:16px; color:var(--t3); flex:none; }
.gs-bar:focus-within .gs-ico { color:var(--pri); }
.gs-inp {
  flex:1; min-width:0; border:0; outline:0; background:transparent;
  font-size:14px; color:var(--t1); height:100%;
}
.gs-inp::placeholder { color:var(--t4); }
.gs-clear {
  flex:none; width:22px; height:22px; border:0; border-radius:50%;
  background:var(--surface-3); color:var(--t3); cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; padding:0;
}
.gs-clear:hover { background:var(--line-2); color:var(--t1); }
.gs-clear svg { width:11px; height:11px; }
.gs-kbd {
  flex:none; font-size:11px; color:var(--t4); border:1px solid var(--line);
  border-bottom-width:2px; border-radius:4px; padding:1px 6px; background:var(--surface-2);
  white-space:nowrap;
}
/* 窄屏：快捷键提示没有意义（本来就没有物理键），占位不如给输入框 */
@media (max-width:640px){ .gs-kbd{ display:none; } .gs-bar{ height:38px; } }

.gs-panel {
  position:absolute; left:0; right:0; top:calc(100% + 6px); z-index:400;
  background:var(--surface); border:1px solid var(--line-2); border-radius:var(--r-l);
  box-shadow:0 8px 28px rgba(29,33,41,.14);
  /* 压在内容之上，所以高度要克制：宽屏一屏最多占约 4 组，
     否则用户搜着搜着看不见自己搜的是哪个项目（面板把指标卡全遮了）。
     min(58vh, 460px) 而不是 min(66vh,560px) 就是为了这个。 */
  max-height:min(58vh,460px); overflow:auto; padding:4px 0;
  overscroll-behavior:contain;
}
.gs-gp + .gs-gp { border-top:1px solid var(--line-soft); margin-top:2px; padding-top:2px; }
.gs-gh {
  display:flex; align-items:center; gap:7px;
  padding:8px 14px 5px; position:sticky; top:0;
  background:var(--surface); z-index:1;
}
.gs-gh b { font-size:12.5px; font-weight:600; color:var(--t1); }
.gs-gh svg { color:var(--t3); flex:none; }
.gs-cnt {
  font-size:11px; color:var(--pri); background:var(--pri-w);
  border-radius:9px; padding:0 6px; line-height:17px; min-width:18px; text-align:center;
}
.gs-hint { font-size:11px; color:var(--t4); }
/* 「还有 N 条」放在组标题最右，hover 才显出可点 */
.gs-more {
  margin-left:auto; font-size:11.5px; color:var(--t3); cursor:pointer;
  padding:1px 6px; border-radius:9px; white-space:nowrap;
}
.gs-more:hover { color:var(--pri); background:var(--pri-w); }

.gs-list { padding:0 6px 4px; }
.gs-it {
  display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,1.1fr);
  gap:10px; align-items:baseline;
  padding:6px 10px; border-radius:var(--r-s); cursor:pointer;
  border-left:2px solid transparent;
}
.gs-it:hover, .gs-it.on { background:var(--pri-w2); border-left-color:var(--pri); }
.gs-t { font-size:13.5px; color:var(--t1); font-weight:500;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gs-s { font-size:12.5px; color:var(--t2);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gs-m { font-size:11.5px; color:var(--t3);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* 窄屏三列会挤成一条：改成名称在上、其余两行副信息 */
@media (max-width:720px){
  .gs-it { grid-template-columns:1fr; gap:1px; }
  .gs-s, .gs-m { font-size:11.5px; }
  .gs-hint { display:none; }
}

.gs-empty { padding:26px 16px; text-align:center; }
.gs-empty b { display:block; font-size:13.5px; color:var(--t1); margin-bottom:4px; }
.gs-empty span { font-size:12px; color:var(--t3); }

/* 落地高亮：从全局搜索跳进清单页时，把命中的行标出来并滚过去。
   一次性提示条，不常驻（清掉就回到普通清单）。 */
.gs-jump-note {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  background:var(--warn-w); border:1px solid #ffd8a8; color:#a8560a;
  border-radius:var(--r); padding:7px 12px; margin-bottom:10px; font-size:12.5px;
}
.gs-jump-note b { color:#8a4708; }
.gs-jump-note .btn { margin-left:auto; }
tr.gs-hit > td { background:#fff6e6 !important; }
tr.gs-hit > td:first-child { box-shadow:inset 3px 0 0 var(--warn); }

/* ===== 采集设置：自定义关键词 chip ===== */
.kw-chips { display:flex; flex-wrap:wrap; gap:4px; margin-bottom:2px; }
.kw-chip {
  display:inline-flex; align-items:center; gap:3px;
  padding:1px 6px; border-radius:4px; font-size:12px; line-height:18px;
  background:#eef3fb; border:1px solid #d8e2f0; color:#31466b;
}
.kw-chip .kw-del {
  display:inline-flex; align-items:center; justify-content:center;
  width:14px; height:14px; border-radius:3px; cursor:pointer;
  font-style:normal; font-size:13px; color:#8a93a3;
}
.kw-chip .kw-del:hover { background:#fde8e8; color:#d03939; }
.new-group-row { background:#fafbfd; }
.new-group-row .inp { font-size:12.5px; }

/* ===== 采集设置弹窗（2.8.53 美化） ===== */
.collect-set { display:flex; flex-direction:column; gap:10px; }
.cs-head { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.cs-meta { display:flex; align-items:baseline; gap:14px; }
.cs-meta b { color:var(--t1); }
.cs-meta .c-num { color:var(--pri); font-weight:600; }
.cs-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.cs-pages { display:flex; align-items:center; gap:6px; }
.cs-pages .inp { width:56px; text-align:center; }
.cs-afbar { display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:7px 10px; background:var(--surface-2); border-radius:var(--r); }
.cs-afbar .cs-ck { display:inline-flex; align-items:center; gap:4px; font-size:12.5px; color:var(--t2); cursor:pointer; white-space:nowrap; }
.cs-afbar .cs-ck input { margin:0; accent-color:var(--pri); }
.cs-afbar .btn { margin-left:auto; }
.cs-table { max-height:min(48vh,460px); overflow-y:auto; border-radius:var(--r); border:1px solid var(--line); }
.cs-table table.tb { table-layout:fixed; }
.cs-table table.tb td { padding:7px 10px; vertical-align:top; }
.cs-table table.tb th { padding:8px 10px; }
.cs-cat { font-size:13.5px; font-weight:600; }
.cs-builtins { min-width:360px; max-width:none; line-height:1.45; word-break:break-word; }
.cs-custom { width:200px; min-width:160px; }
.cs-add { display:flex; gap:6px; margin-top:6px; }
.cs-add .inp { flex:1; min-width:90px; }
.cs-add .btn { padding:4px 10px; }
.cs-newgroup { display:flex; align-items:center; gap:8px; padding:8px 10px; background:var(--surface-2); border-radius:var(--r); }
.cs-newgroup .inp { font-size:12.5px; }
.cs-custom-tag { display:inline-flex; align-items:center; margin-left:4px; padding:1px 5px; border-radius:3px; font-size:11px; font-weight:500; background:#e6f4ea; color:#1e7e34; border:1px solid #b7e0c0; }
.cs-foot { display:flex; align-items:center; gap:10px; padding-top:6px; border-top:1px solid var(--line-soft); }
.cs-note { margin:0; padding:8px 10px; background:var(--surface-2); border-radius:var(--r); }
@media (max-width:720px){
  .cs-head { flex-direction:column; align-items:flex-start; }
  .cs-actions { width:100%; }
  .cs-afbar .btn { margin-left:0; }
}
