:root {
  --ink: #18212f;
  --muted: #637083;
  --line: #d9e1ea;
  --paper: #f7f3ea;
  --white: #ffffff;
  --teal: #167c80;
  --coral: #e5684f;
  --yellow: #f2b84b;
  --green: #3e8f5b;
  --blue: #315f9f;
  --shadow: 0 22px 70px rgba(24, 33, 47, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.5;
}

button,
a,
textarea {
  font: inherit;
}

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

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 74px;
  padding: 12px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid rgba(24, 33, 47, 0.1);
  background: rgba(247, 243, 234, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--teal);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  gap: clamp(12px, 3vw, 30px);
  color: #354253;
  font-size: 15px;
}

.nav a {
  padding: 8px 0;
}

.login-button,
.primary-button,
.secondary-button,
.module-button,
.tool-actions button,
.lesson-list button,
.choice-row button,
#speaking-check,
#essay-check {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
}

.login-button,
.primary-button,
#speaking-check,
#essay-check {
  color: var(--white);
  background: var(--ink);
}

.secondary-button,
.module-button,
.tool-actions button,
.lesson-list button,
.choice-row button {
  color: var(--ink);
  background: var(--white);
  border-color: var(--line);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: clamp(28px, 6vw, 86px);
  align-items: center;
  min-height: calc(100vh - 74px);
  padding: clamp(42px, 8vw, 92px) clamp(18px, 5vw, 64px) 54px;
  background:
    linear-gradient(115deg, rgba(22, 124, 128, 0.12), transparent 42%),
    radial-gradient(circle at 82% 18%, rgba(242, 184, 75, 0.24), transparent 26%),
    var(--paper);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(52px, 8vw, 118px);
  line-height: 0.95;
  letter-spacing: 0;
}

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

h3 {
  font-size: 21px;
  line-height: 1.2;
}

.hero-lede {
  max-width: 680px;
  color: #3d4a5b;
  font-size: clamp(17px, 2vw, 21px);
}

.hero-actions,
.tool-actions,
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-actions {
  margin: 28px 0;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 150px));
  gap: 14px;
  margin: 34px 0 0;
}

.hero-stats div {
  border-top: 1px solid rgba(24, 33, 47, 0.2);
  padding-top: 14px;
}

.hero-stats dt {
  font-size: 32px;
  font-weight: 850;
}

.hero-stats dd {
  margin: 0;
  color: var(--muted);
}

.dashboard-panel,
.tool-stage {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(24, 33, 47, 0.1);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.panel-header,
.tool-header,
.lesson-list article,
.task-list article,
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.panel-header {
  color: var(--muted);
}

.panel-header strong {
  color: var(--ink);
}

.progress-ring {
  display: grid;
  width: min(64vw, 270px);
  aspect-ratio: 1;
  place-items: center;
  margin: 28px auto;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--white) 58%, transparent 59%),
    conic-gradient(var(--teal) 0 68%, #e8edf1 68% 100%);
}

.progress-ring span {
  font-size: 44px;
  font-weight: 900;
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-list article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.task-list p,
.module-card p,
.roadmap p,
.lesson-list p,
.prompt-box small,
.flashcard small {
  color: var(--muted);
}

.task-list p,
.lesson-list p {
  margin: 4px 0 0;
}

.task-icon,
.module-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--white);
  font-weight: 850;
}

.task-icon {
  width: 44px;
  height: 44px;
}

.vocab-icon {
  background: var(--teal);
}

.speak-icon {
  background: var(--coral);
}

.write-icon {
  background: var(--blue);
}

.section {
  padding: clamp(48px, 8vw, 96px) clamp(18px, 5vw, 64px);
}

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

.module-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 16px;
}

.module-card,
.roadmap-grid article {
  min-height: 280px;
  padding: 22px;
  border: 1px solid rgba(24, 33, 47, 0.12);
  border-radius: 8px;
  background: var(--white);
}

.module-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.module-card p {
  flex: 1;
}

.module-icon {
  width: 50px;
  height: 50px;
  margin-bottom: 18px;
  background: var(--ink);
  font-size: 14px;
}

.module-card:nth-child(2) .module-icon {
  background: var(--coral);
}

.module-card:nth-child(3) .module-icon {
  background: var(--yellow);
  color: var(--ink);
}

.module-card:nth-child(4) .module-icon {
  background: var(--green);
}

.module-card:nth-child(5) .module-icon {
  background: var(--blue);
}

.workspace {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  background: #ecf1ed;
}

.tool-tabs {
  display: grid;
  align-content: start;
  gap: 10px;
}

.tab {
  min-height: 46px;
  border: 1px solid rgba(24, 33, 47, 0.12);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  font-weight: 800;
  text-align: left;
  padding: 10px 14px;
}

.tab.active {
  color: var(--white);
  background: var(--teal);
}

.tool-stage {
  min-height: 520px;
  padding: clamp(18px, 3vw, 30px);
}

.tool-panel {
  display: none;
}

.tool-panel.active {
  display: block;
}

.tool-header {
  margin-bottom: 20px;
}

.status-pill {
  border-radius: 999px;
  padding: 8px 12px;
  color: var(--teal);
  background: rgba(22, 124, 128, 0.1);
  font-size: 13px;
  font-weight: 800;
}

.flashcard,
.question-box,
.prompt-box,
.ai-result {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.flashcard {
  display: grid;
  min-height: 260px;
  align-content: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: clamp(24px, 5vw, 44px);
}

#word-label {
  margin: 0;
  font-size: clamp(42px, 7vw, 88px);
  font-weight: 900;
  line-height: 1;
}

#word-meaning {
  font-size: 22px;
  font-weight: 800;
}

.lesson-list {
  display: grid;
  gap: 14px;
}

.lesson-list article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.lesson-thumb {
  display: grid;
  width: 92px;
  aspect-ratio: 16 / 10;
  place-items: center;
  border-radius: 8px;
  color: var(--white);
  background:
    linear-gradient(135deg, rgba(229, 104, 79, 0.9), rgba(49, 95, 159, 0.92)),
    var(--blue);
  font-weight: 900;
}

.question-box {
  padding: clamp(18px, 4vw, 32px);
}

.question-tag {
  color: var(--teal);
  font-weight: 800;
}

.feedback-line {
  min-height: 28px;
  margin: 18px 0 0;
  font-weight: 800;
}

.prompt-box {
  margin-bottom: 14px;
  padding: 18px;
}

.prompt-box p {
  margin-bottom: 8px;
  font-size: 22px;
  font-weight: 850;
}

textarea {
  width: 100%;
  margin-bottom: 12px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--ink);
  background: var(--white);
}

.ai-result {
  min-height: 72px;
  margin-top: 14px;
  padding: 16px;
  color: #334155;
}

.ai-result:empty {
  display: none;
}

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

.roadmap-grid span {
  color: var(--coral);
  font-size: 32px;
  font-weight: 900;
}

.footer {
  flex-wrap: wrap;
  padding: 28px clamp(18px, 5vw, 64px);
  color: var(--white);
  background: var(--ink);
}

.footer span {
  color: rgba(255, 255, 255, 0.72);
}

@media (max-width: 1120px) {
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    position: static;
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .tool-tabs {
    display: flex;
    overflow-x: auto;
  }

  .tab {
    flex: 0 0 auto;
    min-width: 96px;
    text-align: center;
  }

  .roadmap-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .login-button {
    width: 100%;
    text-align: center;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

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

  .panel-header,
  .tool-header,
  .lesson-list article,
  .task-list article {
    align-items: flex-start;
  }

  .lesson-list article,
  .task-list article {
    flex-direction: column;
  }

  .lesson-thumb {
    width: 100%;
  }
}
