* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #1a202c;
  background: #f7fafc;
}
a { color: #2b6cb0; text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85em; background: #edf2f7; padding: 1px 4px; border-radius: 3px; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: #1a202c; color: #fff; padding: 10px 18px;
}
.topbar a { color: #cbd5e0; }
.topbar .brand { color: #fff; font-weight: 600; }
main { max-width: 1200px; margin: 0 auto; padding: 20px 18px 40px; }
.foot { text-align: center; color: #a0aec0; font-size: 12px; padding: 24px; }

h1 { font-size: 22px; margin: .2em 0 .4em; }
h2 { font-size: 17px; margin: 1.6em 0 .5em; border-bottom: 1px solid #e2e8f0; padding-bottom: 4px; }
.ticker, .src { font-weight: 400; color: #718096; font-size: 13px; }
.hint, .empty { color: #718096; }
.empty { padding: 16px 0; }

/* ---- filters ---- */
.filters fieldset { border: 1px solid #e2e8f0; border-radius: 6px; margin: 0 0 14px; padding: 10px 14px 14px; background: #fff; }
.filters legend { font-weight: 600; padding: 0 6px; color: #2d3748; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 18px; }
.filter-grid label { display: flex; flex-direction: column; gap: 4px; }
.flabel { font-size: 13px; color: #2d3748; }
.flabel em { color: #a0aec0; font-style: normal; font-size: 11px; }
.filters select { padding: 4px 6px; border: 1px solid #cbd5e0; border-radius: 4px; background: #fff; font: inherit; }
.filters select[multiple] { min-height: 110px; }
.actions { margin-top: 6px; display: flex; gap: 12px; align-items: center; }
button[type=submit] { background: #2b6cb0; color: #fff; border: 0; padding: 8px 20px; border-radius: 5px; font-size: 14px; cursor: pointer; }
button[type=submit]:hover { background: #2c5282; }
.btn-secondary { padding: 8px 14px; border: 1px solid #cbd5e0; border-radius: 5px; color: #4a5568; background: #fff; }

.results-h { margin-top: 1.8em; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 6px 9px; border-bottom: 1px solid #edf2f7; text-align: left; vertical-align: top; }
thead th { position: sticky; top: 0; background: #edf2f7; z-index: 1; }
tbody tr:hover { background: #f7fafc; }
td.num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

table.results thead th { white-space: nowrap; }
table.results thead th a { color: #2d3748; display: block; }
table.results thead th em { color: #a0aec0; font-style: normal; font-size: 11px; }
table.results thead th.sorted { background: #e2e8f0; }
table.results .arrow { color: #2b6cb0; }

table.kv th { width: 280px; background: #f7fafc; font-weight: 600; }
table.kv td { word-break: break-word; }
table.kv .zh { color: #2d3748; } table.kv .en { color: #a0aec0; font-size: 11px; }
th .zh { font-weight: 600; } th .en { font-weight: 400; color: #a0aec0; font-size: 11px; }

table.periods th.corner { background: #edf2f7; }
table.periods tbody th { background: #f7fafc; min-width: 240px; }
table.periods td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.periods thead th { white-space: nowrap; text-align: right; }

table.rows thead th { white-space: nowrap; }

/* ---- pager ---- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; align-items: center; }
.pager a, .pager span { padding: 4px 9px; border: 1px solid #cbd5e0; border-radius: 4px; background: #fff; }
.pager .cur { background: #2b6cb0; color: #fff; border-color: #2b6cb0; }
.pager .disabled { color: #cbd5e0; }
.pager .gap { border: 0; }

/* ---- chart ---- */
.chart-box { height: 320px; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px; }

section { margin-bottom: 8px; }
