:root {
  color-scheme: light;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --surface-soft: #f4f1eb;
  --line: #e4dfd6;
  --line-strong: #d1c8ba;
  --text: #27231f;
  --muted: #706a62;
  --faint: #90887d;
  --accent: #92764f;
  --accent-strong: #725a39;
  --accent-soft: #efe7dc;
  --sage-line: #d9dfd2;
  --success-soft: #eef5ee;
  --success-text: #43684a;
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86) 0%, rgba(251, 250, 247, 0.96) 44%, var(--paper) 100%),
    repeating-linear-gradient(90deg, rgba(223, 216, 205, 0.24) 0, rgba(223, 216, 205, 0.24) 1px, transparent 1px, transparent 96px);
  color: var(--text);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.page {
  min-height: 100vh;
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 24px;
  border-bottom: 1px solid rgba(209, 200, 186, 0.66);
}

.brand {
  display: grid;
  align-items: center;
  min-height: 54px;
  color: var(--text);
  text-decoration: none;
}

.brand-lockup {
  display: block;
  width: min(280px, 62vw);
  max-height: 54px;
  object-fit: contain;
  object-position: left center;
}

.brand-fallback {
  font-size: 18px;
  font-weight: 750;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-action,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
}

.nav-action.active,
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
}

.back-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--accent-strong);
  font-weight: 750;
  text-decoration: none;
  border-bottom: 1px solid rgba(146, 118, 79, 0.34);
  padding-bottom: 3px;
}

.back-link:hover {
  border-bottom-color: var(--accent-strong);
}

.button:disabled {
  cursor: not-allowed;
  background: #ddd8cf;
  border-color: transparent;
  color: #aaa39a;
}

.hidden {
  display: none !important;
}

.status {
  margin: 28px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.status.error {
  border-color: #dac2b8;
  background: #fff8f5;
  color: #7b4f43;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.54fr) minmax(0, 0.46fr);
  gap: 40px;
  align-items: center;
  min-height: 640px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 82px max(20px, calc((100vw - 1120px) / 2)) 88px;
  position: relative;
  overflow: hidden;
  background-color: var(--paper);
  background-image: var(--hero-bg);
  background-size: cover;
  background-position: 58% center;
  background-repeat: no-repeat;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(251, 250, 247, 0.98) 0%, rgba(251, 250, 247, 0.92) 32%, rgba(251, 250, 247, 0.42) 52%, rgba(251, 250, 247, 0.08) 74%, rgba(251, 250, 247, 0.02) 100%);
  pointer-events: none;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.eyebrow {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-strong);
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.04;
  font-weight: 800;
}

.lead {
  margin: 0;
  max-width: 660px;
  font-size: 20px;
  line-height: 1.8;
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 12px;
}

.fact {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.fact-label {
  display: block;
  font-size: 12px;
  color: var(--faint);
  margin-bottom: 8px;
}

.fact-value {
  display: block;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.actions,
.hero-actions,
.cta-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.sections {
  display: grid;
  gap: 82px;
  padding: 54px 0 108px;
  counter-reset: course-section;
}

.home-hero {
  padding: 56px 0 27px;
  border-bottom: 1px solid rgba(209, 200, 186, 0.66);
  position: relative;
  overflow: hidden;
  background-color: var(--surface-soft);
  background-image:
    linear-gradient(90deg, rgba(251, 250, 247, 0.98) 0%, rgba(251, 250, 247, 0.9) 38%, rgba(251, 250, 247, 0.48) 58%, rgba(251, 250, 247, 0.08) 100%),
    var(--home-hero-bg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 58% center;
}

.home-hero-inner {
  display: grid;
  gap: 18px;
  position: relative;
  z-index: 1;
  min-height: 288px;
  align-content: center;
}

.home-hero .lead {
  max-width: 720px;
}

.home-sections {
  padding-top: 44px;
}

.course-filter-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 16px;
  margin: 0 0 28px;
  padding: 22px;
  border: 1px solid rgba(209, 200, 186, 0.72);
  background: rgba(255, 255, 255, 0.72);
}

.filter-primary-row {
  display: contents;
}

.filter-pet-column,
.filter-taxonomy-column {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.filter-pet-column {
  grid-column: 1;
}

.filter-taxonomy-column {
  grid-column: 2 / 4;
}

.filter-utility-row {
  display: contents;
}

.filter-group {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.filter-group-wide {
  grid-column: span 2;
}

.filter-group legend,
.filter-label {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.filter-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  display: inline-flex;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
}

.filter-chip input {
  margin: 0;
}

.filter-group select {
  width: 100%;
  height: 42px;
  min-height: 42px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  padding: 0 12px;
}

.filter-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
}

.filter-clear {
  width: fit-content;
}

.filter-result-count {
  color: var(--muted);
  font-weight: 700;
}

.course-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
  align-items: stretch;
}

.course-card {
  display: grid;
  grid-template-rows: 1fr;
  max-width: 520px;
  min-width: 0;
  position: relative;
  overflow: hidden;
  background-color: #263547;
  background-image: var(--course-card-bg);
  background-repeat: no-repeat;
  background-size: cover;
  background-position: 32% center;
  border: 1px solid rgba(209, 200, 186, 0.72);
  border-left: 4px solid var(--accent);
}

.course-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(31, 45, 61, 0.42) 0%, rgba(31, 45, 61, 0.3) 36%, rgba(31, 45, 61, 0.08) 70%, rgba(31, 45, 61, 0) 100%);
  pointer-events: none;
}

.course-card-body {
  display: grid;
  gap: 18px;
  align-content: end;
  position: relative;
  z-index: 1;
  padding: 28px;
  max-width: 76%;
  color: #ffffff;
  text-shadow: 0 1px 14px rgba(20, 28, 38, 0.46);
}

.course-card-body .eyebrow {
  color: #f1d7aa;
}

.course-card-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  color: #ffffff;
}

.course-card .summary-row {
  grid-template-columns: 86px minmax(0, 1fr);
  border-top-color: rgba(255, 255, 255, 0.22);
}

.course-card .summary-row span {
  color: rgba(255, 255, 255, 0.72);
}

.course-card .summary-row strong {
  color: #ffffff;
}

.course-card .button.secondary {
  background: #d4a85f;
  border-color: #d4a85f;
  color: #27231f;
  text-shadow: none;
}

.course-card .button.secondary:hover {
  background: #e1b96f;
  border-color: #e1b96f;
}

.sections > section {
  counter-increment: course-section;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 36px;
  align-items: end;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(209, 200, 186, 0.72);
  padding-bottom: 20px;
}

.section-heading::before {
  content: counter(course-section, decimal-leading-zero);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  padding-top: 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.2;
  flex: 1;
}

.section-heading p {
  margin: 0;
  max-width: 440px;
  color: var(--muted);
  line-height: 1.7;
}

.learning-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 34px;
}

.learning-card,
.reviewer-card {
  border-top: 2px solid var(--sage-line);
  padding: 26px 0 6px;
}

.number {
  color: var(--accent);
  font-weight: 800;
  font-size: 28px;
}

.learning-text,
.chapter-description,
.doctor-credentials,
.faq-answer {
  color: var(--muted);
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.course-summary {
  display: grid;
  grid-template-columns: minmax(220px, 0.3fr) minmax(0, 1fr);
  gap: 44px;
}

.summary-panel {
  background: transparent;
  border-left: 3px solid var(--accent-soft);
  padding: 4px 0 4px 24px;
  align-self: start;
}

.summary-list {
  display: grid;
  gap: 18px;
}

.chapter-list,
.faq-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.chapter {
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
}

.chapter-heading {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.chapter-index {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

.chapter-title,
.doctor-name,
.purchase-title {
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
}

.unit-list {
  display: grid;
  gap: 10px;
}

.unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-top: 1px solid rgba(228, 223, 214, 0.82);
  padding: 13px 0 3px;
  color: var(--muted);
}

.unit-title {
  color: var(--text);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success-text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.doctor-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.4fr) minmax(0, 1fr);
  gap: 48px;
  align-items: center;
  background: linear-gradient(135deg, rgba(244, 241, 235, 0.82), rgba(255, 255, 255, 0.68));
  padding: 42px;
}

.doctor-visual {
  min-height: 320px;
  background:
    linear-gradient(135deg, rgba(244, 241, 235, 0.95), rgba(255, 255, 255, 0.86)),
    repeating-linear-gradient(90deg, rgba(209, 200, 186, 0.28) 0, rgba(209, 200, 186, 0.28) 1px, transparent 1px, transparent 46px);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.doctor-visual::before {
  content: "";
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 1px solid rgba(146, 118, 79, 0.32);
  box-shadow: 0 0 0 20px rgba(239, 231, 220, 0.5);
}

.doctor-visual::after {
  content: "Instructor";
  position: absolute;
  left: 28px;
  bottom: 24px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

details {
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
  line-height: 1.6;
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  color: var(--accent);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
}

details[open] summary::after {
  content: "-";
}

.reviewer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 36px;
  border-top: 1px solid var(--line);
}

.reviewer-card {
  border-left: 3px solid var(--sage-line);
  border-top: 0;
  padding: 24px 0 8px 24px;
  display: grid;
  gap: 12px;
}

.reviewer-name {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.reviewer-title {
  color: var(--accent-strong);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.reviewer-credentials {
  color: var(--muted);
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.purchase-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  background: linear-gradient(135deg, rgba(244, 241, 235, 0.92), rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(209, 200, 186, 0.72);
  border-left: 4px solid var(--accent);
  padding: 34px;
}

.purchase-meta {
  color: var(--muted);
  font-weight: 700;
}

.notes {
  white-space: pre-wrap;
  line-height: 1.9;
  color: var(--muted);
  border-left: 3px solid var(--accent-soft);
  padding: 6px 0 6px 24px;
  overflow-wrap: anywhere;
}

.purchase-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.6fr) minmax(320px, 0.4fr);
  gap: 56px;
  padding: 66px 0 92px;
  align-items: start;
}

.purchase-form {
  display: grid;
  gap: 28px;
}

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

label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

input[type="text"],
input[type="email"] {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  padding: 0 14px;
  pointer-events: auto;
}

.notice {
  padding: 18px 0 2px 22px;
  border-left: 3px solid var(--accent-soft);
  color: var(--muted);
  line-height: 1.9;
}

.agreement-content {
  max-height: 260px;
  overflow-y: auto;
  padding: 18px 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  line-height: 1.85;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.agreement-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  color: var(--muted);
  line-height: 1.8;
}

.summary {
  position: sticky;
  top: 28px;
  background: linear-gradient(135deg, rgba(244, 241, 235, 0.92), rgba(255, 255, 255, 0.78));
  border-left: 4px solid var(--accent);
  padding: 30px;
}

.summary h2 {
  margin: 0 0 24px;
  font-size: 28px;
}

.summary-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.summary-row span {
  color: var(--faint);
}

.static-page {
  padding: 58px 0 96px;
}

.static-hero {
  display: grid;
  gap: 18px;
  padding: 52px 0 32px;
  border-bottom: 1px solid rgba(209, 200, 186, 0.72);
}

.static-hero h1 {
  font-size: clamp(38px, 5vw, 64px);
}

.static-sections {
  display: grid;
  gap: 28px;
  max-width: 860px;
  padding-top: 34px;
}

.static-section {
  padding: 28px 0 4px;
  border-top: 1px solid var(--line);
}

.static-section h2 {
  margin: 0 0 18px;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.28;
}

.static-section p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.todo-line {
  color: #7b4f43 !important;
  background: #fff8f5;
  border-left: 3px solid #dac2b8;
  padding: 10px 14px;
}

.site-footer {
  border-top: 1px solid rgba(209, 200, 186, 0.66);
  background: rgba(244, 241, 235, 0.76);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
}

.footer-brand-lockup {
  display: block;
  width: min(240px, 66vw);
  max-height: 46px;
  object-fit: contain;
  object-position: left center;
}

.footer-brand-fallback {
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: flex-end;
}

.footer-links a {
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.footer-links a:hover {
  color: var(--accent-strong);
  border-bottom-color: rgba(146, 118, 79, 0.42);
}

@media (max-width: 860px) {
  .shell {
    width: min(100% - 40px, 680px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 0;
  }

  .nav {
    width: 100%;
  }

  .nav-action {
    flex: 1;
  }

  .hero {
    grid-template-columns: 1fr;
    width: auto;
    margin-left: 0;
    min-height: auto;
    padding: 46px 20px 56px;
    background-size: cover;
    background-position: 74% center;
    background-repeat: no-repeat;
    background-color: var(--paper);
  }

  .home-hero {
    padding: 34px 0 20px;
    background-image:
      linear-gradient(180deg, rgba(251, 250, 247, 0.98) 0%, rgba(251, 250, 247, 0.9) 54%, rgba(251, 250, 247, 0.34) 100%),
      var(--home-hero-bg);
    background-size: cover;
    background-position: 64% center;
  }

  .home-hero-inner {
    min-height: 335px;
    align-content: start;
  }

  .course-catalog-grid {
    grid-template-columns: 1fr;
  }

  .course-filter-panel {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .filter-primary-row,
  .filter-utility-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filter-pet-column,
  .filter-taxonomy-column {
    grid-column: auto;
  }

  .filter-pet-column,
  .filter-taxonomy-column,
  .filter-utility-row {
    gap: 12px;
  }

  .filter-group-wide {
    grid-column: span 1;
  }

  .filter-actions {
    justify-content: flex-start;
  }

  .course-card {
    max-width: none;
  }

  .course-card::before {
    background: linear-gradient(90deg, rgba(31, 45, 61, 0.48) 0%, rgba(31, 45, 61, 0.34) 56%, rgba(31, 45, 61, 0.1) 84%, rgba(31, 45, 61, 0) 100%);
  }

  .course-card-body {
    max-width: 82%;
    padding: 24px;
  }

  .hero::before {
    display: block;
    background: linear-gradient(90deg, rgba(251, 250, 247, 0.98) 0%, rgba(251, 250, 247, 0.92) 48%, rgba(251, 250, 247, 0.58) 72%, rgba(251, 250, 247, 0.24) 100%);
  }

  .hero-copy {
    max-width: min(100%, 560px);
    min-width: 0;
  }

  h1,
  .lead,
  .section-heading h2,
  .purchase-title,
  .doctor-name,
  .chapter-title {
    overflow-wrap: anywhere;
  }

  .facts,
  .learning-grid,
  .course-summary,
  .reviewer-grid,
  .doctor-section,
  .purchase-box,
  .purchase-layout {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 14px;
  }

  .summary {
    position: static;
  }

  .summary-panel {
    border-left: 0;
    border-top: 3px solid var(--accent-soft);
    padding: 20px 0 0;
  }

  .chapter-heading {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .unit {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .doctor-section {
    padding: 30px 22px;
    gap: 28px;
  }

  .doctor-visual {
    min-height: 240px;
  }

  .reviewer-card {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 22px 0;
  }

  .notes {
    border-left: 0;
    border-top: 3px solid var(--accent-soft);
    padding: 18px 0 0;
  }

  .static-page {
    padding: 34px 0 68px;
  }

  .static-hero {
    padding-top: 26px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 390px) {
  .hero {
    background-position: 76% center;
  }
}

@media (max-width: 370px) {
  .hero {
    background-position: 78% center;
  }
}
