:root {
  --cream: #faf7f0;
  --cream-deep: #f1ebdd;
  --green: #2f5d46;
  --green-dark: #234636;
  --green-tint: #e9f0ea;
  --ink: #262e29;
  --muted: #67736b;
  --card: #ffffff;
  --line: #e5ded0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Chinese text always renders larger than surrounding English */
:lang(zh), .zh { font-size: 1.2em; }

nav.site {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 22px clamp(20px, 5vw, 56px);
}
nav.site a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
nav.site a:hover { background: var(--green-tint); color: var(--green-dark); }

nav.site .brand {
  margin-right: auto;
  padding: 8px 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--green-dark);
}
nav.site .brand:hover { background: none; color: var(--green); }

/* Phones: let the menu wrap instead of forcing the page wider than the screen
   (an unwrappable nav made EVERY page overflow horizontally on mobile). */
@media (max-width: 620px) {
  nav.site { flex-wrap: wrap; justify-content: center; gap: 4px; padding: 14px 10px; }
  nav.site a { padding: 7px 12px; font-size: 0.9rem; }
  nav.site .brand { width: 100%; text-align: center; margin: 0 0 4px; padding: 0; }
}

.hero {
  text-align: center;
  padding: clamp(64px, 12vh, 140px) 24px clamp(56px, 10vh, 110px);
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, var(--green-tint) 0%, rgba(233, 240, 234, 0) 65%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 100%);
}
.hero h1 {
  font-size: clamp(2.4rem, 6.5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  max-width: 18em;
  margin: 0 auto;
}
.hero h1 .accent { color: var(--green); }
.hero p {
  max-width: 36em;
  margin: 28px auto 0;
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--muted);
}

.cards {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 80px) 24px 96px;
  display: grid;
  gap: 20px;
}
/* Two balanced columns on wide screens (avoids a 3+1 orphan row), one on phones */
@media (min-width: 620px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
.cards a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 28px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.cards a:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(47, 93, 70, 0.12);
  border-color: var(--green);
}
.cards h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--green-dark);
}
.cards p { margin-top: 8px; font-size: 0.95rem; color: var(--muted); }
.cards .go {
  display: inline-block;
  margin-top: auto;
  padding-top: 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green);
}

.placeholder {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
}
.placeholder h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--green-dark);
}
.placeholder p { margin-top: 14px; color: var(--muted); max-width: 32em; }
.placeholder a.home {
  margin-top: 32px;
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
  padding: 10px 24px;
  border: 1.5px solid var(--green);
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}
.placeholder a.home:hover { background: var(--green); color: #fff; }

footer {
  text-align: center;
  padding: 28px 24px 40px;
  color: var(--muted);
  font-size: 0.85rem;
}

nav.site a[aria-current] { background: var(--green-tint); color: var(--green-dark); }

/* ---- catalog: level-organized listings for handouts & exercises ---- */
.page-head {
  text-align: center;
  padding: clamp(48px, 9vh, 96px) 24px clamp(16px, 3vh, 32px);
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, var(--green-tint) 0%, rgba(233, 240, 234, 0) 65%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 100%);
}
.page-head h1 {
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--green-dark);
}
.page-head p {
  max-width: 34em;
  margin: 14px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.catalog { max-width: 820px; margin: 0 auto; padding: clamp(32px, 6vh, 64px) 24px 80px; }

.system {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--green);
  margin: 48px 0 0;
}
.system:first-child { margin-top: 0; }

.level { margin-top: 22px; }
.level > h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--green-dark);
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.doc-list { list-style: none; display: grid; gap: 10px; }
.doc-list a {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px 20px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.16s, box-shadow 0.16s, border-color 0.16s;
}
.doc-list a:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(47, 93, 70, 0.1);
  border-color: var(--green);
}
.doc-list .ico {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  background: var(--green-tint);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
}
.doc-list .doc-main { flex: 1; min-width: 0; }
.doc-list .doc-title { font-weight: 600; }
.doc-list .doc-meta { font-size: 0.85rem; color: var(--muted); margin-top: 1px; }
.doc-list .dl { flex: none; color: var(--green); font-weight: 600; font-size: 0.9rem; }

.catalog .more-note {
  margin-top: 44px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.more-note a {
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}
.more-note a:hover { text-decoration: underline; }
