/* 相册页面 */
.gallery {
  padding: 50px 0;
}

.gallery h1 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: var(--mc-green);
}

.gallery > .container > p {
  text-align: center;
  margin-bottom: 40px;
  font-size: 1.2rem;
}

.album-selector {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.album-btn {
  background-color: var(--mc-dark-gray);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.album-btn:hover,
.album-btn.active {
  background-color: var(--mc-green);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.gallery-item {
  border-radius: 8px;
  position: relative;
  height: 250px;
  cursor: pointer;
  border: 2px solid var(--mc-dark-gray);
  transition: all 0.3s ease;
  overflow: hidden;
}

.gallery-item:hover {
  transform: scale(1.03);
  border-color: var(--mc-green);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: all 0.3s ease;
}

.gallery-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, 0.85);
  padding: 8px 10px;
  transform: translateY(100%); /* 初始状态在底部之外 */
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 30px;
  height: 30px;
  z-index: 10;
  opacity: 0;
}

.gallery-item .overlay p {
  color: white;
  font-weight: bold;
  margin: 0;
  font-size: 12px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.gallery-item:hover .overlay {
  opacity: 1;
  transform: translateY(0); /* 悬停时滑入视图 */
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* 视频项样式 */
.video-thumbnail {
  position: relative;
  width: 100%;
  height: 100%;
}

.video-bg {
  width: 100%;
  height: 100%;
  background-color: #2a2a2a; /* 深灰色背景 */
  background-image: linear-gradient(45deg, #3a3a3a 25%, transparent 25%), 
                    linear-gradient(-45deg, #3a3a3a 25%, transparent 25%), 
                    linear-gradient(45deg, transparent 75%, #3a3a3a 75%), 
                    linear-gradient(-45deg, transparent 75%, #3a3a3a 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding: 0;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  text-align: center;
}

.modal-content {
  margin: auto;
  display: block;
  width: 90%;
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid var(--mc-dark-gray);
  border-radius: 8px;
  z-index: 1002; /* 确保内容在关闭按钮下方 */
}

.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1003; /* 确保关闭按钮在最上层 */
}

.close:hover {
  color: #bbb;
}

.caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  display: block;
  width: 100%;
  text-align: center;
  color: #ccc;
  padding: 15px 0;
  height: auto;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1001;
  box-sizing: border-box;
  /* 为视频播放器居中显示添加样式 */
  display: flex;
  align-items: center;
  justify-content: center;
  top: 0;
}

.caption a {
  color: var(--mc-green);
  text-decoration: none;
  font-weight: bold;
}

.caption a:hover {
  text-decoration: underline;
}

/* 视频播放器容器 */
.video-player-container {
  width: 80%;
  max-width: 800px;
  max-height: 80vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.video-player-container video {
  width: 100%;
  height: auto;
  max-height: 60vh;
  border: 2px solid var(--mc-dark-gray);
  border-radius: 8px;
  object-fit: contain;
}

.video-player-container p {
  margin: 10px 0;
  color: #ccc;
  text-align: center;
}

.video-player-container a {
  color: var(--mc-green);
  text-decoration: none;
  font-weight: bold;
}

.video-player-container a:hover {
  text-decoration: underline;
}