:root {
  --paper: #f8f7f4;
  --surface: #ffffff;
  --ink: #26322f;
  --muted: #737d77;
  --sage: #6d8078;
  --accent: #db683e;
  --accent-dark: #bf512b;
  --line: #e4e7e1;
  --soft-sage: #edf1eb;
  --soft-orange: #fbefe7;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body {
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #c87852;
  outline-offset: 4px;
}
.container { width: min(1200px, calc(100% - 64px)); margin: 0 auto; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link { position: fixed; top: 8px; left: 12px; z-index: 100; padding: 10px 16px; border-radius: 5px; color: #fff; background: var(--ink); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }

/* A quiet, persistent masthead keeps the library's navigation in view. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(248, 247, 244, 0.98);
}
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--ink); }
.brand-mark { width: 38px; height: 38px; color: var(--accent); flex: 0 0 auto; }
.brand-word { display: grid; gap: 1px; }
.brand-word strong { font-size: 20px; line-height: 1.25; font-weight: 750; letter-spacing: 1px; }
.brand-word small { font-size: 9px; line-height: 1.4; color: var(--sage); letter-spacing: 2.3px; font-weight: 600; }
.nav-links { display: flex; align-items: center; gap: 28px; font-size: 13px; font-weight: 600; }
.nav-links > a { transition: color 160ms ease; }
.nav-links > a:hover, .nav-links > a[aria-current="page"] { color: var(--accent); }
.nav-links .catalog-home-link { color: var(--accent); }
.nav-links .trial-link {
  border: 1px solid #d7ded5;
  border-radius: 6px;
  padding: 7px 21px;
  color: var(--ink);
  background: var(--surface);
}
.nav-links .trial-link:hover { border-color: var(--accent); color: var(--accent); }

/* The books are CSS shapes, so the cover stays crisp without stock imagery. */
.course-hero { padding: 36px 0 34px; border-bottom: 1px solid var(--line); background: #f2f1eb; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 60px; }
.eyebrow { margin-bottom: 9px; color: var(--sage); font-size: 10px; line-height: 1.5; font-weight: 650; letter-spacing: 2.5px; text-transform: uppercase; }
.hero-copy h1 { max-width: 680px; font-size: clamp(32px, 3.5vw, 43px); line-height: 1.3; letter-spacing: -1px; font-weight: 650; overflow-wrap: anywhere; }
.hero-copy h1 span { display: block; }
.hero-copy h1 .hero-title-accent { color: var(--accent); }
.hero-text { max-width: 550px; margin-top: 14px; color: #7a8078; font-size: 14px; line-height: 1.85; overflow-wrap: anywhere; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 19px; }
.hero-action-note { color: #7f8a77; font-size: 10px; letter-spacing: 0.3px; }
.eyebrow-line { display: inline-block; width: 20px; height: 1px; margin: 0 8px 3px 0; background: #9baf93; }
.heading-dot { color: var(--accent); }
.primary-action, .secondary-action { min-height: 41px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid transparent; border-radius: 6px; padding: 9px 20px; font-size: 13px; font-weight: 650; transition: background 160ms ease, border-color 160ms ease; }
.primary-action { color: #fff; background: var(--accent-dark); }
.primary-action:hover { background: #a84322; }
.secondary-action { border-color: #cdd5cb; color: var(--ink); background: transparent; }
.secondary-action:hover { border-color: var(--sage); background: var(--soft-sage); }
.hero-panel { display: flex; align-items: center; gap: 0; margin-top: 22px; }
.hero-panel > div { display: flex; align-items: baseline; gap: 7px; padding: 0 23px; border-left: 1px solid #d9ded4; }
.hero-panel > div:first-child { border-left: 0; padding-left: 0; }
.hero-panel > div:last-child { padding-right: 0; }
.hero-panel strong { color: var(--ink); font-size: 21px; line-height: 1.3; font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-panel span { color: #858b81; font-size: 11px; white-space: nowrap; }
.hero-art { position: relative; width: 100%; min-width: 0; height: 290px; }
.art-copy { position: absolute; right: 0; top: 1px; text-align: right; }
.art-kicker { color: #8c9388; font-size: 9px; letter-spacing: 2.2px; text-transform: uppercase; }
.art-caption { margin-top: 3px; color: var(--sage); font-size: 13px; letter-spacing: 0.7px; }
.book-scene { position: absolute; inset: 35px 0 17px; border-bottom: 1px solid #cbd2c6; }
.book-scene::after { content: ""; position: absolute; left: 20px; right: 7px; bottom: -5px; height: 5px; border-bottom: 1px solid #dfe3da; transform: skewX(-30deg); }
.art-book { position: absolute; display: flex; flex-direction: column; overflow: hidden; border: 1px solid rgba(38, 50, 47, 0.13); border-radius: 2px 5px 5px 2px; padding: 19px 15px 16px 20px; box-shadow: 5px 5px 0 rgba(38, 50, 47, 0.07); }
.art-book::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 7px; border-right: 1px solid rgba(255, 255, 255, 0.25); background: rgba(38, 50, 47, 0.12); }
.art-book::after { content: ""; position: absolute; left: 21px; right: 15px; top: 52%; height: 56px; border: 1px solid currentColor; border-radius: 50%; opacity: 0.16; transform: rotate(-25deg); }
.book-topline { font-size: 7px; line-height: 1.5; letter-spacing: 1.4px; opacity: 0.65; }
.book-title { margin-top: 12px; font-family: Georgia, "Times New Roman", serif; font-size: 24px; line-height: 1.1; font-weight: normal; letter-spacing: -0.5px; }
.book-subtitle { margin-top: 7px; font-size: 8px; line-height: 1.45; letter-spacing: 0.2px; opacity: 0.76; }
.book-footer { margin-top: auto; font-size: 8px; line-height: 1.5; letter-spacing: 0.9px; opacity: 0.72; }
.book-lighting { left: 8%; bottom: 12px; z-index: 4; width: 143px; height: 209px; color: #fff8e9; background: #d56c46; transform: rotate(-8deg); }
.book-think { left: 41%; bottom: 3px; z-index: 3; width: 127px; height: 183px; color: #f4f2e4; background: #62766a; transform: rotate(5deg); }
.book-reading { right: 2%; bottom: 2px; z-index: 2; width: 108px; height: 154px; color: #6b654e; background: #e7dabb; transform: rotate(12deg); }
.book-foundation { right: 10%; bottom: 2px; z-index: 1; width: 109px; height: 216px; color: #686853; background: #e1e5d4; transform: rotate(-1deg); }
.book-reading .book-title, .book-foundation .book-title { font-size: 20px; }
.art-note { position: absolute; right: 0; bottom: -7px; color: #999e94; font-size: 9px; letter-spacing: 1px; }

/* Category, search and series navigation form three clear levels. */
.series-section { padding: 42px 0 72px; scroll-margin-top: 96px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.section-heading h2 { color: var(--ink); font-size: clamp(26px, 3vw, 32px); line-height: 1.35; letter-spacing: -0.6px; font-weight: 650; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-note { max-width: 425px; color: #69736b; font-size: 12px; line-height: 1.8; }
.catalog-controls { display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.direction-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.direction-filter { min-height: 38px; border: 1px solid transparent; border-radius: 6px; padding: 8px 14px; color: #6d786e; background: transparent; font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background 160ms ease, color 160ms ease, border-color 160ms ease; }
.direction-filter:hover { color: var(--ink); border-color: #d9ded5; }
.direction-filter[aria-pressed="true"] { color: #fff; border-color: var(--ink); background: var(--ink); }
.course-finder { flex: 0 1 300px; min-width: 225px; margin: 0; }
.course-search { display: flex; align-items: center; min-height: 42px; border: 1px solid #dfe3db; border-radius: 7px; padding: 0 12px; background: var(--surface); transition: border-color 160ms ease, box-shadow 160ms ease; }
.course-search:focus-within { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(109, 128, 120, 0.12); }
.search-icon { width: 16px; height: 16px; flex: 0 0 16px; color: #929b90; }
.course-search input { min-width: 0; width: 100%; height: 40px; border: 0; outline: 0; border-radius: inherit; padding: 0 9px; color: var(--ink); background: transparent; font-size: 12px; }
.course-search input::placeholder { color: #a1a79c; }
.course-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
#clearCourseSearch { width: 25px; height: 25px; flex: 0 0 25px; display: grid; place-items: center; border: 0; border-radius: 50%; padding: 0; color: var(--sage); background: var(--soft-sage); line-height: 1; cursor: pointer; }
#clearCourseSearch:hover { color: var(--accent); background: var(--soft-orange); }
.catalog-meta { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 15px 0 20px; color: #69736b; font-size: 11px; line-height: 1.7; }
.catalog-meta strong { color: var(--sage); font-weight: 600; font-variant-numeric: tabular-nums; }
.catalog-layout { display: grid; grid-template-columns: 202px minmax(0, 1fr); align-items: start; gap: 30px; }
.catalog-sidebar { position: sticky; top: 92px; max-height: calc(100vh - 114px); overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #d9ded3 transparent; padding-right: 14px; }
.sidebar-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 9px 13px; border-bottom: 1px solid var(--line); }
.sidebar-heading span { color: #9da395; font-size: 9px; letter-spacing: 1.5px; text-transform: uppercase; }
.sidebar-heading h3 { font-size: 12px; font-weight: 650; }
.series-tabs { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; }
.series-tab { position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr) 20px; align-items: center; gap: 4px; min-height: 37px; border-radius: 6px; padding: 8px 9px; color: #65725e; transition: background 160ms ease, color 160ms ease; }
.series-tab:hover { color: var(--ink); background: #eceee7; }
.series-tab strong { min-width: 0; font-size: 12px; line-height: 1.4; font-weight: 550; overflow-wrap: anywhere; }
.series-tab-index { color: #abb0a5; font-size: 9px; font-variant-numeric: tabular-nums; }
.series-tab-count { color: #a0a799; text-align: right; font-size: 10px; font-variant-numeric: tabular-nums; }
.series-tab[aria-current="location"] { color: var(--accent-dark); background: #f3e8de; }
.series-tab[aria-current="location"]::before { content: ""; position: absolute; top: 11px; bottom: 11px; left: 0; width: 2px; border-radius: 2px; background: var(--accent); }
.series-tab[aria-current="location"] strong { font-weight: 650; }
.series-tab[aria-current="location"] .series-tab-index, .series-tab[aria-current="location"] .series-tab-count { color: #c18a6b; }
.sidebar-note { margin: 5px 9px 0; padding-top: 13px; border-top: 1px solid var(--line); color: #a2a79b; font-size: 10px; line-height: 1.9; }
.catalog-content { min-width: 0; }
.series-grid { display: grid; gap: 25px; }
.series-card { --book-color: #778978; scroll-margin-top: 100px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 24px; background: var(--surface); }
.series-card-head { display: flex; align-items: center; gap: 13px; }
.series-symbol { width: 43px; height: 43px; flex: 0 0 43px; display: grid; place-items: center; border: 1px solid #e0e6dc; border-radius: 8px; color: var(--book-color); background: #f3f5ef; font-family: Georgia, "Times New Roman", serif; font-size: 19px; }
.series-card-head > div:not(.series-level) { min-width: 0; }
.series-type { margin-bottom: 3px; color: var(--sage); font-size: 10px; line-height: 1.4; letter-spacing: 0.5px; }
.series-card h3 { color: var(--ink); font-size: clamp(20px, 2.25vw, 25px); line-height: 1.35; font-weight: 600; overflow-wrap: anywhere; }
.series-level { flex: 0 0 auto; margin-left: auto; border: 1px solid #e0e6db; border-radius: 4px; padding: 4px 9px; color: #68745e; background: #fafbf8; font-size: 10px; line-height: 1.5; }
.series-card-body { margin-top: 17px; }
.series-desc { color: #727e67; font-size: 12px; line-height: 1.85; overflow-wrap: anywhere; }
.series-details { margin-top: 7px; color: #8a9383; font-size: 11px; }
.series-details summary { width: fit-content; color: var(--sage); font-size: 11px; cursor: pointer; }
.series-details summary::marker { color: #a2ac98; font-size: 9px; }
.series-details p { max-width: 800px; margin-top: 6px; padding-left: 13px; line-height: 1.85; }
.series-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 13px; color: #697461; font-size: 11px; line-height: 1.6; }
.series-summary span + span { padding-left: 16px; border-left: 1px solid #e2e7dc; }
.series-summary strong { color: var(--sage); font-weight: 600; }
.series-course-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 17px; }
.series-course { min-width: 0; min-height: 132px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; grid-template-rows: 1fr auto; align-items: start; gap: 10px 10px; border: 1px solid #e7ebe3; border-radius: 7px; padding: 14px; background: #fcfdfa; transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.series-course:hover { border-color: #e2b198; background: #fffaf6; box-shadow: 0 3px 8px rgba(38, 50, 47, 0.035); }
.course-book { position: relative; width: 38px; min-height: 52px; display: flex; align-items: center; justify-content: center; border: 1px solid #dfe5d8; border-radius: 1px 4px 4px 1px; padding: 11px 3px 9px 6px; color: var(--book-color); background: #f0f3e8; font-family: Georgia, "Times New Roman", serif; font-size: 10px; line-height: 1.4; font-weight: 600; text-align: center; word-break: break-word; box-shadow: 2px 2px 0 #e8eddf; }
.course-book::before { content: ""; position: absolute; left: 3px; top: 0; bottom: 0; border-left: 1px solid #dbe2d1; }
.course-book::after { content: ""; position: absolute; left: 9px; right: 7px; bottom: 7px; height: 2px; border-top: 1px solid currentColor; opacity: 0.3; }
.series-course-main { min-width: 0; }
.series-course-main strong { display: block; color: var(--ink); font-size: 14px; line-height: 1.45; font-weight: 600; overflow-wrap: anywhere; }
.series-course-main small { display: block; margin-top: 5px; color: #7b866f; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.series-course-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.series-course-meta > span { display: flex; flex-direction: column; align-items: flex-end; }
.series-course-meta em { max-width: 65px; display: block; border-radius: 3px; padding: 2px 5px; color: #59694f; background: #edf2e8; font-size: 10px; line-height: 1.4; font-style: normal; overflow-wrap: anywhere; }
.series-course-meta b { color: #7b8773; font-size: 16px; line-height: 1.4; font-weight: 500; font-variant-numeric: tabular-nums; }
.series-course-meta small { color: #69765d; font-size: 10px; line-height: 1.4; }
.series-course-action { grid-column: 2 / -1; display: flex; align-items: center; gap: 9px; color: #748668; font-size: 11px; font-weight: 600; }
.series-course-action > span { margin-left: auto; color: #94a086; font-size: 14px; font-weight: 400; }
.series-course:hover .series-course-action, .series-course:hover .series-course-action > span { color: var(--accent); }
#series-lighting, #series-think, #series-ket-pet, #series-cambridge { --book-color: #bd744f; }
#series-lighting .series-symbol, #series-lighting .course-book { color: #bf7854; background: #f8ece1; border-color: #edddcf; }
#series-lighting .course-book::before { border-color: #e9d7c8; }
#series-lighting .course-book { box-shadow: 2px 2px 0 #efdecc; }
.series-card[data-direction="reading"] { --book-color: #64877a; }
.series-card[data-direction="general"] { --book-color: #a27855; }
.series-card[data-direction="speaking"] { --book-color: #797b9c; }
.series-card[data-direction="words"] { --book-color: #948057; }
.series-card[data-direction="exams"] { --book-color: #6d7b91; }
.catalog-loading { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 9px; min-height: 220px; border: 1px solid var(--line); border-radius: 8px; color: #8e9a83; background: #fff; font-size: 12px; }
.catalog-loading strong { color: var(--sage); font-size: 16px; font-weight: 500; }
.loading-mark { width: 23px; height: 23px; margin-bottom: 4px; border: 2px solid #e7ece1; border-top-color: var(--sage); border-radius: 50%; animation: library-loading 1s linear infinite; }
.catalog-error { margin-bottom: 18px; padding: 18px 20px; border: 1px solid #e9cbbc; border-radius: 8px; color: #9e6347; background: #fff6ee; font-size: 12px; }
@keyframes library-loading { to { transform: rotate(360deg); } }
.empty-state { min-height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border: 1px dashed #d6ded0; border-radius: 10px; padding: 30px 24px; color: #8d9886; background: #fff; text-align: center; }
.empty-state strong { color: var(--ink); font-size: 20px; font-weight: 600; }
.empty-state p, .empty-state span { max-width: 440px; font-size: 12px; }
.empty-state button, .empty-state a { border: 1px solid #d4dccb; border-radius: 5px; padding: 8px 16px; color: var(--sage); background: var(--soft-sage); cursor: pointer; }
.lesson-section { padding: 45px 0 72px; background: var(--paper); scroll-margin-top: 92px; }
body.is-course-view .course-hero { display: none; }
body.is-course-view .lesson-section .section-heading { align-items: center; }
body.is-course-view .lesson-section h2 { font-size: 28px; }

.toolbar {
  width: min(720px, 100%);
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.select-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.select-box select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #f0b18d;
  border-radius: 12px;
  padding: 0 16px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  outline: none;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.08);
}

.select-box select {
  cursor: pointer;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) 20px,
    calc(100% - 14px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.select-box select:focus {
  border-color: var(--accent);
}

.back-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 0 16px;
  font-weight: 800;
  transition: transform 0.2s, background 0.2s;
}

.back-action:hover {
  transform: translateY(-2px);
  background: var(--accent);
}

.export-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  background: #f0ddc1;
  color: var(--ink);
  padding: 0 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.export-action:hover {
  transform: translateY(-2px);
  background: #ffc43d;
}

.game-intro {
  display: none;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.game-intro strong {
  color: var(--accent);
}

.status-text {
  padding: 18px 20px;
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.lesson-grid {
  display: grid;
  gap: 18px;
}

.lesson-card {
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.09);
}

.lesson-summary {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  border: 0;
  background: #fff;
  color: var(--ink);
  padding: 20px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.lesson-number {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.lesson-title-text {
  min-width: 0;
}

.lesson-title-text strong {
  display: block;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.35;
}

.lesson-title-text span {
  color: #777;
  font-size: 14px;
}

.expand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #ffd9c4;
  background: #fff8f0;
  box-shadow: inset 0 0 0 4px #fff;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.expand-mark::before,
.expand-mark::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.expand-mark::after {
  transform: rotate(90deg);
}

.lesson-card.is-open .expand-mark {
  background: var(--accent);
  border-color: var(--accent);
  transform: rotate(180deg);
}

.lesson-card.is-open .expand-mark::before {
  background: #fff;
}

.lesson-card.is-open .expand-mark::after {
  opacity: 0;
}

.lesson-detail {
  display: none;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(190px, auto);
  gap: 22px;
  padding: 0 20px 22px 90px;
  border-top: 1px solid #f2dccb;
}

.lesson-card.is-open .lesson-detail {
  display: grid;
}

.detail-block h3 {
  margin: 18px 0 10px;
  color: var(--accent);
  font-size: 18px;
}

.detail-block ul {
  display: grid;
  gap: 9px;
  padding-left: 20px;
  color: var(--muted);
}

.knowledge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.knowledge-pill {
  max-width: 100%;
  border-radius: 30px;
  background: #fff3e9;
  color: #9d4523;
  padding: 7px 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.lesson-actions {
  align-self: start;
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.courseware-block,
.game-action-block,
.preview-action-block {
  display: grid;
  gap: 10px;
}

.courseware-block h3,
.game-action-block h3,
.preview-action-block h3 {
  margin: 0;
  color: var(--accent);
  font-size: 18px;
}

.preview-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #86c5a8;
  border-radius: 8px;
  background: #edf9f3;
  color: #176b49;
  padding: 10px 16px;
  font-weight: 800;
}

.preview-action:hover {
  background: #dcf3e8;
}

.courseware-link,
.courseware-placeholder {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 30px;
  padding: 10px 16px;
  font-weight: 800;
  text-align: center;
}

.courseware-link {
  border: 1px solid #f2c2a5;
  color: var(--accent);
  background: #fff8f0;
}

.courseware-placeholder {
  border: 1px dashed #e7c6b4;
  color: #9d7a68;
  background: #fffaf5;
}

.play-action {
  min-height: 46px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  border-radius: 30px;
  background: var(--accent);
  color: #fff;
  padding: 11px 20px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 5px 15px rgba(255, 107, 53, 0.26);
  transition: transform 0.2s, background 0.2s;
}

.lesson-actions .play-action {
  margin-top: 0;
}

.play-action:hover {
  background: var(--accent);
  transform: translateY(-2px);
}

.site-footer { padding: 32px 0; border-top: 1px solid var(--line); color: #879180; background: #efefe8; text-align: center; }
.footer-logo { color: var(--ink); font-size: 16px; line-height: 1.5; font-weight: 650; letter-spacing: 2px; }
.footer-logo span { margin-left: 10px; color: #8a987d; font-size: 9px; font-weight: 500; letter-spacing: 1.8px; }
.site-footer p { margin-top: 6px; color: #a2aa99; font-size: 11px; letter-spacing: 0.7px; }
.site-footer a { display: inline-flex; gap: 9px; align-items: center; margin-top: 12px; color: #829475; font-size: 10px; }
.site-footer a:hover { color: var(--accent); }
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.back-to-top:hover {
  transform: translateY(-3px);
  background: var(--accent);
}


/* Preserve the course detail interactions with the same restrained palette. */
.toolbar { width: min(680px, 100%); grid-template-columns: auto minmax(170px, 1fr) auto; align-items: center; gap: 12px; }
.select-box { gap: 4px; color: #8a9580; font-size: 10px; font-weight: 600; }
.select-box select { min-height: 42px; border-color: #d8e0d0; border-radius: 6px; color: var(--ink); box-shadow: none; font-size: 12px; background-position: calc(100% - 20px) 18px, calc(100% - 14px) 18px; }
.back-action, .export-action { min-height: 42px; border-radius: 6px; padding: 0 13px; font-size: 12px; font-weight: 600; }
.back-action { border: 1px solid #d8e0d0; color: var(--sage); background: #fff; }
.back-action:hover { color: var(--accent); background: var(--soft-orange); transform: none; }
.export-action { color: #fff; background: var(--accent); }
.export-action:hover { background: var(--accent-dark); transform: none; }
.status-text { padding: 18px 20px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-weight: 500; box-shadow: none; }
.lesson-card { border: 1px solid var(--line); border-radius: 8px; box-shadow: none; }
.lesson-number { width: 46px; height: 46px; border-radius: 8px; color: var(--sage); background: var(--soft-sage); font-size: 14px; font-weight: 600; }
.lesson-title-text strong { font-size: 17px; font-weight: 600; }
.lesson-title-text span { color: #929c88; font-size: 12px; }
.lesson-detail { border-top-color: var(--line); }
.knowledge-pill { border-radius: 5px; color: #869779; background: var(--soft-sage); font-size: 12px; font-weight: 500; }
.play-action { border-radius: 6px; font-size: 13px; font-weight: 600; box-shadow: none; }
.courseware-link, .courseware-placeholder { border-radius: 6px; font-size: 12px; font-weight: 500; }
.back-to-top { width: 41px; height: 41px; border: 1px solid #d5ddcc; border-radius: 8px; color: var(--sage); background: #fff; font-size: 18px; box-shadow: 0 2px 10px rgba(38, 50, 47, 0.06); }
.back-to-top:hover { color: var(--accent); background: #fffaf6; transform: none; }

@media (max-width: 1100px) {
  .hero-grid { gap: 28px; }
  .hero-copy h1 { font-size: 36px; }
  .hero-art { height: 284px; }
  .hero-panel > div { padding: 0 17px; }
  .catalog-layout { grid-template-columns: 185px minmax(0, 1fr); gap: 24px; }
  .catalog-sidebar { padding-right: 8px; }
  .direction-filter { padding-left: 11px; padding-right: 11px; }
  .catalog-controls { gap: 14px; }
  .course-finder { flex-basis: 255px; }
  .series-course-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .series-course-main strong { font-size: 14px; }
  .series-course { min-height: 128px; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px 12px; }
  .course-book { width: 42px; min-height: 57px; }
  .series-course-meta em { font-size: 10px; }
}

@media (max-width: 850px) {
  .container { width: calc(100% - 40px); }
  .nav-links { gap: 21px; }
  .hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 26px; }
  .hero-copy h1 { font-size: 30px; letter-spacing: -0.6px; }
  .hero-text { font-size: 12px; }
  .hero-panel > div { display: grid; gap: 0; padding: 0 18px; }
  .hero-panel strong { font-size: 20px; }
  .hero-panel span { font-size: 9px; }
  .hero-art { height: 249px; }
  .book-lighting { left: 2%; width: 115px; height: 175px; padding-left: 16px; }
  .book-think { left: 37%; width: 100px; height: 151px; padding-left: 16px; }
  .book-reading { right: 0; width: 84px; height: 125px; padding-left: 12px; padding-right: 7px; }
  .book-foundation { right: 5%; width: 83px; height: 177px; padding-left: 14px; padding-right: 7px; }
  .book-title { font-size: 20px; }
  .book-reading .book-title, .book-foundation .book-title { font-size: 16px; }
  .book-topline { font-size: 5px; letter-spacing: 0.6px; }
  .book-subtitle { font-size: 6px; }
  .book-footer { font-size: 6px; }
  .catalog-controls { align-items: stretch; flex-direction: column; gap: 14px; }
  .course-finder { flex: none; width: 100%; min-width: 0; }
  .direction-filters { gap: 5px; }
  .direction-filter { min-height: 37px; padding: 7px 14px; }
  .section-note { max-width: 315px; font-size: 11px; }
  .catalog-layout { grid-template-columns: 170px minmax(0, 1fr); gap: 18px; }
  .series-card { padding: 20px; }
  .series-level { font-size: 10px; padding: 4px 6px; }
  .series-card h3 { font-size: 22px; }
  .series-symbol { width: 38px; height: 38px; flex-basis: 38px; font-size: 17px; }
  .series-course { padding: 12px; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 9px; }
  .course-book { width: 34px; min-height: 49px; font-size: 8px; }
  .series-course-main strong { font-size: 14px; }
  .series-course-main small { font-size: 11px; }
  .series-course-meta em { max-width: 55px; font-size: 10px; padding: 2px 3px; }
  .series-course-meta b { font-size: 16px; }
  .series-course-action { font-size: 11px; }
  .lesson-section .section-heading { align-items: stretch; flex-direction: column; gap: 20px; }
  .toolbar { width: 100%; }
  .lesson-detail { grid-template-columns: 1fr; padding-left: 20px; }
  .lesson-actions { grid-template-columns: minmax(0, 1fr) minmax(180px, auto); align-items: end; }
}

@media (max-width: 680px) {
  html { scroll-padding-top: 136px; }
  .container { width: calc(100% - 32px); }
  .header-inner { min-height: 64px; gap: 12px; }
  .brand-mark { width: 30px; height: 30px; }
  .logo { gap: 7px; }
  .brand-word strong { font-size: 16px; letter-spacing: 0; }
  .brand-word small { font-size: 7px; letter-spacing: 1.6px; }
  .nav-links { gap: 15px; font-size: 11px; }
  .nav-links > a:first-child { display: none; }
  .nav-links .trial-link { padding: 5px 11px; border-radius: 5px; }
  .course-hero { padding: 29px 0 28px; }
  .hero-grid { display: block; }
  .hero-copy h1 { max-width: 100%; font-size: clamp(27px, 7vw, 37px); line-height: 1.4; letter-spacing: -0.8px; }
  .hero-text { max-width: 95%; margin-top: 12px; font-size: 12px; line-height: 1.9; }
  .hero-actions { margin-top: 17px; }
  .primary-action { min-height: 39px; padding: 8px 16px; font-size: 12px; }
  .hero-panel { margin-top: 21px; }
  .hero-panel > div { display: flex; gap: 7px; padding: 0 16px; }
  .hero-panel strong { font-size: 18px; }
  .hero-panel span { font-size: 9px; }
  .hero-art { display: none; }
  .eyebrow { font-size: 9px; letter-spacing: 2px; }
  .series-section { padding: 30px 0 44px; scroll-margin-top: 80px; }
  .catalog-heading { display: block; margin-bottom: 18px; }
  .catalog-heading h2 { font-size: 25px; }
  .section-note { max-width: none; margin-top: 8px; font-size: 11px; line-height: 1.8; }
  .catalog-controls { gap: 12px; }
  .direction-filters { flex-wrap: nowrap; gap: 5px; overflow-x: auto; padding-bottom: 4px; overscroll-behavior-x: contain; scrollbar-width: none; }
  .direction-filters::-webkit-scrollbar { display: none; }
  .direction-filter { min-height: 35px; flex: 0 0 auto; padding: 7px 12px; font-size: 11px; }
  .course-search { min-height: 42px; }
  .course-search input { height: 40px; font-size: 12px; }
  .catalog-meta { margin: 11px 0 13px; gap: 12px; font-size: 10px; }
  .catalog-meta > span:last-child { flex: 0 0 auto; }
  .catalog-layout { display: block; }
  .catalog-sidebar { position: sticky; top: 64px; z-index: 20; max-height: none; margin: 0 -16px 15px; padding: 0 16px; overflow: visible; border-top: 1px solid #e5e8e0; border-bottom: 1px solid #e5e8e0; background: rgba(248, 247, 244, 0.98); }
  .sidebar-heading, .sidebar-note { display: none; }
  .series-tabs { flex-direction: row; gap: 6px; overflow-x: auto; padding: 9px 0; overscroll-behavior-x: contain; scrollbar-width: none; }
  .series-tabs::-webkit-scrollbar { display: none; }
  .series-tab { flex: 0 0 auto; display: flex; min-height: 31px; padding: 6px 12px; border: 1px solid #e0e5d9; border-radius: 5px; color: #7d8974; background: #fff; }
  .series-tab strong { font-size: 11px; line-height: 1.4; font-weight: 550; white-space: nowrap; }
  .series-tab-index, .series-tab-count { display: none; }
  .series-tab[aria-current="location"] { border-color: #e6c8b5; background: #f9ebe0; }
  .series-tab[aria-current="location"]::before { display: none; }
  .series-grid { gap: 18px; }
  .series-card { scroll-margin-top: 130px; border-radius: 8px; padding: 20px 17px; }
  .series-card-head { align-items: flex-start; gap: 10px; }
  .series-card h3 { font-size: 23px; }
  .series-type { margin-bottom: 4px; font-size: 10px; }
  .series-symbol { width: 36px; height: 40px; flex-basis: 36px; border-radius: 6px; font-size: 17px; }
  .series-level { margin-top: 1px; max-width: 75px; font-size: 10px; white-space: normal; text-align: right; }
  .series-card-body { margin-top: 14px; }
  .series-desc { font-size: 11px; line-height: 1.9; }
  .series-details { font-size: 10px; }
  .series-details summary { font-size: 10px; }
  .series-summary { gap: 12px; margin-top: 12px; font-size: 11px; }
  .series-summary span + span { padding-left: 12px; }
  .series-course-list { grid-template-columns: 1fr; gap: 9px; margin-top: 15px; }
  .series-course { min-height: 103px; grid-template-columns: 43px minmax(0, 1fr) 51px; grid-template-rows: auto auto; gap: 7px 13px; padding: 14px 13px 12px; }
  .course-book { width: 43px; min-height: 57px; grid-row: 1 / 3; font-size: 10px; }
  .series-course-main strong { font-size: 14px; }
  .series-course-main small { font-size: 11px; margin-top: 4px; }
  .series-course-meta { grid-row: 1 / 3; grid-column: 3; gap: 4px; align-self: center; }
  .series-course-meta em { max-width: 51px; padding: 2px 5px; font-size: 10px; }
  .series-course-meta b { font-size: 17px; }
  .series-course-meta small { font-size: 10px; }
  .series-course-action { grid-column: 2; font-size: 11px; }
  .series-course-action > span { margin-left: 4px; font-size: 13px; }
  .lesson-section { padding: 28px 0 44px; }
  body.is-course-view .lesson-section .section-heading { align-items: stretch; }
  body.is-course-view .lesson-section h2 { font-size: 25px; }
  .toolbar { grid-template-columns: 1fr 1fr; align-items: end; gap: 11px; }
  .select-box { grid-column: 1 / -1; grid-row: 1; }
  .back-action, .export-action { padding: 0 11px; font-size: 11px; }
  .lesson-summary { grid-template-columns: auto minmax(0, 1fr) auto; padding: 15px; gap: 12px; }
  .lesson-number { width: 38px; height: 42px; font-size: 12px; }
  .lesson-title-text strong { font-size: 14px; }
  .lesson-title-text span { font-size: 11px; }
  .expand-mark { width: 28px; height: 28px; box-shadow: none; }
  .expand-mark::before, .expand-mark::after { width: 10px; }
  .lesson-actions { grid-template-columns: 1fr; }
  .lesson-detail { padding: 0 15px 18px; }
  .site-footer { padding: 27px 0; }
  .back-to-top { right: 14px; bottom: 14px; width: 37px; height: 37px; }
}

@media (max-width: 380px) {
  .nav-links { gap: 10px; font-size: 10px; }
  .brand-word strong { font-size: 15px; }
  .brand-mark { width: 27px; height: 27px; }
  .nav-links .trial-link { padding: 5px 8px; }
  .hero-panel > div { padding: 0 11px; gap: 4px; }
  .hero-panel strong { font-size: 17px; }
  .hero-panel span { font-size: 8px; }
  .series-card { padding: 18px 13px; }
  .series-card h3 { font-size: 21px; }
  .series-level { max-width: 60px; }
  .series-course { padding: 13px 10px; gap: 7px 10px; grid-template-columns: 38px minmax(0, 1fr) 43px; }
  .course-book { width: 38px; min-height: 53px; font-size: 9px; }
  .series-course-main strong { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

