:root {
  --ink: #1b2331;
  --muted: #6b7688;
  --line: #dfe4ec;
  --bg: #f4f6fa;
  --card: #fff;
  --navy: #14203a;
  --accent: #1257c3;
  --accent-soft: #e8f0fd;
  --good: #0d7a4a;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }
a { color: var(--accent); }
a:hover { text-decoration: none; }
.wrap { max-width: 1680px; margin: 0 auto; padding: 0 20px; }

.site-header { background: var(--navy); color: #fff; }
.header-inner { display: flex; align-items: center; gap: 32px; min-height: 58px; flex-wrap: wrap; }
.brand { font-size: 17px; font-weight: 700; color: #fff; text-decoration: none; letter-spacing: .2px; }
.site-header nav { display: flex; gap: 6px; flex-wrap: wrap; }
.site-header nav a { color: #c7d2e6; text-decoration: none; padding: 7px 12px; border-radius: 6px; }
.site-header nav a:hover { background: #22314f; color: #fff; }
.site-header nav a[aria-current="page"] { background: #2c4675; color: #fff; }

main { padding: 26px 0 60px; }
h1 { font-size: 26px; margin: 0 0 6px; }
h2 { font-size: 19px; margin: 30px 0 10px; }
h3 { font-size: 14px; margin: 14px 0 6px; }
.lede { color: var(--muted); margin: 0 0 20px; max-width: 900px; }

.layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 18px; align-items: start; }
.filters, .results-pane, .card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.filters { padding: 14px 16px 18px; position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; }
.filters fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 12px 0 4px; }
.filters fieldset:first-of-type { border-top: 0; padding-top: 0; }
.filters legend { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); padding: 0 0 8px; }
.filters label { display: block; font-size: 12px; color: #47546a; margin: 9px 0 3px; }
.filters input[type="search"], .filters input[type="text"], .filters input[type="number"], .filters select {
  width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff;
  color: var(--ink); font: inherit; font-size: 13px;
}
.filters select[multiple] { padding: 3px; }
.filters select[multiple] option { padding: 2px 4px; }
.filters input:focus, .filters select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hint { font-size: 11px; color: var(--muted); margin: 5px 0 0; }
.check { display: flex; align-items: center; gap: 7px; margin-top: 10px; }
.check input { width: auto; }
.check label { margin: 0; font-size: 13px; color: var(--ink); }
.btnrow { display: flex; gap: 8px; margin-top: 16px; }
button { font: inherit; cursor: pointer; }
.btn { padding: 7px 13px; border: 1px solid var(--line); border-radius: 6px; background: #f7f9fc; color: var(--ink); }
.btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
.btn:disabled:hover { background: #f7f9fc; border-color: var(--line); }

.results-pane { padding: 14px 16px 18px; min-width: 0; }
.results-bar { display: flex; gap: 14px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
#results { font-weight: 600; font-size: 13px; }
.sort-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sort-controls label { font-size: 12px; color: var(--muted); }
.sort-controls select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font: inherit; font-size: 13px; }

.table-wrap { overflow: auto; max-height: 78vh; border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; min-width: 1150px; font-size: 12.5px; }
thead th { position: sticky; top: 0; z-index: 1; background: #eef2f8; text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; font-size: 11.5px; text-transform: uppercase; letter-spacing: .3px; color: #4a566b; }
tbody td { padding: 8px; border-bottom: 1px solid #eef1f6; vertical-align: top; }
tbody tr:not(.detail):hover { background: #f8fbff; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
td.rank { white-space: nowrap; color: var(--muted); }
td.plan { min-width: 190px; max-width: 250px; }
td.plan strong { font-weight: 650; }
td.plan .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
td.links { white-space: nowrap; }
td.billing { min-width: 120px; }
td.index { font-weight: 700; color: var(--good); font-variant-numeric: tabular-nums; }
td.price { font-weight: 600; font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); font-size: 11px; margin-top: 2px; }
.muted { color: var(--muted); }
.tag { font-size: 10px; background: #eef2f8; border-radius: 4px; padding: 1px 4px; color: #4a566b; }
.chip { display: inline-block; font-size: 10.5px; background: #eef2f8; border-radius: 4px; padding: 1px 5px; margin: 1px 2px 1px 0; white-space: nowrap; }
.chip-alt { background: #f0ecfb; color: #5b3d9c; }
.expand { width: 20px; height: 20px; line-height: 1; border: 1px solid var(--line); background: #fff; border-radius: 4px; margin-right: 6px; color: var(--accent); font-weight: 700; }
.expand:hover { background: var(--accent-soft); }
tbody tr.detail { background: #f9fbfe; }
tbody tr.detail[hidden] { display: none; }
tbody tr.detail > td { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.detail-grid { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(240px, 1fr); gap: 10px 26px; }
.detail-grid .wide { grid-column: 1 / -1; }
.detail-grid dl { display: grid; grid-template-columns: 150px 1fr; gap: 3px 10px; margin: 0; font-size: 12.5px; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { margin: 0; }
.detail-grid ul { margin: 4px 0; padding-left: 20px; font-size: 12.5px; }
.detail-grid li { margin-bottom: 4px; }
table.mini { min-width: 0; width: auto; font-size: 12px; margin: 6px 0 12px; }
table.mini thead th { position: static; padding: 5px 9px; }
table.mini tbody td { padding: 5px 9px; }
.empty { text-align: center; padding: 28px; color: var(--muted); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 13px; }
.footnote { color: var(--muted); font-size: 12px; margin: 16px 0 0; border-top: 1px solid var(--line); padding-top: 12px; }
.meta { font-size: 12px; color: var(--muted); }

/* About page */
.prose { max-width: 860px; }
.prose .card { padding: 18px 22px; margin-bottom: 18px; }
.prose p, .prose li { line-height: 1.7; }
.prose code { background: #eef2f8; border-radius: 4px; padding: 1px 5px; font-size: 12.5px; }
pre { background: #14203a; color: #eaf0fb; padding: 16px 18px; border-radius: 8px; overflow: auto; font-size: 13px; line-height: 1.6; }
.prose table { min-width: 0; width: 100%; font-size: 13px; margin: 10px 0 18px; }
.prose thead th { position: static; }
.prose td, .prose th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.note { background: #fff8e8; border: 1px solid #f0dfae; border-radius: 8px; padding: 12px 16px; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  .detail-grid { grid-template-columns: 1fr; }
}
