/* ===== 电气及给排水等全专业计算及查询系统 · 浅天空蓝渐变主题 ===== */
:root {
  --sky-50: #f6fcff;
  --sky-100: #e8f5fe;
  --sky-200: #d4ebfa;
  --sky-300: #bfe0f6;
  --pri: #2a7fbd;
  --pri-2: #1b6ca4;
  --pri-3: #4d9fd6;
  --pri-soft: #e9f5fd;
  --ink: #17303f;
  --ink-2: #5b7b91;
  --ink-3: #8aa5b8;
  --line: #d5e8f5;
  --card: #ffffff;
  --ok: #10875a;
  --ok-bg: #e7f7ef;
  --warn: #b0730f;
  --warn-bg: #fdf4e3;
  --bad: #c4373b;
  --bad-bg: #fdeceb;
  --pad: 12px;
  --r: 12px;
  --sh: 0 1px 3px rgba(31, 90, 130, .07), 0 4px 14px rgba(31, 90, 130, .05);
  --font: 'YouYuan', '幼圆', 'Yuanti SC', 'Microsoft YaHei', 'PingFang SC', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--font);
  font-size: 13.5px; line-height: 1.6;
  color: var(--ink);
  background: linear-gradient(165deg, #f9fdff 0%, #e8f5fe 34%, #d8ecfa 68%, #cfe7f8 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

#app { display: flex; flex-direction: column; height: 100%; }

/* ---------- 顶栏 ---------- */
#topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 0 var(--pad);
  height: 50px;
  background: linear-gradient(100deg, var(--pri-2) 0%, var(--pri) 48%, var(--pri-3) 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(27, 108, 164, .22);
  position: relative; z-index: 20;
}
#topbar .logo { font-size: 18px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
#topbar .t-title { font-size: 15px; font-weight: 700; letter-spacing: .5px; }
#topbar .t-sub { font-size: 11px; opacity: .8; margin-left: 2px; }
#topbar .spacer { flex: 1; }
#topbar .t-act {
  border: 0; background: rgba(255,255,255,.16); color: #fff;
  border-radius: 8px; padding: 5px 10px; font-size: 12px;
  font-family: var(--font); cursor: pointer; white-space: nowrap;
}
#topbar .t-act:active { background: rgba(255,255,255,.3); }

/* ---------- 主区 ---------- */
#view {
  flex: 1 1 auto; overflow-y: auto; overflow-x: hidden;
  padding: var(--pad) var(--pad) 18px;
  -webkit-overflow-scrolling: touch;
}
.wrap { max-width: 1180px; margin: 0 auto; }

/* ---------- 底部导航 ---------- */
#tabbar {
  flex: 0 0 auto;
  display: flex;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
#tabbar a {
  flex: 1; text-align: center; text-decoration: none;
  color: var(--ink-3); font-size: 11px;
  padding: 7px 0 6px; cursor: pointer;
  transition: color .15s;
}
#tabbar a .ic { display: flex; justify-content: center; align-items: center; height: 21px; margin-bottom: 1px; }
#tabbar a .ic svg { width: 20px; height: 20px; }
#topbar .t-act { display: inline-flex; align-items: center; gap: 4px; }
#topbar .t-act svg { width: 14px; height: 14px; }
#tabbar a.on { color: var(--pri); font-weight: 700; }
#tabbar a.on .ic { transform: translateY(-1px); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--r);
  box-shadow: var(--sh);
  padding: var(--pad);
  margin-bottom: 10px;
  border: 1px solid rgba(213, 232, 245, .75);
}
.card.tight { padding: 8px 10px; }
.card-h {
  display: flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; color: var(--pri-2);
  margin: -2px 0 8px;
}
.card-h .bar {
  width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--pri-3), var(--pri));
}
.card-h .more { margin-left: auto; font-size: 11.5px; font-weight: 400; color: var(--ink-3); cursor: pointer; }
.card-h .more:hover { color: var(--pri); }

.muted { color: var(--ink-2); font-size: 12px; }
.tiny { color: var(--ink-3); font-size: 11.5px; line-height: 1.5; }
.sec-title {
  font-size: 12px; font-weight: 700; color: var(--ink-2);
  letter-spacing: .5px; margin: 14px 2px 7px;
  display: flex; align-items: center; gap: 6px;
}
.sec-title:first-child { margin-top: 2px; }
.sec-title::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ---------- 表单 ---------- */
.field { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.field > label {
  flex: 0 0 42%; font-size: 12.5px; color: var(--ink-2);
  display: flex; align-items: center; gap: 4px; min-width: 0;
}
.field > label span.unit { color: var(--ink-3); font-size: 11px; }
.field > label .tip {
  display: inline-block; width: 13px; height: 13px; line-height: 13px;
  text-align: center; border-radius: 50%;
  background: var(--sky-200); color: var(--pri); font-size: 9px; cursor: help;
}
.input, select.input {
  flex: 1 1 auto; min-width: 0;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 9px; font-size: 13.5px; font-family: var(--font);
  color: var(--ink); background: var(--sky-50);
  outline: none; transition: border-color .15s, background .15s;
  -webkit-appearance: none; appearance: none;
}
.input:focus { border-color: var(--pri-3); background: #fff; box-shadow: 0 0 0 3px rgba(77,159,214,.13); }
select.input {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M0 0l5 6 5-6z' fill='%235b7b91'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center;
  padding-right: 24px;
}
.row2 { display: flex; gap: 8px; }
.row2 > * { flex: 1; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 1px solid var(--line); background: #fff; color: var(--pri-2);
  border-radius: 9px; padding: 7px 14px; font-size: 13px;
  font-family: var(--font); cursor: pointer; transition: all .15s;
}
.btn:hover { border-color: var(--pri-3); background: var(--pri-soft); }
.btn:active { transform: scale(.98); }
.btn.pri {
  background: linear-gradient(100deg, var(--pri), var(--pri-3));
  color: #fff; border-color: transparent;
  box-shadow: 0 3px 10px rgba(42,127,189,.28);
}
.btn.pri:hover { filter: brightness(1.05); }
.btn.sm { padding: 4px 10px; font-size: 12px; border-radius: 7px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-3); }

/* ---------- 结果 ---------- */
.result {
  margin-top: 10px; padding: 10px 12px;
  background: linear-gradient(135deg, var(--pri-soft), #f7fcff);
  border: 1px solid #cfe8fa; border-radius: 10px;
}
.result .r-h {
  font-size: 11px; color: var(--pri-2); font-weight: 700;
  letter-spacing: .6px; margin-bottom: 6px; opacity: .85;
}
.r-item {
  display: flex; align-items: baseline; gap: 6px;
  padding: 3px 0; border-bottom: 1px dashed rgba(207,232,250,.85);
  font-size: 12.5px;
}
.r-item:last-child { border-bottom: 0; }
.r-item .rl { color: var(--ink-2); flex: 0 0 auto; }
.r-item .rv {
  margin-left: auto; font-size: 17px; font-weight: 700;
  color: var(--pri-2); font-variant-numeric: tabular-nums;
  letter-spacing: .3px;
}
.r-item .rv.txt { font-size: 13px; font-weight: 600; }
.r-item .ru { font-size: 11px; color: var(--ink-3); min-width: 26px; }
.r-item .rv.bad { color: var(--bad); }
.r-item .rv.ok { color: var(--ok); }

.warn-tip {
  margin-top: 6px; font-size: 11.5px; padding: 5px 8px;
  background: var(--warn-bg); color: var(--warn);
  border-radius: 7px; border-left: 3px solid var(--warn);
}
.warn-tip.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }

/* ---------- 标签 / 徽标 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 20px;
  background: var(--pri-soft); color: var(--pri-2);
  font-size: 11px; white-space: nowrap; border: 1px solid #d9ecfa;
}
.chip.g { background: var(--ok-bg); color: var(--ok); border-color: #cbeadb; }
.chip.y { background: var(--warn-bg); color: var(--warn); border-color: #f3e2c2; }
.chip.r { background: var(--bad-bg); color: var(--bad); border-color: #f6d5d4; }
.chip.grey { background: #f1f6fa; color: var(--ink-2); border-color: #e2ecf4; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* ---------- 列表 / 行 ---------- */
.list { display: flex; flex-direction: column; gap: 7px; }
.lit {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 11px; cursor: pointer; transition: all .15s;
}
.lit:hover { border-color: var(--pri-3); box-shadow: 0 3px 12px rgba(42,127,189,.1); transform: translateY(-1px); }
.lit .lt { font-size: 13.5px; font-weight: 700; color: var(--ink); display: flex; gap: 6px; align-items: baseline; }
.lit .ld { font-size: 11.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lit .lm { margin-top: 5px; display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 9px; border: 1px solid var(--line); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 12px; background: #fff; min-width: 100%; }
table.tbl th {
  background: linear-gradient(180deg, #eef8fe, #e4f2fc);
  color: var(--pri-2); font-weight: 700; text-align: left;
  padding: 6px 8px; white-space: nowrap;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1;
}
table.tbl td { padding: 5px 8px; border-bottom: 1px solid #eef5fa; color: var(--ink); vertical-align: top; }
table.tbl tr:nth-child(even) td { background: #fbfdff; }
table.tbl tr:hover td { background: var(--pri-soft); }
table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.tbl td .chip { margin: 0; }
table.tbl .nowrap { white-space: nowrap; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 30px 16px; color: var(--ink-3); font-size: 12.5px; }
.empty .e-ic { font-size: 30px; opacity: .45; display: block; margin-bottom: 8px; }

/* ---------- 公式块 ---------- */
.formula {
  font-family: 'Cambria Math', 'Times New Roman', Georgia, serif;
  font-size: 14.5px; color: var(--pri-2); letter-spacing: .3px;
  background: #f7fcff; border: 1px dashed #cfe8fa; border-radius: 8px;
  padding: 7px 10px; margin: 4px 0 8px; word-break: break-word;
}
.kv { display: flex; gap: 8px; font-size: 12px; padding: 3px 0; }
.kv .k { flex: 0 0 78px; color: var(--ink-3); }
.kv .v { flex: 1; color: var(--ink); word-break: break-word; }

/* ---------- 搜索框 ---------- */
.searchbar { display: flex; gap: 7px; margin-bottom: 9px; }
.searchbar .input { flex: 1; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.filters select.input { flex: 0 0 auto; width: auto; min-width: 92px; font-size: 12px; padding: 5px 22px 5px 8px; }

/* ---------- 工具条（搜索 + 下拉筛选，同一行） ---------- */
.toolbar { display: flex; gap: 8px; margin-bottom: 9px; align-items: stretch; }
.toolbar .searchgroup { position: relative; flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; }
.toolbar .searchgroup:empty { display: none; }
/* 搜索框 + 清除按钮：按钮绝对定位，位置由 JS 按 input 实际宽度计算 */
.toolbar .searchgroup > .clr {
  position: absolute; top: 0; bottom: 0; width: 24px;
  border: 0; padding: 0; background: transparent;
  color: #6b8fa6; font-size: 16px; line-height: 1; font-family: var(--font);
  cursor: pointer; display: none; align-items: center; justify-content: center;
}
.toolbar .searchgroup > .clr.show { display: flex; }
.toolbar .searchgroup > .clr:hover { color: var(--pri-2); }
/* searchgroup 内的筛选下拉：不撑开搜索框 */
.toolbar .searchgroup select.input { flex: 0 0 auto; min-width: 88px; max-width: 130px; padding-right: 24px; }
/* 搜索框保底宽度，避免被同排下拉挤没 */
.toolbar .searchgroup > .input { flex: 1 1 200px; min-width: 150px; padding-right: 28px; }
.toolbar .clr {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0;
  background: #dceaf6; color: #3f7799; font-size: 14px; line-height: 1;
  font-family: var(--font); cursor: pointer;
  display: none; align-items: center; justify-content: center;
}
.toolbar .clr.show { display: flex; }
.toolbar .clr:hover { background: #c3ddef; }
.toolbar select.input {
  flex: 0 0 auto; width: auto; min-width: 116px; max-width: 210px;
  font-size: 12.5px; font-weight: 700; color: var(--pri-2);
  background-color: #fff;
}
/* 工具条首位的 select 作为视图切换器：加宽 + 阴影，和筛选下拉区分 */
.toolbar > select.input:first-child {
  min-width: 150px; font-size: 13.5px;
  box-shadow: 0 1px 3px rgba(31, 90, 130, .07);
}

/* 移动端：分类下拉与搜索框同排时下拉收窄，不挤压输入 */
@media (max-width: 480px) {
  .toolbar select.input { min-width: 96px; max-width: 132px; font-size: 12px; }
  .toolbar > select.input:first-child { min-width: 112px; max-width: 132px; }
  .tabsel .ts-cap { display: none; }
}

/* 窄屏：工具条允许换行，避免控件挤出屏幕 */
@media (max-width: 640px) {
  .toolbar { flex-wrap: wrap; }
  .toolbar > select.input:first-child { flex: 0 0 auto; }
  .toolbar > .searchgroup { flex: 1 1 160px; min-width: 0; }
  .toolbar > .searchgroup > .input { flex: 1 1 120px; min-width: 110px; }
  .toolbar > .searchgroup select.input { flex: 1 1 96px; min-width: 88px; max-width: none; }
  /* 元件页筛选组：搜索框独占一行，品牌/类别下拉均分另一行 */
  .toolbar > .searchgroup.wide { flex: 1 1 100%; order: 2; }
  .toolbar > .searchgroup.wide > .input { flex: 1 1 100%; min-width: 0; order: 1; }
  .toolbar > .searchgroup.wide select.input { order: 2; flex: 1 1 40%; }
}

/* ---------- 页签下拉（视图切换） ---------- */
.tabsel { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.tabsel .ts-cap {
  font-size: 11px; color: var(--ink-3); letter-spacing: .5px;
  flex: 0 0 auto; white-space: nowrap;
}
.tabsel select.input {
  flex: 0 1 auto; width: auto; min-width: 158px; max-width: 260px;
  font-weight: 700; font-size: 13.5px; color: var(--pri-2);
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(31, 90, 130, .07);
}
.tabsel .ts-meta { margin-left: auto; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

/* ---------- 分段控件（备用） ---------- */
.seg {
  display: flex; gap: 3px; padding: 3px; background: #e9f4fc;
  border-radius: 9px; margin-bottom: 9px; overflow-x: auto;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1 0 auto; border: 0; background: transparent; color: var(--ink-2);
  font-size: 12.5px; font-family: var(--font); padding: 5px 11px;
  border-radius: 7px; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.seg button.on { background: #fff; color: var(--pri-2); font-weight: 700; box-shadow: 0 1px 4px rgba(42,127,189,.14); }

/* ---------- 提示条 ---------- */
#toast {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%) translateY(12px);
  background: rgba(23,48,63,.9); color: #fff; font-size: 12.5px;
  padding: 7px 15px; border-radius: 20px; opacity: 0; pointer-events: none;
  transition: all .22s; z-index: 999; max-width: 80%; text-align: center;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 解码器 ---------- */
.decode-seg {
  display: flex; gap: 5px; flex-wrap: wrap; margin: 8px 0;
}
.decode-seg .ds {
  border-radius: 8px; padding: 6px 9px; font-size: 12px;
  background: linear-gradient(135deg, #fff, #f2faff);
  border: 1px solid #cfe8fa; flex: 1 1 46%;
  box-shadow: 0 1px 3px rgba(42,127,189,.06);
}
.decode-seg .ds .n {
  font-size: 10px; color: var(--pri-3); font-weight: 700; letter-spacing: .5px;
}
.decode-seg .ds .t { font-family: 'Cambria', Georgia, serif; font-size: 13.5px; color: var(--pri-2); font-weight: 700; }
.decode-seg .ds .d { font-size: 11px; color: var(--ink-2); margin-top: 1px; line-height: 1.45; }

/* ============================================================
   工作台骨架（Workbench）
   布局：顶部选择条 → 公式/说明框 → 参数表 → 过程/结果框
   ============================================================ */
.wb { max-width: 820px; margin: 0 auto; }

/* ---------- 顶部选择条 ---------- */
.wb-head {
  background: #fff; border: 1px solid var(--line); border-radius: 7px;
  padding: 9px 11px; margin-bottom: 9px;
}
.wb-row { display: flex; gap: 9px; align-items: flex-end; flex-wrap: wrap; }
.wb-row + .wb-row { margin-top: 9px; padding-top: 9px; border-top: 1px dashed #e2eef7; }
.wsel { display: flex; flex-direction: column; gap: 3px; flex: 0 0 auto; }
.wsel.grow { flex: 1 1 220px; min-width: 0; }
.wsel > label { font-size: 11px; color: var(--ink-3); letter-spacing: .4px; font-weight: 700; }
.wsel select.input {
  font-weight: 700; color: var(--pri-2); background-color: #fff;
  min-width: 130px; box-shadow: 0 1px 3px rgba(31, 90, 130, .07);
}
.wsel.grow select.input { width: 100%; }
.wsel .input { min-width: 0; }

/* ---------- 面板 ---------- */
.wb-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 7px;
  margin-bottom: 9px; overflow: hidden;
}
.wb-panel-h {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 11px; font-size: 12.5px; font-weight: 700; color: var(--pri-2);
  background: linear-gradient(180deg, #eef8fe, #e4f2fc);
  border-bottom: 1px solid var(--line);
}
.wb-panel-h .bar {
  width: 3px; height: 13px; border-radius: 2px;
  background: linear-gradient(180deg, var(--pri-3), var(--pri));
}
.wb-panel-h .rt { margin-left: auto; font-size: 11px; font-weight: 400; color: var(--ink-3); }
.wb-panel-b { padding: 11px 12px; }
.wb-panel-b.tight { padding: 9px 11px; }

/* ---------- 公式框 ---------- */
.wb-formula {
  font-family: 'Cambria Math', 'Cambria', Georgia, serif;
  font-size: 17px; color: var(--pri-2); text-align: center;
  padding: 15px 12px; letter-spacing: .4px; line-height: 1.7;
  background: linear-gradient(180deg, #f8fdff, #ecf7fe);
  border: 1px solid #cfe8fa; border-radius: 10px; word-break: break-word;
}
.wb-formula .wf-name {
  display: block; font-family: var(--font); font-size: 12px;
  color: var(--ink-3); letter-spacing: 0; margin-bottom: 7px;
}

/* ---------- 参数表（label + 输入框 竖排） ---------- */
.wb-form { display: flex; flex-direction: column; }
.wb-frow {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px dashed #e6f1f8;
}
.wb-frow:last-child { border-bottom: 0; }
.wb-frow > label {
  flex: 0 0 172px; font-size: 12.5px; color: var(--ink-2);
  display: flex; align-items: center; gap: 4px; min-width: 0;
}
.wb-frow > label .unit { color: var(--ink-3); font-size: 11px; }
.wb-frow > label .tip {
  display: inline-block; width: 13px; height: 13px; line-height: 13px;
  text-align: center; border-radius: 50%;
  background: var(--sky-200); color: var(--pri); font-size: 9px; cursor: help;
}
.wb-frow .input, .wb-frow select.input { flex: 0 1 320px; max-width: 320px; min-width: 0; }
.wb-frow .fval {
  flex: 0 1 320px; max-width: 320px; font-family: 'Cambria', Georgia, serif;
  font-size: 14px; font-weight: 700; color: var(--pri-2);
  font-variant-numeric: tabular-nums;
}
.wb-frow .fval .u { font-size: 11px; color: var(--ink-3); font-weight: 400; margin-left: 3px; }

/* ---------- 计算过程 ---------- */
.wb-proc { font-size: 12.5px; line-height: 1.95; color: var(--ink); }
.wb-proc .pl { color: var(--ink-3); display: inline-block; width: 46px; }
.wb-proc code {
  font-family: 'Cambria Math', Georgia, serif; color: var(--pri-2);
  background: #f2f9fe; padding: 1px 6px; border-radius: 4px; font-size: 12.5px;
}
.wb-proc .sub { color: var(--ink-2); }

/* ---------- 结果行 ---------- */
.wb-res { display: flex; flex-direction: column; }
.wb-res .r {
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px 0; border-bottom: 1px dashed #e6f1f8;
}
.wb-res .r:last-child { border-bottom: 0; }
.wb-res .r .rl { color: var(--ink-2); font-size: 12.5px; }
.wb-res .r .rv {
  margin-left: auto; font-size: 18px; font-weight: 700; color: var(--pri-2);
  font-variant-numeric: tabular-nums; letter-spacing: .3px;
}
.wb-res .r .rv.txt { font-size: 13px; font-weight: 600; }
.wb-res .r .rv.ok { color: var(--ok); }
.wb-res .r .rv.bad { color: var(--bad); }
.wb-res .r .ru { font-size: 11px; color: var(--ink-3); min-width: 24px; }
.wb-res .r.star .rv { color: var(--pri); font-size: 22px; }

/* ---------- 键值对 ---------- */
.wb-kv { display: grid; grid-template-columns: 108px 1fr; gap: 3px 10px; font-size: 12px; }
.wb-kv .k { color: var(--ink-3); }
.wb-kv .v { color: var(--ink); word-break: break-word; }

/* ---------- 目录式条目（选型入口） ---------- */
.wb-menu { display: flex; flex-direction: column; }
.wb-menu .mi {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-bottom: 1px solid #eef5fa;
  cursor: pointer; transition: background .15s;
}
.wb-menu .mi:last-child { border-bottom: 0; }
.wb-menu .mi:hover { background: var(--pri-soft); }
.wb-menu .mi.on { background: linear-gradient(90deg, var(--pri-soft), #fff); }
.wb-menu .mi .mt { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.wb-menu .mi .md { font-size: 11.5px; color: var(--ink-2); margin-top: 2px; }
.wb-menu .mi .mc { margin-left: auto; font-size: 11px; color: var(--ink-3); white-space: nowrap; }

/* ---------- 折叠说明 ---------- */
.wb-note { font-size: 11.5px; line-height: 1.75; color: var(--ink-2); }
.wb-note.warn { color: var(--warn); }
.wb-note + .wb-note { margin-top: 7px; }

/* ---------- 负荷汇总计算表（一张表走完全流程） ---------- */
.ls-bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 0 0 9px; margin-bottom: 9px; border-bottom: 1px dashed #e2eef7;
}
.ls-bar .tiny { margin-left: auto; max-width: 100%; }

table.lf { min-width: 880px; font-size: 11.5px; }
table.lf th { font-size: 11px; padding: 6px 6px; }
table.lf td { padding: 4px 6px; vertical-align: middle; }

/* 单元格内嵌输入框：无边框，聚焦才显形 */
table.lf .cell {
  width: 100%; min-width: 0; border: 1px solid transparent; background: transparent;
  border-radius: 5px; padding: 3px 5px; font: inherit; font-size: 11.5px;
  font-family: var(--font); color: var(--ink); outline: none;
  transition: border-color .15s, background .15s;
}
table.lf .cell:hover { border-color: #d6e9f7; background: #fff; }
table.lf .cell:focus { border-color: var(--pri-3); background: #fff; box-shadow: 0 0 0 2px rgba(42,127,189,.12); }
table.lf select.cell { cursor: pointer; color: var(--pri-2); font-weight: 600; }
/* 工作制列：下拉略小字号，避免与 Kx / cosφ 视觉抢位 */
table.lf td.c-duty select.cell { font-size: 11px; font-weight: 500; color: var(--ink-2); }
/* 长期 / 短时工作制：εN 与 ε基准 被工作制锁定为 100（不做暂载率折算）。
   作为正常数值显示（深色实字、居右），仅用一个小锁标记readonly，不再用灰底斜体造成"占位符"错觉 */
table.lf input.cell.num.fix {
  background: transparent; color: var(--ink);
  cursor: default; font-weight: 600; opacity: 1;
}
table.lf input.cell.num.fix:hover { border-color: transparent; background: transparent; }
table.lf input.cell.num.fix:focus { box-shadow: none; border-color: transparent; background: transparent; }
table.lf input.cell.num { text-align: right; font-variant-numeric: tabular-nums; }
/* 隐藏数字输入框的上下箭头：腾出横向空间，避免 0.35 这类数值被截断 */
table.lf input.cell.num::-webkit-outer-spin-button,
table.lf input.cell.num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
table.lf input.cell.num { -moz-appearance: textfield; }

/* 偏离手册推荐范围的参数（黄色底 + 醒目字色） */
table.lf input.cell.dev {
  background: var(--warn-bg); border-color: #e7c489; color: #9a5b0c; font-weight: 700;
}
table.lf input.cell.dev:hover { border-color: #dfae5e; background: #fdf0da; }

/* 手册校核结论条 */
.lf-check {
  margin: 6px 0 8px; padding: 6px 10px; border-radius: 7px;
  font-size: 11.5px; line-height: 1.65; border: 1px solid transparent;
}
.lf-check .ok { color: var(--ok); }
.lf-check .bad { color: var(--warn); }
.lf-check.pass { background: var(--ok-bg); border-color: #bfe6d3; }
.lf-check.fail { background: var(--warn-bg); border-color: #e7c489; }

/* 计算列（不可编辑） */
table.lf td.cal {
  background: #f6fafd; color: var(--ink-2); font-variant-numeric: tabular-nums;
  font-family: Cambria, Georgia, serif;
}
table.lf tbody tr:nth-child(even) td.cal { background: #f2f8fc; }
table.lf td.cal.neg { color: #0f8a63; font-weight: 700; }

/* 删除行按钮 */
.rowdel {
  width: 20px; height: 20px; line-height: 18px; text-align: center;
  border: 1px solid var(--line); background: #fff; color: var(--ink-3);
  border-radius: 5px; cursor: pointer; font-size: 13px; padding: 0;
}
.rowdel:hover { border-color: #f0b8b6; color: var(--bad); background: var(--bad-bg); }

/* 表尾：合计 / 参数 / 结果 */
table.lf tfoot td { border-bottom: 0; padding: 5px 6px; vertical-align: middle; }
table.lf tfoot tr.lf-sum td {
  background: linear-gradient(180deg, #f4fafd, #eaf5fc);
  font-weight: 700; color: var(--pri-2); border-top: 1px solid #cfe8fa;
  border-bottom: 1px solid #cfe8fa; line-height: 1.45;
}
table.lf tfoot tr.lf-para td {
  background: #fffdf3; color: var(--ink-2); line-height: 1.45;
  border-top: 1px solid #f0e6c8; border-bottom: 1px solid #f0e6c8;
}
table.lf tfoot tr.lf-res td {
  background: linear-gradient(180deg, #eef8fe, #ddeefb);
  color: var(--pri-2); line-height: 1.5;
  border-top: 1px solid #cfe8fa;
}
table.lf tfoot tr.lf-res:last-child td { border-bottom: 1px solid #cfe8fa; }
table.lf tfoot b { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
table.lf tfoot .cell { background: rgba(255,255,255,.85); border-color: #e3dcc4; }
table.lf tfoot .cell:focus { border-color: var(--pri-3); }

/* 表尾横条：参数项 / 结果项 */
.lf-grid { display: flex; gap: 6px 26px; flex-wrap: wrap; align-items: flex-end; }
.lf-grid .lgi { min-width: 0; flex: 0 0 auto; }
.lf-grid .lgi .k {
  font-size: 10.5px; color: var(--ink-3); white-space: normal;
  font-weight: 600; margin-bottom: 2px;
}
.lf-grid .lgi .v {
  font-size: 15px; font-weight: 800; color: var(--pri-2); white-space: nowrap;
  font-variant-numeric: tabular-nums; letter-spacing: .2px;
}
.lf-grid .lgi .v .u { font-size: 10.5px; font-weight: 400; color: var(--ink-3); margin-left: 2px; }
.lf-grid .lgi .cell { width: 96px; }
table.lf tfoot tr.lf-res .lf-grid .lgi .v { font-size: 16px; }
table.lf tfoot tr.lf-res .lf-grid .lgi:first-child .v { color: var(--pri); }
@media (max-width: 899px) {
  .ls-bar .tiny { margin-left: 0; width: 100%; }
  .lf-grid { gap: 6px 16px; }
  .lf-grid .lgi .v { font-size: 14px; }
  /* 窄屏：名称格内纵排「名称 + 类型下拉」，保证一屏内能改负荷类型 */
  table.lf { min-width: 700px; }
  table.lf td.ls-nm { display: flex; flex-direction: column; gap: 2px; min-width: 168px; }
  table.lf td.ls-nm select.cell { font-size: 11px; padding: 2px 4px; }
  table.lf td.ls-nm input.cell { border-bottom-color: #e2eef7; }
  /* 窄屏：汇总与结果区移到表格外（紧贴表格），避免被横向表格截断 */
  .lf-mfoot { margin-top: 9px; border-top: 2px solid #cfe8fa; }
  .lf-mrow {
    padding: 7px 0; border-bottom: 1px solid #eef5fa;
    display: flex; flex-direction: column; gap: 5px;
  }
  .lf-mrow .lfr-t {
    font-size: 11.5px; font-weight: 700; color: var(--pri-2);
  }
  .lf-m-sum { background: linear-gradient(180deg, #f4fafd, #eaf5fc); }
  .lf-m-syn { background: linear-gradient(180deg, #f4fafd, #eaf5fc); }
  .lf-m-para { background: #fffdf3; }
  .lf-m-para .lfr-t { color: #b0730f; }
  .lf-m-res { background: linear-gradient(180deg, #eef8fe, #ddeefb); }
  .lf-mfoot .lf-grid .lgi .v { font-size: 15px; }
}

/* ---------- 负荷与变压器 · 整机选型工作台（手绘稿版） ---------- */

/* 操作条（一键计算入口） */
.lf-actionbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 11px; margin-bottom: 10px;
  background: linear-gradient(180deg, #f2f9fe, #e6f3fb);
  border: 1px solid #cfe4f5; border-radius: 8px;
}
.lf-actionbar .btn.lg { padding: 9px 20px; font-size: 14px; font-weight: 700; border-radius: 8px; }
.lf-actionbar .wsel.inline { flex-direction: row; align-items: center; gap: 6px; margin-left: 4px; }
.lf-actionbar .wsel.inline > label { margin: 0; white-space: nowrap; }
.lf-actionbar .wsel.inline select.input { width: auto; min-width: 190px; }

/* 结论卡（最终结果：变压器容量）——滚动时常驻吸顶，任何位置都看得到结果 */
.lf-verdict {
  position: sticky; top: 0; z-index: 6;
  border: 2px solid var(--pri-2); border-radius: 9px; overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #eef8fe 100%);
  margin-bottom: 11px; box-shadow: 0 2px 8px rgba(31,90,130,.08);
}
.lf-verdict.flash { animation: lfFlash .9s ease; }
@keyframes lfFlash {
  0% { box-shadow: 0 0 0 0 rgba(42,127,189,.55); }
  100% { box-shadow: 0 0 0 14px rgba(42,127,189,0); }
}
.lf-verdict .lv-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 12px; background: var(--pri-2); color: #fff;
}
.lf-verdict .lv-tag { font-size: 13px; font-weight: 800; letter-spacing: .4px; }
.lf-verdict .lv-sub { font-size: 11px; opacity: .88; }
.lf-verdict .lv-main { display: flex; gap: 16px; padding: 12px 14px; flex-wrap: wrap; }
.lf-verdict .lv-cap {
  flex: 0 0 auto; min-width: 232px; max-width: 320px; padding: 8px 16px 10px;
  background: #fff; border: 1px solid #bcdcf3; border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
}
.lf-verdict .lv-cap .k { font-size: 11px; color: var(--ink-3); font-weight: 700; letter-spacing: .3px; }
.lf-verdict .lv-cap .v {
  font-size: 34px; font-weight: 800; color: #c0392b; line-height: 1.12;
  font-variant-numeric: tabular-nums; letter-spacing: -.5px;
}
.lf-verdict .lv-cap .v .u { font-size: 15px; font-weight: 700; margin-left: 4px; color: var(--ink-2); }
.lf-verdict .lv-cap .s { font-size: 10.5px; color: var(--ink-3); line-height: 1.5; margin-top: 3px; }
.lf-verdict .lv-side {
  flex: 1 1 380px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 14px; align-content: center;
}
.lf-verdict .lvi { min-width: 0; }
.lf-verdict .lvi .k { font-size: 10.5px; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.lf-verdict .lvi .v {
  font-size: 16px; font-weight: 800; color: var(--pri-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.lf-verdict .lvi .v .u { font-size: 10.5px; font-weight: 400; color: var(--ink-3); margin-left: 2px; }
.lf-verdict .lvi .v.ok { color: #1a8a52; }
.lf-verdict .lvi .v.bad { color: #c0392b; }

/* 吸顶收缩态：滚离顶部后压成一条，始终露出最终容量，不遮挡下方录入 */
.lf-verdict.stuck { box-shadow: 0 5px 16px rgba(27,108,164,.28); }
.lf-verdict.stuck .lv-sub { display: none; }
.lf-verdict.stuck .lv-head { padding: 4px 12px; }
.lf-verdict.stuck .lv-tag { font-size: 12px; }
.lf-verdict.stuck .lv-main { padding: 5px 12px; gap: 12px; align-items: center; }
.lf-verdict.stuck .lv-cap { min-width: 188px; padding: 2px 12px; display: flex; align-items: center; gap: 10px; }
.lf-verdict.stuck .lv-cap .v { font-size: 23px; }
.lf-verdict.stuck .lv-cap .s { display: none; }
.lf-verdict.stuck .lv-side { gap: 2px 14px; }
.lf-verdict.stuck .lvi .k { display: none; }
.lf-verdict.stuck .lvi .v { font-size: 13px; }

/* 手机端：结论卡默认只留一行摘要，点击展开详情（避免吸顶卡片遮住录入表单） */
.lv-brief { display: none; }
@media (max-width: 760px) {
  .lf-verdict .lv-head, .lf-verdict .lv-main { display: none; }
  .lf-verdict .lv-brief {
    display: flex; align-items: center; gap: 8px; padding: 7px 10px;
    background: var(--pri-2); color: #fff; cursor: pointer;
    -webkit-user-select: none; user-select: none;
  }
  .lv-b-tag { font-size: 11.5px; font-weight: 800; white-space: nowrap; }
  .lv-b-main { font-size: 14px; font-weight: 800; margin-left: auto; }
  .lv-b-act { font-size: 10.5px; padding: 1px 6px; border: 1px solid rgba(255,255,255,.6); border-radius: 9px; white-space: nowrap; }
  .lf-verdict.expanded .lv-head { display: flex; }
  .lf-verdict.expanded .lv-main { display: flex; }
  .lf-verdict.expanded .lv-brief { background: var(--pri); }
  .lf-verdict.expanded .lv-sub { display: none; }
  .lf-verdict.expanded .lv-main { padding: 8px 10px; gap: 10px; }
  .lf-verdict.expanded .lv-cap { min-width: 0; max-width: 100%; }
  .lf-verdict.expanded .lv-cap .s { display: none; }
}

/* 结论卡全局默认只留一行摘要（桌面/预览/APP 一致），点击摘要行展开详情；
   避免宽度 > 760px 时卡片完全展开遮挡数据。 */
.lf-verdict .lv-head, .lf-verdict .lv-main { display: none; }
.lf-verdict .lv-brief {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--pri-2); color: #fff; cursor: pointer;
  -webkit-user-select: none; user-select: none;
}
.lv-b-tag { font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.lv-b-main { font-size: 14px; font-weight: 800; margin-left: auto; }
.lv-b-act { font-size: 10.5px; padding: 1px 6px; border: 1px solid rgba(255,255,255,.6); border-radius: 9px; white-space: nowrap; }
.lf-verdict.expanded .lv-head, .lf-verdict.expanded .lv-main { display: flex; }
.lf-verdict.expanded .lv-brief { background: var(--pri); }
.lf-verdict.expanded .lv-sub { display: none; }
.lf-verdict.expanded .lv-main { padding: 8px 10px; gap: 10px; }
.lf-verdict.expanded .lv-cap { min-width: 0; max-width: 100%; }
.lf-verdict.expanded .lv-cap .s { display: none; }

/* 步骤序号徽标 */
.lf-stepno {
  display: inline-block; min-width: 19px; height: 19px; line-height: 19px;
  text-align: center; border-radius: 50%; background: var(--pri); color: #fff;
  font-size: 11.5px; font-weight: 800; margin-right: 5px; vertical-align: 1px;
}

@media (max-width: 899px) {
  .lf-actionbar { gap: 6px; padding: 8px 9px; }
  .lf-actionbar .btn.lg { padding: 8px 14px; font-size: 13px; }
  .lf-actionbar .wsel.inline select.input { min-width: 140px; }
  .lf-verdict .lv-main { padding: 10px 11px; gap: 10px; }
  .lf-verdict .lv-cap { min-width: 0; flex: 1 1 100%; padding: 8px 12px 10px; }
  .lf-verdict .lv-cap .v { font-size: 30px; }
  .lf-verdict .lv-side { grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 1 1 100%; }
  .lf-verdict .lvi .v { font-size: 14px; }
}
/* 通用 cell（面板①的 Pe 框、工具条里的数值框不在 table.lf 内） */
.cell {
  border: 1px solid var(--line); background: #fff; border-radius: 5px;
  padding: 3px 6px; font: inherit; font-size: 11.5px; font-family: var(--font);
  color: var(--ink); outline: none;
}
.cell:focus { border-color: var(--pri-3); box-shadow: 0 0 0 2px rgba(42,127,189,.12); }
.cell.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 工具条内联下拉 */
.ls-bar .wsel.inline { flex-direction: row; align-items: center; gap: 6px; margin-left: 6px; }
.ls-bar .wsel.inline > label { margin: 0; white-space: nowrap; }
.ls-bar .wsel.inline select.input { width: auto; min-width: 230px; }
.ls-bar .wsel.inline .cell { width: 92px; }

/* 公式卡 */
.lf-formula-card {
  display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center;
  padding: 8px 11px; margin-bottom: 9px;
  background: linear-gradient(180deg, #f4fafd, #eaf5fc);
  border: 1px solid #cfe8fa; border-left: 3px solid var(--pri-3); border-radius: 6px;
}
.lf-formula {
  font-family: Cambria, Georgia, serif; font-size: 12.5px; font-weight: 700;
  color: var(--pri-2); white-space: nowrap;
}
.lf-formula i {
  font-style: normal; font-family: var(--font); font-size: 11px;
  color: var(--ink-3); font-weight: 600; margin-left: 5px;
}
.lf-src { margin-left: auto; font-size: 11px; color: var(--ink-3); }

/* 面板①汇总行 */
.lf-sumrow {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 22px;
  margin-top: 9px; padding-top: 9px; border-top: 2px solid #cfe8fa;
}
.lf-sumrow .lf-formula { font-size: 12px; }
.lf-sumrow .lf-grid { flex: 1 1 300px; }

/* Pe 设备容量独立框 */
.lf-pebox {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 10px; min-width: 158px;
  background: #fffdf3; border: 1px solid #f0e6c8; border-radius: 6px;
}
.lf-pebox .k { font-size: 10.5px; font-weight: 700; color: #b0730f; }
.lf-pebox .lgi { display: flex; align-items: center; gap: 4px; }
.lf-pebox .cell { width: 100%; min-width: 0; }
.lf-pebox .u { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
.lf-pebox .tiny { font-size: 10px; color: var(--ink-3); line-height: 1.4; }

/* 子分区标题条 */
.lf-sub {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 13px 0 7px; padding-top: 10px; border-top: 1px dashed #e2eef7;
}
.lf-sub-t {
  font-size: 12.5px; font-weight: 800; color: var(--pri-2);
  padding: 2px 9px; background: #eaf5fc; border: 1px solid #cfe8fa; border-radius: 5px;
}
.lf-sub .tiny { margin-left: auto; }

/* 注意条 */
.lf-warn {
  margin-top: 9px; padding: 7px 11px;
  background: #fff8e8; border: 1px solid #f3dcae; border-left: 3px solid #e8a33d;
  border-radius: 6px; font-size: 11.5px; color: #8a5c07; line-height: 1.75;
}

/* 面板结果区（独立于表格） */
.lf-grid.lf-g-sum {
  padding: 8px 11px; border-radius: 6px;
  background: linear-gradient(180deg, #f4fafd, #eaf5fc); border: 1px solid #cfe8fa;
}
.lf-grid.lf-g-para {
  padding: 8px 11px; margin-top: 9px; border-radius: 6px;
  background: #fffdf3; border: 1px solid #f0e6c8;
}
.lf-grid.lf-g-res {
  padding: 9px 11px; border-radius: 6px;
  background: linear-gradient(180deg, #eef8fe, #ddeefb); border: 1px solid #cfe8fa;
}
.lf-grid.lf-g-res .lgi .v { font-size: 16px; }
.lf-grid.lf-g-res .lgi:first-child .v { color: var(--pri); }

/* 三张表的最小宽度与列宽（class 化，便于窄屏覆盖） */
table.lf.t1 { min-width: 820px; }
table.lf.t2 { min-width: 850px; }
table.lf.t3 { min-width: 780px; }   /* 定宽布局后 12 列在 780px 内即可排开，不必再逼出横向滚动 */
table.lf th.c-idx, table.lf td.c-idx { width: 30px; }
table.lf th.c-nm, table.lf td.c-nm { min-width: 150px; }
table.lf th.c-ty, table.lf td.c-ty { width: 92px; }
table.lf th.c-pn, table.lf td.c-pn { width: 78px; }
table.lf th.c-n, table.lf td.c-n { width: 58px; }
table.lf th.c-duty, table.lf td.c-duty { width: 104px; }
table.lf th.c-eps, table.lf td.c-eps { width: 68px; }
table.lf th.c-eb, table.lf td.c-eb { width: 68px; }
table.lf th.c-src, table.lf td.c-src { width: 108px; font-size: 10.5px; color: var(--ink-3); }
table.lf th.c-kx, table.lf td.c-kx { width: 60px; }
table.lf th.c-jf, table.lf td.c-jf { width: 66px; }
table.lf th.c-cos, table.lf td.c-cos { width: 62px; }
table.lf th.c-pe, table.lf td.c-pe { width: 82px; }
table.lf th.c-p30, table.lf td.c-p30 { width: 92px; }
table.lf th.c-q30, table.lf td.c-q30 { width: 92px; }
table.lf th.c-s30, table.lf td.c-s30 { width: 96px; }
table.lf th.c-i30, table.lf td.c-i30 { width: 82px; }
table.lf th.c-del, table.lf td.c-del { width: 34px; }
table.lf th.c-act, table.lf td.c-act { width: 78px; white-space: nowrap; }

@media (max-width: 899px) {
  .lf-formula-card { gap: 4px 12px; padding: 7px 9px; }
  .lf-formula { font-size: 11.5px; white-space: normal; }
  .lf-src { margin-left: 0; width: 100%; }
  .ls-bar .wsel.inline { margin-left: 0; }
  .ls-bar .wsel.inline select.input { min-width: 180px; }
  .lf-sumrow { gap: 8px 14px; }
  .lf-pebox { min-width: 140px; }
  .lf-grid.lf-g-res .lgi .v { font-size: 15px; }
  /* 窄屏：缩窄列宽 + 类型下拉并入名称格（保证一屏内可改负荷类型/分项类型） */
  table.lf.t1 { min-width: 540px; }
  table.lf.t2 { min-width: 680px; }
  table.lf.t3 { min-width: 700px; }
  table.lf th.c-nm, table.lf td.c-nm { min-width: 172px; }
  table.lf th.c-pn, table.lf td.c-pn { width: 82px; }
  table.lf th.c-n, table.lf td.c-n { width: 48px; }
  table.lf th.c-duty, table.lf td.c-duty { width: 92px; }
  table.lf th.c-eps, table.lf td.c-eps { width: 66px; }
  table.lf th.c-eb, table.lf td.c-eb { width: 66px; }
  table.lf th.c-kx, table.lf td.c-kx { width: 48px; }
  table.lf th.c-jf, table.lf td.c-jf { width: 56px; }
  table.lf th.c-cos, table.lf td.c-cos { width: 54px; }
  table.lf th.c-pe, table.lf td.c-pe { width: 70px; }
  table.lf th.c-p30, table.lf td.c-p30 { width: 80px; }
  table.lf th.c-q30, table.lf td.c-q30 { width: 82px; }
  table.lf th.c-s30, table.lf td.c-s30 { width: 84px; }
  table.lf th.c-i30, table.lf td.c-i30 { width: 72px; }
  table.lf td.ls-nm { display: flex; flex-direction: column; gap: 2px; min-width: 172px; }
  table.lf td.ls-nm select.cell { font-size: 11px; padding: 2px 4px; }
  table.lf td.ls-nm input.cell { border-bottom-color: #e2eef7; }
}

/* ---------- 桌面端 ---------- */
@media (min-width: 900px) {
  #app { flex-direction: row; }
  #topbar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 158px;
    flex-direction: column; align-items: stretch;
    padding: 14px 8px; height: auto;
    background: linear-gradient(180deg, #ffffff 0%, #f2f9fe 100%);
    border-right: 1px solid var(--line);
    box-shadow: 1px 0 10px rgba(31,90,130,.05);
  }
  #topbar .t-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; padding: 0 4px; }
  #topbar .t-title { font-size: 14.5px; color: var(--pri-2); }
  #topbar .t-sub { display: block; font-size: 10.5px; color: var(--ink-3); margin: 1px 0 0; }
  #topbar .spacer { display: none; }
  #topbar .t-act { display: none; }
  #topbar .sidenav { display: flex; flex-direction: column; }
  #topbar .sidenav a {
    color: var(--ink); text-decoration: none; font-size: 13.5px;
    padding: 11px 12px; cursor: pointer; border-bottom: 1px solid var(--line);
    display: flex; align-items: center; gap: 9px; transition: all .15s;
  }
  #topbar .sidenav a .ic { width: 19px; display: flex; align-items: center; justify-content: center; color: var(--pri-3); }
  #topbar .sidenav a .ic svg { width: 18px; height: 18px; }
  #topbar .sidenav a.on .ic svg { stroke-width: 2.1; }
  #topbar .sidenav a:hover { background: var(--pri-soft); color: var(--pri-2); }
  #topbar .sidenav a.on {
    background: linear-gradient(90deg, #dceefb, #eef8fe);
    color: var(--pri-2); font-weight: 700;
    border-bottom-color: #cfe8fa;
    box-shadow: inset 3px 0 0 var(--pri);
  }
  #topbar .side-foot {
    margin-top: auto; font-size: 10.5px; color: var(--ink-3);
    padding: 10px 6px 0; line-height: 1.6; border-top: 1px solid var(--line);
  }
  #view { margin-left: 158px; padding: 16px 18px 26px; }
  /* 工作台内容紧贴左侧导航靠左排布，不再居中留大片空白 */
  .wb { max-width: 1040px; margin: 0; }
  #tabbar { display: none; }
  .field > label { flex: 0 0 168px; }
  .field .input, .field select.input { flex: 0 1 340px; max-width: 340px; }
  .field { margin-bottom: 7px; }
}
@media (max-width: 899px) {
  #topbar .t-brand { display: flex; align-items: center; gap: 7px; }
  #topbar .sidenav, #topbar .side-foot { display: none; }
}
@media (min-width: 1280px) {
  body { font-size: 14px; }
  .card { padding: 14px 16px; }
}

/* 桌面端双列列表 */
@media (min-width: 1020px) {
  .list.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: start; }
  .list.g2 .lit { margin: 0; }
}

/* 桌面端：搜索框限宽，避免整行拉伸显得松散 */
@media (min-width: 900px) {
  .toolbar > .searchgroup { flex: 0 1 420px; }
  .toolbar > select.input { flex: 0 0 auto; min-width: 150px; }
  /* 含多个筛选下拉时放宽搜索组（由 JS 加 .wide 标记） */
  .toolbar > .searchgroup.wide { flex: 1 1 640px; max-width: 720px; }
}

/* 滚动条 */
#view::-webkit-scrollbar { width: 8px; }
#view::-webkit-scrollbar-track { background: transparent; }
#view::-webkit-scrollbar-thumb { background: #c3ddef; border-radius: 4px; }
#view::-webkit-scrollbar-thumb:hover { background: #a9cde6; }

/* 打印 */
@media print {
  #topbar, #tabbar, .btn { display: none !important; }
  #view { margin: 0; padding: 0; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}

/* ---------- ⑥ 参数取值依据面板 ---------- */
.lf-rules {
  display: grid; gap: 6px; margin: 4px 0 10px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}
.lfr-item {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; background: #fbfdff;
}
.lfr-k { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 3px; }
.lfr-v { font-size: 11.5px; color: var(--ink-2); line-height: 1.55; }
.lfr-s { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.45; }
.lfr-t { font-size: 10.5px; color: #b07d18; margin-top: 2px; line-height: 1.45; }
/* ---------- ⑥ 依据面板专用表格：长文本列给足宽度，杜绝竖排 ---------- */
table.lf.t5 { min-width: 860px; table-layout: auto; }
table.lf.t4 { min-width: 720px; table-layout: auto; }
table.lf.t5 td.c-nm, table.lf.t4 td.c-nm { white-space: normal; min-width: 150px; }
/* 判定依据列：足够宽 + 正常换行 + 正常行高，不再一字一行 */
table.lf.t5 th.c-src, table.lf.t5 td.c-src {
  width: auto; min-width: 340px; max-width: 520px;
  white-space: normal; word-break: break-all; line-height: 1.7;
  color: var(--ink-2); font-size: 11px; vertical-align: top; padding: 7px 9px;
}
table.lf.t5 td.c-duty { font-size: 11px; color: var(--ink-2); white-space: nowrap; }
table.lf.t5 th.c-eps, table.lf.t5 td.c-eps,
table.lf.t5 th.c-eb, table.lf.t5 td.c-eb,
table.lf.t5 th.c-kx, table.lf.t5 td.c-kx { width: 72px; }
/* 手册表出处列 */
table.lf.t4 th.c-src, table.lf.t4 td.c-src {
  width: auto; min-width: 130px; white-space: nowrap; font-size: 10.5px; color: var(--ink-3);
}
table.lf.t4 .c-kx, table.lf.t4 .c-cos { text-align: right; font-variant-numeric: tabular-nums; }
table.lf.t4 tr.alt td { background: #f7fafc; }
/* 依据表中「应用」按钮：点了直接插入设备到①表 */
.apply-row {
  border: 1px solid var(--pri-3); background: var(--pri-soft); color: var(--pri-2);
  border-radius: 5px; padding: 2px 9px; font-size: 10.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}
.apply-row:hover { background: var(--pri); color: #fff; }

/* ---------- ①表设备名称下拉（必选，不可自由填） ---------- */
/* 建筑机电四专业录入表 */
table.lf.mep-t1 { min-width: 620px; }
table.lf.mep-t1 th.c-num, table.lf.mep-t1 td.c-num { width: 104px; }
table.lf.mep-t1 td.c-num input.cell { width: 88px; }
table.lf th.c-del, table.lf td.c-del { width: 34px; text-align: center; }
table.lf.mep-t1 input.cell.num { text-align: right; }

table.lf td.c-nm select.devsel {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 5px;
  padding: 3px 5px; font: inherit; font-size: 11.5px; font-family: var(--font);
  color: var(--pri-2); font-weight: 600; cursor: pointer; outline: none;
}
table.lf td.c-nm select.devsel:focus { border-color: var(--pri-3); box-shadow: 0 0 0 2px rgba(42,127,189,.12); }
/* ①设备表末行的「＋从手册选设备」下拉 */
.panel-devpick { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; }
.panel-devpick label { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.panel-devpick select {
  border: 1px solid var(--pri-3); background: var(--pri-soft); color: var(--pri-2);
  border-radius: 6px; padding: 3px 8px; font: inherit; font-size: 11.5px;
  font-family: var(--font); font-weight: 700; cursor: pointer; max-width: 230px;
}
/* ①设备表末行：增删操作并入表格（tfoot 不计入设备数据行） */
table.lf tfoot .ls-addrow td {
  background: var(--sky-50); border-top: 1px solid var(--line);
  padding: 6px 8px; text-align: left;
}
table.lf tfoot .ls-addrow td .panel-devpick { margin-left: 0; }
table.lf tfoot .ls-addrow td .tiny { margin-left: 8px; color: var(--ink-3); }

/* ①区说明 / 校核：默认收起，状态在标题条常驻 */
.ls-help-fold { margin-top: 9px; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: #fff; }
.ls-help-h {
  display: flex; align-items: center; gap: 8px; padding: 5px 10px; cursor: pointer;
  -webkit-user-select: none; user-select: none; background: var(--sky-50);
  font-size: 11.5px; color: var(--ink-2); font-weight: 600;
}
.ls-help-h:hover { background: #eaf5fc; }
.hf-arrow { display: inline-block; color: var(--pri-2); transition: transform .15s; }
.ls-help-fold.open .hf-arrow { transform: rotate(90deg); }
.hf-st { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 9px; background: #eef3f7; color: var(--ink-3); }
.hf-st.ok { background: #e7f6ea; color: #267a3c; }
.hf-st.bad { background: #fff0e5; color: #b25a12; }
.hf-act { font-size: 10.5px; color: var(--pri-2); }
.ls-help-b { display: none; padding: 8px 10px 10px; }
.ls-help-fold.open .ls-help-b { display: block; }
.ls-help-b .lf-warn { margin-top: 8px; }

/* ---------- ②区负荷计算方法切换 ---------- */
.method-tabs { display: inline-flex; gap: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.method-tabs button {
  border: 0; border-right: 1px solid var(--line); background: #fff; color: var(--ink-2);
  padding: 4px 12px; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.method-tabs button:last-child { border-right: 0; }
.method-tabs button:hover { background: var(--sky-50); }
.method-tabs button.on { background: var(--pri); color: #fff; }
.method-note { font-size: 11px; color: var(--warn); background: var(--warn-bg); border: 1px solid #e7c489;
  border-radius: 6px; padding: 5px 10px; margin-bottom: 8px; line-height: 1.6; }

/* ---------- 给水页内子专业页签（生活 / 生产 / 消防） ---------- */
.mep-subtabs { display: flex; gap: 8px; margin: 0 0 10px; flex-wrap: wrap; }
/* 子系统多（如弱电 8 项）：压缩卡片宽度，两行内排完 */
.mep-subtabs.many .mep-tabbtn { min-width: 118px; padding: 6px 10px; }
.mep-subtabs.many .mep-tabbtn b { font-size: 12.5px; }
.mep-subtabs.many .mep-tabbtn span { font-size: 10px; }
.mep-tabbtn {
  flex: 1 1 0; min-width: 160px; text-align: left; border: 1px solid var(--line);
  background: #fff; border-radius: 8px; padding: 7px 12px; cursor: pointer;
  font-family: var(--font); color: var(--ink-2);
}
.mep-tabbtn b { display: block; font-size: 13px; color: var(--pri-2); }
.mep-tabbtn span { display: block; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.mep-tabbtn:hover { background: var(--sky-50); }
.mep-tabbtn.on {
  border-color: var(--pri); background: var(--pri-soft);
  box-shadow: 0 0 0 2px rgba(42,127,189,.12);
}
.mep-tabbtn.on b { color: var(--pri); }
@media (max-width: 640px) { .mep-tabbtn { min-width: 100%; } }

/* ==================================================================
   v2 · 水电安装专业查询系统
   1) 先选专业（专业选择首页 + 作用域侧栏）
   2) 侧栏宽度可拖动、内容区自适应窗口
   3) 专业材料库 / 设备库
   ================================================================== */

/* ---------- 侧栏宽度可调 ---------- */
:root { --side-w: 186px; }
#sidegrip { display: none; }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing * { cursor: col-resize !important; }
@media (min-width: 900px) {
  #topbar { width: var(--side-w, 186px); }
  #view { margin-left: var(--side-w, 186px); }
  #sidegrip {
    display: block; position: absolute; top: 0; right: -3px; bottom: 0;
    width: 7px; cursor: col-resize; z-index: 30;
  }
  #sidegrip::after {
    content: ''; position: absolute; top: 50%; right: 3px;
    width: 2px; height: 34px; margin-top: -17px; border-radius: 2px;
    background: #cfe4f3;
  }
  #sidegrip:hover::after { background: var(--pri-3); }
  /* 内容区跟随窗口自适应，不再固定窄条 */
  .wb { max-width: none; margin: 0; }
}

/* ---------- 品牌两行名 ---------- */
#topbar .t-bname { min-width: 0; }
#topbar .logo svg { width: 19px; height: 19px; display: block; }
#topbar .t-title2 { font-size: 11px; font-weight: 700; color: var(--pri-2); letter-spacing: .3px; }
@media (min-width: 900px) {
  #topbar .t-brand { align-items: flex-start; }
  #topbar .t-title { font-size: 13.5px; line-height: 1.25; letter-spacing: .2px; }
  #topbar .t-title2 { font-size: 11.5px; margin-top: 1px; }
  #topbar .side-tip { margin-top: 6px; color: #a8c1d2; }
}

/* ---------- 侧栏专业分组 ---------- */
#topbar .sidenav .nav-scope {
  display: flex; align-items: center; gap: 6px;
  margin: 10px 0 2px; padding: 6px 12px 2px;
  font-size: 10.5px; color: var(--ink-3); letter-spacing: .6px;
}
#topbar .sidenav .nav-scope span { font-weight: 700; color: var(--ink-2); }
#topbar .sidenav .nav-scope em { margin-left: auto; font-style: normal; }

/* ---------- 专业选择首页 ---------- */
.home-hero {
  background: linear-gradient(120deg, #ffffff 0%, #eaf6fe 100%);
  border: 1px solid var(--line); border-radius: 14px;
  padding: 15px 17px; margin-bottom: 12px; box-shadow: var(--sh);
}
.home-hero h1 {
  margin: 0 0 3px; font-size: 19px; letter-spacing: .6px; color: var(--pri-2);
}
.home-hero p { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.home-stats { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 11px; }
.home-stat {
  flex: 1 1 118px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 7px 11px;
}
.home-stat b { display: block; font-size: 18px; color: var(--pri); line-height: 1.2; }
.home-stat span { font-size: 11px; color: var(--ink-3); }

.scope-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .scope-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .scope-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.scope-card {
  position: relative; display: block; width: 100%; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 14px 12px; cursor: pointer; font-family: var(--font);
  box-shadow: var(--sh); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.scope-card:hover { transform: translateY(-2px); border-color: var(--pri-3); box-shadow: 0 7px 20px rgba(31, 90, 130, .13); }
.scope-card:active { transform: translateY(0); }
.scope-card .sc-ic {
  width: 40px; height: 40px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #e8f5fe, #d3ebfb); color: var(--pri);
}
.scope-card .sc-ic svg { width: 22px; height: 22px; }
.scope-card .sc-code {
  position: absolute; top: 13px; right: 14px;
  font-size: 10px; letter-spacing: 1.4px; color: var(--ink-3);
}
.scope-card h3 { margin: 9px 0 2px; font-size: 15.5px; color: var(--ink); }
.scope-card p { margin: 0; font-size: 11.5px; color: var(--ink-2); line-height: 1.55; }
.scope-card .sc-foot {
  margin-top: 9px; display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--pri);
}
.scope-card .sc-foot i { margin-left: auto; font-style: normal; color: var(--ink-3); }
.home-note { margin-top: 12px; }

/* ---------- 材料 / 设备库 ---------- */
.lib-nm b { display: block; font-weight: 700; color: var(--ink); }
.lib-nm i { display: block; font-style: normal; font-size: 10.5px; color: var(--ink-3); margin-top: 1px; }
table.lib td.c-spec { white-space: nowrap; }
table.lib td.c-para { color: var(--ink-2); }
table.lib td.c-use { color: var(--ink-2); }
table.lib td.c-std { white-space: nowrap; font-size: 11px; color: var(--ink-3); }
table.lib tbody tr:hover { background: #f7fcff; }
.lib-tip {
  border-left: 3px solid var(--pri-3); background: #f4fbff;
  border-radius: 0 8px 8px 0; padding: 7px 11px;
  font-size: 11.5px; color: var(--ink-2); line-height: 1.65;
}

/* ---------- 底部导航：专业内工具较多时可横滑 ---------- */
#tabbar { overflow-x: auto; scrollbar-width: none; }
#tabbar::-webkit-scrollbar { display: none; }
#tabbar a { min-width: 58px; }

/* 面板头部的跳转链接（材料库 → 计算选型） */
.wb-panel-h .more {
  margin-left: 10px; font-size: 11.5px; font-weight: 400;
  color: var(--ink-3); cursor: pointer; white-space: nowrap;
}
.wb-panel-h .more:hover { color: var(--pri); }
.wb-panel-h .rt + .more { margin-left: auto; }

/* 材料 / 设备库列宽 */
table.lib th.c-cat, table.lib td.c-cat { width: 78px; white-space: nowrap; color: var(--ink-3); font-size: 11.5px; }
table.lib th.c-nm, table.lib td.c-nm { min-width: 190px; }
table.lib th.c-spec, table.lib td.c-spec { width: 130px; }
table.lib th.c-para, table.lib td.c-para { min-width: 210px; }
table.lib th.c-use, table.lib td.c-use { min-width: 130px; }
table.lib th.c-std, table.lib td.c-std { width: 150px; }

/* ============================================================
   v2.1 表格网格化：等宽分配 + 竖分隔线 + 双行表头 + 数值居中
   问题来源：表格原为自动列宽，窗口一变宽，多出来的空间全部灌进
   「设备名称」一列（1920 宽下实测 1038px），其余列固定在 68px 不动，
   于是"前面空、后面挤"；表头「暂载率 εN %」还被折成三行。
   ============================================================ */

/* 表头：统一居中；单位另起一行小字，禁止整格折行 */
table.tbl th { text-align: center; vertical-align: middle; }
table.tbl th .th-n { display: block; white-space: nowrap; }
table.tbl th .th-u,
table.tbl th .tiny {
  display: block; font-size: 9.5px; font-weight: 500; color: var(--ink-3);
  line-height: 1.35; letter-spacing: 0; white-space: nowrap;
}

/* 竖分隔线：把整张表织成网格（首列不画左边线，末列不画右边线） */
table.tbl th + th,
table.tbl td + td { border-left: 1px solid #d3e5f5; }
table.tbl thead th + th { border-left-color: #c5dcf0; }
table.tbl tbody tr:hover td + td { border-left-color: #d3e7f7; }

/* 数值列一律居中（原先左表头 + 右数字，视线不落在一列上） */
table.lf td.num,
table.lf td.cal { text-align: center; }
table.lf input.cell.num,
table.lf.mep-t1 input.cell.num { text-align: center; }

/* 桌面端：固定列宽 + 按比例分配剩余空间，防止单列吞掉全部空白 */
@media (min-width: 900px) {
  table.lf.t1, table.lf.t2, table.lf.t3, table.lf.mep-t1 { table-layout: fixed; }

  /* ① 设备功率总计（10 列） */
  table.lf.t1 th.c-idx, table.lf.t1 td.c-idx { width: 34px; }
  table.lf.t1 th.c-nm,  table.lf.t1 td.c-nm  { width: 26%; min-width: 0; }
  table.lf.t1 th.c-ty,  table.lf.t1 td.c-ty  { width: 11.5%; }
  table.lf.t1 th.c-pn,  table.lf.t1 td.c-pn  { width: 10.5%; }
  table.lf.t1 th.c-n,   table.lf.t1 td.c-n   { width: 6.4%; }
  table.lf.t1 th.c-duty, table.lf.t1 td.c-duty { width: 13.5%; }
  table.lf.t1 th.c-eps, table.lf.t1 td.c-eps { width: 8.6%; }
  table.lf.t1 th.c-eb,  table.lf.t1 td.c-eb  { width: 8.6%; }
  table.lf.t1 th.c-pe,  table.lf.t1 td.c-pe  { width: 8.8%; min-width: 0; }
  table.lf.t1 th.c-del, table.lf.t1 td.c-del { width: 34px; }

  /* ② 计算负荷（9 列） */
  table.lf.t2 th.c-idx, table.lf.t2 td.c-idx { width: 34px; }
  table.lf.t2 th.c-nm,  table.lf.t2 td.c-nm  { width: 28.5%; min-width: 0; }
  table.lf.t2 th.c-pe,  table.lf.t2 td.c-pe  { width: 9.5%; }
  table.lf.t2 th.c-kx,  table.lf.t2 td.c-kx  { width: 8.6%; }
  table.lf.t2 th.c-cos, table.lf.t2 td.c-cos { width: 8.6%; }
  table.lf.t2 th.c-p30, table.lf.t2 td.c-p30 { width: 10.8%; }
  table.lf.t2 th.c-q30, table.lf.t2 td.c-q30 { width: 10.8%; }
  table.lf.t2 th.c-s30, table.lf.t2 td.c-s30 { width: 11.4%; }
  table.lf.t2 th.c-i30, table.lf.t2 td.c-i30 { width: 9.1%; }

  /* ③ 特殊负荷分项（12 列） */
  table.lf.t3 th.c-idx, table.lf.t3 td.c-idx { width: 34px; }
  table.lf.t3 th.c-ty,  table.lf.t3 td.c-ty  { width: 12.5%; }
  table.lf.t3 th.c-nm,  table.lf.t3 td.c-nm  { width: 14.5%; min-width: 0; }
  table.lf.t3 th.c-pe,  table.lf.t3 td.c-pe  { width: 8.5%; }
  table.lf.t3 th.c-kx,  table.lf.t3 td.c-kx  { width: 7%; }
  table.lf.t3 th.c-jf,  table.lf.t3 td.c-jf  { width: 8%; }
  table.lf.t3 th.c-cos, table.lf.t3 td.c-cos { width: 7%; }
  table.lf.t3 th.c-p30, table.lf.t3 td.c-p30 { width: 9.5%; }
  table.lf.t3 th.c-q30, table.lf.t3 td.c-q30 { width: 9.5%; }
  table.lf.t3 th.c-s30, table.lf.t3 td.c-s30 { width: 10%; }
  table.lf.t3 th.c-i30, table.lf.t3 td.c-i30 { width: 9%; }
  table.lf.t3 th.c-del, table.lf.t3 td.c-del { width: 32px; }

  /* 机电四专业录入表：名称定宽，数值列均分剩余（列数随专业变化） */
  table.lf.mep-t1 th.c-nm, table.lf.mep-t1 td.c-nm { width: 26%; min-width: 0; }
  table.lf.mep-t1 th.c-idx, table.lf.mep-t1 td.c-idx { width: 34px; }
  table.lf.mep-t1 th.c-del, table.lf.mep-t1 td.c-del { width: 34px; }
  table.lf.mep-t1 th.c-num, table.lf.mep-t1 td.c-num { width: auto; min-width: 0; }
  table.lf.mep-t1 td.c-num input.cell { width: 100%; }
}

/* 窄屏：保持自动列宽（竖线仍生效，列宽沿用窄屏既有的紧凑数值） */
@media (max-width: 899px) {
  table.lf th { padding: 5px 4px; }
}

/* 窄屏：面板头不再挤成一列竖排字（①设备功率总计曾出现逐字竖排） */
@media (max-width: 760px) {
  .wb-panel-h { flex-wrap: wrap; row-gap: 6px; }
  .wb-panel-h .ph-t { flex: 1 1 auto; min-width: 0; }
  .wb-panel-h .panel-devpick { flex: 1 1 100%; margin-left: 0; }
  .wb-panel-h .panel-devpick select { flex: 1 1 auto; width: auto; min-width: 0; }
  .wb-panel-h .rt { margin-left: auto; order: 8; }
}

/* 选型表单里的只读取值（如「敷设方式随芯数组合固定」） */
.wb-fixed {
  display: inline-block; font-size: 12px; color: var(--ink-2);
  background: #f4faff; border: 1px dashed #cfe4f5; border-radius: 6px;
  padding: 5px 9px; line-height: 1.4;
}

/* 元件库 6 列表：定宽比例，避免「额定参数」把表撑出横滑 */@media (min-width: 900px) {
  table.tbl.comp { table-layout: fixed; }
  table.tbl.comp th:nth-child(1) { width: 8.5%; }
  table.tbl.comp th:nth-child(2) { width: 16.5%; }
  table.tbl.comp th:nth-child(3) { width: 17%; }
  table.tbl.comp th:nth-child(4) { width: 21%; }
  table.tbl.comp th:nth-child(5) { width: 12%; }
  table.tbl.comp th:nth-child(6) { width: 25%; }
  table.tbl.comp td { vertical-align: top; }
  table.tbl.comp td:nth-child(4), table.tbl.comp td:nth-child(6) { word-break: break-word; }
}

/* ===== 硬件选配（hw）：配件选择网格与校验结果色 ===== */
.hw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 10px 16px;
}
.hw-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hw-cell > label { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.hw-cell > .input { width: 100%; }
.hw-cntwrap { display: flex; align-items: center; gap: 6px; }
.hw-cntwrap > span { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.hw-cnt { max-width: 86px; }
table.tbl td.okc { color: #17794a; }
table.tbl td.badc { color: #c0392b; font-weight: 600; }
table.tbl td.warnc { color: #a86412; }
@media (max-width: 720px) {
  .hw-grid { grid-template-columns: 1fr; }
}

/* 配件价格可编辑：单元格内数字框 + 改价标记 */
/* 特异性要压过 table.lf .cell（透明边框），否则看不出可编辑 */
table.lf input.pr-in {
  width: 92px;
  min-width: 92px;
  text-align: right;
  padding: 3px 5px;
  border: 1px solid #b9cfe2;
  border-radius: 4px;
  background: #f6fbff;
  color: var(--ink);
  font: inherit;
  font-size: 11.5px;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}
table.lf input.pr-in:hover { border-color: #7fb2e0; background: #fff; }
table.lf input.pr-in:focus { border-color: var(--pri-3); background: #fff; outline: none; box-shadow: 0 0 0 2px rgba(42,127,189,.12); }
table.lf input.pr-in.pr-mod { color: #c0392b; font-weight: 700; border-color: #e2a49c; background: #fff7f5; }
span.pr-flag { font-size: 11px; color: #c0392b; }

/* 选配：槽位约束说明 + 自动纠正提示条 */
.hw-cell > label .hw-scope {
  margin-left: 6px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--ink-3);
  white-space: nowrap;
}
.hw-fix {
  margin: 0 0 10px;
  padding: 6px 10px;
  border-left: 3px solid #e0a13a;
  border-radius: 4px;
  background: #fdf6e7;
  font-size: 12px;
  line-height: 1.6;
  color: #7a5310;
}
.hw-fix b { color: #5c3d05; }

/* 手机端长说明统一收起为一行（通用机制：桌面端不生效，仅 ≤760px） */
.nf-bar { display: none; }
@media (max-width: 760px) {
  .nf-fold {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.55;
  }
  .nf-fold.open { display: block; -webkit-line-clamp: unset; }
  .nf-bar {
    display: flex; justify-content: space-between; align-items: center;
    margin: -2px 0 8px; padding: 3px 2px;
    font-size: 11px; color: var(--ink-3);
    border-top: 1px dashed rgba(120,160,190,.28);
  }
  .nf-bar b { color: var(--pri); font-weight: 700; }
}

/* ---------- 通用「查阅/说明块」默认收起：只留标题，点击展开（所有专业） ---------- */
.rfold > .wb-panel-h { cursor: pointer; -webkit-user-select: none; user-select: none; }
.rfold > .wb-panel-h::after {
  content: '展开 ▾'; float: right; font-size: 10.5px; font-weight: 700; color: var(--pri-2);
}
.rfold.open > .wb-panel-h::after { content: '收起 ▴'; }
.rfold > .wb-panel-b { display: none; }
.rfold.open > .wb-panel-b { display: block; }
/* lf-sub 型：标题条 + 后续表格包在 .rfold-lf 里 */
.rfold-lf > .lf-sub { cursor: pointer; -webkit-user-select: none; user-select: none; }
.rfold-lf > .lf-sub::after {
  content: '展开 ▾'; margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--pri-2);
}
.rfold-lf.open > .lf-sub::after { content: '收起 ▴'; }
.rfold-lf > .tbl-wrap { display: none; }
.rfold-lf.open > .tbl-wrap { display: block; }
