/* ============================================================
   YooMooc 优慕课 - 自定义主题样式
   参考: 智慧树、学堂在线、中国大学MOOC
   ============================================================ */

/* ---- 全局配色 ---- */
:root {
  --ym-primary: #1890ff;
  --ym-primary-dark: #096dd9;
  --ym-accent: #52c41a;
  --ym-accent-dark: #389e0d;
  --ym-text: #1f1f1f;
  --ym-text-secondary: #595959;
  --ym-text-light: #8c8c8c;
  --ym-bg: #f0f2f5;
  --ym-card-bg: #ffffff;
  --ym-border: #e8e8e8;
  --ym-radius: 8px;
  --ym-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --ym-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ---- 重置默认 ---- */
body.view-home .window-wrap {
  background: #f5f7fa !important;
}

body.view-home .content-wrapper {
  background: #f5f7fa !important;
  padding-bottom: 0 !important;
}

/* ---- Hero 区域 ---- */
.heading-group {
  background: linear-gradient(135deg, #1890ff 0%, #36cfc9 100%);
  padding: 0 0 30px 0 !important;
  margin-bottom: 0 !important;
  border-radius: 0 !important;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.heading-group::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.3;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 50px 20px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-brand img {
  max-height: 60px;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.2));
}

.hero-brand h1 {
  color: #ffffff !important;
  font-size: 42px !important;
  font-weight: 700 !important;
  margin-bottom: 12px !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.hero-subtitle {
  color: rgba(255,255,255,0.92) !important;
  font-size: 18px !important;
  margin-bottom: 6px !important;
}

.hero-slogan {
  color: rgba(255,255,255,0.75) !important;
  font-size: 15px !important;
  letter-spacing: 3px;
  margin-bottom: 24px !important;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 10px;
}

.hero-cta .btn-primary,
.hero-cta .btn-secondary {
  display: inline-block;
  padding: 12px 32px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.hero-cta .btn-primary {
  background: #ffffff;
  color: #1890ff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.hero-cta .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.hero-cta .btn-secondary {
  background: transparent;
  color: #ffffff;
  border: 2px solid rgba(255,255,255,0.6);
}

.hero-cta .btn-secondary:hover {
  background: rgba(255,255,255,0.15);
  border-color: #ffffff;
}

/* ---- 课程分类导航 ---- */
.category-nav-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 20px 0;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.category-nav-bar a {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  background: rgba(255,255,255,0.12);
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,0.2);
}

.category-nav-bar a:hover,
.category-nav-bar a.active {
  background: rgba(255,255,255,0.9);
  color: #1890ff;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ---- 统计栏 ---- */
.ym-stats-bar {
  background: #ffffff;
  border-bottom: 1px solid var(--ym-border);
  padding: 32px 20px;
}

.stats-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: #1890ff;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: #8c8c8c;
}

/* ---- 特色功能区 ---- */
.ym-features-section {
  background: #f5f7fa;
  padding: 56px 20px;
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: #1f1f1f;
  margin-bottom: 40px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-card {
  background: #ffffff;
  border-radius: var(--ym-radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--ym-shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--ym-border);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--ym-shadow-hover);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

.icon-ai { background: linear-gradient(135deg, #722ed1, #b37feb); }
.icon-exam { background: linear-gradient(135deg, #fa8c16, #ffc53d); }
.icon-cert { background: linear-gradient(135deg, #f5222d, #ff7875); }
.icon-data { background: linear-gradient(135deg, #13c2c2, #5cdbd3); }

.feature-card h3 {
  font-size: 18px;
  font-weight: 600;
  color: #1f1f1f;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 14px;
  color: #8c8c8c;
  line-height: 1.6;
  margin: 0;
}

/* ============================================================
   课程列表样式 (覆盖 Open edX 默认)
   ============================================================ */

/* 课程列表区域标题 */
.courses-container .courses {
  padding: 40px 0 !important;
  max-width: 1200px;
  margin: 0 auto;
}

.courses-container .courses > header {
  border-bottom: none !important;
  margin-bottom: 24px !important;
}

.courses-container .courses > header h2 {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: #1f1f1f !important;
  padding: 0 20px !important;
}

/* 课程列表网格 */
.courses-listing {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 24px !important;
  list-style: none !important;
  padding: 0 20px !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
}

.courses-listing-item {
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  display: block !important;
}

/* 课程卡片 */
.courses-listing-item .course {
  background: #ffffff !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
  transition: all 0.3s ease !important;
  border: 1px solid #e8e8e8 !important;
  height: 100% !important;
}

.courses-listing-item .course:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 12px 32px rgba(0,0,0,0.12) !important;
}

/* 课程封面图 */
.courses-listing-item .course-image .cover-image {
  height: 160px !important;
  background: linear-gradient(135deg, #e6f7ff, #f0f5ff) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.courses-listing-item .course-image .cover-image img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

/* 课程信息区 */
.courses-listing-item .course-info {
  padding: 16px 20px 20px !important;
  background: #ffffff !important;
}

.courses-listing-item .course-title {
  font-size: 16px !important;
  font-weight: 600 !important;
  color: #1f1f1f !important;
  line-height: 1.5 !important;
  margin-bottom: 8px !important;
  height: auto !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
}

.courses-listing-item .course-title a {
  color: #1f1f1f !important;
  text-decoration: none !important;
}

.courses-listing-item .course-title a:hover {
  color: #1890ff !important;
}

.courses-listing-item .course-organization {
  font-size: 13px !important;
  color: #8c8c8c !important;
  margin-bottom: 6px !important;
}

.courses-listing-item .course-date {
  font-size: 12px !important;
  color: #bfbfbf !important;
}

/* 课程标签 */
.courses-listing-item .course-status {
  display: inline-block !important;
  padding: 2px 8px !important;
  border-radius: 4px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  margin-bottom: 8px !important;
}

.courses-listing-item .course-status-verified {
  background: #e6f7ff !important;
  color: #1890ff !important;
}

/* ============================================================
   页脚样式
   ============================================================ */
.wrapper-footer {
  background: #1f1f1f !important;
  border-top: none !important;
  padding: 40px 20px 20px !important;
  margin-top: 0 !important;
}

.wrapper-footer footer {
  max-width: 1200px !important;
  margin: 0 auto !important;
}

.wrapper-footer .copyright {
  text-align: center !important;
  color: #8c8c8c !important;
  font-size: 13px !important;
  margin-top: 20px !important;
  padding-top: 20px !important;
  border-top: 1px solid #333 !important;
}

.wrapper-footer .copyright a {
  color: #8c8c8c !important;
  text-decoration: none !important;
}

.wrapper-footer .copyright a:hover {
  color: #1890ff !important;
}

/* ============================================================
   响应式适配
   ============================================================ */
@media (max-width: 1024px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .courses-listing {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .hero-brand h1 {
    font-size: 28px !important;
  }
  .hero-cta {
    flex-direction: column;
    align-items: center;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .courses-listing {
    grid-template-columns: 1fr !important;
  }
  .category-nav-bar a {
    padding: 6px 14px;
    font-size: 13px;
  }
}

/* ============================================================
   导航栏微调
   ============================================================ */
.global-header .main-header {
  box-shadow: 0 1px 4px rgba(0,0,0,0.08) !important;
}

.global-header .nav-links .main .nav-tab a {
  font-weight: 500 !important;
  color: #595959 !important;
}

.global-header .nav-links .main .nav-tab a:hover {
  color: #1890ff !important;
}

/* 搜索框 */
.home .search-bar .search-button {
  background: #1890ff !important;
  border-color: #1890ff !important;
}

.home .search-bar .search-button:hover {
  background: #096dd9 !important;
}
