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

:root {
  --color-primary: #0066cc;
  --color-secondary: #00a86b;
  --color-accent: #ff6b6b;
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5f5;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-border: #e0e0e0;
  --spacing-unit: 8px;
  --border-radius: 8px;
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 calc(var(--spacing-unit) * 2);
}

.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: calc(var(--spacing-unit) * 2);
  padding-bottom: calc(var(--spacing-unit) * 2);
}

.site-logo h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
}

.site-logo a {
  color: inherit;
  text-decoration: none;
}

.site-nav {
  display: flex;
  gap: calc(var(--spacing-unit) * 3);
  white-space: nowrap;
}

.site-nav a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--color-primary);
}

.site-main {
  min-height: 60vh;
  padding: calc(var(--spacing-unit) * 4) 0;
}

.hero-section {
  padding: calc(var(--spacing-unit) * 6) 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: white;
  text-align: center;
  margin-bottom: calc(var(--spacing-unit) * 4);
}

.hero-title {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  max-width: 900px;
  margin: 0 auto;
}

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

.intro-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  font-size: 17px;
  line-height: 1.8;
  color: var(--color-text-light);
}

.module-section {
  margin-bottom: calc(var(--spacing-unit) * 8);
}

.module-section--alt {
  background-color: var(--color-bg-alt);
  padding: calc(var(--spacing-unit) * 4) 0;
  margin-left: calc(var(--spacing-unit) * -2);
  margin-right: calc(var(--spacing-unit) * -2);
}

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

.module-header h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  position: relative;
  padding-left: calc(var(--spacing-unit) * 2);
}

.module-header h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: var(--color-primary);
  border-radius: 2px;
}

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

.video-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.video-grid--related {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.video-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  border: 1px solid var(--color-border);
}

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

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

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

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

.video-cover__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.video-card:hover .video-cover__overlay {
  opacity: 1;
}

.play-icon {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--color-primary);
}

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

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

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

.video-meta {
  display: flex;
  gap: calc(var(--spacing-unit));
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--color-text-light);
}

.video-meta span {
  padding: 2px 8px;
  background: var(--color-bg-alt);
  border-radius: 4px;
}

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

.page-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.page-desc {
  font-size: 17px;
  color: var(--color-text-light);
  line-height: 1.6;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 3);
  padding: calc(var(--spacing-unit) * 2);
  background: var(--color-bg-alt);
  border-radius: var(--border-radius);
}

.filter-label {
  font-weight: 600;
}

.filter-tag {
  padding: 6px 16px;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-tag.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

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

.layout__side {
  background: var(--color-bg-alt);
  padding: calc(var(--spacing-unit) * 3);
  border-radius: var(--border-radius);
  height: fit-content;
  position: sticky;
  top: calc(var(--spacing-unit) * 12);
}

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

.sidebar-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.top-list__items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 2);
}

.top-list__item {
  display: grid;
  grid-template-columns: 50px 120px 1fr;
  gap: calc(var(--spacing-unit) * 2);
  padding: calc(var(--spacing-unit) * 2);
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  transition: all 0.3s;
}

.top-list__item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.top-rank {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  background: var(--color-bg-alt);
  color: var(--color-text-light);
  border-radius: var(--border-radius);
}

.top-rank--featured {
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
  color: white;
}

.top-list__cover {
  width: 120px;
  height: 70px;
  overflow: hidden;
  border-radius: var(--border-radius);
}

.top-list__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-list__info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.top-list__title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.top-list__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s;
}

.top-list__title a:hover {
  color: var(--color-primary);
}

.top-list__meta {
  font-size: 13px;
  color: var(--color-text-light);
  margin-bottom: calc(var(--spacing-unit) * 0.5);
}

.top-list__desc {
  font-size: 14px;
  color: var(--color-text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

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

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

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

.video-player {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

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

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

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

.player-play-icon {
  font-size: 32px;
  color: var(--color-primary);
  margin-left: 4px;
}

.detail-header {
  margin-bottom: calc(var(--spacing-unit) * 4);
  text-align: center;
}

.detail-header h1 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.3;
}

.detail-info {
  background: var(--color-bg-alt);
  padding: calc(var(--spacing-unit) * 4);
  border-radius: var(--border-radius);
  margin-bottom: calc(var(--spacing-unit) * 4);
}

.detail-info h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: calc(var(--spacing-unit) * 3);
}

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

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

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

.detail-module {
  margin-bottom: calc(var(--spacing-unit) * 5);
}

.detail-module h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: calc(var(--spacing-unit) * 3);
  padding-left: calc(var(--spacing-unit) * 2);
  position: relative;
}

.detail-module h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: var(--color-primary);
  border-radius: 2px;
}

.module-content {
  font-size: 17px;
  line-height: 1.8;
  color: var(--color-text);
}

.module-content p {
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.highlight-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-primary);
  padding: calc(var(--spacing-unit) * 2);
  background: linear-gradient(to right, rgba(0, 102, 204, 0.1), transparent);
  border-left: 4px solid var(--color-primary);
}

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

.tag {
  padding: 8px 16px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: 14px;
  color: var(--color-text);
  transition: all 0.3s;
}

.tag:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.detail-related {
  background: var(--color-bg-alt);
  padding: calc(var(--spacing-unit) * 4);
  border-radius: var(--border-radius);
}

.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  padding: calc(var(--spacing-unit) * 4) 0;
  text-align: center;
  color: var(--color-text-light);
}

.back-to-top {
  position: fixed;
  bottom: calc(var(--spacing-unit) * 4);
  right: calc(var(--spacing-unit) * 4);
  width: 50px;
  height: 50px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--color-secondary);
  transform: translateY(-4px);
}

.ui-style-0 {
  --color-primary: #333333;
  --color-secondary: #ff6b6b;
  --color-accent: #ffd93d;
}

.ui-style-1 {
  --color-primary: #ff6b00;
  --color-secondary: #e63946;
  --color-accent: #f1faee;
}

.ui-style-2 {
  --color-primary: #ff6b6b;
  --color-secondary: #4ecdc4;
  --color-accent: #1a535c;
}

.ui-style-3 {
  --color-primary: #e63946;
  --color-secondary: #f1faee;
  --color-accent: #a8dadc;
}

.ui-style-4 {
  --color-primary: #e50914;
  --color-secondary: #221f1f;
  --color-accent: #f5f5f1;
}

.ui-style-5 {
  --color-primary: #e50914;
  --color-secondary: #141414;
  --color-accent: #831010;
}

.ui-style-6 {
  --color-primary: #003f87;
  --color-secondary: #0080ff;
  --color-accent: #00d9ff;
}

.ui-style-7 {
  --color-primary: #042541;
  --color-secondary: #01b4e4;
  --color-accent: #90cea1;
}

.ui-style-8 {
  --color-primary: #00a86b;
  --color-secondary: #1a1a1a;
  --color-accent: #64d2ff;
}

.ui-style-9 {
  --color-primary: #e5e5e5;
  --color-secondary: #0f79af;
  --color-accent: #f9f9f9;
}

.ui-style-10 {
  --color-primary: #00c75a;
  --color-secondary: #00e676;
  --color-accent: #69f0ae;
}

.ui-style-11 {
  --color-primary: #0099ff;
  --color-secondary: #ff6666;
  --color-accent: #ffffff;
}

.ui-style-12 {
  --color-primary: #ff6700;
  --color-secondary: #ff8533;
  --color-accent: #ffb366;
}

.ui-style-13 {
  --color-primary: #00a1d6;
  --color-secondary: #fb7299;
  --color-accent: #ffffff;
}

.ui-style-14 {
  --color-primary: #003d7a;
  --color-secondary: #0066cc;
  --color-accent: #ff6b35;
}

@media (max-width: 768px) {
  .site-header .container {
    flex-direction: column;
    gap: calc(var(--spacing-unit) * 2);
  }

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: calc(var(--spacing-unit) * 1);
    font-size: 14px;
  }

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

  .module-header h2 {
    font-size: 22px;
  }

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

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

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

  .layout__side {
    position: static;
  }

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

  .top-list__cover {
    width: 100px;
    height: 60px;
  }

  .top-rank {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

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

  .detail-header h1 {
    font-size: 28px;
  }

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

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

  .site-nav {
    font-size: 13px;
    gap: 4px;
  }

  .back-to-top {
    width: 40px;
    height: 40px;
    bottom: calc(var(--spacing-unit) * 2);
    right: calc(var(--spacing-unit) * 2);
  }
}
