:root {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #19233e;
  background: #f3f5fa;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px max(20px, calc((100vw - 1040px) / 2));
  color: white;
  background: #131e4b;
}
header img { border-radius: 10px; }
header span { margin-left: auto; color: #f0ca77; font-size: .875rem; }
main { width: min(calc(100% - 40px), 1040px); margin: 36px auto; }
h1 { margin: 0; font-size: clamp(1.55rem, 4vw, 2rem); }
.intro { color: #51617b; margin: 10px 0 24px; }
.filters { display: flex; align-items: center; gap: 12px; }
select, button { font: inherit; min-height: 40px; border-radius: 7px; cursor: pointer; }
select { color: inherit; border: 1px solid #b8c2d4; background: white; padding: 5px 10px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0; }
.metrics section, .ledger { background: white; border: 1px solid #dce2ee; border-radius: 12px; padding: 18px; }
h2 { font-size: 1rem; margin: 0; }
.metrics h2 { color: #51617b; font-weight: 500; }
output { display: block; margin-top: 8px; font-size: 1.35rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin-top: 12px; font-size: .9rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #e4e8f0; white-space: nowrap; }
th { color: #51617b; background: #f6f8fc; }
button { background: #253c8b; border: 1px solid transparent; color: white; padding: 5px 10px; }
button:disabled { color: #526079; background: #edf0f6; cursor: default; }
#reset { color: #253c8b; background: white; border-color: #b8c2d4; }
#notice { margin: 10px 0 0; color: #256044; }
#notice:empty { display: none; }
:focus-visible { outline: 2px solid #546bc1; outline-offset: 3px; }
@media (max-width: 540px) {
  main { width: calc(100% - 24px); margin: 22px auto; }
  .metrics { gap: 6px; }
  .metrics section, .ledger { padding: 10px; }
  .metrics h2 { font-size: .82rem; }
  output { font-size: clamp(.85rem, 3.8vw, 1.15rem); }
}
