/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", Arial, sans-serif;
}

body {
  background-color: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* 密码验证弹窗 */
#passwordModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
  margin-bottom: 20px;
  color: #2c3e50;
  text-align: center;
}

#passwordInput {
  width: 100%;
  padding: 12px 15px;
  margin: 10px 0 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

#submitPassword {
  width: 100%;
  padding: 12px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

#submitPassword:hover {
  background: #219653;
}

#errorMsg {
  color: #e74c3c;
  text-align: center;
  margin-top: 10px;
  display: none;
}

/* 固定播放器样式（仅在流媒体页面显示） */
#playerContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #2c3e50;
  padding: 15px;
  z-index: 999;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#mediaPlayer {
  width: 100%;
  max-width: 900px;
  height: 60px;
  margin: 0 auto;
  display: block;
}

.player-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}

.control-btn {
  padding: 8px 20px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.control-btn:hover {
  background: #2980b9;
}

.control-btn.active {
  background: #e74c3c;
}

/* 弹出式播放器样式 - 核心修复 */
#popupPlayerModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  /* 防止点击穿透 */
  pointer-events: auto;
}

.popup-player-content {
  background: #2c3e50;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  position: relative;
  /* 关键：阻止事件冒泡到外层弹窗 */
  pointer-events: auto;
}

#popupMediaPlayer {
  width: 100%;
  height: 300px;
  margin-bottom: 15px;
}

.popup-controls {
  display: flex;
  justify-content: center;
  gap: 20px;
}

/* 关闭按钮修复 - 提升层级 + 阻止事件冒泡 */
.close-popup {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #e74c3c;
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  /* 提升层级确保可点击 */
  z-index: 10000;
  /* 居中X符号 */
  display: flex;
  justify-content: center;
  align-items: center;
  /* 去掉默认边框/轮廓 */
  outline: none;
  border: none;
}

/* 关闭按钮 hover 效果 */
.close-popup:hover {
  background: #c0392b;
  transform: scale(1.1);
  transition: all 0.2s ease;
}

/* 内容容器（适配播放器顶部留白） */
.content-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 仅流媒体页面需要顶部留白 */
.media-page .content-container {
  padding-top: 100px;
}

/* 标题列表样式 */
.title-list {
  margin-top: 30px;
}

.section-title {
  font-size: 22px;
  color: #2c3e50;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #3498db;
}

.title-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s;
}

.title-card:hover {
  transform: translateY(-2px);
}

.title-card a {
  color: #3498db;
  text-decoration: none;
  font-size: 18px;
  display: block;
}

.title-card a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.page-btn {
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  transition: all 0.3s;
}

.page-btn:hover {
  border-color: #3498db;
  color: #3498db;
}

.page-btn.active {
  background: #3498db;
  color: white;
  border-color: #3498db;
}

.page-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* 返回按钮样式 */
.back-btn {
  background: #9b59b6;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.back-btn:hover {
  background: #8e44ad;
}

/* 响应式适配 */
@media (max-width: 768px) {
  #mediaPlayer {
    height: 50px;
  }
  
  .media-page .content-container {
    padding-top: 90px;
  }
  
  #popupMediaPlayer {
    height: 200px;
  }
  
  .title-card a {
    font-size: 16px;
  }
  
  .section-title {
    font-size: 20px;
  }
  
  /* 移动端关闭按钮适配 */
  .close-popup {
    width: 25px;
    height: 25px;
    font-size: 14px;
    top: 10px;
    right: 10px;
  }
}