:root {
  --ink: #10231f;
  --muted: #62746e;
  --line: #d9e4df;
  --paper: #f7faf8;
  --white: #ffffff;
  --jade: #1e7a63;
  --jade-dark: #0f3c32;
  --mint: #dff3ee;
  --cinnabar: #b84235;
  --cinnabar-soft: #fbe9e5;
  --gold: #d0aa58;
  --shadow: 0 18px 55px rgba(16, 35, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  line-height: 1.5;
}

button,
a {
  font: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 54px);
  border-bottom: 1px solid rgba(217, 228, 223, 0.86);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(30, 122, 99, 0.95), rgba(184, 66, 53, 0.86)),
    var(--jade);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  flex: 0 0 auto;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  line-height: 1.2;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.nav-links a {
  padding: 8px 10px;
  border-radius: 8px;
}

.nav-links a:hover {
  background: var(--mint);
  color: var(--jade-dark);
}

.wechat-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(208, 170, 88, 0.28);
  background: #fff9e9;
  color: #654d1a;
  font-size: 14px;
}

.wechat-banner strong {
  color: var(--cinnabar);
  white-space: nowrap;
}

.wechat-banner span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.studio-band {
  min-height: 620px;
  padding: clamp(22px, 4vw, 52px);
  background:
    linear-gradient(90deg, rgba(13, 35, 30, 0.94), rgba(13, 35, 30, 0.72)),
    url("./assets/course-cover.png") center / cover;
}

.studio-shell {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: stretch;
}

.player-panel,
.side-panel,
.lesson-detail,
.playlist-panel,
.support-panel {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.player-panel {
  overflow: hidden;
  background: #0e1f1b;
  color: var(--white);
}

.stage-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  color: rgba(255, 255, 255, 0.78);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--cinnabar-soft);
  color: var(--cinnabar);
  font-size: 13px;
  font-weight: 700;
}

.status-pill.light {
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
}

.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 320px;
  background: #0b1412;
}

.player-frame iframe,
.player-frame video {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
}

.player-frame video {
  cursor: pointer;
}

.video-placeholder {
  display: flex;
  align-items: end;
  width: 100%;
  height: 100%;
  min-height: 320px;
  background-position: center;
  background-size: cover;
}

.placeholder-content {
  width: min(100%, 760px);
  padding: clamp(22px, 4vw, 42px);
}

.placeholder-content h2 {
  margin: 14px 0 10px;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.08;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.placeholder-content p {
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  overflow-wrap: anywhere;
}

.player-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--jade);
  border-radius: 8px;
  background: var(--jade);
  color: var(--white);
  cursor: pointer;
  font-weight: 700;
}

.action-button:hover {
  filter: brightness(1.05);
}

.action-button.secondary {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
}

.hidden {
  display: none !important;
}

.side-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.teacher-block {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 13px;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.teacher-block img {
  width: 66px;
  height: 66px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--mint);
}

.teacher-block h2,
.section-heading h2,
.lesson-detail h1 {
  margin: 0;
  letter-spacing: 0;
}

.teacher-block h2 {
  font-size: 20px;
}

.teacher-block p:last-child {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.kicker {
  margin: 0 0 6px;
  color: var(--cinnabar);
  font-size: 13px;
  font-weight: 800;
}

.notice-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.notice-list li {
  padding: 12px;
  border-radius: 8px;
  background: #f3f8f5;
  color: var(--muted);
  font-size: 14px;
}

.course-band,
.resource-band {
  padding: clamp(28px, 5vw, 62px) clamp(18px, 4vw, 54px);
}

.course-grid,
.resource-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.lesson-detail,
.playlist-panel,
.support-panel,
.resource-grid > section:first-child {
  padding: clamp(20px, 3vw, 30px);
}

.resource-grid > section:first-child {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.lesson-detail h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.lesson-intro {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.lesson-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 22px 0 28px;
}

.fact-chip {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--muted);
  font-size: 14px;
}

.agenda-wrap {
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.agenda-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding-left: 22px;
}

.agenda-list li {
  padding-left: 5px;
  color: #31443f;
}

.lesson-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.lesson-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  padding: 14px;
  text-align: left;
}

.lesson-card:hover,
.lesson-card.active {
  border-color: rgba(30, 122, 99, 0.5);
  background: #f1faf6;
}

.lesson-card.active {
  box-shadow: inset 4px 0 0 var(--jade);
}

.lesson-card-top,
.lesson-card-title,
.lesson-card-meta {
  display: block;
}

.lesson-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--cinnabar);
  font-size: 13px;
  font-weight: 800;
}

.lesson-card-title {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.lesson-card-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.resource-item {
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

a.resource-item:hover {
  border-color: rgba(184, 66, 53, 0.45);
  background: var(--cinnabar-soft);
}

.resource-item strong,
.resource-item span {
  display: block;
}

.resource-item strong {
  font-size: 17px;
}

.resource-item span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.support-list {
  margin: 18px 0 0;
}

.support-list div {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.support-list dt {
  color: var(--muted);
}

.support-list dd {
  margin: 0;
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mobile-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 25;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -12px 36px rgba(16, 35, 31, 0.12);
  backdrop-filter: blur(14px);
}

.mobile-action-bar a,
.mobile-action-bar button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid var(--jade);
  cursor: pointer;
  font-weight: 800;
  text-align: center;
}

.mobile-action-bar a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--jade);
  color: var(--white);
}

.mobile-action-bar button {
  background: var(--white);
  color: var(--jade-dark);
}

.copy-fallback {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(16, 35, 31, 0.5);
}

.copy-fallback-card {
  position: relative;
  width: min(100%, 440px);
  padding: 24px;
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.copy-fallback-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
  line-height: 1.2;
}

.copy-fallback-card input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #f8fbf9;
  font-size: 15px;
}

.copy-fallback-card p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.copy-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

@media (max-width: 980px) {
  .studio-shell,
  .course-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .studio-band {
    min-height: auto;
  }

  .side-panel {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

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

  .nav-links a {
    padding: 8px 6px;
    text-align: center;
  }

  .wechat-banner {
    align-items: flex-start;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.45;
  }

  .studio-band,
  .course-band,
  .resource-band {
    padding-left: 14px;
    padding-right: 14px;
  }

  .stage-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .player-frame,
  .video-placeholder {
    min-height: 260px;
  }

  .placeholder-content {
    width: 100%;
    padding: 22px 18px;
  }

  .placeholder-content h2 {
    font-size: clamp(25px, 7vw, 30px);
    line-height: 1.16;
    max-width: 300px;
    word-break: break-all;
  }

  .placeholder-content p {
    max-width: 310px;
    font-size: 16px;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .resource-list {
    grid-template-columns: 1fr;
  }

  .action-button {
    width: 100%;
  }

  .copy-fallback {
    padding: 14px 14px calc(90px + env(safe-area-inset-bottom));
  }
}
