:root {
  --ink: #17211d;
  --muted: #5b6862;
  --surface: #ffffff;
  --surface-soft: #f3f6f4;
  --line: #d9e1dd;
  --brand: #176b56;
  --brand-dark: #0f4d3e;
  --accent: #e5a43b;
  --danger: #a33d32;
  --shadow: 0 18px 50px rgba(25, 50, 41, 0.09);
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  background: #eef2ef;
  color: var(--ink);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(#eef2ef 1px, transparent 1px),
    linear-gradient(90deg, #eef2ef 1px, transparent 1px),
    #f8faf9;
  background-size: 28px 28px;
  line-height: 1.65;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 7px;
  background: var(--brand);
  color: white;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.status span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a9d67;
  box-shadow: 0 0 0 4px #daf0e4;
}

main {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
}

.intro {
  padding: 72px 0 34px;
}

.eyebrow,
.section-label {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: clamp(36px, 7vw, 58px);
  line-height: 1.12;
  letter-spacing: 0;
}

.lead {
  max-width: 660px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
}

.calculator {
  padding: 30px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calculator-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.calculator h2,
.content-band h2,
.faq h2 {
  margin-bottom: 5px;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: 0;
}

.calculator-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.secondary-button,
.quick-actions button,
.copy-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.secondary-button {
  padding: 0 18px;
}

.secondary-button:hover,
.quick-actions button:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 50px;
  padding: 0 13px;
  border: 1px solid #bdc9c3;
  border-radius: 6px;
  outline: none;
  color: var(--ink);
  background: #fff;
}

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 107, 86, 0.13);
}

.compact-field {
  grid-column: span 2;
  max-width: 280px;
}

.input-with-unit {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid #bdc9c3;
  border-radius: 6px;
  overflow: hidden;
}

.input-with-unit:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 107, 86, 0.13);
}

.input-with-unit input {
  border: 0;
  box-shadow: none;
}

.input-with-unit input:focus {
  box-shadow: none;
}

.input-with-unit span {
  padding: 0 14px;
  color: var(--muted);
  font-weight: 500;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 20px 0;
}

.quick-actions button {
  padding: 0 14px;
  font-size: 13px;
}

.error-message {
  margin-bottom: 18px;
  padding: 11px 14px;
  border-left: 4px solid var(--danger);
  background: #fff1ef;
  color: var(--danger);
  font-weight: 700;
}

.results {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface-soft);
}

.results article {
  min-width: 0;
  min-height: 132px;
  padding: 20px;
  border-right: 1px solid var(--line);
}

.results article:last-child {
  border-right: 0;
}

.results .result-primary {
  background: var(--brand-dark);
  color: white;
}

.results p {
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.results .result-primary p,
.results .result-primary span {
  color: #cfe6de;
}

.results strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.25;
}

.results span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.copy-button {
  width: 100%;
  margin-top: 16px;
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.copy-button:hover {
  background: var(--brand-dark);
}

.content-band,
.faq {
  padding: 68px 0;
}

.content-band {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(0, 1.8fr);
  gap: 48px;
  border-bottom: 1px solid var(--line);
}

.rule-grid {
  display: grid;
  gap: 22px;
}

.rule-grid article {
  padding-left: 18px;
  border-left: 3px solid var(--accent);
}

.rule-grid strong {
  font-size: 17px;
}

.rule-grid p {
  margin: 5px 0 0;
  color: var(--muted);
}

.faq {
  max-width: 760px;
}

.faq h2 {
  margin-bottom: 24px;
}

details {
  border-top: 1px solid var(--line);
}

details:last-child {
  border-bottom: 1px solid var(--line);
}

summary {
  padding: 18px 0;
  cursor: pointer;
  font-weight: 700;
}

details p {
  padding: 0 0 18px;
  margin-bottom: 0;
  color: var(--muted);
}

footer {
  padding: 28px 20px 44px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

footer p {
  margin: 0;
}

noscript {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 12px;
  border: 1px solid var(--danger);
  background: white;
  color: var(--danger);
  text-align: center;
}

@media (max-width: 820px) {
  .results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .results article:nth-child(2) {
    border-right: 0;
  }

  .results article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .content-band {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 620px) {
  .site-header,
  main {
    width: min(100% - 28px, 960px);
  }

  .site-header {
    min-height: 64px;
  }

  .status {
    display: none;
  }

  .intro {
    padding: 48px 0 26px;
  }

  h1 {
    font-size: 38px;
  }

  .lead {
    font-size: 16px;
  }

  .calculator {
    padding: 20px;
  }

  .calculator-head {
    align-items: center;
  }

  .input-grid,
  .results {
    grid-template-columns: 1fr;
  }

  .compact-field {
    grid-column: auto;
    max-width: none;
  }

  .results article {
    min-height: 112px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .results article:last-child {
    border-bottom: 0;
  }

  .content-band,
  .faq {
    padding: 50px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
