:root {
  --blue: #0071e3;
  --blue-dark: #0066cc;
  --ink: #1d1d1f;
  --muted: rgba(0, 0, 0, 0.58);
  --soft: #f5f5f7;
  --paper: #ffffff;
  --black: #000000;
  --line: rgba(0, 0, 0, 0.08);
  --shadow: rgba(0, 0, 0, 0.16) 0 18px 50px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--soft);
  letter-spacing: -0.374px;
}

button, a { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue-dark); }
code { font-family: "SFMono-Regular", Consolas, monospace; font-size: .94em; }

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 4vw, 48px);
  background: rgba(0, 0, 0, 0.82);
  color: white;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  font-size: 12px;
}

.nav__brand { font-weight: 650; }
.nav__brand--link { color: white; text-decoration: none; }
.nav__links { display: flex; align-items: center; gap: 18px; color: rgba(255,255,255,.78); }
.nav__button {
  border: 0;
  color: white;
  background: rgba(255,255,255,.14);
  border-radius: 999px;
  padding: 5px 10px;
}
.nav__button--plan { background: rgba(0,113,227,.92); font-weight: 700; }
.nav__button--link { text-decoration: none; }

main { max-width: 1120px; margin: 0 auto; padding: 0 20px 56px; }

.hero {
  min-height: 430px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 72px 0 42px;
}
.hero--compact { min-height: auto; padding-bottom: 36px; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 650;
}

h1 {
  margin: 0;
  max-width: 820px;
  font-family: "Helvetica Neue", Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(44px, 8vw, 82px);
  line-height: .99;
  letter-spacing: -1.8px;
  font-weight: 700;
  font-kerning: normal;
}

.hero__copy {
  max-width: 640px;
  margin: 22px auto 0;
  font-size: clamp(18px, 2.4vw, 24px);
  line-height: 1.3;
  color: rgba(0,0,0,.66);
}

.hero__actions, .controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.button {
  border: 1px solid transparent;
  text-decoration: none;
  border-radius: 999px;
  padding: 11px 18px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(1px) scale(.99); }
.button--primary { background: var(--blue); color: white; }
.button--ghost { color: var(--blue-dark); border-color: rgba(0,102,204,.35); background: rgba(255,255,255,.48); }
.button--secondary { color: var(--ink); background: white; border-color: var(--line); }
.shortcut { opacity: .68; font-size: 12px; }

.dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  background: var(--paper);
  border-radius: 26px;
  padding: 22px;
  min-height: 144px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: rgba(0,0,0,.04) 0 1px 1px;
}
.metric-card--dark { background: var(--black); color: white; }
.metric-card--plus { background: linear-gradient(145deg, #ffffff 0%, #eaf4ff 100%); border: 1px solid rgba(0,113,227,.14); }
.metric-card__label { color: var(--muted); font-size: 13px; font-weight: 650; }
.metric-card--dark .metric-card__label, .metric-card--dark span:last-child { color: rgba(255,255,255,.62); }
.metric-card strong { font-size: 38px; line-height: 1; letter-spacing: -1.6px; }
.metric-card span:last-child { color: var(--muted); font-size: 14px; }

.progress {
  height: 8px;
  background: rgba(0,0,0,.08);
  border-radius: 999px;
  overflow: hidden;
}
.progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
  transition: width .32s ease;
}

.study {
  background: var(--paper);
  border-radius: 34px;
  padding: clamp(18px, 4vw, 34px);
  box-shadow: var(--shadow);
}

.deck-strip {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 14px;
}

.flashcard {
  min-height: 430px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fbfbfd 0%, #f5f5f7 100%);
  border: 1px solid rgba(0,0,0,.05);
  display: grid;
  place-items: center;
  padding: clamp(22px, 5vw, 56px);
  text-align: center;
}

.prompt, .label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
}

#targetWord {
  margin: 8px 0 0;
  font-size: clamp(96px, 17vw, 190px);
  line-height: .94;
  letter-spacing: -8px;
  font-weight: 700;
}

#targetHint { color: var(--muted); font-size: 18px; margin-top: 18px; }

.flashcard__answer {
  width: min(720px, 100%);
  margin-top: 28px;
  animation: rise .24s ease both;
}

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.answer-grid > div, .sentence {
  background: white;
  border-radius: 20px;
  padding: 18px;
  text-align: left;
  border: 1px solid rgba(0,0,0,.06);
}
.answer-big { font-size: 24px; font-weight: 650; margin: 8px 0 0; }
.sentence { margin-top: 14px; }
.sentence__zh { font-size: 34px; margin: 10px 0 4px; font-weight: 650; letter-spacing: -1px; }
#examplePinyin, #exampleEnglish { margin: 6px 0 0; color: rgba(0,0,0,.62); font-size: 17px; }

.ratings {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.ratings button {
  border: 0;
  border-radius: 18px;
  min-height: 66px;
  background: #f5f5f7;
  color: var(--ink);
  font-weight: 700;
  transition: transform .16s ease, background .16s ease;
}
.ratings button:hover { background: #eaeaef; transform: translateY(-1px); }
.ratings span { display: block; color: var(--muted); margin-top: 3px; font-size: 12px; }

.sponsor-card {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(0,113,227,.16);
  background: linear-gradient(135deg, #f5fbff 0%, #ffffff 100%);
  border-radius: 24px;
}
.sponsor-card[hidden] { display: none; }
.sponsor-card h3 { margin: 6px 0 4px; font-size: 22px; letter-spacing: -.6px; }
.sponsor-card p { margin: 0; color: rgba(0,0,0,.62); line-height: 1.45; }

.upgrade {
  margin-top: 34px;
  background: #111114;
  color: white;
  border-radius: 34px;
  padding: clamp(24px, 5vw, 44px);
}
.upgrade .eyebrow { color: #7bbcff; }
.upgrade h2 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
  letter-spacing: -1.8px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}
.pricing-card {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 26px;
  padding: 22px;
}
.pricing-card--featured { background: white; color: var(--ink); }
.pricing-card .label { color: rgba(255,255,255,.66); }
.pricing-card--featured .label { color: var(--blue-dark); }
.pricing-card strong { display: block; margin-top: 10px; font-size: 42px; line-height: 1; letter-spacing: -1.5px; }
.pricing-card strong span { font-size: 17px; letter-spacing: 0; color: rgba(0,0,0,.55); }
.pricing-card:not(.pricing-card--featured) strong span { color: rgba(255,255,255,.58); }
.pricing-card p, .pricing-card li, .upgrade__note { color: rgba(255,255,255,.66); line-height: 1.45; }
.pricing-card--featured p, .pricing-card--featured li { color: rgba(0,0,0,.66); }
.pricing-card ul { padding-left: 20px; min-height: 82px; }
.pricing-card .button { width: 100%; margin-top: 8px; }
.upgrade__note { margin: 18px 0 0; font-size: 13px; }

.footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 34px;
  color: rgba(0,0,0,.52);
  font-size: 13px;
  text-align: center;
}

.research-page { max-width: 1160px; }
.research-page h1 { font-size: clamp(38px, 6vw, 68px); max-width: 980px; }
.research-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.research-card, .research-section {
  background: white;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(20px, 3vw, 30px);
  box-shadow: rgba(0,0,0,.04) 0 1px 1px;
}
.research-card--dark { background: var(--black); color: white; grid-column: span 2; }
.research-card--dark .label, .research-card--dark p { color: rgba(255,255,255,.66); }
.research-card h2, .research-section h2 { margin: 10px 0 12px; font-size: clamp(24px, 3vw, 36px); line-height: 1.04; letter-spacing: -1.2px; }
.research-card p, .research-section li, .research-note { color: rgba(0,0,0,.64); line-height: 1.5; }
.research-card a { font-weight: 650; text-decoration: none; }
.research-section { margin-top: 18px; }
.research-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.research-columns h3 { margin-bottom: 8px; }
.research-columns ul { padding-left: 20px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.pill-list span {
  border: 1px solid rgba(0,102,204,.22);
  color: var(--blue-dark);
  background: rgba(255,255,255,.72);
  border-radius: 999px;
  padding: 9px 13px;
  font-weight: 650;
  font-size: 14px;
}

@media (max-width: 900px) {
  .research-grid, .research-columns { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .research-card--dark { grid-column: auto; }
}

@media (max-width: 760px) {
  .nav__links span { display: none; }
  .dashboard { grid-template-columns: 1fr; }
  .sponsor-card { align-items: stretch; flex-direction: column; }
  .answer-grid { grid-template-columns: 1fr; }
  .ratings { grid-template-columns: 1fr 1fr; }
  .flashcard { min-height: 390px; }
  h1 { letter-spacing: -0.6px; line-height: 1.03; }
  #targetWord { letter-spacing: -4px; }
}
