:root {
  color-scheme: light;
  --ink: #24323d;
  --muted: #62717f;
  --line: #d9e8e7;
  --paper: #fffdf7;
  --mint: #d7f4ea;
  --mint-strong: #3aa987;
  --coral: #ff7f6e;
  --yellow: #ffd35a;
  --blue: #7ab8ff;
  --lilac: #c9b8ff;
  --shadow: 0 18px 45px rgba(33, 65, 79, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    Arial,
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 211, 90, 0.36), transparent 28rem),
    linear-gradient(180deg, #f4fffb 0%, #fffaf0 42%, #f8fbff 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem clamp(1rem, 4vw, 4rem);
  background: rgba(255, 253, 247, 0.88);
  border-bottom: 1px solid rgba(122, 184, 255, 0.28);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 12rem;
}

.brand-mark {
  display: grid;
  width: 2.8rem;
  height: 2.8rem;
  place-items: center;
  border: 3px solid #ffffff;
  border-radius: 0.8rem;
  background: var(--coral);
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(255, 127, 110, 0.28);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.25;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
}

.top-nav a {
  padding: 0.65rem 0.8rem;
  border-radius: 999px;
  color: #40505d;
  font-size: 0.95rem;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  background: #e7f6ff;
  outline: none;
}

main {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(18rem, 1.1fr);
  align-items: center;
  gap: clamp(1.4rem, 4vw, 4rem);
  min-height: calc(100vh - 5rem);
  padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 5vw, 5rem) 2rem;
}

.hero-copy {
  max-width: 42rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--mint-strong);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 13ch;
  font-size: clamp(2.6rem, 4.9rem, 4.9rem);
  line-height: 1.03;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.16;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.hero-text {
  max-width: 35rem;
  margin: 1.3rem 0 0;
  color: var(--muted);
  font-size: 1.12rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.8rem;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.78rem 1.1rem;
  border: 0;
  border-radius: 0.75rem;
  cursor: pointer;
  font-weight: 800;
}

.primary-action {
  background: var(--ink);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(36, 50, 61, 0.18);
}

.secondary-action {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
}

.compact {
  width: fit-content;
}

.hero-media {
  position: relative;
  border-radius: 1.6rem;
  overflow: hidden;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hero-media::after {
  position: absolute;
  inset: 0;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: inherit;
  pointer-events: none;
}

.hero-media img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  width: min(72rem, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1rem 0 4rem;
}

.quick-stats div {
  min-height: 7rem;
  padding: 1.1rem;
  border: 1px solid rgba(58, 169, 135, 0.18);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.72);
}

.quick-stats strong {
  display: block;
  color: var(--coral);
  font-size: 2.4rem;
  line-height: 1;
}

.quick-stats span {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
}

section {
  padding: 4rem clamp(1rem, 5vw, 5rem);
}

.section-heading {
  width: min(72rem, 100%);
  margin: 0 auto 1.5rem;
}

.path-grid,
.chapter-grid,
.challenge-board {
  display: grid;
  width: min(72rem, 100%);
  margin: 0 auto;
  gap: 1rem;
}

.path-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.path-grid article,
.chapter-card,
.challenge-card {
  border: 1px solid rgba(98, 113, 127, 0.13);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 24px rgba(33, 65, 79, 0.07);
}

.path-grid article {
  padding: 1.1rem;
}

.path-grid span {
  display: inline-block;
  margin-bottom: 0.9rem;
  color: var(--coral);
  font-size: 1.6rem;
  font-weight: 900;
}

.path-grid p,
.chapter-card p,
.challenge-card p,
.challenge-copy p {
  color: var(--muted);
  line-height: 1.7;
}

.chapters-section {
  background: rgba(255, 255, 255, 0.45);
}

.term-tabs {
  display: flex;
  gap: 0.55rem;
  width: min(72rem, 100%);
  margin: 0 auto 1rem;
}

.tab-button,
.practice-topic {
  min-height: 2.65rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.tab-button {
  min-width: 6rem;
  padding: 0.55rem 1rem;
}

.tab-button.is-active,
.practice-topic.is-active {
  border-color: transparent;
  background: var(--yellow);
  color: #3b2b00;
}

.chapter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chapter-card {
  min-height: 18rem;
  padding: 1rem;
}

.chapter-kicker {
  color: var(--mint-strong);
  font-size: 0.84rem;
  font-weight: 800;
}

.chapter-card ul {
  display: grid;
  gap: 0.42rem;
  margin: 0.85rem 0 0;
  padding-left: 1.1rem;
  color: #435462;
  line-height: 1.55;
}

.practice-layout {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 1rem;
  width: min(72rem, 100%);
  margin: 0 auto;
}

.practice-menu {
  display: grid;
  align-content: start;
  gap: 0.65rem;
}

.practice-topic {
  width: 100%;
  padding: 0.65rem 0.8rem;
  text-align: left;
}

.question-panel {
  display: grid;
  gap: 1rem;
  min-height: 24rem;
  padding: 1rem;
  border: 1px solid rgba(98, 113, 127, 0.13);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.86);
}

.question-list {
  display: grid;
  gap: 0.8rem;
}

.question-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8rem;
  gap: 0.8rem;
  align-items: center;
  min-height: 4.6rem;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: #fbfffd;
}

.question-item label {
  line-height: 1.6;
}

.question-item input {
  width: 100%;
  min-height: 2.55rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid #cfe1df;
  border-radius: 0.55rem;
}

.question-item input:focus {
  border-color: var(--mint-strong);
  outline: 3px solid rgba(58, 169, 135, 0.16);
}

.question-feedback {
  color: var(--muted);
  font-size: 0.9rem;
}

.practice-result {
  min-height: 2.6rem;
  padding: 0.75rem;
  border-radius: 0.7rem;
  background: #f2fbff;
  color: #365366;
}

.challenge-section {
  display: grid;
  grid-template-columns: minmax(16rem, 0.45fr) minmax(0, 1fr);
  gap: 1rem;
  width: min(82rem, 100%);
  margin: 0 auto;
}

.challenge-section .challenge-copy,
.challenge-section .challenge-board {
  width: auto;
  margin: 0;
}

.challenge-board {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.challenge-card {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
}

.challenge-card button {
  width: fit-content;
  min-height: 2.45rem;
  padding: 0.5rem 0.85rem;
  border: 0;
  border-radius: 0.65rem;
  background: var(--blue);
  color: #102b43;
  cursor: pointer;
  font-weight: 800;
}

.stars {
  color: #d79a00;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.site-footer {
  padding: 2rem 1rem 2.4rem;
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  width: min(54rem, 100%);
  margin: 0 auto;
  line-height: 1.7;
}

@media (max-width: 980px) {
  .hero,
  .challenge-section {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    max-width: 12ch;
    font-size: 3.1rem;
  }

  .path-grid,
  .chapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    justify-content: flex-start;
    width: 100%;
  }

  .top-nav a {
    padding: 0.55rem 0.65rem;
    font-size: 0.9rem;
  }

  .hero {
    padding-top: 2rem;
  }

  h1 {
    max-width: none;
    font-size: 2.55rem;
  }

  .quick-stats,
  .path-grid,
  .chapter-grid,
  .practice-layout,
  .challenge-board {
    grid-template-columns: 1fr;
  }

  .quick-stats {
    padding-bottom: 2rem;
  }

  section {
    padding: 3rem 1rem;
  }

  .practice-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .practice-topic {
    text-align: center;
  }

  .question-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .hero-actions,
  .term-tabs {
    flex-direction: column;
  }

  .primary-action,
  .secondary-action,
  .tab-button {
    width: 100%;
  }

  .practice-menu {
    grid-template-columns: 1fr;
  }
}
