:root {
  color-scheme: light;
  --paper: #f7f5ee;
  --card: #fbf9f3;
  --ink: #20342c;
  --muted: #506258;
  --line: #d7dad0;
  --seal: #8d4231;
  --forest: #263b31;
  --serif: "Songti SC", "Noto Serif CJK SC", "Noto Serif SC", "STSong", SimSun, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 2rem;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 1rem / 1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

a:focus-visible {
  outline: 3px solid #a4563d;
  outline-offset: 5px;
}

img { display: block; max-width: 100%; }

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

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
}

.shell {
  width: min(100% - 7rem, 81rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 3;
  inset: 1rem auto auto 1rem;
  padding: .5rem 1rem;
  background: var(--card);
  transform: translateY(-180%);
}

.skip-link:focus { transform: none; }

.header-inner {
  min-height: 5.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .78rem;
  flex-shrink: 0;
  font: 600 1.55rem / 1.2 var(--serif);
  letter-spacing: .11em;
}

.seal {
  width: 2.1rem;
  height: 2.1rem;
  display: grid;
  place-items: center;
  border-radius: .18rem .24rem .19rem .27rem;
  outline: 1px solid #e4bba3;
  outline-offset: -4px;
  color: #fff6e5;
  background: var(--seal);
  font-size: 1.16rem;
  letter-spacing: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(.95rem, 2.5vw, 2.4rem);
  margin-left: auto;
  font-size: .94rem;
}

.site-nav a {
  padding-block: .72rem;
  position: relative;
  white-space: nowrap;
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--ink); }

.site-nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: auto 20% .26rem;
  height: 1px;
  background: var(--seal);
}

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(27rem, 32vw, 29.5rem);
  overflow: hidden;
  border-radius: .55rem;
  background: #22362c;
  color: #fff8e9;
}

.hero-image, .hero::after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-image {
  object-fit: cover;
  object-position: center 57%;
}

.hero::after {
  content: "";
  background: linear-gradient(90deg, rgba(12, 24, 19, .81) 0%, rgba(16, 27, 22, .54) 36%, rgba(16, 27, 22, .10) 70%, transparent);
}

.hero-copy {
  padding: 2.65rem clamp(2.5rem, 6%, 5.6rem);
}

.hero h1 {
  font-size: clamp(3.55rem, 5.5vw, 5.5rem);
  line-height: 1.14;
  letter-spacing: .055em;
  text-wrap: balance;
}

.hero p {
  color: #f0ebdc;
  margin-top: 1.22rem;
  font-size: clamp(1rem, 1.35vw, 1.2rem);
  letter-spacing: .035em;
}

.button {
  display: inline-flex;
  min-height: 2.9rem;
  align-items: center;
  justify-content: center;
  padding-inline: 1.35rem;
  border: 1px solid transparent;
  border-radius: .2rem;
  font-size: .94rem;
  font-weight: 550;
  transition: background-color .2s, color .2s, border-color .2s;
}

.button-light {
  margin-top: 1.7rem;
  background: #f3eee1;
  color: #26392f;
}

.button-light:hover { background: #fff9ee; }

.courses {
  padding: clamp(2.65rem, 3.55vw, 3.6rem) 0 clamp(3.3rem, 6vw, 5.2rem);
}

.courses h2,
.detail-section h2,
.detail-other h2 {
  font-size: clamp(1.6rem, 3.1vw, 2.45rem);
  line-height: 1.25;
  letter-spacing: .06em;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.9rem, 2.2vw, 2rem);
  margin-top: 1.65rem;
}

.course-card {
  display: block;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--card);
}

.course-card:hover { border-color: #9ba99e; }

.course-image {
  aspect-ratio: 1.9;
  overflow: hidden;
}

.course-image-books { background: #6e5946; }
.course-image-herbs { background: #655d46; }
.course-image-ai { background: #47565c; }

.course-image img,
.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-image img {
  transition: transform .45s cubic-bezier(.2, .6, .3, 1);
}

.course-card:hover img { transform: scale(1.04); }

.course-card-copy {
  padding: 1.22rem clamp(.95rem, 1.55vw, 1.55rem) 1.45rem;
}

.course-card h3 {
  font-size: clamp(1.45rem, 2.3vw, 2rem);
  letter-spacing: .025em;
  line-height: 1.34;
}

.teacher-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .6rem;
  color: var(--muted);
}

.course-card .teacher-line { margin-top: .45rem; }

.site-footer {
  background: var(--forest);
  color: #f1ece0;
}

.footer-inner {
  min-height: 6.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: .94rem;
}

.footer-inner a:hover { text-decoration: underline; text-underline-offset: .3em; }

.footer-brand {
  font: 600 1.38rem / 1.5 var(--serif);
  letter-spacing: .12em;
}

.detail-page { padding-bottom: clamp(3rem, 6vw, 6.5rem); }

.breadcrumb {
  margin-block: 1.5rem 1.4rem;
  color: var(--muted);
  font-size: .92rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: .55rem;
  color: #68796d;
}

.breadcrumb a:hover { text-decoration: underline; text-underline-offset: .18em; }

.detail-hero {
  display: grid;
  grid-template-columns: .96fr 1.04fr;
  overflow: hidden;
  border-radius: .4rem;
  background: #e9ede4;
}

.detail-copy {
  align-self: center;
  padding: clamp(2.2rem, 5vw, 4.5rem);
}

.detail-copy h1 {
  font-size: clamp(2.6rem, 5.4vw, 5rem);
  line-height: 1.24;
  letter-spacing: .035em;
}

.detail-copy .teacher-line {
  margin-top: .9rem;
  font-size: 1.14rem;
}

.detail-description {
  margin-top: 1rem;
  max-width: 30ch;
  color: var(--muted);
}

.detail-media {
  min-height: 24rem;
  margin: 0;
  overflow: hidden;
  background: var(--forest);
}

.detail-media img { object-position: center; }

.detail-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3.75rem);
  margin-top: clamp(2.4rem, 4.5vw, 4.5rem);
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.detail-section h2,
.detail-other h2 {
  margin-bottom: .7rem;
  font-size: 1.55rem;
}

.detail-section p { color: var(--muted); }

.detail-other { margin-top: clamp(2rem, 4vw, 3.5rem); }

.course-links {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.course-links a {
  display: inline-flex;
  padding: .6rem .9rem;
  border: 1px solid var(--line);
  border-radius: .2rem;
  background: var(--card);
}

.course-links a:hover { border-color: #9ba99e; }

@media (max-width: 900px) {
  .shell { width: calc(100% - 3.5rem); }
  .detail-media { min-height: 19rem; }
}

@media (max-width: 660px) {
  .shell { width: calc(100% - 2rem); }

  .header-inner {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: .35rem;
    padding-top: .9rem;
    padding-bottom: .36rem;
  }

  .brand { align-self: flex-start; }

  .site-nav {
    justify-content: space-between;
    gap: .4rem;
    font-size: .875rem;
  }

  .site-nav a {
    padding-block: .65rem;
    min-height: 2.75rem;
  }

  .hero { min-height: 24.5rem; }
  .hero::after { background: linear-gradient(90deg,#0d1d16cf,#10231a69 75%,#10231a4f); }
  .hero-image { object-position: 59% center; }
  .hero-copy { padding: 2.35rem 1.5rem; }
  .hero h1 { font-size: clamp(2.85rem, 12vw, 4.1rem); }

  .courses { padding-top: 2.35rem; }
  .course-grid { grid-template-columns: 1fr; gap: 1.05rem; margin-top: 1.1rem; }
  .course-card h3 { font-size: 1.75rem; }

  .breadcrumb { margin-block: 1.05rem .85rem; }
  .detail-hero, .detail-body { grid-template-columns: 1fr; }
  .detail-copy { padding: 1.65rem 1.35rem 1.8rem; }
  .detail-media { min-height: 0; aspect-ratio: 16 / 10; }
  .detail-body { gap: 1.45rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}

.site-actions {
  display: flex;
  align-items: center;
  gap: clamp(.65rem, 1.6vw, 1.15rem);
  flex: 0 0 auto;
}

.site-notifications {
  color: var(--muted);
  font-size: .94rem;
  padding-block: .65rem;
}

.site-notifications:hover { color: var(--ink); }

.site-account { position: relative; }

.site-account summary {
  list-style: none;
  cursor: pointer;
  border-radius: 50%;
}

.site-account summary::-webkit-details-marker { display: none; }

.site-account summary:focus-visible {
  outline: 3px solid #a4563d;
  outline-offset: 3px;
}

.site-avatar {
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  border: 3px solid #dce4d9;
  border-radius: 50%;
  color: #274638;
  background: #cdd9d0;
  font: 650 1rem / 1 var(--serif);
}

.account-menu {
  position: absolute;
  top: calc(100% + .6rem);
  right: 0;
  z-index: 2;
  width: 10rem;
  padding: .32rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--card);
  box-shadow: 0 .65rem 1.9rem #20342c1a;
}

.account-menu a, .account-menu button {
  display: block;
  width: 100%;
  font: inherit;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: .65rem .7rem;
  border-radius: .25rem;
}

.account-menu a:hover, .account-menu button:hover { background: #e8ece2; }
.site-header [hidden] { display: none; }

.community-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.1rem;
  padding: clamp(1.8rem, 3.1vw, 3rem) 0 clamp(2.8rem, 5vw, 5rem);
  border-top: 1px solid var(--line);
}

.community-links h2 {
  font-size: clamp(1.6rem, 3.1vw, 2.45rem);
  line-height: 1.25;
  letter-spacing: .06em;
}

.community-links p { margin-top: .55rem; color: var(--muted); }
.community-entry { background: var(--forest); color: #f7f5ee; flex: 0 0 auto; }
.community-entry:hover { background: #345747; }

.course-image-empty,
.detail-hero-no-cover { background: #e6ebe2; }

.detail-hero-no-cover { grid-template-columns: minmax(0, 1fr); }
.detail-hero-no-cover .detail-copy { min-height: 17rem; }
.detail-page [hidden] { display: none; }

.course-outline {
  margin: 0;
  padding-inline-start: 1.45rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.course-outline li + li { margin-top: .5rem; }
.course-card h3, .detail-copy h1 { overflow-wrap: anywhere; }
.detail-description, .detail-section p { white-space: pre-line; overflow-wrap: anywhere; }

@media (max-width: 850px) {
  .header-inner { gap: .8rem; }
  .site-nav { gap: .85rem; }
}

@media (max-width: 660px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand tools" "nav nav";
    gap: .35rem 1rem;
  }

  .brand { grid-area: brand; align-self: center; justify-self: start; }
  .site-nav { grid-area: nav; margin: 0; gap: .35rem; }
  .site-actions { grid-area: tools; }
  .community-links { align-items: flex-start; flex-direction: column; }
  .detail-hero-no-cover .detail-copy { min-height: 11rem; }
}

.course-unavailable {
  margin-top: 3.6rem;
  min-height: 16rem;
}

.course-unavailable a {
  display: inline-block;
  margin-top: .8rem;
  text-decoration: underline;
  text-underline-offset: .25em;
}

.site-redeem {
  color: var(--muted);
  font-size: .94rem;
  padding-block: .65rem;
  white-space: nowrap;
}

.site-redeem:hover { color: var(--ink); }

.course-access {
  display: grid;
  justify-items: start;
  gap: .4rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--card);
  font-size: .95rem;
}
.course-access p.course-access-rule { color: var(--ink); }
.course-redeem-link, .course-access-status { color: var(--forest); font-weight: 650; }
.course-redeem-link { text-decoration: underline; text-underline-offset: .2em; }
.course-curriculum .course-outline-empty { padding-top: .9rem; }
.course-curriculum .course-outline { margin-top: .7rem; }
.course-lesson-row { padding-block: .65rem; border-bottom: 1px solid var(--line); }
.course-lesson-title { margin-right: .65rem; color: var(--ink); }
.course-lesson-action, .reader-close {
  border: 1px solid #b5c4b8;
  border-radius: .25rem;
  color: var(--ink);
  background: #e9eee5;
  cursor: pointer;
  padding: .45rem .65rem;
  font: inherit;
  font-size: .875rem;
}
.course-lesson-locked { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.lesson-reader {
  width: min(40rem, calc(100% - 2rem));
  max-height: min(80vh, 43rem);
  padding: clamp(1.1rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: .45rem;
  color: var(--ink);
  background: var(--paper);
}
.lesson-reader::backdrop { background: #172821a6; }
.reader-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.reader-bar h2 { overflow-wrap: anywhere; }
.reader-close { flex: 0 0 auto; }
.reader-body { margin-top: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
