:root {
  color-scheme: light dark;
  --background: #eef5f4;
  --surface: #ffffff;
  --ink: #142626;
  --muted: #405c59;
  --accent: #126256;
  --line: #cbdad6;
  --result: #e4f2ee;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #111b1c;
    --surface: #192627;
    --ink: #ecf5f4;
    --muted: #afc6c2;
    --accent: #88d5c4;
    --line: #435b58;
    --result: #203b38;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--ink); font: 16px/1.6 system-ui, "Microsoft YaHei", sans-serif; }
.shell { width: min(100% - 2rem, 58rem); margin-inline: auto; }
.masthead, .footer, .masthead nav { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.25rem; }
.masthead { justify-content: space-between; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.brand { color: var(--ink); font-weight: 750; text-decoration: none; }
a { color: var(--accent); text-underline-offset: .18em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.intro { margin: clamp(1.6rem, 6vw, 3.75rem) 0 1.4rem; }
h1, h2 { line-height: 1.25; }
h1 { font-size: clamp(2rem, 5.4vw, 3.25rem); letter-spacing: -.045em; margin: 0 0 .45rem; }
h2 { font-size: 1.25rem; margin: 0; }
p { margin: .5rem 0; }
.intro p, .muted { color: var(--muted); }
.calculator { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.calculator, .guide { background: var(--surface); border: 1px solid var(--line); border-radius: 1rem; overflow: clip; }
form, .result, .guide { padding: clamp(1rem, 4vw, 1.55rem); }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin-top: 1.15rem; }
label { display: grid; gap: .35rem; font-size: .9rem; }
select, input { width: 100%; min-width: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: .5rem; padding: .55rem .65rem; font: inherit; min-height: 2.6rem; }
.result { background: var(--result); border-inline-start: 1px solid var(--line); }
.result-label { font-weight: 650; margin: 0; }
output { display: block; margin-top: .35rem; font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1.2; font-weight: 750; letter-spacing: -.035em; overflow-wrap: anywhere; }
dl { display: grid; gap: .3rem; padding-bottom: .75rem; margin: 1rem 0 .7rem; border-bottom: 1px solid var(--line); }
dl div { display: flex; justify-content: space-between; gap: .5rem; }
dd { margin: 0; text-align: right; white-space: nowrap; }
.result a { display: inline-block; margin-top: .4rem; }
[hidden] { display: none !important; }
.guide { margin: 1.2rem 0; }
ol { padding-left: 1.45rem; margin: .7rem 0; }
li + li { margin-top: .35rem; }
code { word-break: break-word; }
.footer { padding: .1rem 0 2rem; }
@media (max-width: 42rem) {
  .calculator { grid-template-columns: 1fr; }
  .result { border-inline-start: 0; border-block-start: 1px solid var(--line); }
}
@media (max-width: 25rem) {
  .fields { grid-template-columns: 1fr; }
}

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: .55rem .5rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
