/* 重置样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: #fff;
}

/* Swiper容器 */
.mySwiper {
  width: 100%;
  height: 100vh;
  position: relative;
  background: #fff;
}

/* 幻灯片样式 */
.swiper-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #fff;
}

.slide-content {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}

/* 封面分层样式 - 统一背景定位方案 */
.cover-slide .slide-content {
  position: relative;
  width: 100%;
  height: 100%;
  background-image: url("images/封面(背景).png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 隐藏背景图层，因为已经作为CSS背景 */
.cover-bg {
  display: none;
}

/* 所有图层使用相同的背景定位方式 */
.cover-title-layer,
.cover-characters-layer,
.cover-girl-layer,
.cover-bottom-layer,
.cover-stars-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  pointer-events: none;
}

/* 图层2：上方标题区域 */
.cover-title-layer {
  z-index: 2;
  background-image: url("images/封面(title).png");
}

/* 图层3：中间人物（除小女孩） */
.cover-characters-layer {
  z-index: 3;
  background-image: url("images/封面(内容).png");
}

/* 图层4：小女孩（单独） */
.cover-girl-layer {
  z-index: 4;
  background-image: url("images/封面(女孩).png");
}

/* 图层5：底部文字 */
.cover-bottom-layer {
  z-index: 5;
  background-image: url("images/封面(底部文字).png");
}

/* 图层6：星星闪烁 */
.cover-stars-layer {
  z-index: 6;
  background-image: url("images/封面(星星).png");
}

/* 图片样式 - 居中显示，保持完整内容 */
.slide-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  transition: transform 0.3s ease;
  display: block;
}

/* 封面和封底特殊样式 - 现在与普通页面一致 */
.cover-slide .slide-image {
  object-fit: contain;
}

.slide-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #333;
  z-index: 10;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
}

.title {
  font-size: 2.5rem;
  font-weight: bold;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease-out;
  color: #333;
}

.subtitle {
  font-size: 1.5rem;
  font-weight: 300;
  animation: fadeInUp 1s ease-out 0.3s both;
  color: #666;
}

/* 动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 分页器样式 - 垂直布局调整 */
.swiper-pagination {
  display: none;
}

.swiper-pagination-bullet {
  background: rgba(0, 0, 0, 0.3);
  opacity: 1;
  width: 8px;
  height: 8px;
  margin: 4px 0;
  transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
  background: #333;
  transform: scale(1.2);
}

/* 隐藏原来的Swiper导航按钮 */
.swiper-button-next,
.swiper-button-prev {
  display: none;
}

/* 自定义导航按钮容器 */
.custom-nav-container {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
}

/* 自定义导航按钮 */
.custom-nav-button {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.8);
  padding: 4px 10px;
  border-radius: 18px;
  backdrop-filter: blur(10px);
}

.custom-nav-next {
  bottom: 10px;
}

.custom-nav-button:hover {
  color: #000;
  transform: translateX(-50%) scale(1.1);
  background: rgba(255, 255, 255, 0.9);
}

/* 导航图标 */
.nav-icon {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 导航文字 */
.nav-text {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.7);
  white-space: nowrap;
  font-weight: normal;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* 页面指示器 */
.page-indicator {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  z-index: 100;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.current-page {
  font-weight: bold;
  color: #333;
}

.separator {
  margin: 0 4px;
  opacity: 0.7;
}

.total-pages {
  opacity: 0.7;
}

/* 加载提示 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top: 3px solid #333;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.loading-overlay p {
  color: #333;
  font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .title {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1.2rem;
  }

  .page-indicator {
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    font-size: 12px;
  }

  .nav-icon {
    width: 20px;
    height: 20px;
  }

  .nav-text {
    font-size: 10px;
  }

  .cover-title {
    width: 85%;
    top: 12%;
  }

  .cover-characters {
    width: 95%;
  }

  .cover-bottom {
    width: 65%;
    bottom: 6%;
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 1.5rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .page-indicator {
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    font-size: 11px;
  }

  .nav-icon {
    width: 18px;
    height: 18px;
  }

  .nav-text {
    font-size: 10px;
  }

  .cover-title {
    width: 90%;
    top: 10%;
  }

  .cover-characters {
    width: 98%;
  }

  .cover-bottom {
    width: 70%;
    bottom: 5%;
  }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
  .slide-overlay {
    transform: translate(-50%, -50%) scale(0.8);
  }

  .title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
  }

  .subtitle {
    font-size: 1.2rem;
  }

  .page-indicator {
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    font-size: 11px;
  }

  .nav-icon {
    width: 16px;
    height: 16px;
  }

  .nav-text {
    font-size: 8px;
  }

  .cover-title {
    width: 85%;
    top: 8%;
  }

  .cover-characters {
    width: 95%;
  }

  .cover-bottom {
    width: 60%;
    bottom: 4%;
  }
}

@keyframes fadeInOut {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.8;
  }
}

/* 页面切换动画增强 */
.swiper-slide-active .slide-image {
  transform: scale(1.02);
}

/* 预加载优化 */
.slide-image {
  will-change: transform;
}

/* 性能优化 */
.swiper-slide {
  will-change: transform;
  backface-visibility: hidden;
  perspective: 1000px;
}
