/* Bulma Hero轮播图样式 */

/* 为固定导航栏留出空间 */
body {
  padding-top: 80px !important;
}

/* 基础Hero样式 */
.custom-banner {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 500px !important;
  min-height: 500px !important;
  max-height: 500px !important;
  transition: all 0.3s ease-in-out;
}

/* 添加暗色遮罩 */
.custom-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

/* 确保内容在遮罩之上 - 使用更具体的选择器 */
.custom-banner.hero .hero-body {
  position: relative !important;
  z-index: 2 !important;
  height: 500px !important;
  min-height: 500px !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 强制容器垂直居中 - 使用绝对定位 */
.custom-banner.hero .hero-body .container {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: calc(100% - 2rem) !important;
  min-height: 200px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  max-width: none !important; /* 覆盖index.css的max-width */
  padding: 0 1rem !important;
  margin: 0 !important;
}

/* 覆盖title样式 */
.custom-banner.hero .hero-body .title {
  color: white !important;
  margin: 0 0 1rem 0 !important;
  line-height: 1.2 !important;
}

/* 增强文字阴影 */
.custom-banner .title,
.custom-banner .subtitle,
.custom-banner p {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* 增大标题和副标题的行距 - 保持垂直居中 */
.custom-banner .title {
  line-height: 1.4 !important;
  margin: 0 0 1rem 0 !important;
}

.custom-banner .subtitle {
  line-height: 1.5 !important;
  margin: 0 0 0.8rem 0 !important;
}

.custom-banner p {
  line-height: 1.4 !important;
  margin: 0 !important;
}

/* 轮播控制按钮样式 */
.banner-controls {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 3;
  pointer-events: none;
}

.banner-controls .button {
  pointer-events: auto;
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  transition: all 0.3s ease;
}

.banner-controls .button:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
}

/* 轮播指示器样式 */
.banner-indicators {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 3;
}

.indicator-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator-dot.is-active {
  background-color: white;
  transform: scale(1.2);
}

.indicator-dot:hover {
  background-color: rgba(255, 255, 255, 0.8);
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
  .custom-banner {
    height: 350px !important;
    min-height: 350px !important;
    max-height: 350px !important;
  }
  
  .custom-banner.hero .hero-body {
    height: 350px !important;
    min-height: 350px !important;
  }
  
  .custom-banner .title {
    font-size: 1.75rem !important;
    line-height: 1.4 !important;
    margin: 0 0 0.8rem 0 !important;
  }
  
  .custom-banner .subtitle {
    font-size: 1.25rem !important;
    line-height: 1.5 !important;
    margin: 0 0 0.6rem 0 !important;
  }
  
  .custom-banner p {
    line-height: 1.4 !important;
    margin: 0 !important;
  }
  
  .banner-controls {
    padding: 0 1rem;
  }
  
  .banner-controls .button {
    width: 2.5rem;
    height: 2.5rem;
  }
}

@media screen and (max-width: 480px) {
  .custom-banner {
    height: 300px !important;
    min-height: 300px !important;
    max-height: 300px !important;
  }
  
  .custom-banner.hero .hero-body {
    height: 300px !important;
    min-height: 300px !important;
  }
  
  .custom-banner .title {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
    margin: 0 0 0.6rem 0 !important;
  }
  
  .custom-banner .subtitle {
    font-size: 1.1rem !important;
    line-height: 1.5 !important;
    margin: 0 0 0.4rem 0 !important;
  }
  
  .custom-banner p {
    font-size: 1rem !important;
    line-height: 1.4 !important;
    margin: 0 !important;
  }
  
  .banner-controls {
    padding: 0 0.5rem;
  }
  
  .banner-controls .button {
    width: 2rem;
    height: 2rem;
  }
  
  .banner-indicators {
    bottom: 1rem;
  }
  
  .indicator-dot {
    width: 10px;
    height: 10px;
  }
}

/* 动画效果 */
.fade-in {
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

.fade-out {
  opacity: 0.5;
  transition: opacity 0.5s ease-in-out;
}

/* 防止白屏的样式 */
#banner-hero {
  background-color: #2c3e50; /* 深色背景，避免白屏 */
  position: relative;
  min-height: 500px;
}

#banner-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  z-index: 0;
}

#banner-hero.loaded::before {
  display: none; /* 图片加载完成后隐藏占位背景 */
}

/* 加载状态指示器 */
.banner-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  color: white;
  font-size: 1.2rem;
}

.banner-loading::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 确保内容始终可见 */
#banner-hero .hero-body {
  z-index: 2;
  position: relative;
}
