:root {
  color-scheme: light;
  --ink: #18352f;
  --quiet: #4e6860;
  --line: #d9e5df;
  --paper: #fff;
  --tint: #edf6ef;
  --accent: #176447;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--ink);
  background: #f5f8f4;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: .22em; }
:focus-visible { outline: 3px solid #2e8c61; outline-offset: 3px; }

.site-header {
  padding: 1rem max(1rem, calc((100% - 70rem) / 2));
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-header a { color: var(--ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
main { width: min(70rem, calc(100% - 2rem)); margin: 2.5rem auto 3rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 5vw, 2.8rem); line-height: 1.2; letter-spacing: -.035em; }
h2 { font-size: 1.2rem; }
p { line-height: 1.65; }
.intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .8rem; margin-bottom: 1.4rem; }
.intro p { color: var(--quiet); margin-top: .6rem; }
.intro a { font-size: .9rem; }

.workspace { display: grid; grid-template-columns: 1.12fr 1fr; gap: 1rem; align-items: start; }
.card { min-width: 0; margin-bottom: 1rem; padding: clamp(1rem, 3vw, 1.6rem); background: var(--paper); border: 1px solid var(--line); border-radius: .9rem; }
.card h2 { margin-bottom: 1rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.field { display: grid; gap: .35rem; align-content: start; font-size: .9rem; font-weight: 600; }
.wide { grid-column: 1 / -1; }
input, select, button { font: inherit; }
input[type="number"], select {
  width: 100%;
  min-width: 0;
  border: 1px solid #b8ccc1;
  border-radius: .45rem;
  color: var(--ink);
  background: var(--paper);
  padding: .55rem .6rem;
  font-weight: 400;
}
.checkbox { display: flex; align-items: center; gap: .45rem; font-size: .9rem; }
.checkbox input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent); }
.hint { color: var(--quiet); font-size: .84rem; }
details { margin-top: 1rem; }
details p { margin: .6rem 0; }
details summary { cursor: pointer; font-weight: 600; }
details:first-child { margin: 0; }
.calculate { display: block; width: 100%; background: var(--accent); border: 0; color: #fff; font-weight: 700; padding: .75rem; border-radius: .5rem; cursor: pointer; margin-top: 1rem; }
.calculate:hover { background: #104e37; }
#form-note:not(:empty) { margin-top: .5rem; }

.featured { display: grid; gap: .35rem; padding: 1rem; background: var(--tint); border-radius: .6rem; }
.featured span { font-weight: 600; }
.featured strong { color: var(--accent); font-size: clamp(1.6rem, 4vw, 2.25rem); }
.featured small { color: var(--quiet); }
.result-list { margin: .5rem 0 .75rem; }
.result-list div { display: flex; align-items: start; justify-content: space-between; gap: .5rem 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line); }
.result-list dt { font-size: .9rem; }
.result-list dd { margin: 0; font-weight: 700; text-align: right; }
.result-list dd, .featured strong, td { font-variant-numeric: tabular-nums; }
.results p + p { margin-top: .45rem; }

#city-note { margin-top: .55rem; font-size: .9rem; }
#policy { margin-top: 0; }
.policy-title { font-size: 1.2rem; }
.tax-month { width: max-content; margin-top: .75rem; }
.table-wrap { overflow-x: auto; margin: .75rem 0; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: .88rem; }
thead { background: var(--tint); }
tfoot { background: var(--tint); }
th, td { border-bottom: 1px solid var(--line); padding: .55rem .65rem; text-align: left; }
td small { display: block; margin-top: .15rem; color: var(--quiet); }
.rate-field { display: flex; align-items: center; gap: .25rem; }
.rate-field input { width: 4.4rem; padding: .25rem .3rem; }
.sources, .formulas { margin: .7rem 0; padding-left: 1.35rem; line-height: 1.7; font-size: .88rem; }

@media (max-width: 760px) {
  main { margin-top: 1.5rem; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 370px) {
  .fields { grid-template-columns: minmax(0, 1fr); }
  .result-list div { flex-wrap: wrap; }
}
