/* 轮播图组件样式 */

.hero-section {
  display: flex;
  gap: 20px;
  margin: 20px 0;
  padding: 0 20px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.carousel-container {
  flex: 2;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  background: #fff;
  transition: all 0.3s ease;
  /* 确保桌面端高度正确 */
  height: 400px;
  min-height: 400px;
}

.carousel-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  /* 确保完全填充容器 */
  height: 100%;
  min-height: 100%;
}

.carousel-slides {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease-in-out;
  user-select: none; /* 防止文本被选中 */
  -webkit-user-select: none; /* Safari支持 */
  -moz-user-select: none; /* Firefox支持 */
  -ms-user-select: none; /* IE支持 */
}

.carousel-slide {
  min-width: 100%;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  /* 确保完全填充 */
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  /* 确保完全填充 */
  flex: 1;
  min-height: 100%;
  object-position: center;
}

.carousel-slide:hover img {
  transform: scale(1.05);
}

.carousel-slide-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 20px;
  /* 移除 transform: translateY(100%); 让文字一直显示 */
  transition: transform 0.3s ease;
}



.carousel-slide-overlay h3 {
  margin: 0 0 10px 0;
  font-size: 1.5rem;
  font-weight: 600;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  font-family: 'Noto Serif SC', serif;
}

.carousel-slide-overlay p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
  line-height: 1.4;
  font-family: 'Noto Serif SC', serif;
}

.carousel-controls {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  pointer-events: none;
}

.carousel-btn {
  width: 50px;
  height: 50px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  color: #2c3e50;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  font-weight: bold;
  transition: all 0.3s ease;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
  user-select: none; /* 防止文本被选中 */
  -webkit-user-select: none; /* Safari支持 */
  -moz-user-select: none; /* Firefox支持 */
  -ms-user-select: none; /* IE支持 */
}

.carousel-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 50%;
}

.carousel-btn:hover::before {
  opacity: 1;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
  box-shadow: 
    0 6px 20px rgba(52, 152, 219, 0.25),
    0 3px 8px rgba(0, 0, 0, 0.12),
    inset 0 2px 2px rgba(255, 255, 255, 0.2);
  color: #3498db;
  border-color: rgba(52, 152, 219, 0.4);
}

.carousel-btn:active {
  transform: scale(0.95);
  box-shadow: 
    0 2px 8px rgba(52, 152, 219, 0.3),
    0 1px 4px rgba(0, 0, 0, 0.15);
}

.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.carousel-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.carousel-indicator::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.2), rgba(41, 128, 185, 0.2));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 50%;
}

.carousel-indicator:hover::before {
  opacity: 1;
}

.carousel-indicator:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.2);
  box-shadow: 
    0 3px 8px rgba(52, 152, 219, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
  border-color: rgba(52, 152, 219, 0.5);
}

.carousel-indicator.active {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.3);
  box-shadow: 
    0 0 12px rgba(52, 152, 219, 0.6),
    0 2px 6px rgba(0, 0, 0, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.4);
  border-color: rgba(52, 152, 219, 0.8);
  border-width: 3px;
}

.carousel-indicator.active::before {
  opacity: 1;
  background: linear-gradient(135deg, rgba(52, 152, 219, 0.4), rgba(41, 128, 185, 0.4));
}

/* 700px时，“轮播图”会和“文章索引”分行 */

/* 响应式设计 */
@media (max-width: 700px) {
  .hero-section {
    flex-direction: column;
  }
  
  .carousel-container {
    flex: none;
  }
}

@media (max-width: 768px) {
  .carousel-container {
    /* 移动端设置固定高度 */
    height: 300px;
    min-height: 300px;
  }
  
  .carousel-wrapper {
    height: 300px;
    /* 移动端保持原有高度 */
    min-height: 300px;
  }
  
  .carousel-controls {
    padding: 0 10px;
  }
  
  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    box-shadow: 
      0 3px 8px rgba(0, 0, 0, 0.12),
      0 1px 3px rgba(0, 0, 0, 0.06),
      inset 0 1px 1px rgba(255, 255, 255, 0.1);
  }
  
  .carousel-btn:hover {
    transform: scale(1.05);
    box-shadow: 
      0 4px 12px rgba(52, 152, 219, 0.2),
      0 2px 6px rgba(0, 0, 0, 0.1),
      inset 0 1px 1px rgba(255, 255, 255, 0.15);
  }
  
  .carousel-indicator {
    width: 10px;
    height: 10px;
    border-width: 1.5px;
  }
  
  .carousel-indicator:hover {
    transform: scale(1.1);
  }
  
  .carousel-indicator.active {
    transform: scale(1.2);
    border-width: 2px;
  }
}

@media (max-width: 480px) {
  .carousel-container {
    /* 小屏幕设置固定高度 */
    height: 250px;
    min-height: 250px;
  }
  
  .carousel-wrapper {
    height: 250px;
    /* 小屏幕保持原有高度 */
    min-height: 250px;
  }
  
  .carousel-btn {
    width: 35px;
    height: 35px;
    font-size: 1rem;
    box-shadow: 
      0 2px 6px rgba(0, 0, 0, 0.1),
      0 1px 2px rgba(0, 0, 0, 0.05),
      inset 0 1px 1px rgba(255, 255, 255, 0.1);
  }
  
  .carousel-btn:hover {
    transform: scale(1.03);
    box-shadow: 
      0 3px 8px rgba(52, 152, 219, 0.15),
      0 1px 3px rgba(0, 0, 0, 0.08),
      inset 0 1px 1px rgba(255, 255, 255, 0.12);
  }
  
  .carousel-indicator {
    width: 8px;
    height: 8px;
    border-width: 1px;
  }
  
  .carousel-indicator:hover {
    transform: scale(1.05);
  }
  
  .carousel-indicator.active {
    transform: scale(1.1);
    border-width: 1.5px;
  }
  
  .carousel-slide-overlay h3 {
    font-size: 1.2rem;
  }
  
  .carousel-slide-overlay p {
    font-size: 0.8rem;
  }
} 