:root {
  color-scheme: light;
  --ink: #17231f;
  --muted: #66746f;
  --line: #d8e2de;
  --surface: #ffffff;
  --wash: #f3f7f5;
  --green: #16715f;
  --green-dark: #0d4d42;
  --yellow: #f1b744;
  --red: #d9504d;
  --blue: #2f6f9f;
  --shadow: 0 18px 48px rgba(23, 35, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--wash);
  color: var(--ink);
  font-family:
    Inter, "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui,
    sans-serif;
}

button,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 24px 18px;
  background: #102721;
  color: #f7fffb;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 3px solid #f7fffb;
  background: #f7fffb;
  color: #102721;
  font-weight: 900;
  font-size: 26px;
}

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

.brand small {
  margin-top: 2px;
  color: #b7ccc4;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 8px;
  margin-top: 42px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 8px;
  color: #d9e8e2;
  text-decoration: none;
}

.nav-item span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  font-weight: 800;
}

.nav-item.active,
.nav-item:hover {
  background: #1f4138;
  color: #ffffff;
}

.sidebar-note {
  display: flex;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #c3d8d0;
  font-size: 13px;
  line-height: 1.55;
}

.sidebar-note p {
  margin: 0;
}

.dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 50%;
  background: #61d394;
}

.main {
  min-width: 0;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar h1,
.hero-copy h2,
.section-heading h2,
.mock-header h2,
.study-panel h2,
.quiz-card h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  max-width: 760px;
  font-size: 28px;
  line-height: 1.2;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  min-height: 340px;
  overflow: visible;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 42px;
}

.hero-copy h2 {
  max-width: 700px;
  font-size: 42px;
  line-height: 1.08;
}

.hero-copy p:not(.eyebrow) {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.8;
}

.hero-actions,
.quiz-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.primary-action,
.secondary-action,
.install-button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

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

.secondary-action,
.install-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.road-visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 340px;
  overflow: hidden;
  border-radius: 0 8px 8px 0;
  padding: 44px;
  background:
    linear-gradient(140deg, rgba(22, 113, 95, 0.95), rgba(47, 111, 159, 0.86)),
    url("assets/road-pattern.svg");
  background-size: cover;
  background-position: center;
}

.plate {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 0 0 auto;
  width: clamp(92px, 13vw, 132px);
  height: clamp(92px, 13vw, 132px);
  place-items: center;
  border: 8px solid #1f1f1f;
  background: #ffffff;
  color: #d7222a;
  font-size: clamp(60px, 8vw, 88px);
  font-weight: 900;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.22);
}

.signal {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  flex: 0 0 auto;
  width: 72px;
  padding: 14px;
  border-radius: 999px;
  background: #1b2524;
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.26);
}

.signal span {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #33413e;
}

.signal span:nth-child(1) {
  background: var(--red);
}

.signal span:nth-child(2) {
  background: var(--yellow);
}

.signal span:nth-child(3) {
  background: #55d985;
  box-shadow: 0 0 28px rgba(85, 217, 133, 0.72);
}

.road-lines {
  position: absolute;
  inset: auto 0 0;
  height: 118px;
  background:
    linear-gradient(90deg, transparent 0 44%, rgba(255, 255, 255, 0.9) 44% 49%, transparent 49% 100%),
    linear-gradient(160deg, #202826 0 52%, #151b1a 52%);
}

.metric-grid,
.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.metric,
.topic-card,
.quiz-card,
.study-panel,
.practice-mistakes-panel,
.mock-status,
.mistake-card,
.account-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric {
  padding: 18px;
}

.ad-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid #cdded8;
  border-radius: 8px;
  background: #fff8e8;
}

.ad-banner span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f1b744;
  color: #2b2414;
  font-size: 12px;
  font-weight: 900;
}

.ad-banner strong,
.ad-banner small {
  display: block;
}

.ad-banner small {
  color: var(--muted);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  margin: 8px 0;
  font-size: 30px;
}

.section-band {
  margin-top: 36px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-heading p,
.mock-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

.topic-card {
  padding: 18px;
  text-align: left;
}

.topic-card strong,
.topic-card span {
  display: block;
}

.topic-card strong {
  margin-bottom: 8px;
  font-size: 18px;
}

.topic-card span {
  color: var(--muted);
  line-height: 1.55;
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
}

.quiz-card,
.study-panel,
.mock-status {
  padding: 22px;
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--green);
  font-weight: 800;
}

.quiz-card h2 {
  margin-top: 16px;
  font-size: 28px;
  line-height: 1.35;
}

.question-english {
  color: var(--muted);
  line-height: 1.7;
}

.question-media {
  display: grid;
  min-height: 190px;
  margin-top: 16px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef4f1;
}

.question-media img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.answer-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.answer-option {
  width: 100%;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.answer-option.correct {
  border-color: #58bd80;
  background: #eaf8ef;
}

.answer-option.wrong {
  border-color: #e48a87;
  background: #fff0ef;
}

.feedback {
  min-height: 82px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: #f5f8f7;
  color: var(--muted);
  line-height: 1.65;
}

.study-panel,
.practice-mistakes-panel {
  align-self: start;
}

.practice-side {
  display: grid;
  gap: 18px;
}

.select-label {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
}

select {
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.file-input {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.import-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.unlock-panel {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid #b9d9cf;
  border-radius: 8px;
  background: #edf8f4;
}

.unlock-panel strong,
.unlock-panel span {
  display: block;
}

.unlock-panel span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.toggle {
  position: relative;
  width: 52px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: #becbc6;
}

.toggle::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  content: "";
  transition: transform 0.2s ease;
}

.toggle.active {
  background: var(--green);
}

.toggle.active::after {
  transform: translateX(22px);
}

.progress-ring {
  display: grid;
  width: 152px;
  height: 152px;
  margin: 28px auto 4px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0deg, #e3ece8 0deg);
}

.progress-ring span {
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  font-weight: 900;
  font-size: 24px;
}

.mock-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.mock-status {
  margin-top: 18px;
  min-height: 220px;
}

.mock-result {
  display: grid;
  gap: 12px;
}

.mock-question {
  display: grid;
  gap: 16px;
}

.mock-question h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: 0;
}

.mock-options {
  display: grid;
  gap: 10px;
}

.mock-option {
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
}

.mock-option.selected {
  border-color: var(--green);
  background: #eaf8ef;
}

.mock-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.mock-footer span {
  color: var(--muted);
  font-weight: 800;
}

.mistake-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.mistake-list.compact {
  margin-top: 12px;
}

.mistake-card {
  padding: 16px;
  width: 100%;
  text-align: left;
}

.mistake-card strong,
.mistake-card span {
  display: block;
}

.mistake-card span {
  margin-top: 8px;
  color: var(--muted);
}

.practice-mistakes-panel {
  padding: 18px;
}

.practice-mistakes-panel h2,
.account-card strong {
  margin: 0;
  letter-spacing: 0;
}

.practice-mistakes-panel p,
.account-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.account-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.account-card {
  padding: 20px;
}

.account-label {
  display: block;
  margin-bottom: 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f5f8f7;
  color: var(--ink);
  text-align: left;
}

.plan-row.selected {
  border-color: var(--green);
  background: #edf8f4;
}

.pay-methods {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.pay-method {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.pay-method.active {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.qr-frame {
  display: grid;
  width: min(100%, 260px);
  margin: 14px auto 0;
  place-items: center;
  border-radius: 8px;
  background: #ffffff;
}

.qr-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.order-code {
  text-align: center;
}

.unlock-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

.phone-login-grid {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.phone-login-grid input,
.phone-login-grid select,
.unlock-code-row input {
  min-height: 44px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.account-actions {
  margin-top: 14px;
}

.account-card.is-disabled {
  opacity: 0.62;
}

@media (max-width: 960px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 10;
    inset: auto 0 0;
    height: 72px;
    padding: 8px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .brand,
  .sidebar-note {
    display: none;
  }

  .nav-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 0;
  }

  .nav-item {
    display: grid;
    justify-items: center;
    gap: 2px;
    min-height: 56px;
    padding: 4px;
    font-size: 12px;
  }

  .main {
    padding: 20px 16px 92px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar h1 {
    font-size: 23px;
  }

  .hero-panel,
  .quiz-layout {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    overflow: hidden;
  }

  .hero-copy {
    padding: 28px 22px;
  }

  .hero-copy h2 {
    font-size: 32px;
  }

  .road-visual {
    min-height: 220px;
    border-radius: 0 0 8px 8px;
    padding: 30px;
  }

  .metric-grid,
  .topic-grid,
  .account-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar {
    display: block;
  }

  .install-button {
    margin-top: 12px;
  }

  .metric-grid,
  .topic-grid,
  .account-layout {
    grid-template-columns: 1fr;
  }

  .ad-banner {
    grid-template-columns: 1fr;
  }

  .unlock-code-row {
    grid-template-columns: 1fr;
  }

  .phone-login-grid {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .mock-header {
    display: block;
  }

  .quiz-card h2 {
    font-size: 23px;
  }

  .plate {
    width: 88px;
    height: 88px;
    font-size: 58px;
  }

  .signal {
    width: 58px;
    padding: 12px;
    gap: 10px;
  }

  .signal span {
    width: 34px;
    height: 34px;
  }
}
