:root {
  color-scheme: light;
  --ink: #19231f;
  --muted: #596861;
  --line: #d8ded6;
  --paper: #fffdf7;
  --wash: #f4f8ef;
  --board: #d8a55f;
  --board-dark: #7b5528;
  --green: #2f8f68;
  --green-dark: #176245;
  --red: #b1483f;
  --blue: #315f91;
  --shadow: 0 18px 50px rgba(29, 44, 37, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  line-height: 1.6;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 72px);
  border-bottom: 1px solid rgba(216, 222, 214, 0.82);
  background: rgba(255, 253, 247, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset -8px -8px 0 #f6f1e7;
}

.nav {
  display: flex;
  gap: 6px;
}

.nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
}

.nav a:hover {
  background: var(--wash);
  color: var(--green-dark);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: clamp(42px, 8vw, 96px) clamp(20px, 5vw, 72px) clamp(34px, 6vw, 72px);
  gap: clamp(30px, 6vw, 80px);
  background:
    linear-gradient(120deg, rgba(244, 248, 239, 0.95), rgba(255, 253, 247, 0.72)),
    radial-gradient(circle at 85% 20%, rgba(49, 95, 145, 0.16), transparent 34%);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 22px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.16;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: 0;
}

.hero-text {
  max-width: 640px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  background: var(--green);
  color: white;
}

.button.primary:hover {
  background: var(--green-dark);
}

.button.secondary {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.hero-board {
  display: grid;
  place-items: center;
}

.demo-board {
  position: relative;
  width: min(82vw, 460px);
  aspect-ratio: 1;
  border: 12px solid #9d6d34;
  border-radius: 8px;
  background-color: var(--board);
  background-image:
    linear-gradient(var(--board-dark) 2px, transparent 2px),
    linear-gradient(90deg, var(--board-dark) 2px, transparent 2px);
  background-size: 25% 25%;
  background-position: 12.5% 12.5%;
  box-shadow: var(--shadow);
}

.stone {
  position: absolute;
  width: 15%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.stone.black {
  background: radial-gradient(circle at 35% 30%, #4b4b4b, #0d0f0e 72%);
}

.stone.white {
  border: 1px solid rgba(36, 30, 22, 0.2);
  background: radial-gradient(circle at 35% 30%, #ffffff, #e7e0d2 78%);
}

.stone.liberty {
  width: 8%;
  background: #34a853;
  box-shadow: 0 0 0 8px rgba(52, 168, 83, 0.16);
}

.s1 { left: 37.5%; top: 37.5%; }
.s2 { left: 62.5%; top: 37.5%; }
.s3 { left: 37.5%; top: 62.5%; }
.s4 { left: 62.5%; top: 62.5%; }
.l1 { left: 37.5%; top: 12.5%; }
.l2 { left: 12.5%; top: 37.5%; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
}

.stats div {
  padding: 26px clamp(20px, 5vw, 72px);
  background: white;
}

.stats strong {
  display: block;
  color: var(--blue);
  font-size: 32px;
  line-height: 1;
}

.stats span {
  color: var(--muted);
}

.section {
  padding: clamp(54px, 8vw, 96px) clamp(20px, 5vw, 72px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.lesson-card,
.board-panel,
.quiz-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 10px 30px rgba(29, 44, 37, 0.06);
}

.lesson-card {
  padding: 22px;
}

.lesson-card p,
.board-panel p,
.feedback,
.footer {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e6f2eb;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
}

.board-section {
  background: var(--wash);
}

.board-layout {
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(260px, 1fr);
  align-items: center;
  gap: clamp(22px, 5vw, 52px);
}

.interactive-board {
  position: relative;
  width: min(100%, 520px);
  aspect-ratio: 1;
  border: 10px solid #9d6d34;
  border-radius: 8px;
  background-color: var(--board);
  background-image:
    linear-gradient(var(--board-dark) 2px, transparent 2px),
    linear-gradient(90deg, var(--board-dark) 2px, transparent 2px);
  background-size: 25% 25%;
  background-position: 12.5% 12.5%;
  box-shadow: var(--shadow);
}

.point {
  position: absolute;
  width: 17%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.point::before {
  content: "";
  position: absolute;
  inset: 9%;
  border-radius: 50%;
}

.point.black::before {
  background: radial-gradient(circle at 35% 30%, #4d4d4d, #0b0d0c 72%);
}

.point.white::before {
  border: 1px solid rgba(36, 30, 22, 0.24);
  background: radial-gradient(circle at 35% 30%, #ffffff, #e7e0d2 78%);
}

.point.liberty::before {
  inset: 32%;
  background: #34a853;
  box-shadow: 0 0 0 8px rgba(52, 168, 83, 0.18);
}

.point.selected {
  outline: 3px solid rgba(177, 72, 63, 0.78);
  outline-offset: 4px;
}

.board-panel {
  padding: clamp(22px, 4vw, 34px);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.legend-stone {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

.legend-stone.black {
  background: #111;
}

.legend-stone.white {
  border: 1px solid #cfc7b8;
  background: white;
}

.legend-stone.liberty {
  background: #34a853;
}

.quiz-box {
  max-width: 760px;
  padding: clamp(22px, 4vw, 34px);
}

.quiz-progress {
  margin-bottom: 12px;
  color: var(--blue);
  font-weight: 800;
}

.options {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.option {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.option:hover {
  border-color: var(--green);
}

.option.correct {
  border-color: #34a853;
  background: #eef8f1;
}

.option.wrong {
  border-color: var(--red);
  background: #fff1ef;
}

.feedback {
  min-height: 28px;
}

.quiz-next {
  display: none;
}

.quiz-next.visible {
  display: inline-flex;
}

.footer {
  padding: 28px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  background: white;
}

.footer p {
  margin: 0;
}

@media (max-width: 920px) {
  .hero,
  .board-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

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

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

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .stats,
  .lesson-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 40px;
  }
}
