/* ==========================================================================
   中材节能 · 余热发电量计算平台
   设计基调：绯红（#7F1D1D）+ 暖白纸质背景 + 工程感细线与数字排版
   ========================================================================== */

:root {
  --ink: #1a1210;
  --ink-2: #3d2f2b;
  --muted: #7c6b66;
  --faint: #a3948f;
  --line: #ece2de;
  --line-2: #f6efec;
  --bg: #faf7f5;
  --paper: #ffffff;

  --crimson: #7f1d1d;
  --crimson-600: #991b1b;
  --crimson-500: #b91c1c;
  --crimson-400: #dc2626;
  --tint: #fdf2f1;
  --tint-2: #f9e4e2;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(64, 26, 22, .05), 0 6px 18px -10px rgba(64, 26, 22, .18);
  --shadow-md: 0 18px 48px -24px rgba(64, 26, 22, .3), 0 2px 6px rgba(64, 26, 22, .04);
  --shadow-lg: 0 40px 80px -40px rgba(64, 26, 22, .38);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", -apple-system, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(127, 29, 29, .07), transparent 62%),
    radial-gradient(700px 420px at 92% 4%, rgba(185, 28, 28, .05), transparent 60%);
}

::selection { background: rgba(127, 29, 29, .16); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
}

p { margin: 0; }

.wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------------------------------------------------------------- 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 247, 245, .82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(236, 226, 222, .9);
}

.topbar-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-logo { height: 34px; width: auto; }

.brand-div {
  width: 1px;
  height: 22px;
  background: var(--line);
}

.brand-name {
  font-size: 13px;
  letter-spacing: .14em;
  color: var(--muted);
  font-weight: 600;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 14px;
  color: var(--ink-2);
}

.topnav a {
  position: relative;
  padding: 6px 0;
  transition: color .18s var(--ease);
}

.topnav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 1.5px;
  width: 0;
  background: var(--crimson);
  transition: width .24s var(--ease);
}

.topnav a:hover { color: var(--crimson); }
.topnav a:hover::after { width: 100%; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--crimson);
  background: var(--tint);
  border: 1px solid var(--tint-2);
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--crimson-400);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .14);
}

/* ---------------------------------------------------------------- HERO */
.hero {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 56px;
  align-items: center;
  padding-top: 84px;
  padding-bottom: 56px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  letter-spacing: .16em;
  font-weight: 700;
  color: var(--crimson-600);
  text-transform: uppercase;
  margin-bottom: 22px;
}

.eyebrow .dot {
  width: 22px;
  height: 1.5px;
  background: var(--crimson-400);
}

.hero h1 {
  font-size: clamp(36px, 4.3vw, 60px);
  line-height: 1.07;
  letter-spacing: -.035em;
  font-weight: 800;
}

.hero h1 .accent {
  background: linear-gradient(96deg, #7f1d1d 0%, #b91c1c 55%, #dc2626 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  margin-top: 24px;
  font-size: 16.5px;
  line-height: 1.78;
  color: var(--ink-2);
  max-width: 30em;
}

.lede b { color: var(--crimson-600); font-weight: 600; }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 48px;
  padding: 0 26px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .22s var(--ease),
    background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
  font-family: inherit;
  white-space: nowrap;
}

.btn svg { width: 17px; height: 17px; }

.btn-primary {
  background: linear-gradient(180deg, #8d2222 0%, #7f1d1d 100%);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(127, 29, 29, .8), inset 0 1px 0 rgba(255, 255, 255, .12);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -14px rgba(127, 29, 29, .85), inset 0 1px 0 rgba(255, 255, 255, .16);
}

.btn-ghost {
  background: rgba(255, 255, 255, .7);
  border-color: var(--line);
  color: var(--ink-2);
}

.btn-ghost:hover {
  border-color: #d9c7c2;
  background: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-sm { height: 38px; padding: 0 16px; font-size: 13.5px; border-radius: 10px; }
.btn-sm svg { width: 15px; height: 15px; }

.hero-stats {
  display: flex;
  gap: 44px;
  margin: 48px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.hero-stats div { display: flex; flex-direction: column; gap: 3px; }
.hero-stats dt { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.hero-stats dd {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--crimson);
  font-variant-numeric: tabular-nums;
}
.hero-stats dd small { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 3px; }

/* ------------------------------------------------------- HERO 图示 */
.hero-visual { position: relative; }

.gauge-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 30px 30px 24px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.gauge-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 220px at 50% -20%, rgba(127, 29, 29, .07), transparent 70%);
  pointer-events: none;
}

.gc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .08em;
  position: relative;
  z-index: 1;
}

.gc-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--crimson-600);
  font-weight: 700;
  letter-spacing: .02em;
}

.gauge { position: relative; display: flex; justify-content: center; margin: 6px 0 -6px; }

.gauge svg { width: 264px; height: 264px; }

.gauge-ring { transition: stroke-dashoffset 1.1s cubic-bezier(.16, 1, .3, 1); }

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.gauge-center .gv {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--crimson);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.gauge-center .gu { font-size: 12.5px; color: var(--muted); letter-spacing: .1em; }

.gc-foot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line-2);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}

.gc-foot div {
  background: #fff;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gc-foot span { font-size: 11.5px; color: var(--muted); }
.gc-foot b {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.gc-foot b i { font-style: normal; font-size: 11.5px; color: var(--muted); font-weight: 600; margin-left: 2px; }

.float-chip {
  position: absolute;
  right: -14px;
  top: 34%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-2);
  animation: floaty 6s var(--ease) infinite;
}

.float-chip .ico {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--tint);
  color: var(--crimson);
  display: grid;
  place-items: center;
}
.float-chip .ico svg { width: 16px; height: 16px; }
.float-chip b { display: block; font-size: 13px; color: var(--ink); }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

/* ---------------------------------------------------------------- 分区标题 */
.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.sec-head h2 { font-size: 27px; letter-spacing: -.03em; }
.sec-head p { font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------- 模块卡片 */
.modules { padding-top: 24px; padding-bottom: 60px; scroll-margin-top: 90px; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.module-card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transition: transform .26s var(--ease), box-shadow .26s var(--ease), border-color .26s var(--ease);
}

.module-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, #7f1d1d, #dc2626 60%, #f1a3a0);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .34s var(--ease);
}

.module-card:hover {
  transform: translateY(-4px);
  border-color: #e2cfc9;
  box-shadow: var(--shadow-md);
}

.module-card:hover::before { transform: scaleX(1); }

.mc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.mc-no {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--faint);
}

.mc-arrow {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--line-2);
  transition: all .26s var(--ease);
  font-size: 15px;
}

.module-card:hover .mc-arrow {
  background: var(--crimson);
  color: #fff;
  transform: rotate(-45deg);
}

.module-card h3 { font-size: 19px; letter-spacing: -.025em; }

.mc-industry {
  font-size: 12.5px;
  color: var(--crimson-600);
  font-weight: 600;
  letter-spacing: .01em;
}

.mc-summary {
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--muted);
  min-height: 3.4em;
}

.mc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.mc-tags span {
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--line-2);
  border-radius: 6px;
  padding: 3px 8px;
}

/* ---------------------------------------------------------------- 说明 */
.basis {
  padding-top: 10px;
  padding-bottom: 70px;
  scroll-margin-top: 90px;
}

.basis-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.basis-card {
  background: linear-gradient(180deg, #fff, #fdfafa);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
}

.basis-card .bi {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--tint);
  color: var(--crimson);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}
.basis-card .bi svg { width: 20px; height: 20px; }
.basis-card h3 { font-size: 16px; margin-bottom: 10px; }
.basis-card p { font-size: 13.5px; color: var(--muted); line-height: 1.78; }
.basis-card ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--muted); line-height: 1.9; }

/* ---------------------------------------------------------------- 页脚 */
.footer {
  border-top: 1px solid var(--line);
  padding: 30px 0 40px;
  background: rgba(255, 255, 255, .5);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--faint);
}

.footer-logo { height: 26px; opacity: .78; }

/* ==========================================================================
   计算页
   ========================================================================== */
.page-calc { background: var(--bg); }

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.crumb a:hover { color: var(--crimson); }
.crumb b { color: var(--ink); font-weight: 600; }
.crumb span { color: var(--line); }

.top-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.icon-btn:hover { border-color: #dcc9c4; color: var(--crimson); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }

.calc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 26px;
  align-items: start;
  padding-top: 30px;
  padding-bottom: 80px;
}

/* 模块头 */
.module-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.mh-no {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--crimson);
  background: var(--tint);
  border: 1px solid var(--tint-2);
  border-radius: 8px;
  padding: 5px 9px;
  margin-top: 3px;
}

.module-head h1 { font-size: 26px; letter-spacing: -.03em; }
.module-head p { font-size: 13.5px; color: var(--muted); margin-top: 5px; max-width: 46em; }

.line-toggle {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px 6px 14px;
  white-space: nowrap;
}

.switch {
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #e3d8d4;
  border: none;
  cursor: pointer;
  transition: background .22s var(--ease);
  padding: 0;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: transform .22s var(--ease);
}
.switch[aria-checked="true"] { background: var(--crimson); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* 参数卡片 */
.sec-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sec-card-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 18px 24px 15px;
  border-bottom: 1px solid var(--line-2);
  background: linear-gradient(180deg, #fdfbfa, #ffffff);
}

.sec-idx {
  font-size: 11.5px;
  font-weight: 800;
  color: #fff;
  background: var(--crimson);
  border-radius: 6px;
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  flex: none;
  transform: translateY(-1px);
}

.sec-card-head h2 { font-size: 15.5px; letter-spacing: -.01em; }
.sec-card-head p { font-size: 12.5px; color: var(--faint); margin-left: auto; }

.items { padding: 6px 24px 16px; }

.item {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line-2);
}
.item:last-child { border-bottom: none; }

.item-label { min-width: 0; }
.item-label .t {
  font-size: 13.8px;
  color: var(--ink);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.item-label .u {
  font-size: 11.5px;
  color: var(--faint);
  background: var(--line-2);
  border-radius: 5px;
  padding: 1px 6px;
  font-weight: 500;
}
.item-label .h { font-size: 11.5px; color: var(--faint); margin-top: 3px; }

.dual { display: flex; align-items: center; gap: 8px; }

.field {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.field input,
.field select {
  width: 132px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fdfcfc;
  padding: 0 10px;
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  transition: all .16s var(--ease);
  text-align: right;
  appearance: none;
  -webkit-appearance: none;
}

.field select {
  width: 168px;
  text-align: left;
  padding-right: 30px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c6b66' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.field input:hover, .field select:hover { border-color: #dccbc6; }

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--crimson-400);
  background: #fff;
  box-shadow: 0 0 0 3.5px rgba(127, 29, 29, .09);
}

.field input:disabled, .field select:disabled {
  background: #f7f4f3;
  color: var(--faint);
  cursor: not-allowed;
  opacity: .75;
}

.field .suffix {
  font-size: 11.5px;
  color: var(--faint);
  min-width: 26px;
}

.line-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--line-2);
  border-radius: 4px;
  padding: 2px 5px;
  letter-spacing: .02em;
  flex: none;
}

.dual.off .line-badge { opacity: .35; }

/* 烟气量组合控件 */
.flow-row { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.flow-line { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.flow-line .fl-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--faint);
}
.flow-line .fl-body { display: flex; gap: 6px; align-items: center; }

/* 气体成分 */
.gas-grid {
  display: grid;
  grid-template-columns: 68px 1fr 1fr;
  gap: 6px 10px;
  align-items: center;
}
.gas-grid .gh {
  font-size: 11px;
  color: var(--faint);
  text-align: center;
  padding-bottom: 2px;
}
.gas-grid .gh:first-child { text-align: left; }
.gas-name { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.gas-grid .field input { width: 100%; height: 34px; }
.gas-total {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 8px;
  display: flex;
  gap: 18px;
}
.gas-total b { color: var(--ink); font-variant-numeric: tabular-nums; }
.gas-total b.bad { color: var(--crimson-400); }

/* ---------------------------------------------------------------- 结果面板 */
.result-col { position: sticky; top: 92px; }

.result-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.rc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 0;
}

.rc-head h2 { font-size: 15px; letter-spacing: .01em; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--line-2);
  border-radius: 999px;
  padding: 4px 10px;
}
.status::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #22a06b;
}
.status.busy::before { background: #d97706; animation: pulse 1s infinite; }
.status.error { color: var(--crimson-600); background: var(--tint); }
.status.error::before { background: var(--crimson-400); }

@keyframes pulse { 50% { opacity: .25; } }

.hero-metric {
  padding: 18px 22px 20px;
  border-bottom: 1px solid var(--line-2);
}

.hero-metric .hm-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-metric .hm-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.hero-metric .hm-value b {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -.045em;
  line-height: 1.05;
  color: var(--crimson);
  font-variant-numeric: tabular-nums;
}

.hero-metric .hm-value span { font-size: 14px; color: var(--muted); font-weight: 600; }

.hero-metric .hm-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 6px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.hero-metric .hm-sub b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line-2);
  border-bottom: 1px solid var(--line-2);
}

.kpi {
  background: #fff;
  padding: 13px 20px;
}
.kpi .k-label { font-size: 11.5px; color: var(--muted); }
.kpi .k-value {
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
.kpi .k-value i { font-style: normal; font-size: 11.5px; color: var(--faint); font-weight: 600; margin-left: 3px; }

.rc-section { padding: 16px 22px; border-bottom: 1px solid var(--line-2); }
.rc-section h3 {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .06em;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.line-bars { display: flex; flex-direction: column; gap: 10px; }
.lb-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; }
.lb-row .lbn { font-size: 11.5px; color: var(--muted); }
.lb-track { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.lb-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #b91c1c, #e0625b);
  width: 0;
  transition: width .8s var(--ease);
}
.lb-fill.second { background: linear-gradient(90deg, #7f1d1d, #b91c1c); opacity: .55; }
.lb-row .lbv { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }

.site-list { display: grid; gap: 7px; }
.site-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.8px;
}
.site-row .sl { color: var(--muted); }
.site-row .sv { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.site-row .sv.pair { color: var(--ink-2); font-weight: 500; }

.detail-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: #fff;
  border: none;
  border-bottom: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .16s;
}
.detail-toggle:hover { background: #fdfafa; }
.detail-toggle svg { width: 14px; height: 14px; transition: transform .24s var(--ease); color: var(--muted); }
.detail-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.detail-wrap { max-height: 0; overflow: hidden; transition: max-height .34s var(--ease); }
.detail-wrap.open { max-height: 520px; overflow-y: auto; }

.detail-table { width: 100%; border-collapse: collapse; font-size: 12.3px; }
.detail-table th {
  position: sticky;
  top: 0;
  background: #fdfbfa;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: .04em;
}
.detail-table th:first-child { text-align: left; }
.detail-table td {
  padding: 7px 12px;
  border-bottom: 1px solid #faf6f5;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.detail-table td:first-child { text-align: left; color: var(--ink); }
.detail-table td .du { color: var(--faint); font-size: 10.5px; margin-left: 3px; }
.detail-table tr:hover td { background: #fdfafa; }

.warn-box {
  margin: 14px 22px 0;
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 12.3px;
  line-height: 1.6;
  background: #fff8ec;
  border: 1px solid #f6e3c4;
  color: #8a5a12;
}
.warn-box.error { background: var(--tint); border-color: var(--tint-2); color: var(--crimson-600); }
.warn-box b { font-weight: 700; }

.rc-foot { padding: 16px 22px 20px; display: grid; gap: 9px; }

.rc-foot .btn { width: 100%; height: 44px; }

.hint-line {
  font-size: 11px;
  color: var(--faint);
  text-align: center;
  line-height: 1.6;
}

/* 计算中遮罩 */
.result-card.loading .hero-metric .hm-value b,
.result-card.loading .kpi .k-value { opacity: .38; transition: opacity .2s; }

/* 移动端底栏 */
.mobile-bar { display: none; }

/* ---------------------------------------------------------------- 动画 */
.reveal { animation: rise .6s var(--ease) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 56px; }
  .hero-visual { max-width: 460px; }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-layout { grid-template-columns: 1fr; }
  .result-col { position: static; }
}

@media (max-width: 860px) {
  .wrap { padding: 0 18px; }
  .topnav { gap: 16px; font-size: 13px; }
  .topnav a:not(.pill) { display: none; }
  .hero-stats { gap: 26px; }
  .hero-stats dd { font-size: 21px; }
  .basis-grid { grid-template-columns: 1fr; }
  .sec-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .item { grid-template-columns: 1fr; gap: 8px; align-items: stretch; }
  .dual { justify-content: flex-start; }
  .field input, .field select { width: 100%; flex: 1; }
  .field { flex: 1; }
  .flow-row { justify-content: flex-start; }
  .flow-line { align-items: stretch; flex: 1; }
  .gas-grid { grid-template-columns: 54px 1fr 1fr; }
  .module-head { flex-wrap: wrap; }
  .line-toggle { margin-left: 0; }
  .calc-layout { padding-bottom: 110px; }
  .mobile-bar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 10px 18px calc(10px + env(safe-area-inset-bottom));
    align-items: center;
    gap: 12px;
  }
  .mobile-bar .mb-num { flex: 1; min-width: 0; }
  .mobile-bar .mb-num span { font-size: 10.5px; color: var(--muted); display: block; }
  .mobile-bar .mb-num b {
    font-size: 20px;
    color: var(--crimson);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.03em;
  }
  .mobile-bar .btn { height: 40px; }
  .top-actions .btn span { display: none; }
}

@media (max-width: 560px) {
  .module-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .gauge-card { padding: 22px 18px 18px; }
  .float-chip { display: none; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .hero-metric .hm-value b { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------------------------------------------------------------- 模块切换菜单 */
.mod-switch { position: relative; }

.mod-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 80;
  animation: rise .18s var(--ease) both;
}

.mod-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 9px;
  font-size: 13.5px;
  color: var(--ink-2);
  transition: background .14s;
}
.mod-menu a:hover { background: var(--tint); color: var(--crimson); }
.mod-menu a.active { background: var(--tint); color: var(--crimson); font-weight: 600; }

.mm-no {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--faint);
  letter-spacing: .06em;
}
.mod-menu a.active .mm-no { color: var(--crimson-500); }

/* 烟气量组合控件（JS 生成） */
.flow-sel {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 11.5px;
  color: var(--ink-2);
  background: #fdfcfc;
  padding: 0 24px 0 8px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%237c6b66' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  transition: border-color .16s, box-shadow .16s;
}
.flow-sel:hover { border-color: #dccbc6; }
.flow-sel:focus {
  outline: none;
  border-color: var(--crimson-400);
  box-shadow: 0 0 0 3px rgba(127, 29, 29, .08);
}

.flow-inp {
  width: 118px;
  height: 34px;
  text-align: right;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fdfcfc;
  font-size: 13.5px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  padding: 0 9px;
  color: var(--ink);
  transition: border-color .16s, box-shadow .16s;
}
.flow-inp:hover { border-color: #dccbc6; }
.flow-inp:focus {
  outline: none;
  border-color: var(--crimson-400);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(127, 29, 29, .08);
}


/* ---- 顶部左组 ---- */
.brand-group { display: flex; align-items: center; gap: 20px; }
.crumb-div { width: 1px; height: 18px; background: var(--line); }

/* ---- 共用参数标记 ---- */
.line-badge.shared {
  background: var(--tint);
  color: var(--crimson-600);
  font-weight: 700;
}

/* ---- 烟气量控件：双线等宽对齐 ---- */
.fl-head { width: 100%; }
.fl-head .flow-sel { flex: 1; min-width: 0; width: auto; }
.fl-body { width: 100%; justify-content: flex-end; }
.flow-line .suffix { width: 30px; text-align: left; }

/* ---- 数值输入框更清晰 ---- */
.item-label .u {
  padding: 1.5px 7px;
  color: #8a7a75;
  background: #f5eeec;
}
.field input[type="text"] { letter-spacing: -.01em; }

@media (max-width: 860px) {
  .flow-line { width: 100%; }
  .flow-line .suffix { width: auto; }
  .brand-group { gap: 12px; }
  .crumb-div, .brand-name, .brand-div { display: none; }
}


/* ---- 结果列宽与断点微调 ---- */
.calc-layout { grid-template-columns: minmax(0, 1fr) 372px; }

/* ---- 烟气量列宽 ---- */

/* ---- 双线对比条更实 ---- */
.lb-track { height: 8px; border-radius: 4px; }
.lb-fill { background: linear-gradient(90deg, #991b1b, #d2453c); }
.lb-fill.second { background: linear-gradient(90deg, #c98b86, #e3b7b2); opacity: 1; }

@media (max-width: 1180px) {
  .calc-layout { grid-template-columns: 1fr; }
  .result-col { position: static; }
}

/* 双线对比条修正：i 标签需块级才能撑起高度 */
.lb-fill { display: block; height: 100%; }
.calc-layout { grid-template-columns: minmax(0, 1fr) 392px; }

/* ==========================================================================
   修正：气体成分网格（紧凑、右对齐）
   ========================================================================== */
.gas-grid {
  grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px 16px;
  max-width: 520px;
  margin-left: auto;
}
.gas-grid .gh { text-align: right; padding-right: 12px; }
.gas-grid .gh:first-child { text-align: left; padding-right: 0; }
.gas-grid .field { justify-content: flex-end; }
.gas-grid .field input { width: 84px; }
.gas-grid .field .suffix { width: 14px; min-width: 14px; }

/* 结果值"不存在/超出范围"用弱化色 */
.site-row .sv.is-empty { color: var(--faint); font-weight: 500; }

/* ==========================================================================
   修正：窄屏布局（防止横向溢出）
   ========================================================================== */
.form-col, .result-col { min-width: 0; }
.result-card { overflow: hidden; }

@media (max-width: 1180px) {
  .calc-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .module-head { flex-wrap: wrap; }
  .module-head > div:nth-child(2) { flex: 1 1 160px; min-width: 0; }
  .line-toggle {
    width: 100%;
    margin-left: 0;
    order: 6;
    justify-content: space-between;
  }
  .crumb a, .crumb span { display: none; }
  .site-row .sv { white-space: normal; text-align: right; word-break: break-word; }
  .detail-table { font-size: 11.5px; }
  .detail-table th, .detail-table td { padding: 6px 8px; }
  .gas-grid { max-width: none; margin-left: 0; grid-template-columns: 62px minmax(0, 1fr) minmax(0, 1fr); }
  .gas-grid .field input { width: 100%; }
  .gas-grid .gh { text-align: center; padding-right: 0; }
}

/* ==========================================================================
   修正：flex/grid 子项最小宽度（消除窄屏横向溢出）
   ========================================================================== */
.field { min-width: 0; }
.field input,
.field select { min-width: 0; }
.dual { min-width: 0; }
.item { min-width: 0; }
.items { min-width: 0; }
.sec-card { min-width: 0; }

@media (max-width: 860px) {
  .item { grid-template-columns: minmax(0, 1fr); }
  .dual { gap: 6px; }
  .field { flex: 1 1 0; }
  .field input,
  .field select { width: 100%; flex: 1 1 0; }
  .gas-grid .field { flex: 1 1 auto; }
  .module-head h1 { font-size: 22px; }
}

/* ==========================================================================
   最终布局修正：烟气量控件宽度（按断点严格排序）
   ========================================================================== */
@media (min-width: 861px) {
  .flow-line { width: 236px; min-width: 0; }
  .flow-inp { width: 156px; }
}
@media (max-width: 860px) {
  .flow-line { width: 100%; min-width: 0; }
  .flow-inp { width: 100%; }
  .flow-line .suffix { width: auto; }
  .flow-row { width: 100%; }
}

/* ==========================================================================
   最终：气体成分改为紧凑右对齐小表
   ========================================================================== */
.gas-grid {
  display: grid;
  grid-template-columns: 56px 92px 92px;
  justify-content: end;
  column-gap: 22px;
  row-gap: 8px;
  max-width: none;
  margin-left: 0;
}
.gas-grid .gh { text-align: center; padding-right: 0; }
.gas-grid .gh:first-child { text-align: left; }
.gas-grid .field { justify-content: center; }
.gas-grid .field input { width: 66px; text-align: right; padding: 0 7px; }
.gas-grid .field .suffix { width: 12px; min-width: 12px; }

@media (max-width: 860px) {
  .gas-grid { grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1fr); column-gap: 10px; }
  .gas-grid .field input { width: 100%; }
}

/* ==========================================================================
   精简首页 / 页脚署名 / 空状态
   ========================================================================== */
.hero-slim { padding-top: 78px; padding-bottom: 48px; gap: 48px; }
.hero-slim .hero-actions { margin-top: 34px; }

.footer-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.footer-note { color: var(--crimson-600); font-weight: 600; letter-spacing: .01em; }
.footer-sep { color: var(--line); }

.footer-compact {
  padding: 22px 0 26px;
  background: transparent;
  border-top: 1px solid var(--line);
}
.footer-compact .footer-inner { font-size: 12px; color: var(--faint); }

.detail-empty {
  text-align: center !important;
  color: var(--faint) !important;
  padding: 18px 0 !important;
  font-size: 12px;
}

.btn[disabled],
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

@media (max-width: 860px) {
  .hero-slim { padding-top: 44px; padding-bottom: 32px; }
  .hero-slim .hero-actions { margin-top: 26px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 10px; }
  .footer-right { justify-content: flex-start; }
  .page-calc .footer { padding-bottom: 94px; }
}

@media (max-width: 560px) {
  .hero-slim { padding-top: 34px; }
  .footer-inner { font-size: 11.5px; }
}

/* 空状态主数字 */
.hero-metric .hm-value b.is-empty {
  font-size: 40px;
  color: var(--line);
  font-weight: 600;
  letter-spacing: 0;
}
.status.idle::before { background: #c9bdb8; box-shadow: none; }
.status.idle { color: var(--muted); }

@media (max-width: 860px) {
  .hero-metric .hm-value b.is-empty { font-size: 32px; }
}

/* 气体成分小表：加宽、居中分布，避免过度拥挤在右侧 */
.gas-grid {
  grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 22px;
  max-width: 400px;
  margin-left: auto;
}
.gas-grid .field input { width: 100%; padding: 0 9px; }
.gas-grid .field .suffix { width: 12px; min-width: 12px; text-align: left; }

/* 移动端烟气量：输入框填满剩余宽度，单位紧随其后 */
@media (max-width: 860px) {
  .fl-body { justify-content: flex-start; }
  .flow-inp { flex: 1 1 auto; width: auto; min-width: 0; }
  .gas-grid { max-width: none; margin-left: 0; }
  .gas-grid .field input { width: 100%; }
}

.warn-box.info {
  background: #f7f5f4;
  border: 1px solid var(--line);
  color: var(--muted);
}

/* 首屏收紧一点，避免与模块区之间留白过大 */
.hero-slim { padding-bottom: 28px; }

/* 首屏收紧一点，避免与模块区之间留白过大 */
.hero-slim { padding-bottom: 28px; }

/* 页脚统一浅灰：署名与版权同色同字号 */
.footer-note { color: inherit; font-weight: inherit; letter-spacing: 0; }
.footer-tip { color: inherit; text-align: right; }
.footer-left span { color: inherit; }
.footer-compact .footer-inner { font-size: 12.5px; color: var(--faint); }

@media (max-width: 860px) {
  .footer-tip { text-align: left; }
}

/* 页脚：版权在上、署名在下，统一浅灰 */
.footer-left { align-items: center; }
.footer-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1.5;
}
.footer-meta span { color: inherit; }

/* 结果卡片底部免责小字：留出内边距，避免顶到卡片边缘 */
.rc-foot .hint-line { padding: 0 12px; font-size: 10.5px; line-height: 1.6; }

/* ---- 输入非法 / 重试按钮 ---- */
.field input.invalid,
.flow-inp.invalid {
  border-color: var(--crimson-400);
  background: #fff7f6;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .1);
}

.retry-btn {
  margin-left: 6px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.retry-btn:hover { background: rgba(255, 255, 255, .55); }

/* 页脚终版：版权行与 logo 同高对齐，署名改为更小字号放在其下方 */
.footer-left { align-items: flex-start; }
.footer-meta { gap: 0; }
.footer-copy {
  display: block;
  line-height: 26px;          /* 与 logo 高度一致，实现水平齐平 */
  font-size: 12.5px;
  color: inherit;
}
.footer-note {
  display: block;
  font-size: 10.5px;
  line-height: 1.3;
  color: inherit;
  letter-spacing: 0;
  font-weight: inherit;
}
.footer-compact .footer-copy { line-height: 1.7; }

@media (max-width: 860px) {
  .footer-copy { line-height: 1.7; }
  .footer-note { font-size: 10px; }
}

/* ==========================================================================
   共用项：输入框横跨 1#/2# 两个单线输入框的宽度，一眼可辨“两线共用”
   计算依据：徽标 38 + 间距 8 + 单线框 132 + 间距 8 + 徽标 38 + 间距 8 + 单线框 132 = 364
             共用行 = 徽标 38 + 间距 8 + 共用框 318  →  右边缘与 2# 线输入框齐平
   ========================================================================== */
.line-badge {
  min-width: 38px;
  text-align: center;
  box-sizing: border-box;
}

@media (min-width: 861px) {
  /* 单线框统一 168，共用框 = 168 + 168 + 中间徽标 38 与两处间距 16 = 390
     这样每一行总宽恒为 436，徽标、左右边缘全部对齐 */
  .field input { width: 168px; }
  .dual.shared .field input,
  .dual.shared .field select { width: 390px; }
}
