:root {
  --youtube-red: #FF0000;
  --youtube-red-hover: #CC0000;
  --youtube-dark: #0F0F0F;
  --youtube-dark-secondary: #272727;
  --youtube-dark-hover: #3F3F3F;
  --youtube-text: #FFFFFF;
  --youtube-text-secondary: #AAAAAA;
  --youtube-border: #3F3F3F;
  --youtube-bg: #0F0F0F;
  --youtube-card-bg: #1A1A1A;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--youtube-bg);
  color: var(--youtube-text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--youtube-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--youtube-red);
}

.content-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px;
}

/* 导航栏样式 */
.navbar {
  background-color: var(--youtube-dark);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--youtube-border);
}

.navbar-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 56px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 500;
  color: var(--youtube-text);
}

.youtube-logo {
  width: 32px;
  height: 32px;
  background: var(--youtube-red);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.youtube-logo::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 8px solid white;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  margin-left: 2px;
}

.navbar-nav {
  display: flex;
  list-style: none;
  gap: 24px;
}

.nav-item {
  position: relative;
}

.nav-link {
  color: var(--youtube-text-secondary);
  font-size: 14px;
  font-weight: 400;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background-color: var(--youtube-dark-hover);
  color: var(--youtube-text);
}

.nav-right {
  display: flex;
  align-items: center;
}

/* 搜索框样式 */
.search-form {
  position: relative;
}

.search-wrapper {
  display: flex;
  align-items: center;
  background-color: var(--youtube-dark-secondary);
  border: 1px solid var(--youtube-border);
  border-radius: 20px;
  overflow: hidden;
}

.search-input {
  background: transparent;
  border: none;
  color: var(--youtube-text);
  padding: 8px 16px;
  width: 300px;
  font-size: 14px;
}

.search-input:focus {
  outline: none;
}

.search-input::placeholder {
  color: var(--youtube-text-secondary);
}

.search-button {
  background-color: var(--youtube-border);
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-button:hover {
  background-color: var(--youtube-dark-hover);
}

.search-icon {
  width: 16px;
  height: 16px;
  border: 2px solid var(--youtube-text-secondary);
  border-radius: 50%;
  position: relative;
}

.search-icon::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  width: 6px;
  height: 2px;
  background: var(--youtube-text-secondary);
  transform: rotate(45deg);
  transform-origin: left center;
}

/* 分类标题样式 */
.section {
  margin-bottom: 48px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title {
  color: var(--youtube-text);
  font-size: 20px;
  font-weight: 500;
}

.view-more {
  color: var(--youtube-text-secondary);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
}

.view-more:hover {
  color: var(--youtube-red);
}

.arrow-right {
  width: 0;
  height: 0;
  border-left: 4px solid currentColor;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}

/* 视频网格样式 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* 视频卡片样式 */
.video-card {
  background-color: var(--youtube-card-bg);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.video-card:hover {
  transform: translateY(-2px);
}

.video-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.video-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-card:hover .video-image {
  transform: scale(1.05);
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-card:hover .video-overlay {
  opacity: 1;
}

.play-button {
  background-color: var(--youtube-red);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.play-button:hover {
  background-color: var(--youtube-red-hover);
  color: white;
}

.play-icon {
  width: 0;
  height: 0;
  border-left: 8px solid white;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
}

.video-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.video-info {
  padding: 16px;
}

.video-title {
  color: var(--youtube-text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.video-remarks {
  background-color: var(--youtube-red);
  color: white;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.video-score {
  color: var(--youtube-text-secondary);
  font-size: 12px;
}

/* 页脚样式 */
.footer {
  background-color: var(--youtube-dark-secondary);
  border-top: 1px solid var(--youtube-border);
  margin-top: 48px;
  padding: 32px 0;
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-info {
  color: var(--youtube-text-secondary);
  font-size: 14px;
}

.footer-links {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--youtube-text-secondary);
  font-size: 14px;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--youtube-text);
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 48px 0;
}

.page-link {
  padding: 8px 16px;
  background-color: var(--youtube-dark-secondary);
  color: var(--youtube-text-secondary);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.page-link:hover {
  background-color: var(--youtube-dark-hover);
  color: var(--youtube-text);
}

.page-link.active {
  background-color: var(--youtube-red);
  color: white;
}

.page-info {
  color: var(--youtube-text-secondary);
  font-size: 14px;
  margin-left: 16px;
}

/* 页面标题样式 */
.page-header {
  margin-bottom: 32px;
  text-align: center;
}

.page-title {
  font-size: 32px;
  font-weight: 500;
  color: var(--youtube-text);
  margin-bottom: 8px;
}

.page-description {
  color: var(--youtube-text-secondary);
  font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar-content {
    padding: 0 12px;
  }
  
  .nav-left {
    gap: 16px;
  }
  
  .navbar-nav {
    display: none;
  }
  
  .search-input {
    width: 200px;
  }
  
  .content-container {
    padding: 16px 12px;
  }
  
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
  }
  
  .section {
    margin-bottom: 32px;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .search-input {
    width: 150px;
  }
  
  .page-title {
    font-size: 24px;
  }
}

/* 播放页面特殊样式 */
.play-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px;
}

.video-section {
  margin-bottom: 32px;
}

.video-player-wrapper {
  position: relative;
  width: 100%;
  max-width: 854px;
  margin: 0 auto 24px;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.video-player-wrapper video {
  width: 100%;
  height: auto;
  display: block;
}

.video-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid var(--youtube-red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.video-error {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  padding: 20px;
}

.error-icon {
  width: 48px;
  height: 48px;
  border: 3px solid #ff4444;
  border-radius: 50%;
  position: relative;
  margin-bottom: 16px;
}

.error-icon::before,
.error-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 3px;
  background: #ff4444;
  transform: translate(-50%, -50%) rotate(45deg);
}

.error-icon::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.retry-btn {
  background-color: var(--youtube-red);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 16px;
  transition: background-color 0.2s ease;
}

.retry-btn:hover {
  background-color: var(--youtube-red-hover);
}

.video-info-container {
  max-width: 854px;
  margin: 0 auto;
}

.video-info-header {
  margin-bottom: 16px;
}

.video-title {
  font-size: 24px;
  font-weight: 500;
  color: var(--youtube-text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--youtube-text-secondary);
  font-size: 14px;
}

.meta-item a {
  color: var(--youtube-text-secondary);
  transition: color 0.2s ease;
}

.meta-item a:hover {
  color: var(--youtube-red);
}

.meta-dot {
  color: var(--youtube-text-secondary);
}

.meta-score {
  color: var(--youtube-red);
  font-weight: 500;
}

.video-crew {
  margin-bottom: 16px;
}

.crew-item {
  display: flex;
  margin-bottom: 8px;
  font-size: 14px;
}

.crew-label {
  color: var(--youtube-text-secondary);
  min-width: 60px;
}

.crew-values {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.crew-value {
  color: var(--youtube-text-secondary);
  transition: color 0.2s ease;
}

.crew-value:hover {
  color: var(--youtube-red);
}

.crew-separator {
  color: var(--youtube-text-secondary);
}

.video-desc {
  color: var(--youtube-text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* 剧集选择区域 */
.episode-section {
  margin-bottom: 32px;
}

.episode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.source-select-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-select-container label {
  color: var(--youtube-text-secondary);
  font-size: 14px;
}

.source-dropdown {
  background-color: var(--youtube-dark-secondary);
  color: var(--youtube-text);
  border: 1px solid var(--youtube-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
}

.sort-btn {
  background-color: var(--youtube-dark-secondary);
  color: var(--youtube-text-secondary);
  border: 1px solid var(--youtube-border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.sort-btn:hover {
  background-color: var(--youtube-dark-hover);
  color: var(--youtube-text);
}

.sort-icon {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid currentColor;
}

.episode-container {
  background-color: var(--youtube-card-bg);
  border-radius: 12px;
  padding: 16px;
}

.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.episode-btn {
  background-color: var(--youtube-dark-secondary);
  color: var(--youtube-text-secondary);
  border: 1px solid var(--youtube-border);
  border-radius: 8px;
  padding: 12px 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.episode-btn:hover {
  background-color: var(--youtube-dark-hover);
  color: var(--youtube-text);
}

.episode-btn.active {
  background-color: var(--youtube-red);
  color: white;
  border-color: var(--youtube-red);
}

.episode-number {
  display: block;
  font-weight: 500;
}

.episode-duration {
  display: block;
  font-size: 12px;
  opacity: 0.8;
  margin-top: 4px;
}

/* 相关推荐区域 */
.related-section {
  margin-bottom: 32px;
}