/* ============================================================
   components.css —— 卡片 / 表单 / 表格 / 徽章 / 图表元件
   ============================================================ */

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  min-height: 50px;
}
.card-head h3 { font-size: 13.5px; flex-shrink: 0; }
.card-head .hint {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-head .spacer { flex: 1; min-width: 0; }
.card-head .actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.card-body { padding: 18px; }
.card-body > * + * { margin-top: 14px; }

.card h4 {
  font-size: 12.5px;
  color: var(--text-2);
  margin: 0 0 7px;
  font-weight: 600;
}
.card p { font-size: 13px; color: var(--text-2); }
.card p:last-child { margin-bottom: 0; }

/* 顶部主色条，用于强调卡 */
.card.accent-top { border-top: 2px solid var(--accent); }

/* ---------- 表单 ---------- */
.field label {
  display: block;
  font-size: 11.5px;
  color: var(--text-3);
  margin-bottom: 5px;
  font-weight: 500;
}
input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  transition: border-color .13s, box-shadow .13s, background .13s;
}
textarea { height: auto; padding: 9px 10px; line-height: 1.6; resize: vertical; }
input:hover:not(:disabled), select:hover:not(:disabled) { border-color: var(--border-3); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input:disabled, select:disabled {
  background: var(--surface-2);
  color: var(--text-2);
  cursor: not-allowed;
}
input[type="number"] { font-variant-numeric: tabular-nums; }

/* 滑块 —— 工具感：加粗轨道 + 大圆钮 */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 5px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  box-shadow: var(--shadow-2);
  cursor: grab;
  transition: transform .1s;
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.08); }
input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(.96); }
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--accent);
  box-shadow: var(--shadow-2);
  cursor: grab;
}

/* 滑块刻度 */
.ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 5px;
  padding: 0 2px;
}
.ticks span { cursor: pointer; transition: color .12s; }
.ticks span:hover { color: var(--accent); }

/* 勾选 */
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 9px;
  margin: 0 -9px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background .12s;
}
.check:hover { background: var(--surface-2); }
.check input {
  margin: 3px 0 0;
  width: 15px; height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
.check.done span { color: var(--text-3); text-decoration: line-through; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .13s, border-color .13s, transform .07s, box-shadow .13s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-3); }
.btn:active { transform: scale(.975); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(18, 148, 108, .30);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 3px 10px rgba(18, 148, 108, .34);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
.btn-sm { height: 32px; padding: 0 13px; font-size: 12.5px; border-radius: 7px; }
.btn-icon { width: 36px; padding: 0; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* 分段控件（快捷值） */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-3);
  border-radius: var(--r-sm);
}
.seg button {
  height: 27px;
  padding: 0 12px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-2);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background .13s, color .13s, box-shadow .13s;
}
.seg button:hover { color: var(--text); }
.seg button.on {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-1);
}

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  line-height: 1.6;
}
.b-ok   { background: var(--ok-soft);     color: var(--ok); }
.b-mid  { background: var(--warn-soft);   color: var(--warn); }
.b-no   { background: var(--danger-soft); color: var(--danger); }
.b-info { background: var(--info-soft);   color: var(--info); }
.b-gray { background: var(--surface-3);   color: var(--text-2); }

.t-ok   { color: var(--ok);     font-weight: 600; }
.t-mid  { color: var(--warn);   font-weight: 600; }
.t-no   { color: var(--danger); font-weight: 600; }
.t-dim  { color: var(--text-3); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table-wrap.flush { margin: 0 -18px; }
table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}
table.data th {
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: .2px;
  text-align: left;
  padding: 9px 8px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-2);
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data tbody tr.hl td { background: var(--accent-soft); }
table.data tbody tr.hl:hover td { background: var(--accent-soft); }
table.data .c { text-align: center; }
table.data .r { text-align: right; white-space: nowrap; }
table.data .muted-row td { color: var(--text-3); }
table.data input, table.data select {
  height: 30px;
  padding: 0 7px;
  font-size: 12.5px;
  border-radius: var(--r-xs);
}
.w-num   { width: 68px; }
.w-model { min-width: 104px; }
/* 128px 是「自动（利润款）」不被截断的下限，别再改小 */
.w-role  { width: 128px; }
.w-base  { min-width: 130px; }
.w-acc   { min-width: 150px; }

/* 组合装：型号列用标签代替下拉（它的成本是多款拼出来的） */
.combo-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: help;
  white-space: nowrap;
}
.combo-part { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.combo-part select { flex: 1; min-width: 0; }
.combo-part .w-num { width: 76px; flex: none; }

/* 售价是主输入，给它一点重量 */
table.data input.price-in { font-weight: 600; }
/* 关键结论列（净利率 / 判定）：整张表的答案就在这两列 */
table.data .cell-key { font-weight: 600; font-size: 13px; }
.cell-stack { display: flex; flex-direction: column; align-items: stretch; }
.cell-right { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }

.del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: var(--r-xs);
  color: var(--text-3);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.del:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- 指标卡 ---------- */
.kpi {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 14px 12px 16px;
  overflow: hidden;
}
.kpi::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--kpi-color, var(--border-2));
}
.kpi .k {
  font-size: 11.5px;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kpi .v {
  font-size: 25px;
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.25;
  letter-spacing: -.5px;
}
.kpi .u { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }

/* 大号指标（推广页用） */
.kpi.lg .v { font-size: 29px; }

/* ---------- 进度条 ---------- */
.bar {
  height: 7px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 4px;
  transition: width .28s cubic-bezier(.4, 0, .2, 1);
}

/* 流量档位条 */
.tier { display: flex; gap: 5px; }
.tier i {
  flex: 1;
  height: 11px;
  border-radius: 5px;
  transition: opacity .18s, transform .18s;
}
.tier-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 7px;
}
.tier-labels span { flex: 1; text-align: center; }
.tier-labels span:first-child { text-align: left; }
.tier-labels span:last-child { text-align: right; }
.tier-labels span.on { color: var(--text); font-weight: 600; }

/* ---------- 标签块 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px;
  padding: 4px 11px;
  border: 1px solid var(--border-2);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: all .13s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip-date { font-style: normal; font-size: 10px; color: var(--text-3); margin-left: 5px; }
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* 售价列下方的「建议价」：点一下就填进去 */
.price-hint {
  display: block; margin-top: 4px; font-size: 11.5px; font-weight: 600;
  color: var(--accent); cursor: pointer; text-decoration: underline;
  text-decoration-style: dotted; text-underline-offset: 2px;
}
.price-hint:hover { color: var(--accent-hover); }
.price-hint.low { color: var(--danger); }
.price-hint.plain { color: var(--ok); cursor: default; text-decoration: none; }
.chip:hover .chip-date { color: inherit; opacity: .75; }

/* ---------- 角色说明（回答「角色是干什么的」） ---------- */
.role-legend {
  margin-top: 14px;
  padding: 13px 15px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.role-legend .rl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.role-legend .rl-head b { font-size: 12.5px; color: var(--text); }
.role-legend .rl-head span { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.role-legend .rl-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.role-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 11px; border-radius: 20px;
  font-size: 12px; line-height: 1.5;
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2);
}
.role-chip b { font-weight: 600; }
.role-chip em {
  font-style: normal; font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding-left: 7px; border-left: 1px solid currentColor; opacity: .85;
}
.role-profit  { background: var(--ok-soft);     border-color: var(--accent-line); color: var(--ok); }
.role-main    { background: var(--info-soft);   border-color: var(--border-2);    color: var(--info); }
.role-traffic { background: var(--surface-3);   border-color: var(--border-2);    color: var(--text-2); }
.role-burn    { background: var(--warn-soft);   border-color: var(--warn-line);   color: var(--warn); }
.role-legend .rl-foot { margin-top: 10px; font-size: 11.5px; color: var(--text-3); line-height: 1.6; }

/* ---------- 运营计划：路线图 / 活动日历 ---------- */
.phase .card-head { border-top: 2px solid var(--border-2); }
.phase-accent .card-head { border-top-color: var(--accent); }
.phase-info   .card-head { border-top-color: var(--c-blue-deep); }
.phase-purple .card-head { border-top-color: var(--c-purple); }

.cal { display: flex; flex-direction: column; gap: 6px; }
.cal-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
}
.cal-row.next { border-color: var(--accent-line); background: var(--accent-soft); }
.cal-date { flex-shrink: 0; width: 62px; text-align: center; line-height: 1.15; color: var(--text-2); }
.cal-date b { display: block; font-size: 19px; color: var(--text); }
.cal-date span { font-size: 10.5px; }
.cal-main { flex: 1; min-width: 0; }
.cal-name { display: flex; align-items: center; gap: 8px; }
.cal-name b { font-size: 13.5px; }
.cal-tier {
  font-style: normal;
  font-size: 10.5px;
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--surface-3);
  color: var(--text-2);
  white-space: nowrap;
}
.cal-row.next .cal-tier { background: var(--accent); color: #fff; }
.cal-note { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.cal-days { flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--text-2); text-align: right; }
@media (max-width: 620px) {
  .cal-note { display: none; }
  .cal-date { width: 52px; }
  .cal-days { font-size: 11.5px; }
}

/* ---------- 提示条 ---------- */
.note {
  display: flex;
  gap: 10px;
  border-radius: var(--r);
  padding: 12px 15px;
  font-size: 12.8px;
  line-height: 1.65;
}
.note b { font-weight: 600; }
/* 结论条：整页最该被看见的那句话 */
.note-lg { font-size: 13.5px; padding: 14px 16px; line-height: 1.7; }
.note-lg b { font-weight: 700; }
.note-lg .mark { width: 20px; height: 20px; font-size: 12px; }
.note-warn   { background: var(--warn-soft);   border: 1px solid var(--warn-line);   color: var(--warn);   --mark-bg: var(--warn); }
.note-danger { background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger); --mark-bg: var(--danger); }
.note-ok     { background: var(--ok-soft);     border: 1px solid var(--accent-line); color: var(--ok);     --mark-bg: var(--ok); }
.note-info   { background: var(--info-soft);   border: 1px solid var(--border);       color: var(--info);   --mark-bg: var(--info); }

/* 备份提醒：note 里带一个按钮。
   正文要能伸缩占满中间，按钮才靠右；窄屏时按钮换到下一行撑满。 */
.backup-note { flex-wrap: wrap; align-items: center; }
.backup-note > div { flex: 1 1 240px; min-width: 0; }
.backup-note .btn { flex: none; }
@media (max-width: 620px) {
  .backup-note .btn { flex: 1 1 100%; }
}

/* 左边那个圆点（里面是 i / ! / ✓）。
   ★ 底色必须显式给，不能用 background: currentColor ——
   currentColor 取的是**本元素自己的 color**，而下一行刚好把 color 设成了
   --surface，于是圆点是白的、里面的字也是白的，整块标记等于看不见。
   父级的 color 它取不到：currentColor 只看自己的计算值。
   这个坑一直是静默的（圆点只是个装饰），直到结果页那条 13.5px 的结论条
   把它放大到一眼能看见。 */
.note .mark {
  flex-shrink: 0;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  margin-top: 1px;
  background: var(--mark-bg, var(--text-3));
  color: var(--surface);
}

/* ---------- 公式块 ---------- */
.formula {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.85;
  overflow-x: auto;
}
.formula .cm { color: var(--text-3); }
.formula .hl { color: var(--accent); font-weight: 600; }

/* ---------- 标题输出 ---------- */
.title-out {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 16px;
  font-size: 15.5px;
  line-height: 1.7;
  min-height: 66px;
  word-break: break-all;
  color: var(--text);
}
.count { font-size: 11.5px; color: var(--text-3); }
.count.over { color: var(--danger); font-weight: 600; }

/* ---------- 折叠 ---------- */
.acc {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.acc + .acc { margin-top: 8px; }
.acc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 16px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background .13s;
}
.acc-head:hover { background: var(--surface-2); }
.acc-head .arrow {
  margin-left: auto;
  color: var(--text-3);
  transition: transform .18s;
  font-size: 10px;
  flex-shrink: 0;
}
.acc.open .acc-head .arrow { transform: rotate(90deg); }
.acc-body { display: none; padding: 4px 16px 16px; font-size: 13px; color: var(--text-2); }
.acc.open .acc-body { display: block; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(16px);
  background: var(--text);
  color: var(--bg);
  font-size: 12.8px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--r);
  box-shadow: var(--shadow-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 999;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 图表容器 ---------- */
.chart-box { position: relative; width: 100%; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 11.5px;
  color: var(--text-2);
  margin-bottom: 10px;
}
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: block; }

/* ---------- 列表 ---------- */
.kb-list li {
  position: relative;
  padding: 0 0 9px 17px;
  font-size: 13px;
  color: var(--text-2);
}
.kb-list li:last-child { padding-bottom: 0; }
.kb-list li::before {
  content: '';
  position: absolute;
  left: 3px; top: 9px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent-line);
}
.kb-list b { color: var(--text); }

.step-list { counter-reset: s; }
.step-list li {
  position: relative;
  padding: 0 0 16px 32px;
  font-size: 13px;
  color: var(--text-2);
}
.step-list li::before {
  counter-increment: s;
  content: counter(s);
  position: absolute;
  left: 0; top: 0;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-list li:last-child { padding-bottom: 0; }
.step-list li::after {
  content: '';
  position: absolute;
  left: 10px; top: 25px; bottom: 2px;
  width: 1px;
  background: var(--border);
}
.step-list li:last-child::after { display: none; }
.step-list b { color: var(--text); }

/* ---------- 行式导航（总览用） ---------- */
.nav-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .13s;
}
.nav-row:hover { background: var(--surface-2); }
.nav-row + .nav-row { margin-top: 2px; }
.nav-row .ico {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  flex-shrink: 0;
}
.nav-row .ico svg { width: 16px; height: 16px; }
.nav-row .tt { font-size: 13px; font-weight: 600; color: var(--text); }
.nav-row .dd { font-size: 11.5px; color: var(--text-3); }
.nav-row .go {
  margin-left: auto;
  color: var(--text-3);
  font-size: 14px;
  transition: transform .15s, color .15s;
}
.nav-row:hover .go { transform: translateX(3px); color: var(--accent); }

/* ---------- 纯 CSS 条形图（不依赖任何 CDN，离线可用） ---------- */
.bars { display: flex; flex-direction: column; gap: 2px; }
.bars-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.bars-label {
  width: 136px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bars-track {
  flex: 1;
  min-width: 0;
  height: 17px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
}
.bars-track i {
  display: block;
  height: 100%;
  border-radius: 4px;
  transition: width .35s cubic-bezier(.4, 0, .2, 1);
}
.bars-val {
  width: 54px;
  flex-shrink: 0;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 620px) {
  .bars-label { width: 92px; font-size: 11.5px; }
}

/* ---------- 双列瀑布流 ---------- */
.cols-2 { column-count: 2; column-gap: 14px; }
.cols-2 > * { break-inside: avoid; margin: 0 0 14px; }
.cols-2 > .card + .card { margin-top: 0; }
@media (max-width: 900px) { .cols-2 { column-count: 1; } }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------- 页脚 ---------- */
.page-foot {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-3);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- 术语提示 ---------- */
.term {
  border-bottom: 1px dashed var(--border-3);
  cursor: help;
  white-space: nowrap;
}
.term:hover { border-bottom-color: var(--accent); color: var(--accent); }

.global-tip {
  position: fixed;
  left: 0; top: 0;
  z-index: 1000;
  max-width: 290px;
  background: var(--text);
  color: var(--bg);
  font-size: 12px;
  line-height: 1.55;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s;
}

/* ---------- 辅助 ---------- */
.hr { height: 1px; background: var(--border); margin: 16px 0; border: 0; }
.muted { color: var(--text-3); }
.small { font-size: 11.5px; }
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .mt20 { margin-top: 20px; }
.mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; } .mb14 { margin-bottom: 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.align-start { align-items: start; }

/* ============================================================
   窄屏：宽表塌成「一行一张小卡」
   ------------------------------------------------------------
   12 列的 SKU 表最小也要 780px（实测），而内容区可用宽度 ≈ 视口 − 327px，
   所以视口窄于 1120px 时它必然横向滚动 —— 滚动条一出来，右边的
   「判定」和删除按钮就看不见了。与其让用户左右拖，不如把每一行
   变成一张带列名的小卡：信息一条不少，还不用拖。
   列名由每个 td 上的 data-label 提供，见 pricing.js 的 buildRow。
   ============================================================ */
@media (max-width: 1120px) {
  .table-wrap.flush { margin: 0; }

  table.data.rows-stack { min-width: 0 !important; }
  table.data.rows-stack thead { display: none; }
  table.data.rows-stack,
  table.data.rows-stack tbody,
  table.data.rows-stack tr,
  table.data.rows-stack td { display: block; width: 100%; }

  table.data.rows-stack tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 10px 13px;
    margin-bottom: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-1);
  }
  table.data.rows-stack tbody tr:last-child { margin-bottom: 0; }
  table.data.rows-stack tbody tr:hover td { background: transparent; }

  table.data.rows-stack td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
    text-align: left;
    white-space: normal;
  }
  /* 型号和「操作」独占一行，其余两两并排 —— 一张卡 7 行，比堆 12 行矮一半 */
  table.data.rows-stack td[data-label="型号"],
  table.data.rows-stack td[data-label="操作"] { grid-column: 1 / -1; }
  table.data.rows-stack td[data-label="型号"] { border-bottom: 1px solid var(--border); padding-bottom: 9px; }
  table.data.rows-stack td[data-label="操作"] { border-bottom: none; padding-top: 8px; justify-content: flex-start; }
  table.data.rows-stack td[data-label="操作"]::before { display: none; }

  table.data.rows-stack td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-3);
  }
  /* 没有列名的格子（理论上不该有）不占位 */
  table.data.rows-stack td:not([data-label])::before { display: none; }

  /* 输入控件在卡片里要够宽，别挤成一小条 */
  table.data.rows-stack .w-num,
  table.data.rows-stack .w-model,
  table.data.rows-stack .w-role {
    width: auto;
    flex: 0 1 190px;
    min-width: 120px;
  }
  table.data.rows-stack .cell-stack { flex: 0 1 190px; align-items: flex-end; }
  table.data.rows-stack .cell-stack .w-num { flex: none; width: 100%; min-width: 0; }
  table.data.rows-stack .price-hint { text-align: right; }

  /* 结论类格子（净利率 / 达标）在窄屏反而要更显眼 */
  table.data.rows-stack td.cell-key {
    font-size: 14px;
    border-radius: var(--r-xs);
    padding: 7px 10px;
    border-bottom: none;
    margin: 3px 0;
    background-image: none;
  }
  table.data.rows-stack td.cell-key::before { font-size: 12px; font-weight: 600; }
  /* rateCell 会写行内 background（渐变进度条），窄屏要整格铺色，所以得压过行内样式 */
  table.data.rows-stack td.cell-key.t-ok  { background: var(--ok-soft) !important; }
  table.data.rows-stack td.cell-key.t-mid { background: var(--warn-soft) !important; }
  table.data.rows-stack td.cell-key.t-no  { background: var(--danger-soft) !important; }
  table.data.rows-stack .del { width: 30px; height: 30px; font-size: 18px; }
}
