:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: #17243a;
  background: #f4f6fb;
  --surface: #fff;
  --muted: #505f77;
  --accent: #2457b0;
  --line: #dce3f0;
  --edge: clamp(16px, 5vw, 52px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.55; }
h1, h2, p { margin: 0; }
a { color: var(--accent); text-underline-offset: 0.24em; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #326be4; outline-offset: 3px; }
.skip-link { position: absolute; left: 12px; top: 10px; z-index: 1; padding: 8px 12px; background: #fff; }
.skip-link:not(:focus) { transform: translateY(-150%); }

.topbar { background: #fff; border-bottom: 1px solid var(--line); }
.topbar-inner, main { width: min(100% - 2 * var(--edge), 1140px); margin: 0 auto; }
.topbar-inner, .brand, .topbar nav { display: flex; align-items: center; }
.topbar-inner { justify-content: space-between; min-height: 64px; gap: 12px; }
.topbar nav { gap: clamp(10px, 3vw, 24px); }
.topbar nav a { color: var(--muted); font-size: 0.86rem; white-space: nowrap; }
.brand { gap: 9px; color: inherit; font-weight: 750; text-decoration: none; font-size: 0.98rem; }
.brand-mark { width: 28px; height: 28px; background: #254e9c; border-radius: 9px; position: relative; }
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: solid #e4efff;
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg) translate(2px, -2px);
  border-radius: 1px;
}

main { padding: clamp(22px, 5vw, 54px) 0 60px; }
.intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 24px;
  padding: clamp(23px, 5vw, 56px);
  border: 1px solid #263f61;
  border-radius: clamp(18px, 3vw, 30px);
  background: radial-gradient(ellipse at 92% 90%, #294e82 0%, transparent 64%), linear-gradient(130deg, #101b32, #192d4e);
  color: #f6f9ff;
}
.mode { color: #bcd5ff; font-size: 0.875rem; font-weight: 650; }
h1 { font-size: clamp(2.15rem, 5.3vw, 4.1rem); letter-spacing: -0.045em; line-height: 1.12; margin: 8px 0 10px; }
.lead { color: #d7e4f8; max-width: 37ch; }
.snapshot {
  display: grid;
  gap: 4px;
  border: 1px solid #6481ab;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 0.83rem;
  color: #d7e4f8;
}
.snapshot time, .snapshot code { color: #fff; font-weight: 650; margin-left: 4px; }

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 18px;
  padding: 14px 18px 16px;
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.filters label { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: 0.86rem; font-weight: 650; }
select, .secondary {
  min-width: 0;
  min-height: 42px;
  padding: 6px 11px;
  color: #223654;
  background: #f7f9fd;
  border: 1px solid #c9d4e6;
  border-radius: 9px;
}
select:disabled { opacity: 0.65; }
.secondary { font-size: 0.88rem; }
.secondary:hover { background: #eaf1ff; }

.status-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; margin: 12px 0 23px; }
#status, #evidence-description { color: var(--muted); font-size: 0.9rem; }
#status[data-state="error"] { color: #a1262d; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 10px; }
.section-heading h2 { font-size: clamp(1.18rem, 3vw, 1.45rem); }
.section-heading span { color: var(--muted); font-size: 0.83rem; }

.metrics { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); gap: 12px; }
.metric {
  display: grid;
  gap: 5px;
  align-content: center;
  text-align: start;
  min-height: 92px;
  min-width: 0;
  padding: 14px 17px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.metric:hover, .metric[aria-pressed="true"] { border-color: var(--accent); }
.metric[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--accent); }
.metric span { font-size: 0.875rem; font-weight: 600; color: var(--muted); }
.metric strong { font-size: clamp(1rem, 2.5vw, 1.54rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric.featured { grid-row: span 2; background: #e8efff; border-color: #b7c9f1; padding: clamp(15px, 3vw, 26px); }
.metric.featured strong { color: #173f8a; font-size: clamp(1.62rem, 3.4vw, 2.7rem); letter-spacing: -0.03em; }
.metric.featured .missing { color: var(--muted); }
.metric .formula { font-size: 0.77rem; margin-top: 6px; }
.metric .allocation { display: block; height: 7px; border-radius: 999px; overflow: hidden; background: #a9bee8; margin-top: 8px; }
.allocation > span { height: 100%; display: block; background: #2457b0; }
.metric .allocation-caption { font-size: 0.75rem; font-variant-numeric: tabular-nums; }

.evidence { margin-top: 30px; }
#evidence-description { margin-bottom: 10px; }
.table-wrap { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: start; padding: 12px 17px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { color: #415571; background: #edf2fa; font-size: 0.83rem; }
tr:last-child td { border-bottom: 0; }
.money { font-variant-numeric: tabular-nums; }
.filing { display: block; color: var(--muted); font: 0.75rem/1.6 ui-monospace, monospace; }
.missing, .empty { color: var(--muted); }

@media (max-width: 680px) {
  .intro { gap: 16px; }
  .filters { grid-template-columns: minmax(0, 1fr); padding-inline: 12px; }
  [data-mode="snapshot"] .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters label:first-child { grid-column: 1 / -1; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric { padding: 11px; min-height: 78px; }
  .metric.featured { grid-row: auto; grid-column: 1 / -1; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  tbody { display: block; }
  tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px; padding: 12px; border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border-bottom: 0; }
  td { padding: 0; border: 0; }
  td:nth-child(even) { text-align: end; }
  td:nth-child(2) { font-weight: 650; }
  td:nth-child(3) { color: var(--muted); font-size: 0.8rem; }
  td:nth-child(3)::before { content: "申报 "; }
  td:only-child { grid-column: 1 / -1; }
}
