/* ==========================================================================
   成本估算器（首页「更快、更省、更稳」下方 / c-auto 页底部共用）
   结构与标签来自 common/fragments/smart-model-savings.html
   ========================================================================== */

/* 首页里外层用 .landing-section 提供留白，避免和内层 clamp(56px) 叠加 */
.landing-section .tp-sm-savings {
  padding: 0;
  /* 首页外层 .landing-section 已经限宽，内层不再收窄 */
  max-width: none;
}

.tp-sm-savings-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.tp-sm-savings-head-main {
  max-width: 720px;
  min-width: 0;
}

.tp-sm-savings-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  font-size: 13.5px;
  font-weight: 600;
  color: #4338ca;
  text-decoration: none;
  padding-bottom: 2px;
  white-space: nowrap;
}

.tp-sm-savings-link:hover {
  text-decoration: underline;
}

.tp-sm-savings-title {
  margin: 12px 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -.02em;
  color: #090f1d;
}

.tp-sm-savings-accent {
  background: linear-gradient(96deg, #4338ca, #0072f5 60%, #00a9ce);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.tp-sm-savings-desc {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.75;
  color: #64748b;
}

.tp-sm-savings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 18px;
  align-items: stretch;
}

.tp-sm-savings-form,
.tp-sm-savings-result {
  border: 1px solid #e6ebf4;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
  padding: 22px;
  min-width: 0;
}

.tp-sm-savings-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tp-sm-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.tp-sm-field-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  letter-spacing: .07em;
  color: #94a3b8;
  text-transform: uppercase;
}

.tp-sm-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #f8fafc;
  padding: 0 14px;
  transition: border-color .16s ease;
}

.tp-sm-input-row:focus-within {
  border-color: #4338ca;
  background: #fff;
}

.tp-sm-input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  outline: none;
  font-family: inherit;
}

.tp-sm-input-prefix,
.tp-sm-input-suffix {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: #94a3b8;
}

.tp-sm-select-wrap {
  display: block;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  background: #f8fafc;
}

.tp-sm-select-wrap {
  transition: border-color .16s ease, box-shadow .16s ease;
}

/* 原生下拉聚焦时去掉黑色描边，改用外层容器的品牌色 focus 环 */
.tp-sm-select-wrap:focus-within {
  border-color: #4338ca;
  box-shadow: 0 0 0 3px rgba(67, 56, 202, .1);
}

.tp-sm-select {
  appearance: none;
  outline: none;
  padding: 12px 14px;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #94a3b8 50%), linear-gradient(135deg, #94a3b8 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  background-color: transparent;
}

.tp-sm-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: -6px;
}

.tp-sm-quick button {
  appearance: none;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.tp-sm-quick button:hover {
  border-color: #c7d2fe;
  color: #4338ca;
}

.tp-sm-quick button.is-active {
  border-color: #4338ca;
  background: #eef2ff;
  color: #4338ca;
}

.tp-sm-savings-hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: #94a3b8;
}

.tp-sm-savings-error {
  margin: 0;
  font-size: 12px;
  color: #b91c1c;
}

.tp-sm-savings-result {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: linear-gradient(160deg, #f7f9ff 0%, #eef3ff 55%, #eaf6ff 100%);
  border-color: #e2e9ff;
}

.tp-sm-savings-figure {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.tp-sm-savings-figure-row {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

.tp-sm-savings-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(16, 185, 129, .12);
  border: 1px solid rgba(16, 185, 129, .3);
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* 单价对比：我们用绿色，官方价划线弱化 */
.tp-sm-savings-units {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .7);
  border: 1px solid #e6ecfa;
}

.tp-sm-savings-unit {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
}

.tp-sm-savings-unit-label {
  flex: 1 1 auto;
  min-width: 0;
  color: #64748b;
}

.tp-sm-savings-unit-ours {
  font-weight: 700;
  color: #4338ca;
  font-variant-numeric: tabular-nums;
}

.tp-sm-savings-unit-off {
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.tp-sm-quick--money {
  margin-top: -4px;
}

.tp-sm-savings-figure strong {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -.02em;
  background: linear-gradient(96deg, #4338ca, #0072f5 60%, #00a9ce);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.tp-sm-savings-figure span {
  font-size: 12.5px;
  color: #64748b;
}

.tp-sm-savings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tp-sm-savings-table th,
.tp-sm-savings-table td {
  padding: 10px 6px;
  text-align: right;
  border-bottom: 1px solid rgba(15, 23, 42, .07);
}

.tp-sm-savings-table thead th {
  font-size: 10.5px;
  letter-spacing: .06em;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(15, 23, 42, .1);
}

.tp-sm-savings-table tbody th {
  text-align: left;
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
}

.tp-sm-savings-table tbody td {
  font-weight: 600;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

.tp-sm-savings-table tr.is-ours th,
.tp-sm-savings-table tr.is-ours td {
  color: #4338ca;
  font-weight: 700;
}

.tp-sm-savings-table tr:last-child th,
.tp-sm-savings-table tr:last-child td {
  border-bottom: 0;
}

.tp-sm-savings-cover {
  margin: 0;
  font-size: 12px;
  color: #64748b;
}

.tp-sm-savings-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.tp-sm-savings-actions .landing-btn {
  padding: 11px 18px;
  font-size: 13.5px;
  border-radius: 10px;
}

@media (max-width: 1023px) {
  .tp-sm-savings-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tp-sm-savings-figure {
    align-items: flex-start;
    text-align: left;
  }
}

@media (max-width: 640px) {
  .tp-sm-savings-form,
  .tp-sm-savings-result {
    padding: 16px;
    border-radius: 14px;
  }

  .tp-sm-savings-table th,
  .tp-sm-savings-table td {
    padding: 9px 4px;
    font-size: 12px;
  }

  .tp-sm-savings-table tbody th {
    white-space: normal;
  }
}

html[data-theme="dark"] .tp-sm-savings-title {
  color: #e2e8f0;
}

html[data-theme="dark"] .tp-sm-savings-desc,
html[data-theme="dark"] .tp-sm-savings-hint,
html[data-theme="dark"] .tp-sm-savings-cover {
  color: #94a3b8;
}

html[data-theme="dark"] .tp-sm-savings-form,
html[data-theme="dark"] .tp-sm-savings-result {
  background: #131c30;
  border-color: rgba(148, 163, 184, .18);
  box-shadow: none;
}

html[data-theme="dark"] .tp-sm-input-row,
html[data-theme="dark"] .tp-sm-select-wrap {
  background: #0f1728;
  border-color: rgba(148, 163, 184, .2);
}

html[data-theme="dark"] .tp-sm-input {
  color: #e2e8f0;
}

html[data-theme="dark"] .tp-sm-quick button {
  background: #16233a;
  border-color: rgba(148, 163, 184, .18);
  color: #cbd5e1;
}

html[data-theme="dark"] .tp-sm-quick button.is-active {
  background: rgba(99, 102, 241, .22);
  border-color: rgba(129, 140, 248, .5);
  color: #c7d2fe;
}

html[data-theme="dark"] .tp-sm-savings-table th,
html[data-theme="dark"] .tp-sm-savings-table td {
  border-bottom-color: rgba(148, 163, 184, .14);
}

html[data-theme="dark"] .tp-sm-savings-table tbody th {
  color: #94a3b8;
}

html[data-theme="dark"] .tp-sm-savings-table tbody td {
  color: #e2e8f0;
}

html[data-theme="dark"] .tp-sm-savings-table tr.is-ours th,
html[data-theme="dark"] .tp-sm-savings-table tr.is-ours td {
  color: #a5b4fc;
}

html[data-theme="dark"] .tp-sm-savings-link {
  color: #a5b4fc;
}

html[data-theme="dark"] .tp-sm-savings-badge {
  background: rgba(16, 185, 129, .18);
  border-color: rgba(52, 211, 153, .35);
  color: #6ee7b7;
}

html[data-theme="dark"] .tp-sm-savings-units {
  background: rgba(15, 23, 40, .6);
  border-color: rgba(148, 163, 184, .18);
}

html[data-theme="dark"] .tp-sm-savings-unit-label {
  color: #94a3b8;
}

html[data-theme="dark"] .tp-sm-savings-unit-ours {
  color: #a5b4fc;
}

@media (max-width: 640px) {
  .tp-sm-savings-head {
    align-items: flex-start;
  }

  .tp-sm-savings-link {
    font-size: 13px;
  }
}
