:root {
  --navy: #102844;
  --navy-soft: #234363;
  --orange: #f37945;
  --orange-dark: #de5e31;
  --cream: #fbf5eb;
  --paper: #fffdfa;
  --sand: #efdcc6;
  --mint: #d9eee4;
  --ink: #182b3f;
  --muted: #677586;
  --shadow: 0 18px 46px rgba(16, 40, 68, 0.09);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% -10%, #fbe1c5 0, transparent 32rem),
    radial-gradient(circle at 95% 10%, #d9eee4 0, transparent 26rem),
    var(--cream);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

button, textarea, input { font: inherit; }

button {
  border: 0;
  cursor: pointer;
  color: inherit;
}

p { line-height: 1.7; }

.topbar {
  height: 72px;
  padding: 0 max(calc((100vw - 1180px) / 2), 28px);
  background: rgba(255, 253, 250, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(16, 40, 68, 0.07);
  display: flex;
  align-items: center;
  gap: 44px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  color: var(--navy);
  font-weight: 800;
  font-size: 20px;
}

.brand span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: var(--navy);
}

.desktop-nav {
  display: flex;
  gap: 7px;
}

.desktop-nav button {
  background: transparent;
  color: var(--muted);
  padding: 13px 19px;
  border-radius: 99px;
}

.desktop-nav .active {
  color: var(--navy);
  font-weight: 600;
  background: #f0e8db;
}

.streak {
  margin-left: auto;
  background: #fff1e9;
  padding: 10px 16px;
  color: var(--orange-dark);
  border-radius: 99px;
  font-size: 14px;
}

.streak b { font-size: 19px; }

main {
  width: min(1180px, calc(100% - 48px));
  margin: 30px auto 70px;
}

.eyebrow {
  display: inline-block;
  color: var(--orange-dark);
  font-size: 13px;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 12px;
}

h1, h2, h3 { color: var(--navy); margin-top: 0; }

.hero {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 24px;
  margin-bottom: 22px;
}

.hero-copy, .hero-card {
  background: var(--paper);
  border-radius: 30px;
  padding: 48px;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: clamp(33px, 4.2vw, 47px);
  line-height: 1.25;
  margin-bottom: 18px;
}

.hero h1 em {
  color: var(--orange-dark);
  font-style: normal;
}

.hero-copy p {
  max-width: 500px;
  color: var(--muted);
  margin-bottom: 30px;
}

.primary, .checkin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 25px;
  border-radius: 15px;
  color: white;
  background: var(--orange);
  font-weight: 700;
  transition: transform .18s, background .18s;
}

.primary:hover, .checkin:hover {
  background: var(--orange-dark);
  transform: translateY(-2px);
}

.hero-card {
  position: relative;
  overflow: hidden;
  background: #e9f2ef;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 26px;
}

.hero-card::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  background: #d3e7df;
  border-radius: 50%;
  top: 32px;
}

.mascot {
  position: relative;
  z-index: 1;
  color: var(--navy);
  text-align: center;
  font-weight: 700;
}

.bot-face {
  height: 100px;
  width: 124px;
  border: 7px solid var(--navy);
  border-radius: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 23px;
  background: white;
}

.bot-face span {
  height: 15px;
  width: 15px;
  border-radius: 50%;
  background: var(--orange);
}

.speech {
  position: relative;
  z-index: 1;
  background: white;
  padding: 17px 20px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.7;
  max-width: 300px;
}

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

.metric {
  background: var(--navy);
  color: white;
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.metric:nth-child(2) { background: var(--orange); }
.metric:nth-child(3) { background: var(--navy-soft); }

.metric b { font-size: 34px; }
.metric span { opacity: .8; font-size: 14px; }

.section-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  margin-bottom: 22px;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.section-heading h2 { margin-bottom: 0; }
.section-heading.compact { align-items: center; }

.ghost {
  background: #f2eade;
  color: var(--navy);
  border-radius: 12px;
  padding: 12px 17px;
  white-space: nowrap;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}

.lesson-tile {
  text-align: left;
  border: 1px solid #eee2d3;
  border-radius: 16px;
  background: white;
  padding: 16px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lesson-tile:hover { border-color: var(--orange); }
.lesson-tile.done { background: #edf7f1; border-color: #b9ddcd; }

.tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.day-chip {
  align-self: flex-start;
  border-radius: 99px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--orange-dark);
  background: #fff0e5;
  font-weight: 700;
}

.format-chip {
  border-radius: 99px;
  padding: 5px 8px;
  font-size: 11px;
  color: #596b70;
  background: #eef4f3;
  font-weight: 700;
}

.lesson-tile.done .day-chip {
  color: #187052;
  background: #d6eddf;
}

.lesson-tile small, .tile-score { color: var(--muted); font-size: 12px; }
.tile-score { margin-top: auto; }

.two-column, .learning-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.two-column .section-card, .learning-columns .section-card { height: 100%; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-row span, .time-pill {
  background: #f4ece0;
  color: var(--navy-soft);
  border-radius: 99px;
  padding: 7px 11px;
  font-size: 12px;
}

.guardrail { background: var(--navy); }
.guardrail h2, .guardrail p { color: white; }
.guardrail .eyebrow { color: #ffc49f; }

.lesson-header {
  display: grid;
  grid-template-columns: 130px 1fr 285px;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

.back {
  padding: 13px 16px;
  border-radius: 13px;
  background: #efe6d8;
}

.lesson-title h1 {
  font-size: clamp(30px, 4vw, 41px);
  margin-bottom: 10px;
}

.lesson-title p { color: var(--muted); margin: 0; }

.mission {
  padding: 20px;
  border-radius: 19px;
  background: var(--navy);
  color: white;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.mission span, .mission small { opacity: .72; font-size: 13px; }

.illustrated-comic {
  position: relative;
  max-width: 650px;
  margin: 0 auto;
}

.manga-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 99px;
  background: #fff0e5;
  color: var(--orange-dark);
  font-size: 12px;
  font-weight: 700;
}

.manga-stage {
  position: relative;
}

.manga-stage img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.manga-background {
  border: 1px solid #e7dbcd;
  box-shadow: 0 18px 34px rgba(16, 40, 68, 0.12);
}

.manga-copy {
  position: absolute;
  inset: 0;
}

.comic-transcript {
  margin-top: 22px;
  padding: 20px;
  border-radius: 18px;
  background: #fcf6ee;
  border: 1px solid #f0e4d5;
}

.comic-transcript summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 700;
}

.comic-transcript[open] summary { margin-bottom: 16px; }

.caption-strip {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  counter-reset: scene;
}

.caption-strip li {
  position: relative;
  min-height: 72px;
  padding: 12px 12px 12px 40px;
  border-radius: 12px;
  background: white;
  color: var(--navy-soft);
  font-size: 13px;
  line-height: 1.6;
  counter-increment: scene;
}

.caption-strip li::before {
  content: counter(scene);
  position: absolute;
  top: 13px;
  left: 12px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: white;
  background: var(--orange);
  font-weight: 700;
  font-size: 11px;
}

.comic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.comic-panel {
  position: relative;
  border: 2px solid var(--navy);
  border-radius: 16px;
  padding: 20px 16px 15px;
  min-height: 174px;
  background: #fff8ed;
}

.comic-panel:nth-child(even) { background: #edf5f2; }

.panel-number {
  position: absolute;
  top: -11px;
  left: 13px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.comic-panel small {
  display: block;
  margin: 8px 0 14px;
  color: var(--muted);
}

.character {
  display: inline-block;
  background: var(--navy);
  color: white;
  padding: 5px 11px;
  border-radius: 8px 8px 8px 0;
  font-weight: 700;
  font-size: 13px;
}

.comic-panel p { margin-bottom: 0; font-size: 14px; }
.lead { font-size: 17px; background: #fff0e4; padding: 16px; border-radius: 13px; }
.knowledge h3, .practice h3 { margin: 20px 0 7px; font-size: 16px; }
.knowledge ul { margin: 8px 0 0; padding-left: 20px; line-height: 1.9; }

.action-box {
  border-left: 4px solid var(--orange);
  padding: 12px 15px;
  background: #fff7ef;
  margin: 18px 0 15px;
}

.action-box p { margin: 6px 0 0; }

.risk-box {
  background: #eef4f3;
  color: var(--navy-soft);
  border-radius: 12px;
  padding: 13px;
  font-size: 13px;
  line-height: 1.6;
}

.artifact textarea {
  display: block;
  width: 100%;
  min-height: 106px;
  margin-top: 18px;
  resize: vertical;
  border: 1px solid #e6d8c7;
  border-radius: 14px;
  padding: 16px;
  background: #fffaf3;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 25px 0;
}

legend {
  margin-bottom: 14px;
  font-weight: 700;
  color: var(--navy);
}

.option {
  display: block;
  background: #faf6ef;
  margin: 8px 0;
  border-radius: 12px;
  padding: 12px 15px;
  cursor: pointer;
}

.option:has(input:checked) {
  background: #fff0e5;
  box-shadow: inset 0 0 0 1px var(--orange);
}

.option input { margin-right: 9px; accent-color: var(--orange); }

.explanation {
  padding: 12px 14px;
  background: #eef6f1;
  color: var(--navy-soft);
  border-radius: 12px;
  font-size: 13px;
}

.result {
  padding: 15px 18px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 17px;
  margin: 20px 0;
}

.result.pass { color: #126c4d; background: #ddf1e5; }
.result.retry { color: #9a4c27; background: #ffebdc; }

.quiz-actions {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}

.checkin { background: var(--navy); }
.checked {
  padding: 14px 16px;
  color: #126c4d;
  background: #ddf1e5;
  border-radius: 13px;
}

.toast {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  border-radius: 99px;
  padding: 13px 22px;
  color: white;
  background: var(--navy);
  box-shadow: var(--shadow);
  max-width: calc(100vw - 30px);
  text-align: center;
}

.map-view, .portfolio { max-width: 850px; margin: 45px auto; }
.map-view > p, .portfolio > p { color: var(--muted); margin-bottom: 34px; }

.map-route {
  position: relative;
  padding-left: 24px;
  display: grid;
  gap: 13px;
}

.map-route::before {
  content: "";
  position: absolute;
  left: 38px;
  top: 30px;
  bottom: 30px;
  width: 3px;
  background: var(--sand);
}

.map-stop {
  display: flex;
  position: relative;
  gap: 21px;
  align-items: center;
  text-align: left;
  padding: 18px;
  background: white;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.map-stop > span {
  z-index: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #f0e6d8;
  font-weight: 700;
}

.map-stop.arrived > span { background: var(--orange); color: white; }
.map-stop small { display: block; color: var(--muted); margin-top: 5px; }

.badge-card {
  margin-top: 25px;
  padding: 27px;
  border-radius: 21px;
  background: #ece5d9;
  color: var(--muted);
}

.badge-card strong { display: block; color: var(--navy); font-size: 25px; margin: 8px 0; }
.badge-card.earned { background: #ffebd8; }

.artifact-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.artifact-list article {
  border-radius: 18px;
  background: white;
  padding: 22px;
  box-shadow: var(--shadow);
}

.artifact-list article > span {
  background: #f1e9dd;
  color: var(--muted);
  border-radius: 99px;
  padding: 6px 11px;
  font-size: 12px;
}

.artifact-list article > span.ready { background: #d9eee4; color: #126c4d; }
.artifact-list h2 { font-size: 18px; margin: 17px 0 8px; }
.artifact-list p { color: var(--muted); font-size: 14px; }
.bottom-nav { display: none; }

@media (max-width: 880px) {
  .topbar {
    height: 62px;
    padding: 0 17px;
  }

  .brand span { height: 34px; width: 34px; }
  .desktop-nav, .streak { display: none; }

  main {
    width: calc(100% - 28px);
    margin: 16px auto 82px;
  }

  .hero, .two-column, .learning-columns, .lesson-header {
    display: block;
  }

  .hero-copy, .hero-card { padding: 27px 22px; border-radius: 22px; }
  .hero-card { margin-top: 13px; min-height: 280px; }
  .hero h1 { font-size: 31px; }
  .dashboard { gap: 8px; }

  .metric {
    display: block;
    padding: 15px 12px;
    text-align: center;
  }

  .metric b { display: block; font-size: 27px; }
  .metric span { font-size: 11px; }
  .section-card { padding: 20px 16px; margin-bottom: 13px; }
  .section-heading { margin-bottom: 18px; }
  .section-heading h2 { font-size: 20px; }
  .lesson-grid { grid-template-columns: repeat(2, 1fr); }
  .lesson-tile { min-height: 137px; padding: 13px; }
  .two-column .section-card, .learning-columns .section-card { height: auto; }
  .today { margin-top: 13px; }

  .lesson-header .back { margin-bottom: 20px; }
  .lesson-title { margin-bottom: 19px; }
  .lesson-title h1 { font-size: 31px; }
  .mission { margin-bottom: 14px; }
  .comic-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .comic-panel { min-height: 184px; padding: 18px 12px 12px; }
  .comic-panel p { font-size: 13px; }
  .comic-transcript { margin-top: 15px; padding: 14px; }
  .caption-strip { grid-template-columns: 1fr; gap: 8px; }
  .caption-strip li { min-height: auto; }
  .learning-columns .section-card { margin-bottom: 13px; }
  .result { display: block; }
  .result strong { display: block; margin-bottom: 5px; }
  .quiz-actions .primary, .quiz-actions .checkin { width: 100%; }
  .map-view, .portfolio { margin: 26px auto; }
  .artifact-list { grid-template-columns: 1fr; }

  .bottom-nav {
    position: fixed;
    display: flex;
    bottom: 0;
    left: 0;
    right: 0;
    height: 66px;
    background: rgba(255, 253, 250, .98);
    border-top: 1px solid #ede2d4;
    z-index: 20;
  }

  .bottom-nav button {
    flex: 1;
    background: none;
    color: var(--muted);
    font-size: 12px;
  }

  .bottom-nav span {
    display: block;
    color: var(--navy);
    font-size: 20px;
    margin-bottom: 3px;
  }
}
