:root {
  --bg: #fbfaf6;
  --surface: #ffffff;
  --surface-soft: #f1f7f0;
  --text: #26312a;
  --muted: #667268;
  --line: #dfe8de;
  --primary: #377d55;
  --primary-dark: #235a3b;
  --accent: #d9824b;
  --accent-soft: #fff1e7;
  --shadow: 0 18px 50px rgba(39, 68, 49, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
  animation: pageFadeIn 420ms ease-out both;
}

img,
video {
  max-width: 100%;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 5vw, 72px);
  background: rgba(251, 250, 246, 0.94);
  border-bottom: 1px solid rgba(223, 232, 222, 0.8);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--primary-dark);
  white-space: nowrap;
  transition: transform 180ms ease, color 180ms ease;
}

.brand:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  letter-spacing: 0;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.brand:hover .brand-mark {
  box-shadow: 0 8px 18px rgba(55, 125, 85, 0.24);
  transform: rotate(-3deg) scale(1.04);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.main-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 15px;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.main-nav a.active,
.main-nav a:hover {
  background: var(--surface-soft);
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  min-height: auto;
  padding: clamp(34px, 5vw, 62px) clamp(18px, 5vw, 72px) 52px;
}

.hero-copy {
  max-width: 620px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
}

h1 {
  max-width: 12em;
  font-size: 64px;
  letter-spacing: 0;
}

h2 {
  font-size: 36px;
}

h3 {
  font-size: 20px;
}

.hero-text {
  margin: 22px 0 0;
  max-width: 36em;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
  box-shadow: 0 0 0 rgba(39, 68, 49, 0);
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.button:hover {
  box-shadow: 0 12px 26px rgba(39, 68, 49, 0.16);
  transform: translateY(-2px);
}

.button:active {
  box-shadow: 0 6px 16px rgba(39, 68, 49, 0.12);
  transform: translateY(0);
}

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  background: #fff;
  color: var(--primary-dark);
}

.hero-media {
  position: relative;
  min-height: 420px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: translateZ(0);
  transition: transform 360ms ease, box-shadow 360ms ease;
}

.hero-media:hover {
  box-shadow: 0 22px 60px rgba(39, 68, 49, 0.16);
  transform: translateY(-4px);
}

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
  animation: calmFloat 8s ease-in-out infinite;
  transition: transform 700ms ease;
}

.hero-media:hover img {
  transform: scale(1.035);
}

.section,
.simple-page,
.course-hero {
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto;
  padding: clamp(44px, 7vw, 78px) 0;
}

.section-heading {
  max-width: 760px;
}

.section-heading p,
.course-hero p,
.simple-page p,
.notice-band p {
  color: var(--muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.feature-card {
  min-height: 210px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.feature-card:hover {
  border-color: #bdd6c1;
  box-shadow: 0 16px 36px rgba(39, 68, 49, 0.1);
  transform: translateY(-4px);
}

.feature-number {
  display: block;
  margin-bottom: 16px;
  color: var(--primary);
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
}

.notice-band {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;
  align-items: start;
  width: min(1120px, calc(100vw - 36px));
  margin: 16px auto 72px;
  padding: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid #f0d0ba;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.notice-band:hover {
  box-shadow: 0 14px 34px rgba(121, 78, 42, 0.08);
  transform: translateY(-2px);
}

.notice-band.compact {
  margin-top: 0;
}

.course-hero {
  padding-bottom: 28px;
}

.course-hero h1 {
  max-width: 14em;
}

.course-hero p {
  max-width: 760px;
}

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px;
  align-items: start;
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto 28px;
}

.player-panel,
.course-sidebar {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 34px rgba(39, 68, 49, 0.08);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.player-panel:hover,
.course-sidebar:hover {
  box-shadow: 0 16px 42px rgba(39, 68, 49, 0.11);
  transform: translateY(-2px);
}

.player-panel {
  overflow: hidden;
}

.course-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  object-fit: contain;
}

.now-playing {
  padding: 22px 24px 10px;
}

.now-playing h2 {
  font-size: 26px;
}

.now-playing p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
}

.medical-note {
  margin: 12px 24px 24px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #f5f8f4;
  color: var(--muted);
  font-size: 14px;
}

.course-sidebar {
  max-height: calc(100vh - 128px);
  overflow: hidden;
  position: sticky;
  top: 88px;
}

.tab-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.tab-button {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.tab-button:hover {
  border-color: #bcd5c0;
  color: var(--primary-dark);
  transform: translateY(-1px);
}

.tab-button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.chapter-list {
  max-height: calc(100vh - 198px);
  overflow-y: auto;
  padding: 10px;
}

.chapter-button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  margin: 0 0 8px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.chapter-button:hover,
.chapter-button.active {
  border-color: #bcd5c0;
  background: var(--surface-soft);
}

.chapter-button:hover {
  box-shadow: 0 8px 22px rgba(39, 68, 49, 0.08);
  transform: translateX(3px);
}

.chapter-button:active {
  transform: translateX(1px) scale(0.99);
}

.chapter-no {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: #edf4ec;
  color: var(--primary-dark);
  font-weight: 900;
  line-height: 1;
}

.chapter-title {
  display: block;
  min-width: 0;
  font-weight: 800;
  line-height: 1.35;
}

.chapter-meta {
  display: block;
  min-width: 0;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.hidden {
  display: none;
}

.simple-page {
  max-width: 860px;
}

.simple-page h1 {
  max-width: 13em;
  margin-bottom: 24px;
}

.simple-page h2 {
  margin: 30px 0 8px;
  font-size: 24px;
}

.legal-page p {
  margin: 10px 0 0;
}

.site-footer {
  margin-top: 52px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 24px 0 34px;
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-links a:hover {
  color: var(--primary-dark);
}

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 520ms ease, transform 520ms ease;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.feature-card.reveal-on-scroll:nth-child(2) {
  transition-delay: 80ms;
}

.feature-card.reveal-on-scroll:nth-child(3) {
  transition-delay: 160ms;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes calmFloat {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.018);
  }
}

@media (max-width: 900px) {
  h1 {
    font-size: 48px;
  }

  h2 {
    font-size: 32px;
  }

  .hero,
  .player-layout,
  .notice-band {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    padding-top: 34px;
  }

  .hero-media,
  .hero-media img {
    min-height: 300px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .course-sidebar {
    position: static;
    max-height: none;
  }

  .chapter-list {
    max-height: 560px;
  }
}

@media (max-width: 620px) {
  .section,
  .simple-page,
  .course-hero,
  .notice-band,
  .player-layout,
  .footer-inner {
    width: min(320px, calc(100% - 120px));
    margin-left: 24px;
    margin-right: 0;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .main-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .main-nav a {
    padding: 8px 10px;
  }

  h1 {
    font-size: 30px;
    word-break: break-all;
  }

  h2 {
    font-size: 24px;
    word-break: break-all;
  }

  .hero-actions,
  .button {
    width: 100%;
  }

  .chapter-button {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .chapter-no {
    width: 38px;
    height: 38px;
  }

  .now-playing {
    padding: 20px 18px 10px;
  }

  .now-playing h2 {
    font-size: 24px;
  }

  .medical-note {
    margin: 12px 18px 18px;
  }
}

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

  .reveal-on-scroll {
    opacity: 1;
    transform: none;
  }
}
