/* 重置与基础设置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: url(img/25.png) center no-repeat fixed;
  background-size: cover;
  min-height: 100vh;
  font-family: "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

.top-box {
  text-align: center;
  padding: 20px 10px;
}
.top-box-img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* 按钮样式 */
.btn {
  border: 2px solid purple;
  padding: 8px 16px;
  text-decoration: none;
  color: purple;
  border-radius: 10px;
  display: inline-block;
  transition: all 0.3s ease;
  font-size: 1rem;
}
.btn-item {
  background: purple;
  color: white;
}
.btn:hover {
  background: #9933cc;
  color: white;
  transform: scale(1.05);
}

.btn-box {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 15px;
}

/* 角色介绍区域 - 响应式双栏 */
.characters-intro {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0 20px;
}

.characters-intro-left,
.characters-intro-right {
  background: rgba(204, 204, 204, 0.5);
  border-radius: 12px;
  padding: 20px;
}

/* 左侧：角色头像 */
.characters-intro-left {
  flex: 1;
  min-width: 280px; /* 最小宽度保证可读性 */
  max-width: 300px;
  margin: 0 auto;
}

.characters-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  cursor: pointer;
}

/* 右侧：文字内容 */
.characters-intro-right {
  flex: 3;
  min-width: 300px;
  background: rgba(204, 204, 204, 0.5);
}

/* 图片网格 - 自适应 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 32px;
  padding: 20px;
}

.image-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 8px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.img-items {
  cursor: pointer;
}

.img-items:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Lightbox 样式 */
.lightbox {
  display: none;
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  border: 3px solid white;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

/* 返回顶部按钮 - 所有角色共用一个位置 */
#backToTop-knd,
#backToTop-mfy,
#backToTop-mzk,
#backToTop-ena {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1000;
}

/* 小屏设备优化（手机） */
@media (max-width: 768px) {
  .top-box-img {
    width: 90%;
    max-width: 400px;
  }

  .btn {
    width: auto;
    padding: 10px 16px;
    font-size: 0.95rem;
  }

  .btn-box {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .characters-intro {
    flex-direction: column;
    align-items: center;
  }

  .characters-intro-left,
  .characters-intro-right {
    width: 100% !important;
    max-width: none;
  }

  .image-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  #backToTop-knd,
  #backToTop-mfy,
  #backToTop-mzk,
  #backToTop-ena {
    width: 50px;
    height: 50px;
    bottom: 15px;
    right: 15px;
  }
}

/* 超小屏（如 iPhone SE） */
@media (max-width: 480px) {
  .characters-img {
    height: auto;
  }

  .image-grid img {
    height: 160px;
  }
}
