:root {
  --black: #16130b;
  --gold: #d4af37;
  --gold-bright: #f2ca50;
  --paper: #f7f1e4;
  --line-dark: rgba(212, 175, 55, 0.26);
  --serif: "Noto Serif SC", "Songti SC", SimSun, serif;
  --sans: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--black); }
body {
  min-height: 100%;
  margin: 0;
  font-family: var(--sans);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, #110e07 0%, var(--black) 42%, #0f0c07 100%);
  color: #eae1d4;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.site-shell { min-height: 100vh; }
.page {
  width: min(100%, 448px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 24px 108px;
}
.hero { padding: 18px 0 22px; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
}
.hero h1 {
  margin: 0;
  color: var(--gold-bright);
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.22;
}
.lead {
  margin: 14px 0 0;
  color: rgba(234, 225, 212, 0.76);
  font-size: 15px;
  line-height: 1.8;
}
.hero-count { margin-top: 4px; }
.stat-grid, .detail-stats { display: grid; gap: 12px; margin-top: 18px; }
.stat-card {
  padding: 18px 16px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  background: rgba(35, 31, 23, 0.78);
}
.stat-card span {
  display: block;
  color: rgba(234, 225, 212, 0.66);
  font-size: 12px;
}
.stat-card strong {
  display: block;
  margin-top: 8px;
  color: #f7eedb;
  font-family: var(--serif);
  font-size: 28px;
}
.section { margin-top: 22px; padding: 18px 0 0; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0;
  color: #f7eedb;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}
.search-row {
  display: flex;
  gap: 10px;
  width: 100%;
}
.search-field {
  position: relative;
  flex: 1;
  min-width: 0;
}
.search {
  min-width: 0;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  color: #f7eedb;
}
.search::placeholder { color: rgba(234, 225, 212, 0.42); }
.school-suggestions {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background: #211e17;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}
.school-suggestion {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
  background: transparent;
  color: #f7eedb;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}
.school-suggestion:last-child { border-bottom: 0; }
.school-suggestion small {
  flex: 0 0 auto;
  color: rgba(234, 225, 212, 0.48);
  font-size: 11px;
}
.school-suggestion:hover,
.school-suggestion.is-active {
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold-bright);
}
.search-button,
.page-button {
  min-height: 46px;
  border: 1px solid rgba(212, 175, 55, 0.38);
  border-radius: 18px;
  background: rgba(212, 175, 55, 0.12);
  color: #f2ca50;
  cursor: pointer;
}
.search-button {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  padding: 0 18px;
  pointer-events: auto;
}
.page-button {
  min-width: 82px;
  padding: 0 14px;
}
.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}
.school-list { display: grid; gap: 12px; margin-top: 14px; }
.school-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 16px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  background: rgba(35, 31, 23, 0.74);
}
.school-copy { display: grid; gap: 4px; text-align: left; }
.school-name {
  color: #f2ca50;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
}
.school-meta, .school-submeta {
  color: rgba(234, 225, 212, 0.62);
  font-size: 12px;
  line-height: 1.45;
}
.school-arrow { flex: 0 0 auto; color: rgba(225, 196, 117, 0.72); font-size: 22px; }
.detail-title {
  margin: 0;
  color: #f2ca50;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.25;
}
.detail-note {
  margin: 10px 0 0;
  color: rgba(234, 225, 212, 0.6);
  font-size: 12px;
  line-height: 1.6;
}
.density-section { margin-top: 24px; }
.density-section .section-head { justify-content: center; }
.density-section .density-note { text-align: center; }
.density-note {
  margin: -6px 0 12px;
  color: rgba(234, 225, 212, 0.58);
  font-size: 12px;
}
.density-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.density-tab {
  min-width: 58px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(212, 175, 55, 0.26);
  border-radius: 16px;
  background: transparent;
  color: rgba(234, 225, 212, 0.68);
  font-size: 13px;
}
.density-tab.is-active {
  border-color: rgba(242, 202, 80, 0.72);
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold-bright);
}
.density-plot {
  position: relative;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(35, 31, 23, 0.72);
}
.density-chart { display: block; width: 100%; height: auto; touch-action: none; }
.density-axis, .density-grid { stroke: rgba(234, 225, 212, 0.22); stroke-width: 1; }
.density-grid { stroke-dasharray: 2 3; }
.density-area { fill: url(#density-fill); }
.density-line { fill: none; stroke: #f2ca50; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.density-guide { stroke: rgba(242, 202, 80, 0.85); stroke-width: 1; stroke-dasharray: 3 3; }
.density-marker line { stroke-width: 1; stroke-dasharray: 3 3; }
.density-marker circle { stroke: #16130b; stroke-width: 1.5; }
.density-marker-highest line { stroke: #f26b5e; }
.density-marker-highest circle { fill: #f26b5e; }
.density-marker-lowest line { stroke: #70b77e; }
.density-marker-lowest circle { fill: #70b77e; }
.density-marker-largest line { stroke: #8bc6df; }
.density-marker-largest circle { fill: #8bc6df; }
.density-marker-label { font-size: 10px; font-weight: 600; }
.density-marker-highest .density-marker-label { fill: #f26b5e; }
.density-marker-lowest .density-marker-label { fill: #70b77e; }
.density-marker-largest .density-marker-label { fill: #8bc6df; }
.density-tick, .density-y-tick { fill: rgba(234, 225, 212, 0.65); font-size: 11px; }
.density-axis-title { fill: rgba(234, 225, 212, 0.72); font-size: 10px; }
.density-watermark { fill: rgba(234, 225, 212, 0.14); font-size: 23px; font-weight: 600; letter-spacing: 2px; pointer-events: none; }
.density-tooltip {
  min-height: 37px;
  padding: 9px 11px;
  border-top: 1px solid rgba(212, 175, 55, 0.14);
  color: rgba(234, 225, 212, 0.8);
  font-size: 12px;
  line-height: 1.5;
}
.density-annotations {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.45;
}
.density-annotation {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: baseline;
  color: rgba(234, 225, 212, 0.7);
}
.density-annotation-label { font-weight: 600; }
.density-annotation-name { min-width: 0; color: #f7eedb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.density-annotation-highest .density-annotation-label { color: #f26b5e; }
.density-annotation-lowest .density-annotation-label { color: #70b77e; }
.density-annotation-largest .density-annotation-label { color: #8bc6df; }
@media (max-width: 360px) {
  .density-annotation { grid-template-columns: 68px minmax(0, 1fr); }
  .density-annotation > :last-child { grid-column: 2; }
}
.table-wrap {
  overflow-x: auto;
  margin-top: 14px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  background: rgba(35, 31, 23, 0.72);
}
.program-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}
.program-table th,
.program-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.14);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.program-table th {
  color: #f2ca50;
  background: rgba(212, 175, 55, 0.08);
  font-size: 12px;
  font-weight: 600;
}
.program-table td { color: #eae1d4; font-size: 13px; }
.program-table td.muted { color: rgba(234, 225, 212, 0.66); }
.ad-section { margin-top: 18px; }
.ad-banner {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.18);
  background: rgba(35, 31, 23, 0.72);
}
.ad-banner img {
  display: block;
  width: 100%;
  height: auto;
}
.empty-state {
  margin-top: 18px;
  padding: 18px 16px;
  border: 1px dashed rgba(212, 175, 55, 0.26);
  color: rgba(234, 225, 212, 0.7);
  background: rgba(255, 255, 255, 0.03);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.page-info {
  color: rgba(234, 225, 212, 0.68);
  font-size: 12px;
  white-space: nowrap;
}
@media (min-width: 720px) {
  .page { padding-top: 40px; }
}
