:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --accent-pink: #db2777;
  --bg-alt: #f6f7fb;
  --text: #1f2330;
  --muted: #5b6172;
  --border: #e3e5ec;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  line-height: 1.65;
  background: #fff;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.10) 0, transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(255,255,255,0.08) 0, transparent 50%),
    linear-gradient(160deg, #1e1b4b 0%, #4338ca 38%, #6d28d9 68%, #9d174d 130%);
  color: #fff;
  padding-bottom: 64px;
  overflow: hidden;
}

.hero-decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("assets/hero-illustration.svg");
  background-size: cover;
  background-position: center;
  opacity: 0.9;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.32;
}

.blob-1 {
  width: 360px; height: 360px;
  background: #818cf8;
  top: -140px; left: -100px;
}

.blob-2 {
  width: 300px; height: 300px;
  background: #f472b6;
  bottom: -120px; right: 0;
  opacity: 0.28;
}

.blob-3 {
  width: 220px; height: 220px;
  background: #fbbf24;
  top: 35%; right: 22%;
  opacity: 0.16;
}

.hero-wave {
  position: absolute;
  left: 0; bottom: -1px;
  width: 100%;
  height: 60px;
  z-index: 1;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 48px;
  flex-wrap: wrap;
  color: #fff;
  backdrop-filter: blur(10px);
  background: rgba(30, 27, 75, 0.55);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: background 0.25s ease, padding 0.25s ease, box-shadow 0.25s ease;
}

.navbar.is-scrolled {
  background: rgba(30, 27, 75, 0.92);
  padding: 16px 48px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: 0.01em;
  color: #fff;
}

.nav-brand:hover { text-decoration: none; }

.logo-mark {
  width: 44px;
  height: 44px;
  display: block;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: #fff;
  display: block;
  border-radius: 2px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 8px 0 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-links a {
  color: #fff;
  opacity: 0.88;
  font-size: 1.08rem;
  font-weight: 600;
  position: relative;
  padding-bottom: 2px;
}

.nav-links a:hover { opacity: 1; text-decoration: none; }

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0%;
  height: 2px;
  background: #fff;
  transition: width 0.18s ease;
}

.nav-links a:hover::after { width: 100%; }

.nav-links a.is-active { opacity: 1; }
.nav-links a.is-active::after { width: 100%; background: #fbbf24; }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  margin: 56px auto 0;
  padding: 0 32px;
  text-align: center;
}

.hero-logo {
  width: 76px;
  height: 76px;
  margin: 0 0 20px;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.25));
}

.hero-eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 6px 16px;
  border-radius: 999px;
  margin: 0 0 22px;
}

.hero-content h1 {
  font-size: 3.4rem;
  margin: 0 0 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #ffffff, #e9d5ff 60%, #fbcfe8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  font-size: 1.2rem;
  margin: 0 0 34px;
  opacity: 0.95;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-strip {
  position: relative;
  z-index: 3;
  max-width: 880px;
  margin: 46px auto 16px;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px 12px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(31,35,48,0.14);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--primary-dark);
  background: linear-gradient(90deg, var(--primary), var(--accent-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.btn-secondary {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
}

.btn:hover { transform: translateY(-2px); text-decoration: none; box-shadow: 0 10px 22px rgba(0,0,0,0.16); }

/* ---------- Layout ---------- */

main { max-width: 980px; margin: 0 auto; padding: 0 32px; }

.section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.section.alt {
  background: var(--bg-alt);
  margin: 0 -32px;
  padding: 64px 32px;
  border-bottom: 1px solid var(--border);
}

.section h2 {
  font-size: 1.75rem;
  margin-top: 0;
  margin-bottom: 18px;
  color: var(--primary-dark);
  position: relative;
  padding-left: 18px;
}

.section h2::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--primary), var(--accent-pink));
}

.section h3 {
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 12px;
}

.section p {
  color: var(--text);
  text-align: justify;
  text-justify: inter-word;
}
.muted { color: var(--muted); }

/* ---------- QR toggle (WeChat group) ---------- */

.qr-toggle { margin-top: 18px; }

.qr-toggle summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  list-style: none;
}

.qr-toggle summary::-webkit-details-marker { display: none; }

.qr-toggle summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 8px;
  font-size: 0.7em;
  transition: transform 0.15s ease;
}

.qr-toggle[open] summary::before { transform: rotate(90deg); }

.qr-toggle summary:hover { text-decoration: underline; }

.qr-image {
  display: block;
  width: 220px;
  margin: 16px 0 0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(31,35,48,0.12);
}

/* ---------- Track cards ---------- */

.track-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 32px 28px;
  margin-bottom: 28px;
  box-shadow: 0 4px 18px rgba(31, 35, 48, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.track-card:hover {
  box-shadow: 0 10px 28px rgba(31, 35, 48, 0.09);
  transform: translateY(-2px);
}

.track-card.track-1 { border-top: 4px solid var(--primary); }
.track-card.track-2 { border-top: 4px solid var(--accent-pink); }

.track-icon {
  position: absolute;
  top: -22px;
  left: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 4px 10px rgba(31,35,48,0.08);
}

.track-card h3 { margin-top: 10px; }

.code-block {
  background: #1e1e2e;
  color: #e5e7eb;
  padding: 16px 18px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.88rem;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.formula {
  text-align: center;
  margin: 18px 0;
  overflow-x: auto;
}

/* ---------- NVV samples (collapsible) ---------- */

.nvv-sample-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-items: start;
}

.nvv-sample {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 16px;
}

@media (max-width: 640px) {
  .nvv-sample-grid { grid-template-columns: 1fr; }
}

.nvv-sample summary {
  cursor: pointer;
  list-style: none;
  color: var(--primary-dark);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 2px 0;
}

.nvv-sample summary::-webkit-details-marker { display: none; }

.nvv-sample summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 8px;
  font-size: 0.7em;
  transition: transform 0.15s ease;
}

.nvv-sample[open] summary::before { transform: rotate(90deg); }

.nvv-sample summary:hover { text-decoration: underline; }

.nvv-sample-body { margin-top: 10px; }

.nvv-sample-body audio {
  width: 100%;
  margin-bottom: 10px;
}

.nvv-text-zh, .nvv-text-en {
  text-align: left;
  font-size: 0.88rem;
  margin: 4px 0;
}

.nvv-text-en {
  color: var(--muted);
  font-style: italic;
}

/* ---------- Vertical timeline ---------- */

.vtimeline {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  position: relative;
}

.vtimeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

.vtimeline li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
}

.vtimeline li::before {
  content: "";
  position: absolute;
  left: 0; top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--primary);
}

.vtimeline li:last-child::before { border-color: var(--accent-pink); }
.vtimeline li:last-child { margin-bottom: 0; }

/* milestones already reached get a solid, filled dot instead of a hollow one */
.vtimeline li.is-past::before { background: var(--primary); }

.vt-date {
  font-weight: 700;
  color: var(--primary-dark);
  min-width: 170px;
}

.vt-event { color: var(--text); }

/* ---------- News ---------- */

.news-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
}

.news-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.news-list li:last-child { border-bottom: none; }

.news-date {
  font-weight: 700;
  color: var(--primary-dark);
  min-width: 130px;
}

.news-text { color: var(--text); }

/* ---------- Rules ---------- */

.rules-list {
  padding-left: 22px;
}

.rules-list li {
  margin-bottom: 14px;
  line-height: 1.7;
}

/* ---------- Registration ---------- */

.registration-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.registration-buttons .btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 18px rgba(79,70,229,0.25);
}

/* ---------- Organizers ---------- */

.organizer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px 24px;
  text-align: center;
}

.organizer-item {
  min-width: 0;
}

.organizer-item h4 {
  margin: 0 0 6px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.organizer-item .affil {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.organizer-item .email {
  margin: 2px 0 0;
  font-size: 0.85rem;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-word;
}

.organizer-item .email a {
  color: var(--primary-dark);
}

/* ---------- Dataset table ---------- */

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

.ds-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(31, 35, 48, 0.06);
}

.ds-table thead {
  background: var(--primary);
  color: #fff;
}

.ds-table th {
  padding: 12px 16px;
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.ds-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: center;
  line-height: 1.5;
}

.ds-table tbody tr:last-child td {
  border-bottom: none;
}

.ds-table tbody tr:hover {
  background: #f5f6fc;
}

.ds-table td:first-child {
  font-weight: 700;
  color: var(--primary-dark);
  white-space: nowrap;
}

.ds-table th:last-child {
  text-align: center;
  vertical-align: middle;
}

.ds-table td:last-child {
  text-align: left;
  vertical-align: top;
  color: var(--text);
  font-size: 0.87rem;
  word-break: break-word;
}

/* ---------- Footer ---------- */

.footer {
  text-align: center;
  padding: 32px 16px 48px;
  color: var(--muted);
  font-size: 0.88rem;
  background: var(--bg-alt);
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 12px;
    margin-top: 14px;
    padding: 14px 0 6px;
    border-top: 1px solid rgba(255,255,255,0.2);
  }

  .nav-links.is-open { display: flex; }
}

@media (max-width: 760px) {
  .organizer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .organizer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .hero-content h1 { font-size: 2.1rem; }
  .section, .section.alt { padding: 44px 16px; }
  main { padding: 0 16px; }
  .vt-date { min-width: 130px; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}
