:root {
  --primary-color: #FB7299; /* B站粉色 */
  --primary-hover: #FC8BAB;
  --secondary-color: #23ADE5; /* B站蓝色 */
  --dark-color: #F6F7F8; /* 浅色背景 */
  --dark-color-lighter: #FFFFFF; /* 白色卡片背景 */
  --dark-color-light: #F1F2F3;
  --light-color: #212121; /* 深色文字 */
  --gray-color: #6D757A; /* 灰色文字 */
  --gray-color-dark: #9499A0; /* 浅灰色文字 */
  --border-color: #E3E5E7; /* 边框颜色 */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--dark-color);
  color: var(--light-color);
  line-height: 1.6;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

a {
  color: var(--light-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-color);
}

.content-container {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px;
  overflow-y: auto;
}

/* 导航栏样式 */
.navbar {
  background-color: #FFFFFF;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
}

.navbar-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
}

.navbar-brand img {
  height: 32px;
}

.navbar-nav {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--gray-color);
  font-size: 0.95rem;
  padding: 0.5rem 0;
  transition: color 0.2s ease;
  font-weight: 500;
}

.nav-link:hover {
  color: var(--primary-color);
}

.nav-right {
  display: flex;
  align-items: center;
}

/* 搜索框样式 */
.search-form {
  position: relative;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input {
  background-color: var(--dark-color-light);
  border: 1px solid var(--border-color);
  color: var(--light-color);
  padding: 8px 16px;
  padding-right: 40px;
  border-radius: 20px;
  min-width: 240px;
  transition: all 0.3s ease;
}

.search-input:focus {
  background-color: #FFFFFF;
  border-color: var(--primary-color);
  outline: none;
}

.search-input::placeholder {
  color: var(--gray-color-dark);
}

.search-button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.search-icon {
  display: block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--gray-color);
  border-radius: 50%;
  position: relative;
}

.search-icon::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  width: 7px;
  height: 2px;
  background: var(--gray-color);
  transform: rotate(45deg);
  transform-origin: left center;
}

/* 分类标题样式 */
.section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary-color);
  padding-left: 10px;
}

.section-title {
  color: var(--light-color);
  font-size: 20px;
  font-weight: 600;
}

.view-more {
  color: var(--gray-color);
  font-size: 14px;
  transition: color 0.2s ease;
}

.view-more:hover {
  color: var(--primary-color);
}

/* 电影网格布局 */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

/* 电影卡片样式 */
.movie-card {
  background: var(--dark-color-lighter);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.movie-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.movie-poster {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2/3;
}

.movie-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.movie-card:hover .movie-image {
  transform: scale(1.05);
}

.movie-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.movie-card:hover .movie-overlay {
  opacity: 1;
}

.movie-info {
  padding: 12px;
}

.movie-title {
  color: var(--light-color);
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-meta {
  display: flex;
  justify-content: space-between;
  color: var(--gray-color);
  font-size: 14px;
}

.movie-remarks {
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-score {
  color: var(--primary-color);
  font-weight: 600;
}

/* 播放按钮 */
.play-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--primary-color);
  color: #FFFFFF;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.play-button:hover {
  background-color: var(--primary-hover);
  color: #FFFFFF;
}

.play-icon {
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent #FFFFFF;
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: var(--dark-color-lighter);
  border-radius: 4px;
  color: var(--gray-color);
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
}

.page-link:hover {
  background: var(--dark-color-light);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.page-link.active {
  background: var(--primary-color);
  color: #FFFFFF;
  border-color: var(--primary-color);
}

.page-info {
  color: var(--gray-color);
  font-size: 14px;
}

/* 页脚样式 */
.footer {
  background: #FFFFFF;
  padding: 30px 0;
  margin-top: 40px;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-info p {
  color: var(--gray-color);
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--gray-color);
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--primary-color);
}

/* 响应式调整 */
@media (max-width: 992px) {
  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 768px) {
  .navbar-content {
    flex-direction: column;
    gap: 15px;
    padding: 10px 20px;
  }

  .nav-left {
    width: 100%;
    justify-content: space-between;
  }

  .navbar-nav {
    display: none;
  }

  .nav-right {
    width: 100%;
  }

  .search-form {
    width: 100%;
  }

  .search-input {
    width: 100%;
    min-width: unset;
  }

  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
  }

  .footer-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* 视频播放页面样式 */
.play-container {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 20px;
}

/* 视频播放器区域 */
.video-section {
  margin-bottom: 30px;
  background: var(--dark-color-lighter);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.video-player-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  /* 16:9 宽高比 */
  background: #000;
}

#my-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: opacity 0.3s ease;
}

/* 加载状态 */
.video-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  color: #FFFFFF;
  z-index: 2;
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 错误信息 */
.video-error {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
  color: #FFFFFF;
  z-index: 2;
  display: none;
}

.error-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(251, 114, 153, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  position: relative;
}

.error-icon:before,
.error-icon:after {
  content: '';
  position: absolute;
  width: 30px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

.error-icon:before {
  transform: rotate(45deg);
}

.error-icon:after {
  transform: rotate(-45deg);
}

.retry-btn {
  background: var(--primary-color);
  color: #FFFFFF;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  margin-top: 15px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.retry-btn:hover {
  background: var(--primary-hover);
}

/* 视频信息区域 */
.video-info-container {
  padding: 20px;
}

.video-info-header {
  margin-bottom: 15px;
}

.video-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--light-color);
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  color: var(--gray-color);
  font-size: 14px;
  gap: 5px;
}

.meta-dot {
  color: var(--gray-color-dark);
}

.meta-score {
  color: var(--primary-color);
  font-weight: 600;
}

/* 剧组信息 */
.video-crew {
  margin-bottom: 15px;
}

.crew-item {
  display: flex;
  margin-bottom: 8px;
  font-size: 14px;
}

.crew-label {
  color: var(--gray-color);
  margin-right: 10px;
  flex-shrink: 0;
}

.crew-values {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.crew-value {
  color: var(--light-color);
  transition: color 0.2s ease;
}

.crew-value:hover {
  color: var(--primary-color);
}

.crew-separator {
  color: var(--gray-color-dark);
}

/* 视频描述 */
.video-desc {
  color: var(--gray-color);
  font-size: 14px;
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 10px;
}

/* 剧集选择区域 */
.episode-section {
  margin-bottom: 30px;
  background: var(--dark-color-lighter);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.episode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.source-select-container {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--light-color);
}

.source-dropdown {
  background: var(--dark-color-light);
  color: var(--light-color);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 4px;
  min-width: 120px;
  cursor: pointer;
}

.sort-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--dark-color-light);
  color: var(--light-color);
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sort-btn:hover {
  background: var(--dark-color);
}

.sort-icon {
  display: inline-block;
  width: 12px;
  height: 12px;
  position: relative;
}

.sort-icon:before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid var(--gray-color);
}

.sort-icon:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--light-color);
}

.sort-btn.desc .sort-icon:before {
  border-bottom-color: var(--light-color);
}

.sort-btn.desc .sort-icon:after {
  border-top-color: var(--gray-color);
}

.episode-container {
  margin-top: 15px;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.episode-btn {
  background: var(--dark-color-light);
  border: none;
  border-radius: 4px;
  padding: 10px;
  color: var(--gray-color);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.episode-btn:hover {
  background: var(--dark-color);
  color: var(--light-color);
}

.episode-btn.active {
  background: var(--primary-color);
  color: #FFFFFF;
}

.episode-number {
  font-weight: 600;
  margin-bottom: 5px;
}

.episode-duration {
  font-size: 12px;
  opacity: 0.8;
}

/* 相关推荐区域 */
.related-section {
  margin-bottom: 30px;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .video-player-wrapper {
    padding-top: 75%;
    /* 4:3 宽高比，在移动设备上更合适 */
  }

  .episode-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  .crew-item {
    flex-direction: column;
  }

  .crew-label {
    margin-bottom: 5px;
  }
  
  .episode-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .source-select-container {
    width: 100%;
  }
  
  .source-dropdown {
    flex-grow: 1;
  }
}