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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  overflow-x: hidden;
}

/* 导航栏 */
.navbar {
  display: flex;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.nav-item {
  flex: 1;
  text-align: center;
  padding: 15px 0;
  font-size: 16px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  border-bottom: 2px solid transparent;
}

.nav-item.active {
  color: #ff6b6b;
  border-bottom-color: #ff6b6b;
}

/* 主内容区 */
main {
  margin-top: 56px;
  min-height: calc(100vh - 56px);
}

/* 页面切换 */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* 轮播图 */
.carousel {
      position: relative;
    width: calc(100% - 20px);
    height: 180px;
    overflow: hidden;
    background-color: #eee;
    border-radius: 10px;
    margin: 10px;
    margin-top: 70px;
}

.carousel-container {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease;
  border-radius: 10px;
}

.carousel-item {
  flex: 0 0 100%;
  height: 100%;
  display: block;
  border-radius: 10px;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}

.carousel-indicators {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator.active {
  background-color: #fff;
  width: 20px;
  border-radius: 4px;
}

/* 分类导航 */
.category-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  background-color: #fff;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #e0e0e0;
}

.category-item.active {
  background-color: #ff6b6b;
  color: white;
  border-color: #ff6b6b;
}

.category-item:hover {
  background-color: #ff5252;
  color: white;
  border-color: #ff5252;
  transform: translateY(-2px);
}

.category-logo {
  width: 60px;
  height: 60px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 8px;
  background-color: #f5f5f5;
}

.category-item.active .category-logo {
  background-color: rgba(255, 255, 255, 0.2);
}

.category-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-name {
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  word-break: break-word;
  max-width: 100%;
}

/* 内容区域 */
.content-section {
  padding: 15px;
  background-color: #fff;
  margin-bottom: 10px;
}

.content-section h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

/* 列表样式 */
.item-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.item {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.item:hover {
  transform: translateY(-2px);
}

.item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

.item p {
  font-size: 14px;
  text-align: center;
  color: #333;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 详情页 */
.detail-page {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fff;
  z-index: 2000;
  display: none;
  flex-direction: column;
}

.detail-page.active {
  display: flex;
}

.detail-header {
  display: flex;
  align-items: center;
  padding: 15px;
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.back-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  padding: 8px;
  margin-right: 15px;
}

#detail-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  flex: 1;
  text-align: center;
  margin: 0;
}

/* 播放器容器 */
.player-container {
  width: 100%;
  background-color: #000;
  flex-shrink: 0;
  position: relative;
}

/* 添加视频播放器默认高度和横屏布局 */
.player-container video {
  width: 100%;
  height: 300px;
  object-fit: contain;
  display: block;
}

/* 添加放大模式样式 */
.player-container.fullscreen-mode {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
}

.player-container.fullscreen-mode video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 添加视频控制按钮样式 */
.video-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 10px;
  z-index: 100;
}

.video-control-btn {
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.video-control-btn:hover {
  background-color: rgba(255, 107, 107, 0.8);
  transform: scale(1.05);
}

.video-control-btn:active {
  transform: scale(0.95);
}

.player-container audio {
  width: 100%;
  height: auto;
}

#player {
  width: 100%;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* 音频播放器样式 */
.audio-player {
  width: 100%;
  background-color: #1a1a1a;
  padding: 20px;
  box-sizing: border-box;
}

#audio-element {
  display: none;
}

.audio-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}

.control-btn {
  background-color: #ff6b6b;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 80px;
}

.control-btn:hover {
  background-color: #ff5252;
  transform: translateY(-2px);
}

.control-btn.play-btn {
  background-color: #4ecdc4;
  min-width: 100px;
}

.control-btn.play-btn:hover {
  background-color: #26a69a;
}

/* 进度条样式 */
.progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #444;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #ff6b6b;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.progress-bar::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #ff5252;
}

.progress-bar::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #ff6b6b;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.progress-bar::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: #ff5252;
}

.time {
  color: #fff;
  font-size: 12px;
  min-width: 45px;
  text-align: center;
}

/* 集数选择区域 */
.episode-section {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  background-color: #f5f5f5;
}

.episode-section h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  color: #333;
}

.episode-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.episode-item {
  background-color: #fff;
  padding: 10px;
  text-align: center;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #e0e0e0;
}

.episode-item:hover {
  background-color: #ff6b6b;
  color: #fff;
  border-color: #ff6b6b;
}

.episode-item.active {
  background-color: #ff6b6b;
  color: #fff;
  border-color: #ff6b6b;
}

/* 响应式设计 */
@media (max-width: 320px) {
  .item-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .item img {
    height: 140px;
  }

  .episode-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 密码输入弹窗样式 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: white;
  padding: 25px;
  border-radius: 12px;
  width: 90%;
  max-width: 320px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  text-align: center;
}

.modal-content h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
  color: #333;
  font-weight: 600;
}

.modal-content p {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: #666;
}

#password-input {
  width: 100%;
  padding: 12px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.3s ease;
}

#password-input:focus {
  border-color: #ff6b6b;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

#cancel-btn,
#confirm-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 80px;
}

#cancel-btn {
  background-color: #f5f5f5;
  color: #666;
}

#cancel-btn:hover {
  background-color: #e0e0e0;
}

#confirm-btn {
  background-color: #ff6b6b;
  color: white;
}

#confirm-btn:hover {
  background-color: #ff5252;
  transform: translateY(-2px);
}
