@layer utilities {
  /* 原有的工具类样式 */
  .content-auto {
    content-visibility: auto;
  }

  .text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  }

  .hover-scale {
    transition: transform 0.3s ease;
  }

  .hover-scale:hover {
    transform: scale(1.03);
  }

  .card-shadow {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
      0 4px 6px -2px rgba(0, 0, 0, 0.05);
  }
}



.popup {
  /* 原有的弹窗样式 */
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.popup.active {
  display: block;
  opacity: 1;
}

.popup-content {
  /* 原有的弹窗内容样式 */
  background-color: #fefefe;
  margin: 10% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 500px;
  border-radius: 10px;
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.popup.active .popup-content {
  transform: translateY(0);
}

.popup-close {
  /* 原有的弹窗关闭按钮样式 */
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s ease;
}

.popup-close:hover,
.popup-close:focus {
  color: #000;
  text-decoration: none;
}

.popup-header {
  /* 原有的弹窗头部样式 */
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}

.popup-title {
  /* 原有的弹窗标题样式 */
  margin: 0;
  font-size: 20px;
  font-weight: bold;
}

.popup-image {
  /* 原有的弹窗图片样式 */
  width: 100%;
  height: auto;
  margin: 15px 0;
  border-radius: 5px;
}

.popup-message {
  /* 原有的弹窗消息样式 */
  margin: 15px 0;
  line-height: 1.5;
}

/* 图片切换容器样式 */
.image-slider-1,
.image-slider-2 {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 0 0 1rem 1rem;
  background-color: white;
  padding: 0.75rem;
  /* 添加临时高度，直到图片加载完成 */
  min-height: 200px;
}

/* 为 slider-1 设置特定高度 */
.slider-1 {
  height: 300px; /* 你可以根据需要调整高度 */
}

/* 为 slider-2 设置特定高度 */
.slider-2 {
  height: 600px; /* 你可以根据需要调整高度 */
}

.image-slider-1 img,
.image-slider-2 img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1.1);
  width: auto;
  height: auto;
  max-width: calc(100% - 1.5rem);
  max-height: calc(100% - 1.5rem);
  object-fit: contain;
  opacity: 0;
  transition: opacity 1s ease, transform 1s ease;
  border-radius: 0.75rem;
}

.image-slider-1 img.active,
.image-slider-2 img.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}



/* 图片加载完成后调整容器高度 */
.image-slider-1.loaded,
.image-slider-2.loaded {
  min-height: 0;
}

/* 新增按钮样式 */
.image-slider-1 .slider-button,
.image-slider-2 .slider-button {
  /* 原有的滑块按钮样式 */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s ease;
  border-radius: 9999px;
  /* 按钮圆角 */
}

.image-slider-1 .slider-button.prev,
.image-slider-2 .slider-button.prev {
  left: 1.5rem;
  /* 按钮位置调整 */
}

.image-slider-1 .slider-button.next,
.image-slider-2 .slider-button.next {
  right: 1.5rem;
  /* 按钮位置调整 */
}

.image-slider-1 .slider-button:hover,
.image-slider-2 .slider-button:hover {
  background-color: rgba(0, 0, 0, 0.8);
}




/* 新增按钮样式 */
.slider-button {
  /* 原有的滑块按钮样式 */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s ease;
  border-radius: 9999px;
  /* 按钮圆角 */
}

.slider-button.prev {
  left: 1.5rem;
  /* 按钮位置调整 */
}

.slider-button.next {
  right: 1.5rem;
  /* 按钮位置调整 */
}

.slider-button:hover {
  background-color: rgba(0, 0, 0, 0.8);
}



/* 新增按钮样式 */
.slider-button {
  /* 原有的滑块按钮样式 */
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s ease;
  border-radius: 9999px;
  /* 按钮圆角 */
}

.slider-button.prev {
  left: 1.5rem;
  /* 按钮位置调整 */
}

.slider-button.next {
  right: 1.5rem;
  /* 按钮位置调整 */
}

.slider-button:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* 专家建议图片样式 */
.expert-image {
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
}

.expert-image:hover {
  transform: scale(1.1);
}

/* 增强移动端适配 */
@media (max-width: 768px) {
  /* 使用更具体的选择器 */
  .flex.flex-col.md:flex-row.items-start.md:items-center.gap-6 .w-24.h-24.rounded-full.overflow-hidden.shadow-lg.flex-shrink-0 {
    margin: 0 auto;
    display: flex;
    justify-content: center;
  }
  
  /* 备选方案：直接针对图片容器 */
  .rounded-full.overflow-hidden {
    margin-left: auto !important;
    margin-right: auto !important;
  }
  
  /* 如果上面的选择器不匹配，尝试更通用的方案 */
  .expert-image-container {
    display: flex;
    justify-content: center;
  }
}

/* 视频容器样式 */
.video-container {
  /* 原有的视频容器样式 */
  position: relative;
  border-radius: 0 0 1rem 1rem; /* 修改圆角，上左和上右为 0，下左和下右为 1rem */
  overflow: hidden;
  padding: 0.75rem;
  background-color: white;
  cursor: pointer;
  aspect-ratio: 16/9; /* 添加固定的宽高比，保持一致的高度 */
}

/* 视频样式 */
.video-container video {
  /* 原有的视频样式 */
  width: 100%;
  height: 100%;
  object-fit: cover; /* 确保视频填满容器 */
  border-radius: 0.75rem;
}

/* 播放按钮样式 */
.play-button {
  /* 原有的播放按钮样式 */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 60px; /* 设置固定的宽度 */
  height: 60px; /* 设置固定的高度，确保是圆形 */
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  z-index: 10;
  transition: background-color 0.3s ease, opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1; /* 默认显示 */
}

.play-button.hidden {
  opacity: 0; /* 隐藏时完全透明 */
  pointer-events: none; /* 隐藏时不响应点击 */
}

/* 媒体查询，针对小屏幕设备（手机） */
@media (max-width: 768px) {
  .flex.flex-col.md:flex-row.items-start.md:items-center.gap-6 .w-24.h-24.rounded-full.overflow-hidden.shadow-lg.flex-shrink-0 {
    margin: 0 auto; /* 水平居中 */
  }
}

/* 图片轮播组件样式 */
.image-slider-3 {
  position: relative;
  width: 100%;
  margin: 2rem 0;
  overflow: hidden;
  aspect-ratio: 25/9;
  background-color: #f8fafc;
  border-radius: 1rem;
  padding: 0.75rem 2rem; /* 修改为上下0.75rem，左右2rem（可根据需要调整） */
}

.image-slider-3 img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
  border-radius: 0.75rem;
  padding: 0; /* 保持图片内边距为0 */
}

.image-slider-3 img.active {
  opacity: 1;
}

/* 轮播控制按钮样式 */
.image-slider-3 .slider-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: background-color 0.3s ease;
}

.image-slider-3 .slider-button:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.image-slider-3 .slider-button.prev {
  left: 1rem;
}

.image-slider-3 .slider-button.next {
  right: 1rem;
}

/* 按钮图标样式 */
.image-slider-3 .slider-button i {
  font-size: 1.25rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .image-slider-3 {
    /* 移除固定的宽高比 */
    /* aspect-ratio: 4/3; */
    border-radius: 0.5rem; /* 减小容器圆角 */
    padding: 0; /* 移除容器内边距 */
    background-color: #f8fafc;
    position: relative;
    min-height: 150px; /* 适当减小最小高度 */
  }
  
  .image-slider-3 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.5rem; /* 保持与容器相同的圆角 */
    padding: 0; /* 确保没有内边距 */
    background-color: transparent; /* 移除背景色，让图片完全显示 */
    opacity: 0;
    transition: opacity 1s ease;
  }
  
  .image-slider-3 img.active {
    opacity: 1;
  }
  
  .image-slider-3 .slider-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    background-color: rgba(255, 255, 255, 0.7); /* 添加半透明背景 */
    border-radius: 50%; /* 使按钮变为圆形 */
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    z-index: 10; /* 确保按钮在图片上方 */
  }
  
  .image-slider-3 .slider-button.prev {
    left: 0.5rem; /* 微调左侧按钮位置 */
  }
  
  .image-slider-3 .slider-button.next {
    right: 0.5rem; /* 微调右侧按钮位置 */
  }
  
  .image-slider-3 .slider-button i {
    font-size: 1rem;
    color: #333;
  }
  
  /* 为容器添加高度控制 */
  .image-slider-3::before {
    content: "";
    display: block;
    padding-top: 75%; /* 保持宽高比，可根据图片调整 */
  }
}

