/* 课堂再现：独立板块样式（立体卡片 + 渐变 + 完整响应式） */
:root {
  --cr-radius: 18px;
  --cr-shadow: 0 14px 34px rgba(29, 34, 51, 0.08);
  --cr-shadow-lg: 0 22px 50px rgba(29, 34, 51, 0.14);
}

.cr-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 32px;
  border-radius: 24px;
  color: #fff;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, 0.22), transparent 55%),
    linear-gradient(135deg, #5b5ff0 0%, #7a5cf0 55%, #9a63f0 100%);
  box-shadow: var(--cr-shadow-lg);
  margin-bottom: 22px;
}
.cr-kicker {
  font-size: 12px;
  letter-spacing: 3px;
  opacity: 0.82;
  font-weight: 700;
}
.cr-title {
  margin: 6px 0 8px;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
}
.cr-sub { margin: 0; opacity: 0.9; font-size: 14px; }

.cr-book-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  max-width: 320px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-family: var(--font-sans);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.2s;
}
.cr-book-btn:hover { background: rgba(255, 255, 255, 0.26); transform: translateY(-1px); }
.cr-book-ic, .cr-book-chev { display: inline-flex; width: 20px; height: 20px; flex: 0 0 auto; }
.cr-book-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 14px;
}

/* 单元 tab */
.cr-unit-wrap { margin-bottom: 20px; }
.cr-unit-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}
.cr-unit-tab {
  flex: 0 0 auto;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid #e6e8f2;
  background: #fff;
  color: var(--ink-soft);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(29, 34, 51, 0.04);
  transition: all 0.18s;
}
.cr-unit-tab:hover { border-color: var(--accent); color: var(--accent); }
.cr-unit-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(91, 95, 240, 0.32);
}

/* 章节头 */
.cr-section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.cr-section-head h2 { margin: 0; font-size: 19px; font-weight: 800; color: var(--ink); }
.cr-section-head small { color: #9aa1b5; font-size: 13px; }

/* 章节卡片网格 */
.cr-lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.cr-lesson-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--cr-radius);
  border: 1px solid #eef0f7;
  background: #fff;
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(29, 34, 51, 0.04);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.cr-lesson-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--cr-shadow);
  border-color: var(--accent-soft);
}
.cr-lesson-card.active { border-color: var(--accent); box-shadow: 0 12px 26px rgba(91, 95, 240, 0.2); }
.cr-l-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 13px;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  background: linear-gradient(145deg, #6a6ef2, #8a63f0);
  box-shadow: 0 8px 16px rgba(91, 95, 240, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.cr-l-txt { flex: 1; min-width: 0; }
.cr-l-txt strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cr-l-txt sup { color: #e08a3c; }
.cr-l-play {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  transition: background 0.18s, color 0.18s;
}
.cr-lesson-card:hover .cr-l-play { background: var(--accent); color: #fff; }
.cr-l-play svg { width: 16px; height: 16px; }

/* 播放区 */
.cr-player-area { margin: 22px 0; }
.cr-player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  background: #fff;
  border: 1px solid #eef0f7;
  border-radius: var(--cr-radius);
  padding: 16px;
  box-shadow: var(--cr-shadow);
}
.cr-stage {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #0e1020;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cr-video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.cr-video-lock {
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  padding: 24px;
}
.cr-lock-ic { display: inline-flex; width: 40px; height: 40px; margin-bottom: 10px; }
.cr-video-lock p { margin: 0; font-size: 14px; }

.cr-playlist {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 14px;
  background: #f7f8fc;
  padding: 12px;
  overflow-y: auto;
}
.cr-pl-head { margin-bottom: 10px; }
.cr-pl-head strong { display: block; font-size: 14px; color: var(--ink); }
.cr-pl-head small { color: #9aa1b5; font-size: 12px; }
.cr-pl-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 11px;
  background: transparent;
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s;
}
.cr-pl-item:hover { background: #eceef8; }
.cr-pl-item.active { background: var(--accent-soft); }
.cr-pl-dot { display: inline-flex; width: 26px; height: 26px; flex: 0 0 auto; color: var(--accent); }
.cr-pl-dot svg { width: 100%; height: 100%; }
.cr-pl-name { font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.cr-pl-item.active .cr-pl-name { color: var(--accent); }

/* 状态：空 / 加载 / 错误 */
.cr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 24px;
  background: #fff;
  border-radius: var(--cr-radius);
  border: 1px dashed #dfe3f0;
  color: var(--ink-soft);
}
.cr-empty-ic { width: 42px; height: 42px; color: #9aa1b5; }
.cr-empty p { margin: 0; font-size: 14px; }
.cr-retry {
  padding: 9px 22px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 700;
  cursor: pointer;
}
.cr-loading, .cr-video-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 30px;
  color: var(--ink-soft);
  font-size: 14px;
  background: #fff;
  border-radius: var(--cr-radius);
}
.cr-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: cr-spin 0.8s linear infinite;
}
@keyframes cr-spin { to { transform: rotate(360deg); } }

/* 响应式 */
@media (max-width: 900px) {
  .cr-player-layout { grid-template-columns: 1fr; }
  .cr-playlist { max-height: 240px; }
}
@media (max-width: 640px) {
  .cr-hero { flex-direction: column; align-items: stretch; padding: 24px; gap: 18px; }
  .cr-title { font-size: 25px; }
  .cr-book-btn { max-width: none; }
  .cr-lesson-grid { grid-template-columns: 1fr; gap: 12px; }
  .cr-lesson-card { padding: 14px; }
}

/* ===================================================================
   课堂再现 · 手机端纵向黏土版（≤640px） · .crm- 命名空间
   单元纵向堆叠，章节全部平铺，点章节就地展开播放器
   =================================================================== */
@media (max-width: 640px) {
  #classroom-replay-view {
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 28px;
    background:
      radial-gradient(120% 60% at 85% -5%, rgba(255, 224, 189, .55), transparent 60%),
      radial-gradient(90% 45% at -10% 0%, rgba(214, 234, 255, .5), transparent 55%),
      #F7F2E9;
    color: #2B2620;
  }
  .crm { width: 100%; max-width: 480px; margin: 0 auto; }
  .crm-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
  .crm-back {
    width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center;
    border: none; border-radius: 14px; color: #6F675C; background: #fff;
    box-shadow: 0 6px 16px rgba(168, 143, 104, .16); cursor: pointer;
  }
  .crm-back svg { width: 20px; height: 20px; }
  .crm-title { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .3px; color: #2B2620; }

  .crm-book {
    display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 12px; border-radius: 22px;
    background: linear-gradient(160deg, #FFFDF8, #FFF6E9);
    box-shadow: 0 12px 28px rgba(168, 143, 104, .16), inset 0 1px 0 rgba(255, 255, 255, .9);
  }
  .crm-book-ic { width: 52px; height: 52px; flex: 0 0 52px; object-fit: contain; border-radius: 16px; background: #FDECD9; padding: 6px; }
  .crm-book-tx { flex: 1; min-width: 0; }
  .crm-book-k { display: block; font-size: 11.5px; color: #A79C8C; letter-spacing: .5px; }
  .crm-book-n { display: block; margin-top: 2px; font-size: 15.5px; font-weight: 800; line-height: 1.35; color: #2B2620; overflow-wrap: anywhere; }
  .crm-switch {
    flex: 0 0 auto; padding: 8px 14px; border: none; border-radius: 999px; font-family: inherit;
    font-size: 12.5px; font-weight: 800; color: #8A4B12;
    background: linear-gradient(180deg, #FFD79B, #FFC172);
    box-shadow: 0 6px 14px rgba(240, 160, 70, .32); cursor: pointer;
  }
  .crm-meta { margin: 12px 4px 14px; font-size: 12.5px; color: #A79C8C; letter-spacing: .2px; }

  .crm-unit {
    margin-bottom: 14px; padding: 14px 14px 8px; border-radius: 24px;
    background: rgba(255, 253, 248, .96);
    box-shadow: 0 14px 30px rgba(168, 143, 104, .14), inset 0 1px 0 rgba(255, 255, 255, .9);
  }
  .crm-uhead { display: flex; align-items: center; gap: 10px; padding: 2px 2px 8px; }
  .crm-uno {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: 12px; display: grid; place-items: center;
    font-size: 13px; font-weight: 900; color: #7A3E0B;
    background: radial-gradient(circle at 32% 28%, #FFE3B8, #F8C784);
    box-shadow: 0 5px 12px rgba(219, 156, 76, .3);
  }
  .crm-utx { flex: 1; min-width: 0; }
  .crm-utx h2 { margin: 0; font-size: 15px; font-weight: 800; line-height: 1.35; color: #2B2620; overflow-wrap: anywhere; }
  .crm-umeta { margin: 3px 0 0; font-size: 11.5px; color: #ABA192; }

  .crm-rows { display: flex; flex-direction: column; }
  .crm-row {
    display: flex; align-items: center; gap: 11px; width: 100%; padding: 13px 10px;
    border: none; border-radius: 16px; background: transparent;
    font-family: inherit; text-align: left; cursor: pointer; transition: background .16s;
  }
  .crm-row + .crm-row, .crm-stage + .crm-row { box-shadow: inset 0 1px 0 #F2ECE1; }
  .crm-row:active { background: #FBF3E7; }
  .crm-row.is-open { background: #FBF3E7; }
  .crm-no {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 13px; display: grid; place-items: center;
    font-size: 13px; font-weight: 900; color: #4A3A78;
    background: radial-gradient(circle at 30% 26%, #EDE6FF, #D9CDFF);
    box-shadow: 0 5px 12px rgba(150, 128, 230, .2);
  }
  .crm-tx { flex: 1; min-width: 0; }
  .crm-tx b { display: block; font-size: 14.5px; font-weight: 700; line-height: 1.45; color: #2B2620; overflow-wrap: anywhere; }
  .crm-tx b sup { color: #E08A2E; }
  .crm-tx small { display: block; margin-top: 2px; font-size: 11.5px; color: #A79C8C; }
  .crm-mark {
    width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; display: grid; place-items: center;
    color: #fff; background: linear-gradient(180deg, #FFB25C, #F4913A);
    box-shadow: 0 6px 14px rgba(240, 145, 58, .34);
  }
  .crm-mark svg { width: 18px; height: 18px; }

  .crm-stage {
    margin: 2px 0 10px; padding: 10px; border-radius: 18px;
    background: #FFFDF8; box-shadow: inset 0 0 0 1px #F2E9DA, 0 10px 22px rgba(168, 143, 104, .12);
  }
  .crm-video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 13px; background: #14110D; object-fit: contain; }
  .crm-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
  .crm-chip {
    padding: 7px 12px; border: none; border-radius: 999px; font-family: inherit;
    font-size: 12px; font-weight: 700; color: #7A6E5E; background: #F4EEE4; cursor: pointer;
  }
  .crm-chip.is-on { color: #8A4B12; background: linear-gradient(180deg, #FFEFD6, #FFE0B6); }
  .crm-lock { margin: 8px 2px 2px; font-size: 12.5px; color: #A79C8C; line-height: 1.6; }
  .crm .cr-loading, .crm .cr-empty { border-radius: 20px; background: rgba(255, 253, 248, .96); box-shadow: 0 12px 26px rgba(168, 143, 104, .12); }
}
