:root {
  --spacing-unit: 8px;
  --primary-color: #e74c3c;
  --text-color: #333;
  --bg-color: #fff;
  --border-color: #e0e0e0;
  --hover-color: #c0392b;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

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

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

.nav-link {
  padding: calc(var(--spacing-unit) * 2) 0;
  font-size: 15px;
  transition: color 0.3s;
  position: relative;
}

.nav-link:hover {
  color: var(--primary-color);
}

.nav-link--active {
  color: var(--primary-color);
  font-weight: 600;
}

.nav-link--active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-color);
}

.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 3) calc(var(--spacing-unit) * 2);
}

.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: calc(var(--spacing-unit) * 8) calc(var(--spacing-unit) * 3);
  border-radius: 16px;
  margin-bottom: calc(var(--spacing-unit) * 4);
  text-align: center;
}

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

.hero-desc {
  font-size: 16px;
  line-height: 1.8;
  max-width: 900px;
  margin: 0 auto;
  opacity: 0.95;
}

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

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.section-title {
  font-size: 24px;
  font-weight: 700;
}

.section-more {
  color: var(--primary-color);
  font-size: 14px;
  transition: transform 0.3s;
}

.section-more:hover {
  transform: translateX(4px);
}

.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));
  gap: calc(var(--spacing-unit) * 2);
}

.video-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.video-card__link {
  display: block;
}

.video-cover {
  position: relative;
  padding-top: 140%;
  background: #f5f5f5;
  overflow: hidden;
}

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

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.video-card:hover .play-overlay {
  opacity: 1;
}

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

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

.video-title {
  font-size: 16px;
  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-meta {
  font-size: 13px;
  color: #888;
  margin-bottom: calc(var(--spacing-unit));
}

.video-one-line {
  font-size: 14px;
  color: #666;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

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

.page-desc {
  font-size: 16px;
  color: #666;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
}

.filter-bar {
  display: flex;
  gap: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 3);
  flex-wrap: wrap;
}

.filter-item {
  padding: calc(var(--spacing-unit)) calc(var(--spacing-unit) * 3);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-item:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

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

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

.layout__side--filters {
  position: sticky;
  top: 80px;
  height: fit-content;
}

.layout__side--filters h3 {
  font-size: 18px;
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.filter-tags {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit));
}

.filter-tag {
  padding: calc(var(--spacing-unit)) calc(var(--spacing-unit) * 2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

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

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

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

.top-list__item {
  display: flex;
  gap: calc(var(--spacing-unit) * 2);
  padding: calc(var(--spacing-unit) * 3);
  background: white;
  border-radius: 12px;
  margin-bottom: calc(var(--spacing-unit) * 2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.rank-badge {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  border-radius: 8px;
  flex-shrink: 0;
}

.rank-badge--top {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
}

.rank-badge--normal {
  background: #f5f5f5;
  color: #888;
}

.top-item__cover {
  width: 120px;
  flex-shrink: 0;
}

.top-item__cover img {
  width: 100%;
  border-radius: 8px;
}

.top-item__info {
  flex: 1;
}

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

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

.top-item__meta {
  font-size: 13px;
  color: #888;
  margin-bottom: calc(var(--spacing-unit));
}

.top-item__desc {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
}

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

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

.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 {
  max-width: 1200px;
  margin: 0 auto;
}

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

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

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

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

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

.detail-title {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.detail-info {
  max-width: 900px;
  margin: 0 auto calc(var(--spacing-unit) * 4);
  background: white;
  padding: calc(var(--spacing-unit) * 4);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

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

.info-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 3);
  font-size: 15px;
  line-height: 1.8;
}

.info-list dt {
  font-weight: 600;
  color: #666;
}

.info-list dd {
  color: #333;
}

.detail-module {
  max-width: 900px;
  margin: 0 auto calc(var(--spacing-unit) * 4);
  background: white;
  padding: calc(var(--spacing-unit) * 4);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

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

.module-content {
  font-size: 15px;
  line-height: 1.8;
  color: #333;
}

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

.module-content p:last-child {
  margin-bottom: 0;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.tag-item {
  padding: calc(var(--spacing-unit)) calc(var(--spacing-unit) * 2);
  background: #f5f5f5;
  border-radius: 20px;
  font-size: 14px;
  color: #666;
}

.tag-desc {
  font-size: 15px;
  color: #666;
}

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

.video-card--related .video-cover {
  padding-top: 130%;
}

.site-footer {
  background: #2c3e50;
  color: white;
  padding: calc(var(--spacing-unit) * 5) calc(var(--spacing-unit) * 2);
  margin-top: calc(var(--spacing-unit) * 8);
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}

.footer-text {
  margin-bottom: calc(var(--spacing-unit) * 2);
  font-size: 14px;
  opacity: 0.8;
}

.footer-links {
  font-size: 14px;
}

.footer-links a {
  opacity: 0.8;
  transition: opacity 0.3s;
}

.footer-links a:hover {
  opacity: 1;
}

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

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

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

@media (max-width: 1024px) {
  .page--with-sidebar {
    grid-template-columns: 1fr;
  }

  .layout__side--filters {
    position: static;
  }
}

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

  .site-nav {
    width: 100%;
    justify-content: space-between;
    gap: calc(var(--spacing-unit));
  }

  .nav-link {
    font-size: 14px;
    padding: calc(var(--spacing-unit));
  }

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

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

  .page-title {
    font-size: 28px;
  }

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

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

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

  .top-list__item {
    flex-direction: column;
  }

  .top-item__cover {
    width: 100%;
  }

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

  .detail-info,
  .detail-module {
    padding: calc(var(--spacing-unit) * 3);
  }

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

.ui-style-0 { --primary-color: #000; }
.ui-style-1 { --primary-color: #ff6b35; }
.ui-style-2 { --primary-color: #2ecc71; }
.ui-style-3 { --primary-color: #e74c3c; }
.ui-style-4 { --primary-color: #c0392b; }
.ui-style-5 { --primary-color: #e74c3c; }
.ui-style-6 { --primary-color: #3498db; }
.ui-style-7 { --primary-color: #1e90ff; }
.ui-style-8 { --primary-color: #2ecc71; }
.ui-style-9 { --primary-color: #000; }
.ui-style-10 { --primary-color: #00c75a; }
.ui-style-11 { --primary-color: #0099ff; }
.ui-style-12 { --primary-color: #ff6700; }
.ui-style-13 { --primary-color: #00a1d6; }
.ui-style-14 { --primary-color: #1a3a52; }
