/* ==========================================================
   在线工具 / 案例中心  独立样式
   只被 tools-roi.html 与 case.html 引用，不影响全站主样式
   ========================================================== */

/* ==========================================================
   基础排版层（.tl-*）
   必须与全站 .lp-content 标准对齐，否则新页面会显得发灰、层级弱、行宽过长：
     正文   var(--ink) 深色        （不是 var(--muted)）
     strong var(--green-dark) 加粗 （必须显式定义，否则继承灰色等于没加粗）
     h2     22px + 左侧 4px 绿色竖条
     行宽   max-width 900px
   ========================================================== */

.tl-h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  margin: 40px 0 16px;
  padding-left: 12px;
  border-left: 4px solid var(--green);
  max-width: 900px;
}
.tl-h2:first-child { margin-top: 8px; }
.tl-h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  margin: 28px 0 12px;
  padding-left: 10px;
  border-left: 3px solid #bfe8d7;
  max-width: 900px;
}
.tl-lead {
  font-size: 16px;
  line-height: 1.95;
  color: var(--ink);
  margin: 0 0 16px;
  max-width: 900px;
}
.tl-lead strong,
.tl-note strong,
.tl-h2 strong,
.tl-h3 strong { color: var(--green-dark); font-weight: 700; }

.tl-note {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--bg-soft);
  border-left: 3px solid var(--green);
  padding: 14px 16px;
  border-radius: 0 10px 10px 0;
  margin: 18px 0 0;
  max-width: 900px;
}

/* 正文里的列表同样限宽，保证行长一致 */
.lp-main .lp-ul,
.lp-main .lp-ol { max-width: 900px; }

/* 摘要文本框 */
.tl-pre {
  white-space: pre-wrap;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--muted);
  font-family: inherit;
  margin: 0;
  max-width: 900px;
}

/* ---------- 测算工具布局 ---------- */
.calc-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 24px;
  align-items: start;
  margin: 8px 0 6px;
}
.calc-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  box-shadow: var(--shadow);
}
.calc-panel__title {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 4px;
}
.calc-panel__sub { font-size: 14px; color: var(--muted); margin: 0 0 16px; }

/* 类型切换 */
.calc-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 18px;
}
.calc-seg button {
  appearance: none;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 11px 6px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all .18s ease;
  font-family: inherit;
  line-height: 1.3;
}
.calc-seg button small { display: block; font-size: 12.5px; font-weight: 500; margin-top: 3px; opacity: .8; }
.calc-seg button:hover { border-color: var(--green); color: var(--green-dark); }
.calc-seg button.is-active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 6px 16px rgba(6, 182, 122, .22);
}
.calc-seg button.is-active small { color: rgba(255, 255, 255, .88); }

/* 字段 */
.calc-field { margin: 0 0 16px; }
.calc-field__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}
.calc-field label { font-size: 14.5px; color: var(--ink); font-weight: 600; }
.calc-field .val {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--green-dark);
  white-space: nowrap;
}
.calc-field .val span { font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.calc-row { display: flex; align-items: center; gap: 10px; }
.calc-row input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: var(--green);
  height: 22px;
  cursor: pointer;
}
.calc-row input[type="number"] {
  flex: 0 0 96px;
  width: 96px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 8px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  text-align: right;
  background: #fff;
}
.calc-row input[type="number"]:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(6, 182, 122, .14);
}
.calc-field__hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; line-height: 1.6; }

.calc-fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 14px 2px;
  margin: 0 0 16px;
  background: #fbfdfc;
}
.calc-fieldset legend {
  font-size: 13px;
  font-weight: 700;
  color: var(--green-dark);
  padding: 0 6px;
}

/* 结果面板 */
.calc-result { position: sticky; top: 92px; }
.calc-hero {
  background: linear-gradient(135deg, #06b67a 0%, #04875c 100%);
  border-radius: 14px;
  padding: 18px 18px 16px;
  color: #fff;
  margin-bottom: 14px;
}
.calc-hero__label { font-size: 13.5px; opacity: .92; margin: 0 0 4px; }
.calc-hero__num {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 2px;
  letter-spacing: -.5px;
}
.calc-hero__num em { font-size: 16px; font-style: normal; font-weight: 700; margin-left: 3px; }
.calc-hero__sub { font-size: 13px; opacity: .9; margin: 6px 0 0; line-height: 1.7; }

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.calc-cell {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 12px 11px;
  background: #fff;
}
.calc-cell__k { font-size: 13px; color: var(--muted); margin: 0 0 5px; }
.calc-cell__v { font-size: 19px; font-weight: 800; color: var(--ink); margin: 0; line-height: 1.25; }
.calc-cell__v em { font-size: 13px; font-style: normal; font-weight: 600; color: var(--muted); margin-left: 2px; }
.calc-cell--hl { background: #f1faf6; border-color: #bfe8d7; }
.calc-cell--hl .calc-cell__v { color: var(--green-dark); }

/* 敏感性表 */
.calc-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
.calc-table th, .calc-table td {
  border: 1px solid var(--border);
  padding: 9px 10px;
  text-align: center;
}
.calc-table th { background: var(--bg-soft); color: var(--ink); font-weight: 700; font-size: 14px; }
.calc-table td { color: var(--ink); }
.calc-table td:first-child { color: var(--ink); font-weight: 600; }
.calc-table tr.is-base td { background: #f1faf6; color: var(--green-dark); font-weight: 700; }
.calc-table td b { color: var(--green-dark); }
.calc-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 数字+单位不拆行（如 "36,000 元"、"150—900 元/路"），由生成器/JS 包 span.nw */
.nw { white-space: nowrap; }

/* ---------- 测算免责声明 ---------- */
.tl-disclaimer {
  position: relative;
  max-width: 900px;
  margin: 18px 0 0;
  padding: 14px 16px 14px 44px;
  background: #fffaf0;
  border: 1px solid #f3e0bb;
  border-left: 4px solid #e0a03a;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.85;
  color: #4a3b1f;
}
.tl-disclaimer::before {
  content: "!";
  position: absolute;
  left: 16px; top: 15px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #e0a03a;
  color: #fff;
  font-size: 12px; font-weight: 700;
  line-height: 18px; text-align: center;
}
.tl-disclaimer__t {
  margin: 0 0 4px;
  font-size: 14.5px; font-weight: 700; color: #7a5a12;
}
.tl-disclaimer p { margin: 0; }
.tl-disclaimer strong { font-weight: 700; color: #6b4c0a; }
/* 留资按钮上方的提示，语气要软一些 */
.tl-disclaimer--soft {
  background: var(--bg-soft);
  border-color: var(--border);
  border-left-color: #bcd9cf;
  color: var(--ink);
}
.tl-disclaimer--soft::before {
  content: "i";
  background: #7fa89a;
  font-family: Georgia, "Times New Roman", serif;
}
.tl-disclaimer--soft .tl-disclaimer__t { color: var(--green-dark); }
.tl-disclaimer--soft strong { color: var(--green-dark); }

/* 窄屏把说明型表格转成卡片堆叠，避免列被挤成一字一行 */
@media (max-width: 560px) {
  table.break-cards, table.break-cards tbody { display: block; }
  table.break-cards thead { display: none; }
  table.break-cards tr {
    display: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 0 12px;
  }
  table.break-cards td { display: block; border: 0; padding: 0 0 12px; text-align: left; }
  table.break-cards tr > td:last-child { padding-bottom: 0; }
  table.break-cards td:first-child {
    font-weight: 700;
    color: var(--green-dark);
    font-size: 15px;
    padding-bottom: 4px;
  }
  table.break-cards td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 3px;
  }
}

.calc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.calc-actions .btn { flex: 1 1 46%; text-align: center; }
.calc-tip { font-size: 13px; color: var(--muted); margin: 10px 0 0; line-height: 1.7; }

/* ---------- 案例中心 ---------- */
.case-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 8px 0 6px;
}
.case-stat {
  background: linear-gradient(160deg, #ffffff 0%, #f3f8f6 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 14px;
  text-align: center;
}
.case-stat b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--green-dark);
  line-height: 1.2;
}
.case-stat b em { font-size: 14px; font-style: normal; margin-left: 2px; }
.case-stat span { display: block; font-size: 14px; color: var(--muted); margin-top: 6px; }

.case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 6px; }
.case-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  background: #fff;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.case-card__tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green-dark);
  background: #e8f7f0;
  border-radius: 999px;
  padding: 4px 11px;
  margin-bottom: 10px;
}
.case-card h3 { font-size: 17.5px; margin: 0 0 8px; color: var(--ink); font-weight: 800; line-height: 1.45; }
.case-card p { font-size: 15px; line-height: 1.85; color: var(--ink); margin: 0 0 12px; }
.case-meta { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.case-meta li {
  font-size: 14px;
  color: var(--muted);
  background: var(--bg-soft);
  border-radius: 9px;
  padding: 7px 10px;
}
.case-meta li b { color: var(--ink); font-weight: 700; }
.case-card__link { margin-top: auto; font-size: 14.5px; font-weight: 700; color: var(--green-dark); }
.case-card__link:hover { text-decoration: underline; }

.case-empty {
  border: 1px dashed #c9dbd3;
  background: #fbfdfc;
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: center;
  margin-top: 6px;
}
.case-empty h3 { font-size: 17px; margin: 0 0 8px; color: var(--ink); }
.case-empty p { font-size: 15px; color: var(--ink); line-height: 1.85; margin: 0 0 12px; }

.case-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.case-field {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--muted);
  background: #fff;
}
.case-field b { display: block; color: var(--ink); font-size: 14.5px; margin-bottom: 3px; }

/* ---------- 留资表单 ---------- */
.tl-form { max-width: 720px; margin-top: 8px; }
.tl-form .f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.tl-form .f-row--1 { grid-template-columns: 1fr; }
.tl-form input, .tl-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 13px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
}
.tl-form textarea { min-height: 108px; resize: vertical; line-height: 1.7; }
.tl-form input:focus, .tl-form textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(6, 182, 122, .14);
}
.tl-form .form-hint { margin-top: 10px; }

/* ---------- 工具中心 ---------- */
.tc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 6px; }
.tc-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 20px 18px; background: #fff; box-shadow: var(--shadow);
}
.tc-card__ico {
  width: 42px; height: 42px; border-radius: 11px;
  background: #e8f7f0; color: var(--green-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; margin-bottom: 12px;
}
.tc-card h3 { font-size: 18px; margin: 0 0 8px; color: var(--ink); font-weight: 800; line-height: 1.45; }
.tc-card p { font-size: 15px; line-height: 1.85; color: var(--ink); margin: 0 0 14px; }
.tc-card ul { list-style: none; margin: 0 0 14px; padding: 0; }
.tc-card li { font-size: 14px; color: var(--muted); padding: 4px 0 4px 16px; position: relative; line-height: 1.7; }
.tc-card li::before {
  content: ""; position: absolute; left: 0; top: 12px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--green);
}
.tc-card__go { margin-top: auto; font-size: 14.5px; font-weight: 700; color: var(--green-dark); }
.tc-card__go:hover { text-decoration: underline; }

/* ---------- 造价拆解表 ---------- */
.cost-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
.cost-table th, .cost-table td { border: 1px solid var(--border); padding: 9px 10px; }
.cost-table th { background: var(--bg-soft); color: var(--ink); font-weight: 700; font-size: 14px; text-align: left; }
.cost-table td { color: var(--ink); }
.cost-table td:first-child { color: var(--ink); font-weight: 600; }
.cost-table td.num, .cost-table th.num { text-align: right; white-space: nowrap; }
.cost-table tr.is-total td { background: #f1faf6; color: var(--green-dark); font-weight: 800; font-size: 15px; }
.cost-table .pct { font-size: 12.5px; color: var(--muted); margin-left: 4px; }

/* 方案切换 */
.plan-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 16px; }
.plan-seg button {
  appearance: none; border: 1px solid var(--border); background: #fff;
  border-radius: 12px; padding: 11px 6px; font-size: 14.5px; font-weight: 700;
  color: var(--muted); cursor: pointer; transition: all .18s ease; font-family: inherit;
}
.plan-seg button small { display: block; font-size: 12.5px; font-weight: 500; margin-top: 3px; opacity: .8; }
.plan-seg button:hover { border-color: var(--green); color: var(--green-dark); }
.plan-seg button.is-active {
  background: var(--green); border-color: var(--green); color: #fff;
  box-shadow: 0 6px 16px rgba(6, 182, 122, .22);
}
.plan-seg button.is-active small { color: rgba(255, 255, 255, .88); }

/* ---------- 模式对比 ---------- */
.cmp-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
.cmp-table th, .cmp-table td { border: 1px solid var(--border); padding: 10px 11px; text-align: left; vertical-align: top; }
.cmp-table thead th { background: var(--bg-soft); color: var(--ink); font-weight: 800; font-size: 14px; }
.cmp-table thead th.is-rec { background: var(--green); color: #fff; }
.cmp-table tbody th { background: #fbfdfc; color: var(--ink); font-weight: 700; font-size: 14px; width: 96px; }
.cmp-table td { color: var(--ink); line-height: 1.8; }
.cmp-table td.is-rec { background: #f1faf6; color: var(--green-dark); font-weight: 700; }
.cmp-table td b { color: var(--ink); font-weight: 800; }
.cmp-table td.is-rec b { color: var(--green-dark); }
.rec-badge {
  display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; background: var(--green); color: #fff; margin-left: 6px; vertical-align: middle;
}

/* 收益条形图 */
.bar-row { margin: 0 0 12px; }
.bar-row__top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; margin-bottom: 5px; }
.bar-row__top span { color: var(--muted); }
.bar-row__top b { color: var(--ink); font-weight: 800; }
.bar-track { height: 22px; background: var(--bg-soft); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--green); border-radius: 6px; transition: width .35s ease; }
.bar-fill.is-rec { background: var(--green-dark); }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .calc-wrap { grid-template-columns: 1fr; gap: 18px; }
  .calc-result { position: static; }
  .case-stats { grid-template-columns: repeat(2, 1fr); }
  .case-grid { grid-template-columns: 1fr; }
  .case-fields { grid-template-columns: 1fr; }
  .tc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .tl-h2 { font-size: 20.5px; }
  .calc-seg { grid-template-columns: 1fr; }
  .calc-seg button { padding: 10px 8px; font-size: 14px; }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-hero__num { font-size: 29px; }
  .tl-form .f-row { grid-template-columns: 1fr; }
  .case-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .case-stat b { font-size: 22px; }
  .calc-actions .btn { flex: 1 1 100%; }
  .plan-seg { grid-template-columns: 1fr; }
  .cmp-table tbody th { width: 78px; font-size: 12.5px; }
  .cmp-table th, .cmp-table td { padding: 8px 7px; font-size: 13px; }
  .cost-table { font-size: 13px; }
  .cost-table th, .cost-table td { padding: 7px 6px; }
}
