* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #000;
  --secondary-color: #fff;
  --accent-color: #ff6b6b;
  --text-primary: #333;
  --text-secondary: #666;
  --bg-primary: #fff;
  --bg-secondary: #f5f5f5;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --radius: 8px;
  --spacing: 8px;
}

body.ui-style-5 {
  --primary-color: #1a1a1a;
  --secondary-color: #fff;
  --accent-color: #e50914;
  --bg-primary: #141414;
  --bg-secondary: #1a1a1a;
  --text-primary: #fff;
  --text-secondary: #b3b3b3;
  --border-color: #2a2a2a;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-nav {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 calc(var(--spacing) * 2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}

.nav-logo a {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-color);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: calc(var(--spacing) * 2);
  flex-wrap: nowrap;
  align-items: center;
}

.nav-links li {
  white-space: nowrap;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  padding: calc(var(--spacing) * 1.5) 0;
  display: block;
}

.nav-links a:hover {
  color: var(--accent-color);
}

.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: calc(var(--spacing) * 4) calc(var(--spacing) * 2);
}

.hero-section {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
  padding: calc(var(--spacing) * 6) calc(var(--spacing) * 4);
  border-radius: var(--radius);
  margin-bottom: calc(var(--spacing) * 4);
  box-shadow: var(--shadow);
}

.hero-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: calc(var(--spacing) * 2);
  line-height: 1.3;
}

.hero-desc {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 900px;
}

.content-section {
  margin-bottom: calc(var(--spacing) * 6);
}

.section-header {
  margin-bottom: calc(var(--spacing) * 3);
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  position: relative;
  padding-bottom: calc(var(--spacing) * 1.5);
}

.section-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 4px;
  background-color: var(--accent-color);
  border-radius: 2px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: calc(var(--spacing) * 3);
}

.video-card {
  background-color: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: var(--shadow);
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.video-card__link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.video-cover {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  overflow: hidden;
  background-color: var(--bg-secondary);
}

.video-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-info {
  padding: calc(var(--spacing) * 2);
}

.video-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.video-one-line {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.video-meta {
  display: flex;
  gap: calc(var(--spacing) * 2);
  font-size: 12px;
  color: var(--text-secondary);
}

.page-header {
  margin-bottom: calc(var(--spacing) * 4);
}

.page-header h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: calc(var(--spacing) * 2);
}

.page-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.page--grid,
.page--with-sidebar,
.page--top,
.page--grouped {
  width: 100%;
}

.page--with-sidebar {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: calc(var(--spacing) * 4);
}

.layout__side--filters {
  background-color: var(--bg-secondary);
  padding: calc(var(--spacing) * 3);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 80px;
}

.layout__side--filters h3 {
  font-size: 20px;
  margin-bottom: calc(var(--spacing) * 2);
  color: var(--text-primary);
}

.filter-info p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing);
}

.top-list__items {
  list-style: none;
  counter-reset: top-counter;
}

.top-list__item {
  display: grid;
  grid-template-columns: 60px 200px 1fr;
  gap: calc(var(--spacing) * 3);
  align-items: center;
  padding: calc(var(--spacing) * 3);
  margin-bottom: calc(var(--spacing) * 2);
  background-color: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  counter-increment: top-counter;
}

.top-rank {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-color);
  text-align: center;
}

.top-list__item:nth-child(1) .top-rank,
.top-list__item:nth-child(2) .top-rank,
.top-list__item:nth-child(3) .top-rank {
  color: #ffd700;
}

.top-item-cover {
  width: 100%;
  padding-top: 56.25%;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}

.top-item-cover img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-item-info {
  min-width: 0;
}

.top-item-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: var(--spacing);
}

.top-item-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.top-item-title a:hover {
  color: var(--accent-color);
}

.top-item-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: var(--spacing);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.top-item-meta {
  display: flex;
  gap: calc(var(--spacing) * 2);
  font-size: 12px;
  color: var(--text-secondary);
}

.group {
  margin-bottom: calc(var(--spacing) * 6);
}

.group__title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: calc(var(--spacing) * 3);
  padding-bottom: calc(var(--spacing) * 1.5);
  border-bottom: 2px solid var(--border-color);
}

.group__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: calc(var(--spacing) * 3);
}

.video-player-section {
  margin-bottom: calc(var(--spacing) * 4);
}

.video-player {
  max-width: 1000px;
  margin: 0 auto;
}

.video-player-inner {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}

.player-play-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-play-btn:hover {
  background-color: var(--accent-color);
  transform: translate(-50%, -50%) scale(1.1);
}

.player-play-icon {
  font-size: 32px;
  color: #000;
  margin-left: 4px;
}

.player-play-btn:hover .player-play-icon {
  color: #fff;
}

.video-header {
  margin-bottom: calc(var(--spacing) * 4);
}

.video-header h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-primary);
}

.video-basic-info {
  background-color: var(--bg-secondary);
  padding: calc(var(--spacing) * 3);
  border-radius: var(--radius);
  margin-bottom: calc(var(--spacing) * 4);
  box-shadow: var(--shadow);
}

.video-basic-info h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: calc(var(--spacing) * 2);
}

.info-list {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: calc(var(--spacing) * 2);
}

.info-list dt {
  font-weight: 600;
  color: var(--text-primary);
}

.info-list dd {
  color: var(--text-secondary);
}

.detail-module {
  background-color: var(--bg-secondary);
  padding: calc(var(--spacing) * 3);
  border-radius: var(--radius);
  margin-bottom: calc(var(--spacing) * 3);
  box-shadow: var(--shadow);
}

.detail-module h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: calc(var(--spacing) * 2);
}

.module-content p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: var(--spacing);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing);
}

.tag {
  display: inline-block;
  padding: calc(var(--spacing) * 0.5) calc(var(--spacing) * 1.5);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border-radius: calc(var(--radius) / 2);
  font-size: 14px;
  border: 1px solid var(--border-color);
}

.related-section {
  margin-top: calc(var(--spacing) * 6);
}

.related-section h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: calc(var(--spacing) * 3);
}

.site-footer {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: calc(var(--spacing) * 4) calc(var(--spacing) * 2);
  margin-top: auto;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.back-to-top {
  position: fixed;
  bottom: calc(var(--spacing) * 4);
  right: calc(var(--spacing) * 4);
  width: 50px;
  height: 50px;
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  z-index: 999;
}

.back-to-top.show {
  display: flex;
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 var(--spacing);
  }

  .nav-logo a {
    font-size: 20px;
  }

  .nav-links {
    gap: var(--spacing);
    font-size: 14px;
  }

  .nav-links a {
    padding: var(--spacing) 0;
  }

  .hero-section {
    padding: calc(var(--spacing) * 4) calc(var(--spacing) * 2);
  }

  .hero-title {
    font-size: 24px;
  }

  .hero-desc {
    font-size: 14px;
  }

  .section-title {
    font-size: 22px;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: calc(var(--spacing) * 2);
  }

  .video-cover {
    padding-top: 50%;
  }

  .video-info {
    padding: var(--spacing);
  }

  .video-title {
    font-size: 14px;
  }

  .video-one-line {
    font-size: 12px;
  }

  .page-header h1 {
    font-size: 24px;
  }

  .page--with-sidebar {
    grid-template-columns: 1fr;
  }

  .layout__side--filters {
    position: static;
  }

  .top-list__item {
    grid-template-columns: 40px 120px 1fr;
    gap: var(--spacing);
    padding: calc(var(--spacing) * 2);
  }

  .top-rank {
    font-size: 24px;
  }

  .top-item-title {
    font-size: 16px;
  }

  .top-item-desc {
    font-size: 12px;
  }

  .video-header h1 {
    font-size: 24px;
  }

  .info-list {
    grid-template-columns: 80px 1fr;
    gap: var(--spacing);
  }

  .detail-module h2 {
    font-size: 20px;
  }

  .module-content p {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }

  .top-list__item {
    grid-template-columns: 1fr;
  }

  .top-item-cover {
    max-width: 300px;
    margin: 0 auto;
  }
}
