:root {
  --ink: #1d3557;
  --ink-soft: #457b9d;
  --sky: #e8f4fc;
  --sky-deep: #cfe8f7;
  --leaf: #2a9d8f;
  --leaf-dark: #1f7a6f;
  --sun: #e9c46a;
  --coral: #e76f51;
  --paper: #f7fbfe;
  --white: #ffffff;
  --muted: #5b7390;
  --line: rgba(29, 53, 87, 0.1);
  --font-display: "Nunito", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "Nunito", system-ui, sans-serif;
  --max: 980px;
  --radius: 18px;
  --shadow: 0 12px 40px rgba(29, 53, 87, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 70% 50% at 100% 0%, rgba(42, 157, 143, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 100%, rgba(233, 196, 106, 0.18), transparent 50%),
    var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(247, 251, 254, 0.86);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.85rem 0; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.65rem; }
.brand img { width: 40px; height: 40px; }
.brand strong {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.1rem; letter-spacing: 0.02em;
}
.brand small { display: block; font-size: 0.72rem; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; align-items: center; }
.links a {
  font-size: 0.92rem; color: var(--ink-soft); font-weight: 600;
  padding: 0.25rem 0.2rem;
}
.links a:hover, .links a.is-active { color: var(--leaf-dark); }
.links .cta {
  background: var(--leaf); color: #fff !important;
  padding: 0.45rem 0.9rem; border-radius: 999px;
}
    .links .cta:hover { background: var(--leaf-dark); }
    .nav-login, .nav-user {
      font-size: 0.92rem; font-weight: 700; color: var(--leaf-dark) !important;
      padding: 0.35rem 0.75rem; border-radius: 999px;
      border: 1px solid rgba(42,157,143,0.35); background: rgba(42,157,143,0.08);
    }
    .nav-user { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hero {
  padding: 2.6rem 0 2rem;
  display: grid; gap: 1.5rem;
}
@media (min-width: 800px) {
  .hero { grid-template-columns: 1.2fr 0.8fr; align-items: center; }
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 2.7rem);
  font-weight: 800; line-height: 1.2; letter-spacing: -0.02em;
  margin: 0.4rem 0 0.75rem;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; font-weight: 700; color: var(--leaf-dark);
  background: rgba(42, 157, 143, 0.12);
  padding: 0.28rem 0.7rem; border-radius: 999px;
}
.lead { color: var(--muted); font-size: 1.02rem; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 1.2rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4rem; font-weight: 700; font-size: 0.95rem;
  padding: 0.7rem 1.15rem; border-radius: 999px; border: none; cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #152843; }
.btn-soft { background: var(--white); color: var(--ink); border: 1px solid var(--line); }
.btn-leaf { background: var(--leaf); color: #fff; }
.btn-leaf:hover { background: var(--leaf-dark); }
.hero-card {
  background: var(--white); border-radius: 24px; padding: 1.3rem;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.hero-card h3 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 0.6rem; }
.hero-card ol { padding-left: 1.15rem; color: var(--muted); font-size: 0.92rem; }
.hero-card li { margin: 0.35rem 0; }

.section { padding: 1.5rem 0 2.5rem; }
.section-head {
  display: flex; justify-content: space-between; align-items: end;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem;
}
.section-head h2 {
  font-family: var(--font-display); font-size: 1.45rem; font-weight: 800;
}
.section-head p { color: var(--muted); font-size: 0.92rem; }

.grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 6px 20px rgba(29, 53, 87, 0.04);
  display: flex; flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-cover {
  aspect-ratio: 16/10;
  background:
    linear-gradient(135deg, var(--sky-deep), #dff5f1);
  display: grid; place-items: center;
  font-size: 2.6rem;
  position: relative;
}
.card-cover .badge {
  position: absolute; left: 0.7rem; top: 0.7rem;
  background: rgba(29, 53, 87, 0.82); color: #fff;
  font-size: 0.72rem; font-weight: 700;
  padding: 0.2rem 0.5rem; border-radius: 999px;
}
.card-body { padding: 1rem 1.05rem 1.15rem; flex: 1; display: flex; flex-direction: column; gap: 0.45rem; }
.card-body h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
.card-body p { color: var(--muted); font-size: 0.88rem; flex: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  font-size: 0.72rem; font-weight: 600; color: var(--ink-soft);
  background: var(--sky); padding: 0.18rem 0.5rem; border-radius: 999px;
}
.card-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.5rem; }
.card-actions a, .card-actions button {
  font-size: 0.82rem; font-weight: 700; color: var(--leaf-dark);
  background: rgba(42, 157, 143, 0.1); border: none; cursor: pointer;
  padding: 0.4rem 0.7rem; border-radius: 999px; font-family: inherit;
}

.notice {
  background: #fff8e8; border: 1px solid rgba(233, 196, 106, 0.55);
  color: #6b5420; border-radius: 14px; padding: 0.9rem 1rem;
  font-size: 0.9rem; margin-bottom: 1.2rem;
}

.lesson-layout {
  display: grid; gap: 1.2rem;
}
@media (min-width: 860px) {
  .lesson-layout { grid-template-columns: 1.4fr 0.8fr; align-items: start; }
}
.panel {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.2rem 1.25rem;
}
.panel h1 { font-family: var(--font-display); font-size: 1.6rem; margin: 0.3rem 0 0.6rem; }
.panel h2 { font-family: var(--font-display); font-size: 1.15rem; margin: 1rem 0 0.5rem; }
.phrase {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 0.85rem 1rem; margin: 0.55rem 0;
  display: grid; gap: 0.25rem;
}
.phrase .en {
  font-family: var(--font-display); font-size: 1.25rem; font-weight: 800;
  color: var(--ink);
}
.phrase .zh { color: var(--muted); font-size: 0.9rem; }
.phrase .tip { font-size: 0.78rem; color: var(--leaf-dark); }

.practice-box { text-align: center; padding: 1.4rem 1rem; }
.practice-target {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.4rem, 4vw, 2rem);
  margin: 1rem 0 0.4rem;
}
.score-ring {
  width: 120px; height: 120px; margin: 1rem auto;
  border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--leaf) calc(var(--p) * 1%), var(--sky-deep) 0);
  position: relative;
}
.score-ring::after {
  content: ""; position: absolute; inset: 10px;
  background: var(--white); border-radius: 50%;
}
.score-ring span {
  position: relative; z-index: 1;
  font-family: var(--font-display); font-weight: 800; font-size: 1.6rem;
}
.mic-btn {
  width: 72px; height: 72px; border-radius: 50%; border: none;
  background: var(--coral); color: #fff; font-size: 1.6rem;
  cursor: pointer; box-shadow: 0 8px 24px rgba(231, 111, 81, 0.35);
}
.mic-btn.listening { animation: pulse 1s ease infinite; background: var(--ink); }
@keyframes pulse {
  50% { transform: scale(1.06); box-shadow: 0 0 0 12px rgba(29, 53, 87, 0.12); }
}
.status { color: var(--muted); font-size: 0.9rem; margin-top: 0.8rem; min-height: 1.4em; }
.heard {
  margin-top: 0.8rem; padding: 0.7rem; border-radius: 12px;
  background: var(--sky); font-size: 0.92rem; color: var(--ink-soft);
}

footer.site-foot {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.2rem; color: var(--muted); font-size: 0.85rem;
}
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1rem;
}
.filter-bar button {
  border: 1px solid var(--line); background: var(--white);
  border-radius: 999px; padding: 0.35rem 0.75rem;
  font-size: 0.82rem; font-weight: 600; cursor: pointer; color: var(--ink-soft);
  font-family: inherit;
}
.filter-bar button.is-on { background: var(--ink); color: #fff; border-color: transparent; }
.empty {
  text-align: center; padding: 2rem; color: var(--muted);
  border: 1px dashed var(--line); border-radius: var(--radius);
}
