:root {
  color-scheme: light;
  --paper: #fffaf1;
  --white: #fffefa;
  --ink: #19284b;
  --muted: #526079;
  --blue: #234fca;
  --blue-dark: #173caa;
  --line: #e8dfd0;
  --amber: #ffc64e;
  --amber-dark: #edaa25;
  --soft-blue: #eaf0ff;
  --radius: 25px;
  --shadow: 0 10px 28px #3d30240a;
  font-family: Nunito, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
body[data-theme="peppa"] {
  --blue: #a23269;
  --blue-dark: #82234f;
  --soft-blue: #fce7f1;
  background: #fff8f5;
}
main { min-height: 68vh; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
p, h1, h2, h3 { margin: 0; }
svg { display: block; width: 22px; height: 22px; flex: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 5px; }
html { scroll-behavior: smooth; }
.shell { width: min(1240px, calc(100% - 112px)); margin-inline: auto; }
.sr-only, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link:focus { position: fixed; z-index: 5; top: 10px; left: 10px; padding: 10px 16px; background: var(--white); border-radius: 10px; }

.site-header { border-bottom: 1px solid var(--line); background: #fffcf6; }
.header-inner { min-height: 78px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.brand, .footer-brand { display: inline-flex; align-items: center; gap: 11px; justify-self: start; }
.brand-icon { flex: none; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 19px; font-weight: 900; line-height: 1.15; white-space: nowrap; }
.brand-copy small { color: #65718a; letter-spacing: .095em; font-size: 9px; font-weight: 900; white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: 8px; }
.site-nav a { padding: 9px 17px; border-radius: 11px; font-weight: 800; font-size: 14px; color: var(--muted); white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--blue-dark); background: var(--soft-blue); }
.progress-link {
  display: inline-flex; gap: 8px; align-items: center; justify-self: end; white-space: nowrap;
  border: 1px solid #ecdba9; padding: 7px 8px 7px 11px; border-radius: 999px; background: #fffae9; font-size: 13px; font-weight: 800;
}
.progress-link svg { width: 18px; height: 18px; fill: var(--amber); stroke: #a96b0b; }
.progress-link strong { padding: 4px 8px; border-radius: 999px; background: #ffe9a9; color: #63471c; line-height: 1.1; }
.progress-link:hover, .progress-link[aria-current] { background: #fff1c5; }

.hero {
  display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  align-items: center; gap: 48px; padding-block: 52px 42px;
}
.hero-copy { padding-block: 8px; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: #fff0c6; color: #6e4b16; border: 1px solid #f6e1a2; border-radius: 999px;
  font-size: 13px; font-weight: 850; letter-spacing: .045em;
}
.hero-kicker svg { width: 16px; height: 16px; color: #9c6512; }
.hero h1 { margin-top: 18px; font-size: clamp(2.55rem, 4.8vw, 4.4rem); font-weight: 900; line-height: 1.19; letter-spacing: -.075em; }
.hero h1 .hero-title-accent { color: var(--blue); }
.hero-description { margin-top: 19px; max-width: 400px; color: var(--muted); font-size: 16px; font-weight: 600; line-height: 1.9; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 13px 16px; margin-top: 26px; }
.button {
  min-height: 49px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 11px 17px;
  border: 1px solid transparent; border-radius: 13px; font-size: 15px; font-weight: 900; line-height: 1.45;
  transition: background .16s ease, transform .16s ease, box-shadow .16s ease;
}
.button svg { width: 18px; height: 18px; }
.button-primary { color: var(--ink); background: var(--amber); border-color: #efb134; box-shadow: 0 3px 0 #dea12b; }
.button-primary:hover { background: #ffd46d; transform: translateY(-2px); box-shadow: 0 5px 0 #dea12b; }
.button-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 #dea12b; }
.button-arrow { margin-left: 5px; }
.button-text { color: var(--blue-dark); padding-inline: 9px; }
.button-text:hover { background: var(--soft-blue); }
.button-outline { background: var(--white); border-color: var(--line); color: var(--blue-dark); }
.button-outline:hover { background: var(--soft-blue); border-color: #c5d4ff; }
.hero-art {
  position: relative; aspect-ratio: 1.65; border-radius: 32px; isolation: isolate; overflow: hidden;
  background: linear-gradient(145deg, #9baff1, #f8e2ad 67%, #dac576); border: 1px solid #d8cbea;
  box-shadow: 0 13px 0 #ecdcc0, 0 18px 34px #5f3f1d14;
}
.hero-art > img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.hero-bubble {
  position: absolute; z-index: 1; right: 18px; bottom: 19px; display: flex; align-items: center; gap: 9px;
  color: var(--blue-dark); background: var(--white); border: 1px solid #fff; border-radius: 16px 16px 4px 16px;
  padding: 8px 13px 8px 8px; box-shadow: 0 4px 15px #12245630; font-size: 22px; font-weight: 900; line-height: 1;
}
.hero-bubble:hover { background: var(--soft-blue); }
body[data-theme="peppa"] .hero-kicker { background: #fce6ef; color: #842a55; border-color: #efcadd; }
body[data-theme="peppa"] .hero-kicker svg { color: #a23269; }
body[data-theme="peppa"] .hero-art {
  background:
    radial-gradient(ellipse 24% 8% at 48% 86%, #bd9581 98%, transparent 100%),
    radial-gradient(ellipse 89% 50% at 31% 119%, #95ce8a 98%, transparent 100%),
    radial-gradient(ellipse 84% 63% at 92% 120%, #b3dd9d 98%, transparent 100%),
    radial-gradient(ellipse 7% 7% at 20% 23%, #fffaf6 98%, transparent 100%),
    radial-gradient(ellipse 10% 6% at 15% 28%, #fffaf6 98%, transparent 100%),
    radial-gradient(ellipse 8% 6% at 80% 19%, #fffaf6 98%, transparent 100%),
    radial-gradient(ellipse 11% 5% at 83% 23%, #fffaf6 98%, transparent 100%),
    #c5eaf5;
  border-color: #e7c8d4;
  box-shadow: 0 13px 0 #f0dce3, 0 18px 34px #5f3f1d14;
}
body[data-theme="peppa"] .hero-art > img {
  position: absolute; left: 23%; bottom: 15%; width: 51%; height: 76%;
  object-fit: contain; object-position: center bottom;
}
.bubble-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--soft-blue); }
.bubble-icon svg { width: 17px; height: 17px; }

.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; padding: 17px 0;
  border: 1px solid #e9dfcf; border-radius: 20px; background: #fffcf6;
}
.step { display: flex; align-items: center; gap: 13px; padding: 2px 25px; }
.step + .step { border-left: 1px dashed #ddcfbb; }
.step-icon { display: grid; flex: none; place-items: center; width: 46px; height: 46px; border-radius: 13px; }
.step-icon svg { width: 23px; height: 23px; }
.step-blue { color: #294fc2; background: #e9efff; }
.step-purple { color: #7042b0; background: #f0e7ff; }
.step-orange { color: #98580a; background: #ffedc2; }
.step h2 { font-size: 16px; font-weight: 900; }
.step p { margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 650; }

.lessons-section { padding-block: 44px 58px; scroll-margin-top: 20px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 21px; }
.section-heading h2 { font-size: clamp(1.62rem, 3vw, 2.05rem); font-weight: 900; line-height: 1.28; letter-spacing: -.045em; }
.section-heading p { margin-top: 7px; color: var(--muted); font-size: 14px; font-weight: 600; line-height: 1.7; }
.count-label {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 999px; color: var(--muted); background: var(--white); font-size: 13px; font-weight: 800; white-space: nowrap;
}
.count-label svg { width: 15px; height: 15px; }
.lesson-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; }
.lesson-card {
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 19px;
  background: var(--white); box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.lesson-card:hover { transform: translateY(-4px); box-shadow: 0 13px 25px #46372317; border-color: #c7bda9; }
.lesson-cover { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--accent-soft); }
.lesson-cover img { width: 100%; height: 100%; object-fit: cover; }
.lesson-cover::after { content: ""; position: absolute; inset: 50% 0 0; background: linear-gradient(transparent, #111b3b50); pointer-events: none; }
.lesson-play {
  position: absolute; z-index: 1; left: 11px; bottom: 11px; display: grid; place-items: center; width: 37px; height: 37px;
  border-radius: 50%; background: var(--white); color: var(--blue-dark); box-shadow: 0 2px 10px #18234830;
}
.lesson-play svg { width: 17px; height: 17px; }
.lesson-length {
  position: absolute; z-index: 1; right: 11px; bottom: 11px; border-radius: 7px; padding: 3px 6px;
  color: white; background: #19213bdc; font-size: 12px; font-weight: 850; line-height: 1.3;
}
.lesson-card-body { padding: 14px 15px 15px; flex: 1; }
.lesson-card-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: var(--accent); font-size: 12px; font-weight: 850; }
.lesson-card-meta span:first-child { border-radius: 5px; padding: 3px 7px; background: var(--accent-soft); }
.lesson-card-meta svg { width: 16px; height: 16px; fill: var(--amber); color: #a96b0b; }
.lesson-card h3 { font-size: 18px; font-weight: 900; line-height: 1.35; }
.lesson-card-phrase { margin-top: 4px; color: var(--muted); font-size: 14px; font-weight: 800; }
.lesson-accent-blue { --accent: #254cb4; --accent-soft: #e7eeff; }
.lesson-accent-purple { --accent: #6940a2; --accent-soft: #f1e7ff; }
.lesson-accent-green { --accent: #27624c; --accent-soft: #e4f4e7; }
.lesson-accent-pink { --accent: #984268; --accent-soft: #fce7ef; }

.inner-view { padding-block: 35px 60px; }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 24px; color: var(--blue-dark); font-size: 14px; font-weight: 850; }
.back-link:hover { text-decoration: underline; }
.back-link svg { width: 17px; height: 17px; }
.lesson-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-bottom: 25px; }
.lesson-heading .hero-kicker { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.lesson-heading h1, .progress-view-title { margin-top: 8px; font-size: clamp(2.15rem, 5vw, 3.45rem); font-weight: 900; letter-spacing: -.055em; line-height: 1.2; }
.lesson-heading p, .progress-description { margin-top: 9px; color: var(--muted); font-weight: 650; line-height: 1.7; }
.lesson-layout { display: grid; grid-template-columns: minmax(0, 1.34fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: var(--white); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.panel-heading .step-icon { width: 40px; height: 40px; }
.panel-heading h2 { font-size: 20px; font-weight: 900; }
.panel-copy { margin-bottom: 13px; color: var(--muted); font-size: 14px; font-weight: 650; line-height: 1.7; }
.video-box { position: relative; aspect-ratio: 16/9; border-radius: 15px; overflow: hidden; background: #172545; }
.video-box iframe, .video-preview, .video-preview img { width: 100%; height: 100%; }
.video-box iframe { display: block; border: 0; }
.video-preview { display: grid; place-items: center; border: 0; padding: 0; background: transparent; }
.video-preview img { position: absolute; inset: 0; object-fit: cover; }
.video-preview::after { position: absolute; inset: 0; content: ""; background: #111d4a2e; }
.video-preview-play {
  z-index: 1; display: grid; place-items: center; width: 68px; height: 68px;
  border-radius: 50%; color: var(--ink); background: var(--amber); box-shadow: 0 3px 14px #141b2b5c; transition: transform .18s ease;
}
.video-preview:hover .video-preview-play { transform: scale(1.08); }
.video-preview-play svg { width: 29px; height: 29px; }
.video-outbound {
  z-index: 1; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px;
  color: var(--ink); background: var(--amber); border-radius: 13px; font-size: 14px; font-weight: 900;
  box-shadow: 0 3px 14px #141b2b5c;
}
.video-outbound svg { width: 18px; height: 18px; }
.video-preview:hover .video-outbound { background: #ffd46d; }
.video-return-note { margin-top: 5px; color: var(--muted); font-size: 12px; }
.video-caption { margin-top: 11px; display: flex; align-items: start; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.video-caption a { display: inline-flex; align-items: center; gap: 5px; flex: none; color: var(--blue-dark); font-weight: 850; }
.video-caption a:hover { text-decoration: underline; }
.video-caption svg { width: 14px; height: 14px; }
.practice-list { display: grid; gap: 9px; }
.speak-row {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px;
  text-align: left; background: #f9f7ff; border: 1px solid #eae1f7; border-radius: 12px;
}
.speak-row:hover, .speak-row.is-speaking { border-color: #bca1e6; background: #f2eafe; }
.speak-row .english { display: block; font-size: 19px; font-weight: 900; line-height: 1.35; }
.speak-row .translation { display: block; margin-top: 2px; color: var(--muted); font-size: 13px; font-weight: 650; }
.speak-row .bubble-icon { flex: none; color: #7042b0; background: #ebe0fb; }
.word-title { margin-top: 16px; margin-bottom: 8px; font-size: 14px; font-weight: 900; }
.word-list { display: flex; flex-wrap: wrap; gap: 6px; }
.word-chip { display: inline-flex; align-items: center; gap: 5px; background: #f8f8fa; border: 1px solid #e6e6ef; border-radius: 9px; padding: 6px 8px; font-size: 13px; font-weight: 850; }
.word-chip small { color: var(--muted); font-size: 11px; }
.word-chip svg { width: 13px; height: 13px; color: var(--blue-dark); }
.word-chip:hover, .word-chip.is-speaking { background: var(--soft-blue); }
.speech-note { margin-top: 10px; color: #8d421e; font-size: 13px; line-height: 1.6; }
.quiz-panel { margin-top: 20px; }
.quiz-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quiz-option {
  min-height: 48px; border: 1px solid #dedfed; border-radius: 12px; background: #f9faff;
  padding: 8px 11px; text-align: left; font-size: 15px; font-weight: 850;
}
.quiz-option:not([aria-disabled]):hover { background: var(--soft-blue); border-color: #b3c5f4; }
.quiz-option.is-wrong { background: #fff0e8; border-color: #eab9a6; color: #883d27; }
.quiz-option.is-correct { background: #e6f5e9; border-color: #a6d5b2; color: #1d6440; }
.quiz-feedback { min-height: 21px; margin-top: 10px; font-size: 13px; font-weight: 750; }
.quiz-feedback.success { color: #246844; }
.quiz-feedback.retry { color: #8d421e; }
.quiz-bottom { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 4px; }
.quiz-bottom p { max-width: 650px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.quiz-bottom .button { flex: none; }

.progress-top { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 22px; }
.progress-summary { margin-bottom: 20px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 15px; }
.progress-summary .step-icon { width: 52px; height: 52px; }
.progress-summary strong { display: block; margin-bottom: 7px; font-weight: 900; }
.progress-summary progress { display: block; width: 100%; height: 11px; appearance: none; border: 0; border-radius: 10px; overflow: hidden; background: #f1e9db; }
.progress-summary progress::-webkit-progress-bar { background: #f1e9db; border-radius: 10px; }
.progress-summary progress::-webkit-progress-value { background: #efaf2f; border-radius: 10px; }
.progress-summary progress::-moz-progress-bar { background: #efaf2f; border-radius: 10px; }
.progress-lessons { display: grid; gap: 9px; }
.progress-group + .progress-group { margin-top: 23px; }
.progress-group h2 { margin-bottom: 8px; font-size: 18px; font-weight: 900; }
.progress-lesson { display: flex; align-items: center; justify-content: space-between; gap: 13px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--white); }
.progress-lesson:hover { border-color: #b8c9f6; background: #f9faff; }
.progress-lesson strong { font-weight: 900; }
.progress-lesson small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 800; }
.progress-status { display: inline-flex; align-items: center; flex: none; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
.progress-status svg { width: 17px; height: 17px; }
.progress-status.completed { color: #735016; }
.progress-status.completed svg { fill: var(--amber); }
.no-script { padding-block: 20px; }

.site-footer { background: #fffcf6; border-top: 1px solid var(--line); }
.footer-inner { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.footer-brand { gap: 8px; white-space: nowrap; font-size: 14px; font-weight: 900; }
.footer-inner p { color: var(--muted); font-size: 12px; line-height: 1.6; }

@media (max-width: 1100px) {
  .shell { width: calc(100% - 72px); }
  .hero { gap: 30px; }
  .hero h1 { font-size: clamp(2.5rem, 5.2vw, 4.25rem); }
}
@media (max-width: 820px) {
  .shell { width: calc(100% - 44px); }
  .hero { gap: 23px; padding-block: 32px 33px; }
  .hero-description { font-size: 14px; }
  .hero-actions { gap: 9px; margin-top: 19px; }
  .hero-actions .button { padding-inline: 12px; font-size: 14px; }
  .hero-actions .button-arrow { display: none; }
  .hero-art { border-radius: 23px; aspect-ratio: 1.29; }
  .step { gap: 8px; padding-inline: 13px; }
  .step p { font-size: 12px; }
  .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 570px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { grid-template-columns: 1fr auto; gap: 2px 9px; min-height: 62px; padding-top: 8px; }
  .brand-icon { width: 39px; height: 39px; }
  .brand { gap: 7px; }
  .brand-copy strong { font-size: 16px; }
  .brand-copy small { font-size: 8px; }
  .site-nav { grid-row: 2; grid-column: 1 / -1; justify-content: center; padding-bottom: 7px; gap: 8px; }
  .site-nav a { padding: 5px 14px; font-size: 13px; }
  .progress-link { gap: 5px; }
  .progress-link svg { width: 16px; height: 16px; }
  .hero { grid-template-columns: 1fr; gap: 22px; padding-block: 21px 30px; }
  .hero-copy { padding: 0; }
  .hero h1 { font-size: clamp(2.55rem, 10.6vw, 3.55rem); margin-top: 12px; }
  .hero-description { margin-top: 12px; }
  .hero-actions { margin-top: 16px; }
  .hero-art { aspect-ratio: 1.55; box-shadow: 0 7px 0 #ecdcc0; }
  .hero-bubble { font-size: 17px; right: 11px; bottom: 12px; padding: 5px 9px 5px 5px; }
  .bubble-icon { width: 28px; height: 28px; }
  .steps { padding: 12px 2px; border-radius: 15px; }
  .step { display: grid; justify-items: center; gap: 6px; padding-inline: 4px; text-align: center; }
  .step-icon { width: 36px; height: 36px; border-radius: 10px; }
  .step-icon svg { width: 19px; height: 19px; }
  .step h2 { font-size: 14px; }
  .step p { font-size: 10px; }
  .lessons-section { padding-block: 30px 38px; }
  .section-heading { gap: 5px; margin-bottom: 14px; }
  .section-heading p { font-size: 12px; }
  .count-label { padding: 5px 7px; font-size: 11px; }
  .count-label svg { width: 13px; height: 13px; }
  .lesson-grid { gap: 10px; }
  .lesson-card { border-radius: 13px; }
  .lesson-card-body { padding: 10px; }
  .lesson-card h3 { font-size: 16px; }
  .lesson-card-phrase { font-size: 13px; }
  .lesson-play { width: 29px; height: 29px; left: 7px; bottom: 7px; }
  .lesson-play svg { width: 14px; height: 14px; }
  .lesson-length { right: 7px; bottom: 7px; }
  .inner-view { padding-block: 23px 40px; }
  .panel { border-radius: 17px; padding: 13px; }
  .lesson-heading { margin-bottom: 16px; }
  .lesson-heading p, .progress-description { font-size: 14px; }
  .lesson-layout { gap: 13px; }
  .quiz-panel { margin-top: 13px; }
  .quiz-options { grid-template-columns: 1fr; }
  .quiz-bottom { align-items: start; flex-direction: column; }
  .progress-top { align-items: start; flex-direction: column; }
  .footer-inner { align-items: start; flex-direction: column; padding-block: 13px; gap: 6px; }
}
@media (max-width: 340px) {
  .progress-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
