:root {
  --ink: #231c19;
  --muted: #756b65;
  --paper: #f7f1e7;
  --paper-deep: #eee3d2;
  --red: #a5312f;
  --red-dark: #6f201f;
  --gold: #c79a4b;
  --line: rgba(74, 55, 44, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(197, 154, 75, 0.12), transparent 28rem),
    linear-gradient(180deg, #fbf7ef 0, var(--paper) 45rem, #f3eadc 100%);
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.load-status {
  margin: 18px 0 0;
  color: var(--muted);
  text-align: center;
}

.course-shell {
  width: min(100% - 32px, 1040px);
  margin: 0 auto;
  padding: 32px 0 44px;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px 12px 12px 4px;
  color: #fff8ea;
  background: var(--red);
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
  box-shadow: 0 8px 22px rgba(112, 32, 31, 0.2);
}

.brand-name,
.brand-note,
.eyebrow,
.intro-copy,
.now-label,
.lesson-label,
.section-kicker,
footer p {
  margin: 0;
}

.brand-name {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-note {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro {
  padding: 66px 0 34px;
  text-align: center;
}

.eyebrow,
.section-kicker {
  color: var(--red);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.intro h1 {
  margin: 12px 0 14px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(42px, 7vw, 72px);
  font-weight: 650;
  letter-spacing: 0.06em;
  line-height: 1.08;
}

.intro-copy {
  max-width: 600px;
  margin-inline: auto;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.course-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  flex-wrap: wrap;
}

.course-meta span {
  padding: 6px 11px;
  border: 1px solid rgba(165, 49, 47, 0.16);
  border-radius: 999px;
  color: #7d3733;
  background: rgba(255, 251, 244, 0.72);
  font-size: 12px;
}

.player-card {
  position: sticky;
  top: 14px;
  z-index: 10;
  overflow: hidden;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  color: #fff9ef;
  background:
    radial-gradient(circle at 82% 12%, rgba(218, 159, 90, 0.18), transparent 28%),
    linear-gradient(135deg, #6f201f, #411b1a 68%, #301817);
  box-shadow: 0 28px 70px rgba(66, 29, 23, 0.28);
}

.player-card::before {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}

.player-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.now-label,
.lesson-label {
  display: block;
}

.now-label {
  color: #e7bd74;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.16em;
}

.lesson-label {
  margin-top: 5px;
  color: rgba(255, 249, 239, 0.62);
  font-size: 12px;
}

.follow-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 249, 239, 0.72);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.follow-button.is-active {
  color: #fff9ef;
  border-color: rgba(224, 181, 108, 0.46);
  background: rgba(224, 181, 108, 0.12);
}

.follow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.follow-button.is-active .follow-dot {
  background: #e7bd74;
  box-shadow: 0 0 0 4px rgba(231, 189, 116, 0.12);
}

.current-caption {
  display: flex;
  min-height: 174px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 6px 20px;
  text-align: center;
}

.caption-role {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #e8bb73;
  background: rgba(231, 189, 116, 0.1);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.caption-role.waiter {
  color: #f4c9bb;
}

.caption-role.customer {
  color: #b9d7cf;
}

.caption-role.practice {
  color: #e8bb73;
}

.current-caption p {
  max-width: 820px;
  margin: 0;
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: clamp(24px, 4.2vw, 40px);
  font-weight: 600;
  line-height: 1.38;
  text-wrap: balance;
}

.current-translation {
  max-width: 680px;
  margin-top: 10px;
  color: rgba(255, 249, 239, 0.6);
  font-size: 14px;
}

.timeline-wrap {
  margin-top: 6px;
}

.timeline {
  --progress: 0%;
  width: 100%;
  height: 5px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  outline: none;
  background: linear-gradient(to right, #e6b86a var(--progress), rgba(255, 255, 255, 0.16) var(--progress));
  cursor: pointer;
}

.timeline::-webkit-slider-thumb {
  width: 15px;
  height: 15px;
  appearance: none;
  border: 3px solid #e6b86a;
  border-radius: 50%;
  background: #fff8ea;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
}

.timeline::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 3px solid #e6b86a;
  border-radius: 50%;
  background: #fff8ea;
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: rgba(255, 249, 239, 0.5);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.player-controls {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.skip-button,
.play-button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.skip-button {
  width: 42px;
  height: 42px;
  color: rgba(255, 249, 239, 0.82);
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 750;
}

.play-button {
  width: 62px;
  height: 62px;
  color: #5d201e;
  background: #f3cf8e;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.skip-button:hover,
.play-button:hover {
  transform: translateY(-2px);
}

.play-icon {
  width: 0;
  height: 0;
  margin-left: 4px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid currentColor;
}

.pause-icon {
  width: 15px;
  height: 18px;
  border-right: 5px solid currentColor;
  border-left: 5px solid currentColor;
}

.speed-control {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 249, 239, 0.54);
  font-size: 11px;
}

.speed-control select {
  padding: 7px 28px 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  color: #fff9ef;
  background: #572220;
}

.transcript-section {
  margin-top: 70px;
}

.transcript-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.transcript-heading h2 {
  margin: 5px 0 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 34px;
  font-weight: 650;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.36);
}

.filter-tabs button {
  padding: 7px 11px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
}

.filter-tabs button.is-active {
  color: #fff;
  background: var(--red);
  box-shadow: 0 4px 12px rgba(165, 49, 47, 0.2);
}

.transcript-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.caption-row {
  display: grid;
  grid-template-columns: 52px 70px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.caption-row:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.38);
}

.caption-row.is-active {
  border-color: rgba(165, 49, 47, 0.24);
  background: rgba(255, 250, 241, 0.9);
  box-shadow: 0 12px 28px rgba(83, 51, 35, 0.08);
  transform: translateX(4px);
}

.caption-time {
  padding-top: 2px;
  color: #9a8d83;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.caption-speaker {
  display: inline-flex;
  justify-content: center;
  padding: 3px 6px;
  border-radius: 6px;
  color: #7a4c28;
  background: #f2e3c8;
  font-size: 10px;
  font-weight: 700;
}

.caption-row.waiter .caption-speaker {
  color: #873b38;
  background: #f3dcd6;
}

.caption-row.customer .caption-speaker {
  color: #2f6660;
  background: #dcebe5;
}

.caption-copy {
  min-width: 0;
}

.caption-copy strong,
.caption-copy small {
  display: block;
}

.caption-copy strong {
  font-family: "Songti SC", "STSong", Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
}

.caption-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

footer {
  margin-top: 42px;
  padding: 26px 0 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(216, 154, 70, 0.55);
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .course-shell {
    width: min(100% - 20px, 1040px);
    padding-top: 18px;
  }

  .site-header {
    padding-bottom: 20px;
  }

  .intro {
    padding: 42px 8px 24px;
  }

  .player-card {
    top: 8px;
    padding: 20px 16px;
    border-radius: 22px;
  }

  .lesson-label {
    max-width: 220px;
  }

  .current-caption {
    min-height: 158px;
    padding: 22px 0 16px;
  }

  .current-caption p {
    font-size: clamp(22px, 7.5vw, 30px);
  }

  .speed-control {
    position: static;
    margin-left: 4px;
  }

  .speed-control > span {
    display: none;
  }

  .transcript-section {
    margin-top: 48px;
  }

  .transcript-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-tabs {
    width: 100%;
  }

  .filter-tabs button {
    flex: 1;
  }

  .caption-row {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 13px 11px;
  }

  .caption-speaker {
    grid-column: 1;
    grid-row: 2;
  }

  .caption-copy {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
