:root {
  --primary-color: #E50914;
  --primary-hover: #B81D24;
  --secondary-color: #f5f5f1;
  --dark-color: #141414;
  --dark-color-lighter: #181818;
  --dark-color-light: #222222;
  --light-color: #ffffff;
  --gray-color: rgba(255, 255, 255, 0.7);
  --gray-color-dark: rgba(255, 255, 255, 0.5);
}

* {
  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-left: 20px;
  padding-right: 20px;
  overflow-y: auto;
}

/* 导航栏样式 */
.navbar {
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.navbar-content {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.navbar-brand img {
  height: 25px;
}

.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;
}

.nav-link:hover {
  color: var(--light-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: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--light-color);
  padding: 8px 16px;
  padding-right: 40px;
  border-radius: 4px;
  min-width: 240px;
  transition: all 0.3s ease;
}

.search-input:focus {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  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;
}

/* 英雄区域 */
.hero-section {
  height: 400px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9)), url('/static/mntu.png');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 40px;
  border-radius: 8px;
}

.hero-content {
  max-width: 800px;
  padding: 0 20px;
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--light-color);
}

.hero-content p {
  font-size: 1.2rem;
  color: var(--gray-color);
}

/* 分类标题样式 */
.section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  color: var(--light-color);
  font-size: 24px;
  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: 6px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.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: 20px;
  display: flex;
  align-items: end;
  justify-content: center;
  opacity: 1;
  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: var(--light-color);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.play-button:hover {
  background-color: var(--primary-hover);
}

.play-icon {
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent var(--light-color);
}

/* 筛选标签样式 */
.filter-wrapper {
  margin-bottom: 30px;
  background: var(--dark-color-lighter);
  border-radius: 8px;
  padding: 15px;
}

.filter-section {
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-tag {
  display: inline-block;
  padding: 6px 12px;
  background: var(--dark-color-light);
  border-radius: 4px;
  color: var(--gray-color);
  transition: all 0.2s ease;
}

.filter-tag:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--light-color);
}

.filter-tag.active {
  background: var(--primary-color);
  color: var(--light-color);
}

/* 分页样式 */
.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;
}

.page-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--light-color);
}

.page-link.active {
  background: var(--primary-color);
  color: var(--light-color);
}

.page-info {
  color: var(--gray-color);
  font-size: 14px;
}

/* 页脚样式 */
.footer {
  background: var(--dark-color-lighter);
  padding: 30px 0;
  margin-top: 40px;
}

.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));
  }

  .hero-content h1 {
    font-size: 2.5rem;
  }
}

@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;
  }

  .hero-section {
    height: 300px;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .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;
}

.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: var(--light-color);
  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: var(--light-color);
  z-index: 2;
  display: none;
}

.error-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(229, 9, 20, 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: var(--light-color);
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  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;
}

.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;
}

.episode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.source-select-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.source-dropdown {
  background: var(--dark-color-light);
  color: var(--light-color);
  border: 1px solid rgba(255, 255, 255, 0.2);
  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: rgba(255, 255, 255, 0.15);
}

.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: rgba(255, 255, 255, 0.15);
  color: var(--light-color);
}

.episode-btn.active {
  background: var(--primary-color);
  color: var(--light-color);
}

.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;
  }
}

@media (max-width: 480px) {
  .episode-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .episode-grid {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
  }

  .episode-btn {
    padding: 8px 5px;
  }

  .episode-number {
    font-size: 13px;
  }

  .episode-duration {
    font-size: 11px;
  }
}