/* ============================================================
 * 组件层：按钮 / 卡片 / 表格 / 表单 / 弹层 / 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.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); }

/* ============ 加载指示 ============ */
.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); }

/* ============ 指标卡 ============ */
.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; }

/* 产品库行内编辑：点单元格原地处编辑 */
.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); }

/* ============ 空状态 ============ */
.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.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; }

/* ============ 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;
}

/* ============ 粘贴 / 上传区 ============ */
.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); }
/* 每网交换机列：一个「网 × 设备类型」一格，只放台数；该项为 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); }

/* ============ 清单表格 ============ */
.tb .sys-title td {
  background: var(--pri-w);
  font-weight: 600;
  color: var(--pri);
  padding: 9px 12px;
}
.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 .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; }

/* 模板可见范围筛选条（公有 / 私人），与卡片区分层但同属一块 */
.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; }

/* ============ 键值对 ============ */
.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: #fff7e0; }
  .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 横向滚动条 + 操作按钮 */
.sysbar-row {
  display: flex; align-items: center; gap: 8px;
  border-top: 1px dashed var(--line-soft);
  padding-top: 7px;
}
.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; }
/* 主区顶部快速设置工具条 */
.quick-tog { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.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;
}

/* 表格列宽拖拽：把手 + 调整时表格进入固定布局 */
table.tb.resizable th { position: relative; }
table.tb.resizable th .col-resizer {
  position: absolute; right: -3px; top: 0; bottom: 0;
  width: 6px; cursor: col-resize;
  user-select: none;
}
table.tb.resizable th .col-resizer:hover,
table.tb.resizable th .col-resizer.drag { background: var(--pri); opacity: .5; }

@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; }
