/* ================================================
   课程详情页（course/detail.html）
   ================================================ */

/* ===== Hero：首页同款深蓝渐变（矮版）===== */
.cd-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #241a52 0%, #5b4fe8 60%, #3b82f6 100%);
  color: #fff;
  padding: 2rem 0 2.5rem;
}

.cd-hero::before,
.cd-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.cd-hero::before {
  width: 420px;
  height: 420px;
  right: -120px;
  top: -180px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
}

.cd-hero::after {
  width: 280px;
  height: 280px;
  left: -100px;
  bottom: -140px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 70%);
}

.cd-hero-inner {
  position: relative;
  z-index: 1;
}

/* 返回链接 */
.cd-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  margin-bottom: 0.875rem;
  transition: color 0.15s;
}

.cd-back:hover {
  color: #fff;
}

/* 标签 */
.cd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.cd-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.cd-tag-accent {
  background: rgba(255, 138, 0, 0.9);
  border-color: rgba(255, 138, 0, 0.9);
}

.cd-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.625rem;
}

.cd-summary {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 1.25rem;
  max-width: 720px;
}

/* 统计栏*/
.cd-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.cd-stat {
  display: flex;
  flex-direction: column;
}

.cd-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.cd-stat-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.125rem;
}

.cd-score-star {
  color: #ffe484;
}

/* ===== 右侧学习卡片 ===== */
.cd-study-card {
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(36, 26, 82, 0.32);
}

.cd-study-cover {
  position: relative;
  height: 168px;
  background: var(--bg-muted);
  overflow: hidden;
}

.cd-study-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cd-study-body {
  padding: 1.125rem 1.25rem 1.25rem;
}

.cd-study-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  margin-bottom: 0.5rem;
}

.cd-study-progress .label {
  color: var(--text-muted);
}

.cd-study-progress .value {
  color: #5b4fe8;
  font-weight: 700;
}

.cd-btn-study {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.875rem;
  padding: 0.6875rem 1rem;
  border-radius: 0.5rem;
  background: linear-gradient(135deg, #5b4fe8 0%, #4438c8 100%);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  transition: all 0.2s;
}

.cd-btn-study:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(91, 79, 232, 0.32);
}

.cd-study-tip {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ===== 主体区块 ===== */
.cd-main {
  padding: 2.25rem 0 3rem;
}

.cd-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 0.875rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.cd-card-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.cd-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.125rem;
}

.cd-intro {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: #5b5573;
  margin: 0;
  white-space: pre-wrap;
}

/* ===== 课程大纲 ===== */
.cd-chapter {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9375rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.cd-chapter:hover {
  background: #f5f3ff;
  border-color: rgba(91, 79, 232, 0.25);
}

.cd-chapter-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-muted);
  color: #5b4fe8;
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.cd-chapter:hover .cd-chapter-num {
  background: #5b4fe8;
  color: #fff;
}

.cd-chapter-info {
  flex: 1;
  min-width: 0;
}

.cd-chapter-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cd-chapter:hover .cd-chapter-title {
  color: #5b4fe8;
}

.cd-chapter-intro {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cd-chapter-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.cd-chapter-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.cd-chapter-play {
  color: #5b4fe8;
  display: flex;
  align-items: center;
}

/* ===== 侧栏 ===== */
.cd-side {
  position: sticky;
  top: 72px;
}

.cd-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border-color);
}

.cd-info-row:last-child {
  border-bottom: none;
}

.cd-info-row .label {
  color: var(--text-muted);
}

.cd-info-row .value {
  font-weight: 600;
  color: var(--text-primary);
}

/* 讲师 */
.cd-teacher-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0;
}

.cd-teacher-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-muted);
  flex-shrink: 0;
}

.cd-teacher-avatar-fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cd-teacher-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cd-teacher-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
}

/* 奖励卡片 */
.cd-reward {
  background: linear-gradient(135deg, #f5f3ff 0%, #ece9ff 100%);
  border: 1px solid rgba(91, 79, 232, 0.18);
  border-radius: 0.875rem;
  padding: 1.25rem;
}

/* ===== 相关课程 ===== */
.cd-relate-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.2s;
  height: 100%;
}

.cd-relate-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(36, 26, 82, 0.1);
}

.cd-relate-cover {
  height: 120px;
  background: var(--bg-muted);
  overflow: hidden;
}

.cd-relate-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cd-relate-body {
  padding: 0.75rem 0.875rem 0.875rem;
}

.cd-relate-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.cd-relate-meta {
  font-size: 0.6875rem;
  color: var(--text-muted);
  margin-top: 0.375rem;
}

/* ===== 空状态===== */
.cd-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  background: #fff;
  border: 1px dashed var(--border-color);
  border-radius: 0.75rem;
}

/* ===== 响应式===== */
@media (max-width: 991.98px) {
  .cd-title {
    font-size: 1.5rem;
  }

  .cd-stats {
    gap: 1.25rem;
  }

  .cd-side {
    position: static;
  }
}

@media (max-width: 575.98px) {
  .cd-title {
    font-size: 1.25rem;
  }

  .cd-card {
    padding: 1.125rem;
  }

  .cd-chapter {
    padding: 0.75rem;
    gap: 0.75rem;
  }

  .cd-chapter-intro {
    display: none;
  }
}
