/* ============================================================
   蘇浙公學 AI 國際證書榮譽榜 · cert.kccnp.app
   Design System: Editorial Warm Ochre (matches airevision.netlify.app)
   ============================================================ */

/* ============ THEME TOKENS ============ */
:root {
  /* Background / paper */
  --bg:        oklch(0.985 0.006 75);
  --bg-2:      oklch(1 0 0);              /* elevated white */
  --bg-elev:   oklch(1 0 0);
  --surface:   oklch(1 0 0);
  --surface-2: oklch(0.97 0.012 70);      /* warm paper */
  --surface-3: oklch(0.95 0.014 70);
  --paper:     oklch(0.97 0.012 70);

  /* Lines */
  --border:        oklch(0.90 0.012 70);
  --border-strong: oklch(0.85 0.014 70);
  --rule:          oklch(0.90 0.012 70);
  --rule-soft:     oklch(0.94 0.010 70);

  /* Ink (text) */
  --text:       oklch(0.22 0.012 60);
  --text-soft:  oklch(0.40 0.012 60);
  --text-muted: oklch(0.55 0.012 60);
  --ink:        oklch(0.22 0.012 60);
  --ink-soft:   oklch(0.40 0.012 60);
  --ink-muted:  oklch(0.55 0.012 60);

  /* Accent — ochre orange */
  --accent:        oklch(0.58 0.145 48);
  --accent-soft:   oklch(0.66 0.135 50);
  --accent-deep:   oklch(0.42 0.115 45);
  --accent-tint:   oklch(0.95 0.040 65);
  --accent-tint-2: oklch(0.91 0.060 60);
  --accent-glow:   oklch(0.58 0.145 48 / 0.18);

  /* Secondary (for charts / progress, etc.) — muted teal */
  --cyan:        oklch(0.55 0.090 200);
  --cyan-soft:   oklch(0.65 0.080 205);
  --cyan-glow:   oklch(0.55 0.090 200 / 0.18);

  /* Status */
  --warn: oklch(0.68 0.140 60);

  /* Shadow / effects */
  --shadow:       0 1px 0 oklch(1 0 0 / 0.5) inset, 0 1px 3px oklch(0.20 0.02 50 / 0.08);
  --shadow-soft:  0 1px 2px oklch(0.20 0.02 50 / 0.06);
  --shadow-pop:   0 6px 20px oklch(0.45 0.12 48 / 0.18);
  --hero-overlay: linear-gradient(180deg, transparent 0%, oklch(0.985 0.006 75 / 0.5) 60%, var(--bg) 100%);

  /* Type stacks */
  --serif-en: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --serif-zh: "Noto Serif HK", "Songti TC", "Source Han Serif TC", "Noto Serif CJK TC", serif;
  --sans:     "Inter", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", "PingFang TC", "Noto Sans TC", sans-serif;
  --mono:     "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --content-max: 1240px;
}

/* ============ BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-zh), var(--serif-en);
  font-size: 17px;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt";
}
a { color: var(--accent-deep); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
::selection { background: var(--accent-tint-2); color: var(--ink); }

.container { max-width: var(--content-max); margin: 0 auto; padding: 0 32px; }
.muted { color: var(--ink-muted); }
.text-accent { color: var(--accent-deep); }
.hidden { display: none !important; }

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 32px;
  max-width: var(--content-max);
  margin: 0 auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif-en);
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
}
.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}
/* Legacy fallback if .brand-icon still appears anywhere */
.brand-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: var(--accent);
  display: grid; place-items: center;
  color: oklch(0.99 0.01 70);
  font-family: var(--serif-en);
  font-weight: 600;
  font-size: 15px;
}
.brand-text { font-family: var(--serif-en); font-weight: 600; font-size: 15px; }
.nav {
  display: flex;
  gap: 4px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
}
.nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: all .15s;
}
.nav a:hover {
  color: var(--accent-deep);
  background: var(--accent-tint);
}
@media (max-width: 640px) {
  .header-inner { padding: 12px 20px; }
  .brand-text { display: none; }
  .nav { gap: 2px; }
  .nav a { padding: 6px 8px; font-size: 12.5px; }
}

/* ============ Language toggle ============ */
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg);
  margin-left: 8px;
}
.lang-toggle button {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.lang-toggle button:hover { color: var(--ink); }
.lang-toggle button.active {
  background: var(--accent-tint);
  color: var(--accent-deep);
}
html[data-lang="zh"] [data-lang="en"] { display: none !important; }
html[data-lang="en"] [data-lang="zh"] { display: none !important; }
.lang-toggle button[data-lang] { display: inline-flex !important; }

/* ============ HERO ============ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 80px;
  background: var(--bg);
}
.hero-grid { display: none; }
.hero-glow {
  position: absolute;
  top: -120px; left: 50%;
  transform: translateX(-50%);
  width: 720px; height: 360px;
  background: radial-gradient(ellipse at center, var(--accent-tint) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.7;
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
}
.hero-school {
  display: inline-flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  padding: 12px 24px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--bg-2);
  box-shadow: var(--shadow-soft);
}
.hero-school-name {
  font-family: var(--serif-zh);
  font-weight: 600;
  font-size: 20px;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.hero-school-prog {
  font-family: var(--serif-zh);
  font-weight: 500;
  font-size: 17px;
  color: var(--accent-deep);
  letter-spacing: 0.02em;
}
.hero-slogan {
  font-family: var(--serif-zh), var(--serif-en);
  font-size: clamp(20px, 2.6vw, 28px);
  letter-spacing: -0.005em;
  color: var(--accent-deep);
  font-weight: 600;
  margin: 0 0 28px;
}
.hero-slogan-dot { margin: 0 12px; opacity: 0.5; color: var(--accent); }
@media (max-width: 640px) {
  .hero-school { padding: 10px 18px; gap: 10px; flex-direction: column; align-items: center; }
  .hero-school-name { font-size: 18px; }
  .hero-school-prog { font-size: 15px; }
  .hero-slogan { font-size: 20px; }
}
.hero-title {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 600;
  font-size: clamp(36px, 5.5vw, 58px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  color: var(--ink);
  text-wrap: balance;
}
.hero-title .text-accent {
  color: var(--accent-deep);
}
.hero-sub {
  font-family: var(--serif-zh), var(--serif-en);
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto 48px;
  text-wrap: pretty;
}

/* Stat grid in hero */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  max-width: 760px;
  margin: 0 auto 48px;
}
.stat-card {
  background: var(--bg);
  padding: 28px 20px;
  text-align: center;
}
.stat-card-accent { background: var(--accent-tint); }
.stat-num {
  font-family: var(--serif-en);
  font-feature-settings: "lnum";
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 600;
  line-height: 1;
  color: var(--accent-deep);
  letter-spacing: -0.02em;
}
.stat-card-accent .stat-num { color: var(--accent); }
.stat-label {
  font-family: var(--sans);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-top: 8px;
}

/* Hero credit */
.hero-credit {
  max-width: 760px;
  margin: 0 auto;
  text-align: left;
  padding: 32px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.hero-credit-meta {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  margin: 0 0 14px;
}
.hero-credit-meta b { color: var(--ink); font-weight: 600; }
.hero-credit-text {
  font-family: var(--serif-zh), var(--serif-en);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 20px;
}
.hero-credit-text b { color: var(--ink); font-weight: 600; }
.hero-credit-team {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px dashed var(--rule);
}
.hero-credit-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 16px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.55;
}
.hero-credit-role {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-deep);
  font-weight: 600;
  padding-top: 2px;
}
.hero-credit-names {
  color: var(--ink);
  font-weight: 500;
}

/* ============ SECTION FRAME ============ */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--rule);
}
.section-alt {
  background: var(--paper);
}
.section-title {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 600;
  font-size: clamp(28px, 3.6vw, 38px);
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 16px;
  color: var(--ink);
  text-align: center;
  text-wrap: balance;
}
.section-sub {
  font-family: var(--serif-zh), var(--serif-en);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 640px;
  margin: 0 auto 48px;
  text-align: center;
  text-wrap: pretty;
}
.eyebrow-mini {
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-deep);
  font-weight: 600;
  margin: 0 0 14px;
  text-align: center;
}

/* ============ ABOUT CARD ============ */
.section-about { background: var(--paper); }
.about-card {
  max-width: 800px;
  margin: 0 auto;
  padding: 56px 48px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 12px;
}
.about-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-deep);
  font-weight: 600;
  margin-bottom: 14px;
  text-align: center;
}
.about-slogan {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 32px;
  color: var(--ink);
  text-align: center;
}
.about-dot { color: var(--accent); margin: 0 8px; }
.about-body {
  font-family: var(--serif-zh), var(--serif-en);
  font-size: 16.5px;
  line-height: 1.85;
  color: var(--ink-soft);
}
.about-body p { margin: 0 0 18px; text-wrap: pretty; }
.about-body p:last-child { margin-bottom: 0; }
.about-body b { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) {
  .about-card { padding: 36px 24px; }
}

/* ============ INFO CARDS (about certs) ============ */
.info-head { text-align: center; max-width: 760px; margin: 0 auto 56px; }
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto 56px;
}
.info-card {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.info-icon {
  font-size: 24px;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: var(--accent-tint);
  border-radius: 10px;
  margin-bottom: 4px;
}
.info-card-title {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
}
.info-card p {
  font-family: var(--serif-zh), var(--serif-en);
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin: 0;
}
.info-card p b { color: var(--ink); font-weight: 600; }

.info-subtitle {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 24px 0 12px;
  color: var(--ink);
  text-align: center;
}
.info-subnote {
  font-family: var(--serif-zh), var(--serif-en);
  font-size: 14.5px;
  color: var(--ink-soft);
  text-align: center;
  margin: 0 auto 32px;
  max-width: 600px;
}
.info-subnote b { color: var(--ink); font-weight: 600; }

/* ============ COURSE LIST ============ */
.course-list {
  max-width: 880px;
  margin: 0 auto;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--rule);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.course-item {
  background: var(--bg-2);
  padding: 28px 32px;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 20px;
  align-items: start;
}
.course-rank {
  font-family: var(--serif-en);
  font-feature-settings: "lnum";
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
  padding-top: 4px;
}
.course-meta { }
.course-name {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.3;
  color: var(--ink);
  margin-bottom: 6px;
}
.course-cn {
  display: block;
  font-family: var(--serif-zh);
  font-weight: 500;
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.course-issuer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-muted);
  margin: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.issuer-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.course-stat {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 500;
}
.course-detail {
  grid-column: 1 / -1;
  padding-top: 16px;
  margin-top: 4px;
  border-top: 1px dashed var(--rule);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.course-detail > div {
  font-family: var(--serif-zh), var(--serif-en);
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}
.course-label {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-deep);
  font-weight: 600;
  margin-right: 10px;
  background: var(--accent-tint);
  padding: 2px 8px;
  border-radius: 4px;
}
@media (max-width: 640px) {
  .course-item { padding: 24px 20px; grid-template-columns: 44px 1fr; gap: 14px; }
  .course-rank { font-size: 28px; }
}

/* ============ PROGRESS ============ */
.progress-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.progress-item {
  padding: 24px 28px;
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
}
.progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
}
.progress-label {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
}
.progress-num {
  font-family: var(--serif-en);
  font-feature-settings: "lnum";
  font-size: 22px;
  font-weight: 500;
  color: var(--accent-deep);
}
.progress-num .muted {
  font-size: 15px;
  color: var(--ink-muted);
}
.progress-track {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--rule);
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width .8s cubic-bezier(.2,.7,.2,1);
  border-radius: 999px;
}
.progress-bar-cyan { background: var(--accent-soft); }
.progress-text {
  font-family: var(--sans);
  font-size: 12.5px;
  margin-top: 8px;
  letter-spacing: 0.01em;
}

/* ============ TIER GRID ============ */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--rule);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  max-width: 880px;
  margin: 0 auto;
}
.tier-card {
  background: var(--bg-2);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: background .2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: 0;
}
.tier-card:hover { background: var(--accent-tint); }
.tier-icon { font-size: 32px; line-height: 1; }
.tier-name {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
}
.tier-desc {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-muted);
}
.tier-num {
  font-family: var(--serif-en);
  font-feature-settings: "lnum";
  font-size: 36px;
  font-weight: 600;
  color: var(--accent-deep);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-top: 6px;
}
.tier-starter .tier-num { color: var(--accent); }
.tier-explorer .tier-num { color: var(--accent-deep); }
.tier-pioneer .tier-num { color: var(--accent-deep); }
.tier-unit {
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
}

/* ============ WALL / STUDENT GRID ============ */
.wall-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.wall-head > div { flex: 1; min-width: 280px; }
.wall-head .section-title { text-align: left; margin-bottom: 8px; }
.wall-head .section-sub { text-align: left; margin: 0; max-width: none; }

.search-input {
  font-family: var(--sans);
  font-size: 14px;
  padding: 10px 16px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--ink);
  width: 280px;
  max-width: 100%;
  transition: border-color .15s;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
}
.search-input::placeholder { color: var(--ink-muted); }

.wall-subtitle {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.3;
  color: var(--ink);
  margin: 24px 0 8px;
  letter-spacing: -0.01em;
}
.wall-subtitle-spaced { margin-top: 56px; }
.wall-subcount {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-muted);
  font-weight: 400;
  margin-left: 8px;
  letter-spacing: 0.02em;
}
.wall-note {
  font-family: var(--serif-zh), var(--serif-en);
  font-size: 14.5px;
  color: var(--ink-muted);
  margin: 0 0 24px;
}

/* === Student card (details/summary) === */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}
.student-card {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.student-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px oklch(0.55 0.14 48 / 0.10);
}
.student-card[open] {
  grid-column: 1 / -1;
  background: var(--bg-2);
  border-color: var(--accent);
  box-shadow: 0 4px 18px oklch(0.55 0.14 48 / 0.14);
}
.student-card > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.student-card > summary::-webkit-details-marker { display: none; }
.student-card > summary > div:first-child { flex: 1; min-width: 0; }

.student-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

/* Tier badges */
.tier-badge {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.tier-badge-pioneer {
  background: var(--accent-tint);
  color: var(--accent-deep);
  border: 1px solid var(--accent-tint-2);
}
.tier-badge-explorer {
  background: oklch(0.96 0.030 90);
  color: oklch(0.42 0.090 75);
  border: 1px solid oklch(0.90 0.060 85);
}
.tier-badge-starter {
  background: oklch(0.96 0.018 140);
  color: oklch(0.42 0.070 150);
  border: 1px solid oklch(0.90 0.030 145);
}

.spec-pill {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-deep);
  color: oklch(0.98 0.012 70);
  letter-spacing: 0.02em;
}
.cert-count-pill {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

/* Name section — make name BIG and prominent */
.student-name {
  font-family: var(--serif-zh), var(--serif-en);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  line-height: 1.25;
}
.student-class {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.student-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  flex-shrink: 0;
}
.student-display {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.student-count {
  font-family: var(--serif-en);
  font-feature-settings: "lnum";
  font-size: 28px;
  font-weight: 600;
  color: var(--accent-deep);
  line-height: 1;
  letter-spacing: -0.02em;
}
.chev {
  display: block;
  color: var(--ink-muted);
  margin-top: 4px;
  transition: transform .2s;
}
.student-card[open] .chev { transform: rotate(180deg); }

/* Cert list (expanded) */
.student-card .cert-list {
  padding: 16px 16px 18px;
  border-top: 1px dashed var(--rule);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cert-row {
  display: block;
  padding: 12px 14px;
  border-radius: 6px;
  font-family: var(--sans);
  color: var(--ink-soft);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.cert-row + .cert-row { margin-top: 4px; }
.cert-row:hover {
  background: var(--accent-tint);
  border-color: var(--accent-tint-2);
}
.cert-row[data-no-url] { cursor: default; opacity: 0.7; }
.cert-row[data-no-url]:hover { background: transparent; border-color: transparent; }
.cert-row-spec {
  background: var(--accent-tint);
  border-color: var(--accent-tint-2);
  margin-bottom: 4px;
}
.cert-row-spec:hover { background: var(--accent-tint); }
.cert-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.cert-name {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.4;
}
.spec-name {
  color: var(--accent-deep);
}
.spec-name-zh {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}
.cert-meta {
  font-family: var(--sans);
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.cert-verify {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--accent-deep);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.spec-verify {
  font-size: 18px;
  color: var(--accent);
  text-decoration: none;
}
.spec-badge {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-deep);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

/* pop-in animation */
@keyframes pop-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.pop-in { animation: pop-in .25s ease-out; }

.empty {
  text-align: center;
  font-family: var(--serif-zh), var(--serif-en);
  font-size: 16px;
  color: var(--ink-muted);
  padding: 40px 20px;
}

/* ============ GRADE TABS / BOARDS ============ */
.grade-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0;
}
.grade-tab {
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 18px;
  background: transparent;
  border: 0;
  color: var(--ink-soft);
  cursor: pointer;
  position: relative;
  transition: color .15s;
  letter-spacing: 0.02em;
}
.grade-tab:hover { color: var(--ink); }
.grade-tab.active {
  color: var(--accent-deep);
  font-weight: 600;
}
.grade-tab.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
}

/* === Grade leaderboard cards (used by app.js renderGradeBoards) === */
.grade-boards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
}
.grade-card {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
.grade-card-head {
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.grade-label {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin-bottom: 4px;
}
.grade-totals {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.grade-totals b { color: var(--ink); font-weight: 600; }

.grade-rows {
  display: flex;
  flex-direction: column;
}
.grade-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px dashed var(--rule);
  font-family: var(--sans);
}
.grade-row:last-child { border-bottom: 0; }

.grade-rank-num {
  font-family: var(--serif-en);
  font-feature-settings: "lnum";
  font-size: 18px;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: -0.01em;
  text-align: center;
}

.grade-class-name {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1;
}

.grade-stat-students {
  font-family: var(--serif-en);
  font-feature-settings: "lnum";
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-soft);
  text-align: right;
  white-space: nowrap;
}

.grade-stat-certs {
  font-family: var(--serif-en);
  font-feature-settings: "lnum";
  font-size: 14.5px;
  color: var(--ink-soft);
  text-align: right;
  white-space: nowrap;
  min-width: 100px;
}
.grade-stat-certs b {
  font-size: 19px;
  font-weight: 700;
  color: var(--accent-deep);
}

.grade-stat-unit {
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--ink-muted);
  margin-left: 4px;
  font-weight: 500;
}

/* Champion row highlight */
.grade-row.is-champion {
  background: var(--accent-tint);
  border-bottom-color: var(--accent-tint-2);
}
.grade-row.is-champion .grade-rank-num {
  font-size: 22px;
  color: var(--accent);
}
.grade-row.is-champion .grade-class-name {
  font-size: 26px;
  color: var(--accent-deep);
}
.grade-row.is-champion .grade-stat-certs b {
  color: var(--accent);
}

@media (max-width: 640px) {
  .grade-row { padding: 12px 18px; gap: 10px; grid-template-columns: 36px 1fr auto; }
  .grade-row .grade-stat-students { display: none; }
  .grade-card-head { padding: 18px 18px 12px; }
  .grade-label { font-size: 19px; }
}

/* ============ CHART CARD ============ */
.chart-card {
  background: var(--bg-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 32px 28px 24px;
  max-width: 900px;
  margin: 0 auto;
}

/* ============ FOOTER ============ */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--paper);
  padding: 48px 0 56px;
  text-align: center;
}
.footer-title {
  font-family: var(--serif-zh), var(--serif-en);
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.site-footer .muted {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-muted);
  margin: 0;
  letter-spacing: 0.01em;
}
.footer-fine {
  margin-top: 8px !important;
  max-width: 560px;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 720px) {
  .container { padding: 0 20px; }
  .hero { padding: 64px 0 56px; }
  .section { padding: 56px 0; }
  .info-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr 1fr; }
  .stat-card { padding: 20px 12px; }
  .hero-credit { padding: 24px; }
  .hero-credit-row { grid-template-columns: 1fr; gap: 6px; }
  .about-body { font-size: 15.5px; }
}
