/* =============================================================================== */
/* HOME.CSS - 首页个性化样式 (education-design-system.css配套版) */
/* 该文件仅包含与education-design-system.css配套的个性化样式 */
/* 通用样式(颜色、字体、间距、组件等)均从education-design-system.css继承 */
/* 专注于首页特有布局的个性化定制 */
/* =============================================================================== */

/* =============================================================================== */
/* 页面基础样式 */
/* =============================================================================== */

.main-content {
  background-color: var(--bg-color-primary);
}

/* =============================================================================== */
/* 区块通用样式 */
/* =============================================================================== */

/* 区块基础样式 */
.hero-section-wrapper,
.star-teachers-section,
.recommended-courses-section,
.platform-advantages-section,
.student-feedback-section {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 0 var(--space-20) 0;
  transition: background 0.5s ease;
}

/* 区块背景样式 */
.hero-section-wrapper {
  background: url('/static/website/image/bg-1.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.star-teachers-section {
  background: linear-gradient(135deg, var(--neutral-50) 0%, var(--neutral-100) 100%);
}

.recommended-courses-section {
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--white) 100%);
}

.platform-advantages-section {
  background: linear-gradient(135deg, var(--neutral-50) 0%, var(--white) 100%);
}

.student-feedback-section {
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
}

/* 懒加载背景图片 */
.star-teachers-section.lazy-bg,
.recommended-courses-section.lazy-bg,
.platform-advantages-section.lazy-bg,
.student-feedback-section.lazy-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.star-teachers-section.lazy-bg {
  background-image: url('/static/website/image/bg-2.webp');
}

.recommended-courses-section.lazy-bg {
  background-image: url('/static/website/image/bg-3.webp');
}

.platform-advantages-section.lazy-bg {
  background-image: url('/static/website/image/bg-4.webp');
}

.student-feedback-section.lazy-bg {
  background-image: url('/static/website/image/bg-5.webp');
}

/* 文字阴影增强可读性 */
.hero-section-wrapper h1,
.hero-section-wrapper h2,
.hero-section-wrapper h3,
.hero-section-wrapper h4,
.star-teachers-section.lazy-bg h1,
.star-teachers-section.lazy-bg h2,
.star-teachers-section.lazy-bg h3,
.star-teachers-section.lazy-bg h4,
.recommended-courses-section.lazy-bg h1,
.recommended-courses-section.lazy-bg h2,
.recommended-courses-section.lazy-bg h3,
.recommended-courses-section.lazy-bg h4,
.platform-advantages-section.lazy-bg h1,
.platform-advantages-section.lazy-bg h2,
.platform-advantages-section.lazy-bg h3,
.platform-advantages-section.lazy-bg h4,
.student-feedback-section.lazy-bg h1,
.student-feedback-section.lazy-bg h2,
.student-feedback-section.lazy-bg h3,
.student-feedback-section.lazy-bg h4 {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 区块间距 */
.section-meta {
  margin-bottom: var(--space-9);
}

.advantages-wrapper > * {
  margin-bottom: var(--space-12);
}

.advantages-wrapper > *:last-child {
  margin-bottom: 0;
}

/* =============================================================================== */
/* 英雄区块样式 */
/* =============================================================================== */

.hero-section-wrapper {
  min-height: 400px;
}

@media (min-width: 1320px) {
  .hero-section-wrapper {
    min-height: 580px;
  }
}

.hero-section {
  margin-top: var(--space-50);
}

.hero-section h1 {
  font-size: var(--text-6xl);
  color: var(--text-color-brand);
  font-weight: var(--font-weight-bold);
}

.hero-section p {
  font-size: var(--text-base);
  color: var(--text-color-secondary);
  max-width: 60ch;
  margin-bottom: var(--space-9);
}

/* =============================================================================== */
/* 区块标题样式 */
/* =============================================================================== */

.section-title {
  font-weight: var(--font-weight-semibold);
  color: var(--text-color-secondary);
  text-align: center;
  position: relative;
  margin-bottom: var(--space-3);
}

.section-subtitle {
  color: var(--text-color-secondary);
  position: relative;
  margin-bottom: var(--space-3);
}

.section-title-description {
  font-weight: var(--font-weight-light);
  font-size: var(--text-sm);
  color: var(--text-color-tertiary);
  text-align: center;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.section-title-description::before {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(to left, var(--border-color-default), transparent);
}

.section-title-description::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(to right, var(--border-color-default), transparent);
}

/* =============================================================================== */
/* 教师卡片样式 */
/* =============================================================================== */
.star-teachers-section .card {
  border: none;
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
}

.teacher-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--bg-color-secondary);
}

.teacher-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-transform);
  border-radius: 0;
}

.card:hover .teacher-image img {
  transform: scale(1.05);
}

.teacher-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.teacher-info__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
}

.teacher-name {
  font-size: var(--text-lg);
  margin: 0;
}

.teacher-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.tag {
  background-color: var(--bg-color-brand-light);
  color: var(--text-color-brand);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-ty);
  font-weight: var(--font-weight-medium);
}

.teacher-desc {
  font-size: var(--text-sm);
  line-height: var(--line-height-normal);
  flex-grow: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  min-height: calc(var(--text-sm) * 1.6 * 3);
  margin: 0;
  padding: 0;
}

.teacher-time {
  font-size: var(--text-sm);
  color: var(--text-color-tertiary);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.teacher-timeactions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.teacher-actions {
  display: flex;
  justify-content: flex-end;
}

/* =============================================================================== */
/* 推荐课程区块样式 - 轮播图 */
/* =============================================================================== */

.courses-carousel-container {
  overflow: hidden;
  position: relative;
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
}

.courses-carousel-slides-wrapper {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

.courses-carousel-slide {
  flex: 0 0 100%;
  box-sizing: border-box;
  border: none;
}

.course-slide-card {
  display: grid;
  grid-template-columns: 1fr;
  background-color: var(--bg-color-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-base);
  height: 100%;
}

@media (min-width: 768px) {
  .course-slide-card {
    grid-template-columns: 2fr 3fr;
    /* 调整图片和内容的比例 */
    min-height: 380px;
  }
}

.course-slide-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.course-slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-transform);
}

.course-slide-card:hover .course-slide-image img {
  transform: scale(1.05);
}

.course-slide-details {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.course-slide-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-semibold);
  margin: var(--space-2) 0 var(--space-3);
  color: var(--text-color-primary);
}

.course-slide-description {
  font-size: var(--text-base);
  color: var(--text-color-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-6);
}

.course-slide-actions {
  text-align: right;
}

.link-arrow {
  color: var(--text-color-brand);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  transition: var(--transition-color);
}

.link-arrow:hover {
  color: var(--brand-600);
}

.link-arrow::after {
  content: ' →';
  transition: transform 0.2s;
  display: inline-block;
}

.link-arrow:hover::after {
  transform: translateX(4px);
}

.carousel-dots {
  position: absolute;
  bottom: var(--space-4);
  display: flex;
  gap: var(--space-2);
  place-self: center;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--neutral-300);
  cursor: pointer;
  transition: var(--transition-all);
}

.dot.active {
  background-color: var(--neutral-500);
  transform: scale(1.2);
}

/* =============================================================================== */
/* 平台优势区块样式 */
/* =============================================================================== */

.recommended-courses-section .grid-layout-1-2,
.platform-advantages-section .grid-layout-1-2,
.platform-advantages-section .grid-layout-2-1 {
  align-items: center;
}

.advantages-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
  padding: var(--space-5);
}

.advantages-info h3 {
  font-weight: var(--font-weight-semibold);
  color: var(--text-color-primary);
  margin-bottom: var(--space-3);
}

.advantages-info p {
  color: var(--text-color-primary);
  line-height: var(--line-height-relaxed);
}

.advantages-image {
  border: none;
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-base);
}

.advantages-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-top: auto;
}

/* =============================================================================== */
/* 学员反馈区块样式 */
/* =============================================================================== */

.testimonial {
  border:none;
  box-shadow: 0px 4px 20px 0px rgba(0, 0, 0, 0.1);
}

.testimonial .card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.testimonial-avatar {
  width: var(--space-20);
  height: var(--space-20);
  border-radius: 50%;
  margin-bottom: var(--space-3);
  object-fit: cover;
  box-shadow: var(--shadow-base);
  border: 2px solid var(--bg-color-primary);
}

.testimonial-content {
  font-style: italic;
  margin-top: var(--space-3);
  color: var(--text-color-secondary);
  flex-grow: 1;
  position: relative;
  padding: var(--space-3);
}

.testimonial-content::before,
.testimonial-content::after {
  content: '"';
  font-size: var(--text-4xl);
  color: var(--primary-200);
  position: absolute;
  line-height: var(--line-height-none);
  margin-top: auto;
}

.testimonial-content::before {
  top: -0.5rem;
  left: -0.5rem;
}

.testimonial-content::after {
  content: '"';
  bottom: -1.5rem;
  right: -0.5rem;
}

.testimonial-author {
  font-weight: var(--font-weight-semibold);
  color: var(--text-color-secondary);
  margin-top: auto;
}

/* =============================================================================== */
/* 占位符样式覆盖 */
/* =============================================================================== */

.teacher-card .placeholder-image,
.advantages-image.placeholder-image {
  aspect-ratio: 16 / 9;
}

.testimonial .placeholder-avatar {
  width: var(--space-20);
  height: var(--space-20);
  border-radius: 50%;
}

/* =============================================================================== */
/* 响应式优化 */
/* =============================================================================== */

@media (max-width: 768px) {
  .hero-section-wrapper {
    min-height: 300px;
  }
  
  .section-meta {
    margin-bottom: var(--space-7);
  }
  
  .advantages-wrapper > * {
    margin-bottom: var(--space-8);
  }
}

@media (min-width: 1024px) {
  .hero-section-wrapper {
    min-height: 500px;
  }
}

@media (min-width: 1920px) {
  .hero-section-wrapper {
    min-height: 600px;
  }
}

/* =============================================================================== */
/* 性能优化 */
/* =============================================================================== */

/* 硬件加速 */
.hero-section-wrapper,
.star-teachers-section,
.recommended-courses-section,
.platform-advantages-section,
.student-feedback-section,
.teacher-image img,
.commerce-illustration img,
.advantages-image img {
  will-change: transform;
  transform: translateZ(0);
}

/* 图片优化 - 移除不适用于背景图和普通照片的锐化渲染 */
.testimonial-avatar {
  image-rendering: auto; /* 或直接移除 image-rendering 规则 */
}

/* =============================================================================== */
/* 可访问性增强 */
/* =============================================================================== */

/* 焦点可见性 */
.course-card:focus,
.tag:focus {
  outline: 2px solid var(--border-color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-base);
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
  .hero-section-wrapper,
  .star-teachers-section,
  .recommended-courses-section,
  .platform-advantages-section,
  .student-feedback-section,
  .teacher-image img,
  .commerce-illustration img,
  .advantages-image img {
    transition: none !important;
    animation: none !important;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .tag {
    border: 1px solid var(--text-color-brand);
  }
  
  .course-card.active {
    border-left-color: var(--text-color-brand);
  }
}