:root {
  color-scheme: light;
  --ink: #183432;
  --muted: #607573;
  --brand: #168c84;
  --brand-dark: #0d655f;
  --brand-soft: #e7f7f4;
  --line: #d8e4e2;
  --paper: #ffffff;
  --background: #edf4f2;
  --danger: #bd2d2d;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(circle at top right, #d9f2ed 0, transparent 36rem), var(--background); }
button, input { font: inherit; }
.calculator-shell { width: min(100% - 32px, 980px); margin: 0 auto; padding: 56px 0 72px; }
.hero { max-width: 720px; margin-bottom: 28px; }
.eyebrow, .step { margin: 0 0 8px; color: var(--brand-dark); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { max-width: 680px; margin: 0; font-size: clamp(34px, 6vw, 64px); line-height: 1.08; letter-spacing: -.045em; }
.hero > p:last-child { max-width: 620px; margin: 18px 0 0; color: var(--muted); font-size: 17px; line-height: 1.75; }
.calculator-card, .results-card, .rules-card { margin-top: 18px; padding: clamp(22px, 4vw, 36px); border: 1px solid rgba(22, 140, 132, .14); border-radius: 24px; background: rgba(255, 255, 255, .94); box-shadow: 0 18px 60px rgba(24, 52, 50, .08); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
h2 { margin: 0; font-size: clamp(22px, 3vw, 32px); }
.privacy-note { padding: 8px 12px; border-radius: 999px; color: var(--brand-dark); background: var(--brand-soft); font-size: 13px; font-weight: 700; }
fieldset { min-width: 0; margin: 28px 0 0; padding: 0; border: 0; }
legend { margin-bottom: 12px; font-weight: 800; }
.withdrawal-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.withdrawal-options legend { grid-column: 1 / -1; }
.withdrawal-options label { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.withdrawal-options input { grid-row: 1 / span 2; margin: 4px 0 0; accent-color: var(--brand); }
.withdrawal-options small { color: var(--muted); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.field { display: grid; gap: 9px; font-weight: 800; }
.field input { width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fbfdfd; outline: none; }
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(22, 140, 132, .12); }
.action-row { display: flex; align-items: center; gap: 16px; min-height: 44px; margin-top: 18px; }
#fillLimit { padding: 11px 16px; border: 0; border-radius: 12px; color: white; background: var(--brand); font-weight: 800; cursor: pointer; }
#fillLimit:hover { background: var(--brand-dark); }
#fillLimit:focus-visible { outline: 3px solid rgba(22, 140, 132, .3); outline-offset: 3px; }
.validation-message { margin: 0; color: var(--danger); font-size: 14px; }
.results-card { color: white; background: linear-gradient(135deg, #123d39, #0e746c); }
.results-card .step { color: #8ce0d7; }
.final-total { display: flex; align-items: flex-start; color: #fff; }
.final-total span { margin: 7px 4px 0 0; font-size: 22px; }
.final-total strong { font-size: clamp(36px, 7vw, 64px); line-height: 1; letter-spacing: -.04em; }
.results-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 28px 0 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, .16); border-radius: 16px; background: rgba(255, 255, 255, .16); }
.results-grid div { padding: 18px; background: rgba(9, 50, 46, .58); }
.results-grid dt { color: #bce2dd; font-size: 13px; }
.results-grid dd { margin: 8px 0 0; font-size: 20px; font-weight: 800; }
.rules-card ul { margin: 18px 0 0; padding-left: 1.2em; color: var(--muted); line-height: 1.9; }

@media (max-width: 680px) {
  .calculator-shell { width: min(100% - 20px, 980px); padding: 32px 0 48px; }
  .calculator-card, .results-card, .rules-card { border-radius: 18px; }
  .section-heading { display: grid; }
  .privacy-note { justify-self: start; }
  .withdrawal-options, .field-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-row { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 420px) {
  .results-grid { grid-template-columns: 1fr; }
}
