.course-detail {
  padding-bottom: 8px;
  background: var(--surface-page);
}

.course-detail-hero {
  position: relative;
  min-height: 308px;
  overflow: hidden;
  background: var(--brand-deep);
}

.course-detail-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-detail-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgb(15 47 42 / 0.2) 0%, rgb(13 46 41 / 0.56) 50%, rgb(12 43 38 / 0.94) 100%);
}

.course-detail-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 308px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 32px 18px 24px;
  color: #fff;
}

.course-status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgb(255 255 255 / 0.55);
  border-radius: 999px;
  background: rgb(19 82 74 / 0.72);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.course-detail-hero h2 {
  max-width: 340px;
  margin: 13px 0 8px;
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.course-detail-hero p {
  max-width: 330px;
  margin: 0;
  color: rgb(255 255 255 / 0.84);
  font-size: 13px;
  line-height: 1.65;
}

.course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.course-tags span {
  padding: 5px 9px;
  border: 1px solid rgb(255 255 255 / 0.32);
  border-radius: 3px;
  background: rgb(255 255 255 / 0.08);
  font-size: 11px;
}

.course-highlight {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.course-highlight span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.course-highlight strong {
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.5;
}

.course-content-section {
  padding: 25px 18px 27px;
  border-top: 8px solid var(--surface-muted);
}

.course-content-section > h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.4;
}

.course-content-section > p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.85;
}

.course-facts {
  margin: 22px 0 0;
  border-top: 1px solid var(--line-default);
}

.course-quick-section .course-facts {
  margin-top: 0;
}

.course-facts > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line-default);
}

.course-facts dt {
  color: var(--ink-secondary);
  font-size: 12px;
}

.course-facts dd {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.fee-lines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line-default);
  background: var(--line-default);
}

.fee-lines p {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  margin: 0;
  padding: 14px;
  background: #fff;
}

.fee-lines span {
  color: var(--ink-secondary);
  font-size: 11px;
}

.fee-lines strong {
  font-family: var(--numeric);
  font-size: 18px;
  color: var(--brand-deep);
}

.payment-notice {
  margin: 12px 0 0 !important;
  color: var(--ink-primary) !important;
  font-size: 12px !important;
  font-weight: 700;
}

.subsidy-copy {
  margin-top: 18px;
  padding: 16px;
  border-left: 3px solid var(--brand-primary);
  background: var(--surface-muted);
}

.subsidy-copy strong {
  color: var(--brand-deep);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.6;
}

.subsidy-copy p {
  margin: 8px 0 0;
  color: var(--ink-secondary);
  font-size: 11px;
  line-height: 1.7;
}

.outcome-copy {
  margin-top: 18px;
  padding: 18px;
  background: var(--brand-deep);
  color: #fff;
}

.outcome-copy strong {
  font-size: 11px;
  letter-spacing: 0.08em;
}

.outcome-copy p {
  margin: 9px 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.65;
}

.outcome-copy small {
  color: rgb(255 255 255 / 0.68);
  font-size: 11px;
  line-height: 1.65;
}

.certificate-names {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
}

.certificate-names li + li {
  padding-top: 10px;
  border-top: 1px solid rgb(255 255 255 / 0.2);
}

.certificate-carousel { margin-top: 20px; }
.certificate-stage {
  position: relative;
  height: 286px;
  overflow: hidden;
  perspective: 900px;
  touch-action: pan-y;
  background: var(--surface-muted);
}
.certificate-slide {
  position: absolute;
  top: 20px;
  left: calc(50% - 87px);
  width: 174px;
  height: 246px;
  padding: 6px;
  border: 1px solid var(--line-default);
  background: white;
  box-shadow: 0 8px 20px rgb(23 61 55 / 0.16);
  cursor: pointer;
  transition: transform 420ms ease, opacity 420ms ease;
}
.certificate-slide img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.certificate-slide.is-center { z-index: 3; transform: translateX(0) rotateY(0); }
.certificate-slide.is-left { z-index: 1; opacity: 0.7; transform: translateX(-108px) scale(0.76) rotateY(24deg); }
.certificate-slide.is-right { z-index: 1; opacity: 0.7; transform: translateX(108px) scale(0.76) rotateY(-24deg); }
.certificate-slide img.certificate-landscape {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 234px;
  height: 162px;
  transform: translate(-50%, -50%) rotate(-90deg);
}
.certificate-controls { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.certificate-controls button {
  display: grid; flex: 0 0 36px; height: 36px; place-items: center;
  border: 1px solid var(--line-default); border-radius: 50%;
  background: white; color: var(--brand-primary); cursor: pointer;
}
.certificate-controls svg { width: 16px; height: 16px; }
.certificate-caption { flex: 1; min-width: 0; text-align: center; }
.certificate-caption strong { display: block; font-size: 14px; line-height: 1.6; color: var(--brand-deep); }
.certificate-caption span { display: block; margin-top: 6px; font-size: 11px; color: var(--ink-secondary); }
.course-content-section .certificate-sample-note { margin-top: 14px; font-size: 11px; line-height: 1.7; }
.certificate-preview {
  width: min(92vw, 760px); max-height: 92vh; padding: 16px;
  border: 0; border-radius: 8px; background: var(--surface-page); color: var(--ink-primary);
}
.certificate-preview::backdrop { background: rgb(12 30 26 / 0.85); }
.certificate-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.certificate-preview-heading strong { font-size: 15px; line-height: 1.6; }
.certificate-preview-heading button { flex: 0 0 40px; height: 40px; border: 0; background: var(--surface-muted); font-size: 26px; cursor: pointer; }
.certificate-preview-image { position: relative; height: min(72vh, 760px); margin-top: 12px; }
.certificate-preview-image img { width: 100%; height: 100%; object-fit: contain; }
.certificate-preview-image img.certificate-landscape { position: absolute; top: 50%; left: 50%; width: min(72vh, 760px); height: min(84vw, 720px); transform: translate(-50%, -50%) rotate(-90deg); }
@media (prefers-reduced-motion: reduce) { .certificate-slide { transition: none; } }

.pass-rate-note {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 14px !important;
  padding: 13px 14px;
  border: 1px solid var(--line-default);
}

.pass-rate-note strong {
  color: var(--brand-deep);
  font-size: 13px;
}

.pass-rate-note span {
  color: var(--ink-secondary);
  font-size: 11px;
  line-height: 1.6;
}

.audience-section ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.audience-section li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 0;
  border-top: 1px solid var(--line-default);
}

.audience-section li:last-child {
  border-bottom: 1px solid var(--line-default);
}

.audience-section li > span {
  display: grid;
  width: 28px;
  height: 24px;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-primary);
  font-family: var(--numeric);
  font-size: 11px;
  font-weight: 700;
}

.audience-section li p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
}

.audience-notice {
  margin-top: 16px !important;
  font-size: 11px !important;
  line-height: 1.7 !important;
}

.course-detail-action {
  position: sticky;
  z-index: 4;
  bottom: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-default);
  background: rgb(255 255 255 / 0.97);
  box-shadow: 0 -10px 30px rgb(23 61 55 / 0.08);
}

.course-detail-action > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.course-detail-action span {
  color: var(--ink-secondary);
  font-size: 10px;
}

.course-detail-action strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-detail-action button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 7px;
  padding: 0 16px;
  border: 0;
  border-radius: 3px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.course-detail-action svg {
  width: 15px;
  height: 15px;
}

.course-not-found {
  display: grid;
  min-height: 560px;
  place-content: center;
  justify-items: center;
  padding: 28px;
  text-align: center;
}

.course-not-found > svg {
  width: 34px;
  height: 34px;
  color: var(--brand-primary);
}

.course-not-found strong {
  margin-top: 14px;
  font-family: var(--serif);
  font-size: 18px;
}

.course-not-found p {
  margin: 8px 0 18px;
  color: var(--ink-secondary);
  font-size: 13px;
}

.course-not-found button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 3px;
  background: var(--brand-primary);
  color: #fff;
  cursor: pointer;
}

.course-detail-hero.image-failed > img {
  opacity: 0;
}

.course-detail-hero.image-failed .course-hero-fallback {
  display: grid;
  position: absolute;
  inset: 0;
  place-items: center;
  color: rgb(255 255 255 / 0.5);
  font-size: 12px;
}

@media (max-width: 389px) {
  .course-detail-hero,
  .course-detail-hero-copy {
    min-height: 286px;
  }

  .course-detail-hero h2 {
    font-size: 23px;
  }

  .course-detail-action {
    gap: 8px;
    padding-inline: 10px;
  }

  .course-detail-action button {
    padding-inline: 12px;
  }
}
