/* ============================================================
   2025 上海高中五大学科竞赛排行榜 — 浅色主题
   ============================================================ */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --surface-3: #f0f3f8;
  --border: #e4e8ef;
  --border-strong: #d2d9e4;
  --ink: #1a2433;
  --ink-2: #4b586b;
  --ink-3: #8290a3;
  --accent: #1f4e79;
  --accent-2: #2b6ca3;
  --accent-soft: #eaf2f9;
  --gold: #b8912f;

  --c-math: #3d6fa8;
  --c-physics: #7a5bb5;
  --c-chemistry: #2a9276;
  --c-biology: #cf8a2c;
  --c-informatics: #c0534d;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(26, 36, 51, .04), 0 2px 8px rgba(26, 36, 51, .03);
  --shadow-md: 0 4px 20px rgba(26, 36, 51, .08);
  --shadow-lg: 0 18px 60px rgba(20, 32, 50, .18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 28px;
  height: 66px; display: flex; align-items: center; gap: 36px;
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(140deg, #24567f, #16344f);
  color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-size: 20px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(31, 78, 121, .22);
}
.brand-title { font-size: 15px; font-weight: 700; letter-spacing: .3px; line-height: 1.25; }
.brand-sub { font-size: 11px; color: var(--ink-3); letter-spacing: 1.2px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-item {
  border: 0; background: transparent; color: var(--ink-2);
  padding: 8px 15px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
  transition: .18s;
}
.nav-item:hover { background: var(--surface-3); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.header-tag {
  font-size: 11px; color: var(--ink-3); border: 1px solid var(--border);
  padding: 5px 10px; border-radius: 20px; white-space: nowrap;
}

/* ---------- Layout ---------- */
.container { max-width: 1240px; margin: 0 auto; padding: 30px 28px 60px; }
.view { display: none; animation: fade .28s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 20px; margin: 38px 0 18px;
}
.section-head.standalone { margin-top: 4px; }
.section-head h2 {
  margin: 0 0 4px; font-size: 21px; font-weight: 700; letter-spacing: .2px;
}
.section-head p { margin: 0; color: var(--ink-3); font-size: 13px; }
.section-head-badge {
  font-size: 12px; color: var(--accent); background: var(--accent-soft);
  border: 1px solid #d5e5f2; padding: 5px 12px; border-radius: 20px; white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1fr 300px; gap: 40px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 38px 40px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--c-math), var(--c-informatics));
}
.eyebrow {
  font-size: 11.5px; letter-spacing: 2px; color: var(--accent);
  font-weight: 700; text-transform: uppercase; margin-bottom: 14px;
}
.hero h1 {
  font-family: var(--serif); font-size: 36px; line-height: 1.4;
  margin: 0 0 16px; font-weight: 700; letter-spacing: 1px; color: #16202e;
}
.hero h1 em { font-style: normal; color: var(--accent); border-bottom: 3px solid #cfdff0; padding-bottom: 2px; }
.hero-desc { color: var(--ink-2); font-size: 13.5px; line-height: 1.9; max-width: 620px; margin: 0 0 22px; }
.hero-desc strong { color: var(--accent); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: 8px; font-size: 13px; font-weight: 600;
  border: 1px solid transparent; transition: .18s;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 3px 10px rgba(31,78,121,.18); }
.btn-primary:hover { background: #173d5f; text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.hero-right { border-left: 1px solid var(--border); padding-left: 34px; display: flex; flex-direction: column; justify-content: center; }
.hero-stat { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.hero-stat-num { font-size: 40px; font-weight: 700; color: var(--accent); line-height: 1.1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.hero-stat-label { font-size: 12px; color: var(--ink-3); letter-spacing: .5px; }
.hero-stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.hero-stat-row > div { display: flex; flex-direction: column; }
.mini-num { font-size: 22px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.mini-label { font-size: 11.5px; color: var(--ink-3); }
.hero-note { margin-top: 16px; font-size: 11.5px; color: var(--ink-3); line-height: 1.8; }

/* ---------- Subject cards ---------- */
.subject-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 16px; }
.subject-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 14px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: .2s;
}
.subject-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.subject-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--sc); }
.sc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sc-name { font-size: 15px; font-weight: 700; }
.sc-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sc); }
.sc-big { font-size: 26px; font-weight: 700; color: var(--sc); font-variant-numeric: tabular-nums; line-height: 1.2; }
.sc-big-label { font-size: 11px; color: var(--ink-3); margin-bottom: 10px; }
.sc-line { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-2); border-top: 1px dashed var(--border); padding-top: 8px; }
.sc-line b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Toolbar ---------- */
.toolbar {
  display: flex; align-items: flex-end; gap: 22px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.toolbar.secondary { margin-top: 10px; padding-top: 13px; padding-bottom: 13px; align-items: center; }
.toolbar-group { display: flex; flex-direction: column; gap: 7px; }
.toolbar-group.grow { flex: 1; min-width: 260px; }
.tool-label { font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: 1px; }
.segmented { display: inline-flex; background: var(--surface-3); border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 2px; }
.seg {
  border: 0; background: transparent; color: var(--ink-2); font-size: 12.5px;
  padding: 6px 13px; border-radius: 6px; font-weight: 500; white-space: nowrap; transition: .16s;
}
.seg:hover { color: var(--ink); }
.seg.active { background: var(--surface); color: var(--accent); font-weight: 700; box-shadow: 0 1px 4px rgba(26,36,51,.1); }
.seg-hint { color: var(--ink-3); font-size: 11px; font-weight: 400; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 8px 32px 8px 32px; font-size: 13px; color: var(--ink); background: var(--surface);
  outline: none; transition: .18s;
}
.search-box input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(43,108,163,.1); }
.search-box input::placeholder { color: #a8b2c0; }
.search-icon { position: absolute; left: 11px; color: var(--ink-3); font-size: 18px; line-height: 1; }
.search-clear { position: absolute; right: 8px; border: 0; background: transparent; color: var(--ink-3); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 5px; }
.search-clear:hover { background: var(--surface-3); color: var(--ink); }
.check-label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.check-label input { accent-color: var(--accent); width: 15px; height: 15px; }
.check-hint { color: var(--ink-3); font-size: 11.5px; }

/* ---------- Rank table ---------- */
.table-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: auto; box-shadow: var(--shadow-sm); margin-top: 14px;
}
table { border-collapse: collapse; width: 100%; }
.rank-table { min-width: 980px; }
.rank-table thead th, .data-table thead th {
  background: var(--surface-2); text-align: left; font-size: 11.5px; font-weight: 700;
  color: var(--ink-3); letter-spacing: .6px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.th-hint { font-weight: 400; letter-spacing: 0; color: #a5afbd; }
.rank-table tbody tr { border-bottom: 1px solid #eef1f5; transition: background .14s; cursor: pointer; }
.rank-table tbody tr:last-child { border-bottom: 0; }
.rank-table tbody tr:hover { background: #f7fafd; }
.rank-table td { padding: 11px 14px; vertical-align: middle; font-size: 13px; }
.col-rank { width: 62px; }
.col-name { min-width: 150px; }
.col-index { width: 105px; }
.col-bars { min-width: 250px; }
.col-num { width: 84px; text-align: right; }
.col-quality { width: 110px; }
.rank-table th.col-num { text-align: right; }

.rank-badge {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--surface-3); color: var(--ink-2);
}
.rank-badge.r1 { background: linear-gradient(140deg, #e9c96a, #c9a227); color: #fff; box-shadow: 0 2px 6px rgba(184,145,47,.3); }
.rank-badge.r2 { background: linear-gradient(140deg, #c9d2dd, #9aa8b8); color: #fff; }
.rank-badge.r3 { background: linear-gradient(140deg, #dfae8a, #b8815a); color: #fff; }
.school-cell { display: flex; flex-direction: column; gap: 1px; }
.school-name { font-weight: 650; color: var(--ink); font-size: 13.5px; }
.school-alias { font-size: 10.5px; color: var(--ink-3); }
.index-val { font-size: 16px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.num-val { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.num-strong { font-weight: 700; color: var(--ink); }
.coverage-val { font-variant-numeric: tabular-nums; }

.stack-mini { display: flex; height: 9px; width: 100%; max-width: 250px; border-radius: 5px; overflow: hidden; background: #f0f2f6; }
.stack-mini span { display: block; height: 100%; transition: width .3s; }
.stack-mini-labels { display: flex; gap: 8px; margin-top: 5px; font-size: 10px; color: var(--ink-3); }
.stack-mini-labels span { white-space: nowrap; }
.stack-mini-labels i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 3px; }
.stack-mini-labels b { font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.quality-bar { display: flex; align-items: center; gap: 7px; }
.quality-track { width: 52px; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.quality-fill { height: 100%; border-radius: 3px; background: #4aa88a; }
.quality-pct { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.flag-low { color: #c0782c; }
.empty-state { padding: 40px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------- Stack chart ---------- */
.chart-section { margin-top: 34px; }
.stack-chart {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow-sm);
}
.chart-row { display: grid; grid-template-columns: 132px 1fr 62px; gap: 14px; align-items: center; margin-bottom: 11px; }
.chart-row:last-child { margin-bottom: 0; }
.chart-label { font-size: 12.5px; color: var(--ink-2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-label b { color: var(--ink-3); font-weight: 500; margin-right: 6px; font-size: 11px; }
.chart-bar-track { height: 22px; background: var(--surface-3); border-radius: 5px; overflow: hidden; display: flex; }
.chart-bar-seg { height: 100%; transition: width .35s ease; }
.chart-value { font-size: 13px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; text-align: right; }
.chart-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 18px; justify-content: center; font-size: 12px; color: var(--ink-2); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.footnote { margin-top: 20px; font-size: 12px; color: var(--ink-3); text-align: center; }

/* ---------- Subject view ---------- */
.subject-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 16px; }
.subject-tab {
  border: 1px solid var(--border); background: var(--surface); border-radius: 9px;
  padding: 10px 18px; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; gap: 8px; transition: .18s; box-shadow: var(--shadow-sm);
}
.subject-tab i { width: 9px; height: 9px; border-radius: 50%; background: var(--sc); }
.subject-tab:hover { border-color: var(--sc); }
.subject-tab.active { background: var(--sc); border-color: var(--sc); color: #fff; }
.subject-tab.active i { background: rgba(255,255,255,.9); }
.subject-panel { display: grid; grid-template-columns: 270px 1fr; gap: 16px; align-items: start; }
.subject-info {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.subject-info h3 { margin: 0 0 4px; font-size: 17px; }
.subject-info .si-full { font-size: 12px; color: var(--ink-3); line-height: 1.7; margin-bottom: 16px; }
.si-row { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px dashed var(--border); font-size: 12px; }
.si-row span { color: var(--ink-3); }
.si-row b { font-variant-numeric: tabular-nums; }
.si-note { margin-top: 14px; padding: 11px 12px; background: var(--surface-2); border-left: 3px solid var(--sc); border-radius: 0 6px 6px 0; font-size: 11.5px; color: var(--ink-2); line-height: 1.8; }
.subject-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow-sm); max-height: 720px; }
.subject-table { min-width: 620px; }
.subject-table thead th { position: sticky; top: 0; }
.subject-table td { padding: 9px 14px; border-bottom: 1px solid #eef1f5; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.subject-table tbody tr:last-child td { border-bottom: 0; }
.subject-table tbody tr:hover { background: #f7fafd; cursor: pointer; }
.subject-table .st-rank { color: var(--ink-3); width: 50px; }
.subject-table .st-name { font-weight: 600; }
.subject-table .st-a { color: var(--sc); font-weight: 700; }
.subject-table .st-score { font-weight: 700; color: var(--accent); }
.th-right { text-align: right !important; }
.td-right { text-align: right; }

/* ---------- Rules ---------- */
.rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.rule-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 22px 24px; box-shadow: var(--shadow-sm); position: relative;
}
.rule-step {
  font-family: var(--serif); font-size: 30px; font-weight: 700; color: #dbe6f0;
  line-height: 1; margin-bottom: 10px; letter-spacing: 1px;
}
.rule-card h3 { margin: 0 0 10px; font-size: 16px; }
.rule-card p { color: var(--ink-2); font-size: 12.5px; line-height: 1.85; margin: 0 0 12px; }
.rule-card p strong, .rule-ul strong { color: var(--accent); }
.formula {
  background: var(--accent-soft); border: 1px solid #d8e7f4; border-radius: 8px;
  padding: 12px 14px; font-family: "SF Mono", "Menlo", Consolas, monospace;
  font-size: 12.5px; color: var(--accent); font-weight: 600; margin: 4px 0 10px;
  letter-spacing: .3px; overflow-x: auto; white-space: nowrap;
}
.formula-note { font-size: 11.5px !important; color: var(--ink-3) !important; }
.weight-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.weight-item { display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--ink-2); }
.weight-item b { min-width: 52px; color: var(--ink); }
.weight-item code { font-family: "SF Mono", Menlo, monospace; background: var(--surface-3); padding: 2px 7px; border-radius: 4px; color: var(--accent); font-size: 11px; }
.rule-ol, .rule-ul { margin: 6px 0 0; padding-left: 19px; color: var(--ink-2); font-size: 12.5px; line-height: 1.95; }
.rule-ol li, .rule-ul li { margin-bottom: 3px; }

.callout {
  display: flex; gap: 16px; background: #f0f6fb; border: 1px solid #d7e6f2;
  border-radius: var(--radius); padding: 20px 22px; margin-top: 16px;
}
.callout-warn { background: #fdf6ec; border-color: #f0dfc0; }
.callout-icon {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; font-family: var(--serif);
}
.callout-warn .callout-icon { background: #c08a2e; }
.callout h3 { margin: 0 0 8px; font-size: 14.5px; }
.callout p { margin: 0 0 7px; font-size: 12.5px; color: var(--ink-2); line-height: 1.9; }
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--accent); }
.callout-warn strong { color: #96681d; }

.rule-example {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-top: 16px; box-shadow: var(--shadow-sm);
}
.rule-example h3 { margin: 0 0 8px; font-size: 16px; }
.rule-example > p { color: var(--ink-2); font-size: 12.5px; margin: 0 0 16px; }
.example-flow { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.example-node {
  flex: 1; min-width: 160px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.example-node span { font-size: 11px; color: var(--ink-3); }
.example-node strong { font-size: 12.5px; color: var(--ink); font-weight: 650; }
.example-node.accent { background: var(--accent-soft); border-color: #d8e7f4; }
.example-node.accent strong { color: var(--accent); }
.example-arrow { display: grid; place-items: center; color: var(--ink-3); font-size: 17px; }
.example-note { margin-top: 14px !important; font-size: 11.5px !important; color: var(--ink-3) !important; }

/* ---------- Data view ---------- */
.data-block {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; margin-top: 16px; box-shadow: var(--shadow-sm);
}
.data-block h3 { margin: 0 0 6px; font-size: 16px; }
.block-desc { color: var(--ink-3); font-size: 12.5px; line-height: 1.85; margin: 0 0 14px; }
.data-block .table-wrap { margin-top: 12px; box-shadow: none; }
.data-table { min-width: 760px; }
.data-table td { padding: 10px 13px; border-bottom: 1px solid #eef1f5; font-size: 12.5px; vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td b { font-variant-numeric: tabular-nums; }
.tag-ok { display: inline-block; background: #e8f5ef; color: #2c8767; font-size: 11px; padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.tag-warn { display: inline-block; background: #fdf1e3; color: #a8762a; font-size: 11px; padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.tag-mid { display: inline-block; background: #eef1f8; color: #5a6b8c; font-size: 11px; padding: 2px 8px; border-radius: 12px; font-weight: 600; }
.diff-neg { color: #b5652f; }
.diff-zero { color: #2c8767; }
.limit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.limit-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 14px 16px; }
.limit-card strong { display: block; font-size: 12.5px; color: var(--ink); margin-bottom: 6px; }
.limit-card p { margin: 0; font-size: 11.5px; color: var(--ink-2); line-height: 1.8; }
.source-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; margin-top: 12px; }
.source-item { display: flex; gap: 9px; align-items: flex-start; font-size: 12px; line-height: 1.7; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.source-subject { flex-shrink: 0; font-size: 10.5px; padding: 1px 7px; border-radius: 4px; color: #fff; font-weight: 600; margin-top: 2px; }
.source-item a { color: var(--ink-2); }
.source-item a:hover { color: var(--accent-2); }
code { font-family: "SF Mono", Menlo, Consolas, monospace; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-size: 11.5px; color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); background: var(--surface);
  padding: 22px 28px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  color: var(--ink-3); font-size: 11.5px;
}

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(18, 28, 42, .45); backdrop-filter: blur(3px); }
.modal-panel {
  position: relative; background: var(--surface); border-radius: 16px; width: min(820px, 100%);
  max-height: 88vh; overflow: auto; box-shadow: var(--shadow-lg); animation: pop .25s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; right: 16px; top: 14px; z-index: 2;
  width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--surface-3);
  color: var(--ink-2); font-size: 20px; line-height: 1;
}
.modal-close:hover { background: #e2e7ef; color: var(--ink); }
.modal-header { padding: 26px 28px 20px; border-bottom: 1px solid var(--border); }
.modal-kicker { font-size: 11px; letter-spacing: 1.5px; color: var(--accent); font-weight: 700; }
.modal-header h2 { margin: 6px 0 4px; font-family: var(--serif); font-size: 26px; }
.modal-sub { color: var(--ink-3); font-size: 12px; }
.modal-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 18px 28px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.mstat { display: flex; flex-direction: column; }
.mstat b { font-size: 21px; color: var(--accent); font-variant-numeric: tabular-nums; }
.mstat span { font-size: 11px; color: var(--ink-3); }
.modal-body { padding: 22px 28px 28px; }
.modal-body h4 { margin: 0 0 12px; font-size: 14px; }
.modal-cols { display: grid; grid-template-columns: 1fr 260px; gap: 24px; align-items: start; }
.detail-table { width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.detail-table th { background: var(--surface-2); font-size: 11px; color: var(--ink-3); padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border); font-weight: 700; }
.detail-table td { padding: 9px 10px; font-size: 12px; border-bottom: 1px solid #eef1f5; font-variant-numeric: tabular-nums; }
.detail-table tr:last-child td { border-bottom: 0; }
.detail-table .dt-name { font-weight: 600; }
.detail-table .dt-a { color: var(--accent); font-weight: 700; }
.detail-table .dt-u { color: #c0782c; }
.radar-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.radar-box svg { width: 100%; height: auto; }
.radar-caption { font-size: 11px; color: var(--ink-3); margin-top: 6px; line-height: 1.6; }
.modal-note { margin-top: 18px; padding: 12px 14px; background: var(--surface-2); border-radius: 8px; font-size: 11.5px; color: var(--ink-2); line-height: 1.8; }
.alias-line { font-size: 11.5px; color: var(--ink-3); margin-top: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .rule-grid, .limit-grid { grid-template-columns: repeat(2, 1fr); }
  .subject-cards { grid-template-columns: repeat(3, 1fr); }
  .subject-panel { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .header-inner { height: auto; padding: 12px 16px; flex-wrap: wrap; gap: 12px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .header-tag { display: none; }
  .container { padding: 18px 14px 40px; }
  .hero { grid-template-columns: 1fr; padding: 26px 22px; gap: 22px; }
  .hero h1 { font-size: 27px; }
  .hero-right { border-left: 0; border-top: 1px solid var(--border); padding-left: 0; padding-top: 18px; }
  .subject-cards { grid-template-columns: repeat(2, 1fr); }
  .rule-grid, .limit-grid, .source-list, .modal-cols { grid-template-columns: 1fr; }
  .toolbar { gap: 14px; }
  .toolbar-group.grow { min-width: 100%; }
  .chart-row { grid-template-columns: 90px 1fr 48px; gap: 8px; }
  .modal-stats { grid-template-columns: repeat(2, 1fr); }
  .example-arrow { display: none; }
}
