:root {
  --primary-color: #0099FF;
  --secondary-color: #FF6700;
  --text-color: #333;
  --bg-color: #fff;
  --border-color: #e0e0e0;
  --hover-bg: #f5f5f5;
  --spacing-unit: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

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

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

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

.site-logo a {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
  white-space: nowrap;
}

.main-nav {
  display: flex;
  gap: calc(var(--spacing-unit) * 3);
  align-items: center;
}

.main-nav a {
  color: var(--text-color);
  text-decoration: none;
  padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 2);
  border-radius: 4px;
  transition: all 0.3s;
  white-space: nowrap;
  font-size: 15px;
}

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

.main-content {
  min-height: calc(100vh - 200px);
  padding: calc(var(--spacing-unit) * 4) 0;
}

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

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

.hero-intro {
  font-size: 18px;
  opacity: 0.95;
  line-height: 1.8;
}

.site-intro {
  background: #f8f9fa;
  padding: calc(var(--spacing-unit) * 6) 0;
  margin-bottom: calc(var(--spacing-unit) * 6);
  border-radius: 8px;
}

.site-intro h2 {
  font-size: 28px;
  margin-bottom: calc(var(--spacing-unit) * 3);
  color: var(--text-color);
}

.site-intro p {
  font-size: 16px;
  line-height: 1.8;
  color: #666;
}

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

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

.section-header h2 {
  font-size: 26px;
  font-weight: 600;
}

.more-link {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  transition: opacity 0.3s;
}

.more-link:hover {
  opacity: 0.8;
}

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

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

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

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

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

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

.video-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 .video-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(--primary-color);
}

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

.video-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: calc(var(--spacing-unit) * 1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.video-meta {
  display: flex;
  gap: calc(var(--spacing-unit) * 2);
  font-size: 13px;
  color: #999;
}

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

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

.page-desc {
  font-size: 16px;
  color: #666;
  line-height: 1.6;
}

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

.layout__side--filters {
  position: sticky;
  top: 100px;
  height: fit-content;
  background: #f8f9fa;
  padding: calc(var(--spacing-unit) * 3);
  border-radius: 8px;
}

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

.filter-group h4 {
  font-size: 14px;
  margin-bottom: calc(var(--spacing-unit) * 2);
  color: #666;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--spacing-unit) * 1);
}

.filter-tag {
  padding: 4px 12px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.filter-tag:hover {
  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) * 3);
  padding: calc(var(--spacing-unit) * 3);
  margin-bottom: calc(var(--spacing-unit) * 2);
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  align-items: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.top-rank {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary-color);
  min-width: 50px;
  text-align: center;
}

.top-cover {
  width: 120px;
  height: 160px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

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

.top-info {
  flex: 1;
}

.top-title {
  font-size: 18px;
  margin-bottom: calc(var(--spacing-unit) * 1);
}

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

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

.top-one-line {
  font-size: 14px;
  color: #666;
  margin-bottom: calc(var(--spacing-unit) * 1);
  line-height: 1.6;
}

.top-meta {
  display: flex;
  gap: calc(var(--spacing-unit) * 2);
  font-size: 13px;
  color: #999;
}

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

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

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

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

.video-player {
  border-radius: 8px;
  overflow: hidden;
}

.video-player-inner {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  overflow: hidden;
}

.player-play-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border: none;
  background: rgba(255,255,255,0.95);
  border-radius: 50%;
  cursor: pointer;
  transition: all 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: 32px;
  color: var(--primary-color);
  padding-left: 4px;
}

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

.video-header h1 {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.4;
}

.video-basic-info {
  background: #f8f9fa;
  padding: calc(var(--spacing-unit) * 4);
  border-radius: 8px;
  margin-bottom: calc(var(--spacing-unit) * 4);
}

.video-basic-info h2 {
  font-size: 20px;
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: calc(var(--spacing-unit) * 2);
}

.info-item {
  font-size: 15px;
  line-height: 1.8;
}

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

.detail-module {
  margin-bottom: calc(var(--spacing-unit) * 4);
  padding: calc(var(--spacing-unit) * 4);
  background: white;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

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

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

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

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

.tag {
  padding: 6px 16px;
  background: var(--primary-color);
  color: white;
  border-radius: 20px;
  font-size: 14px;
}

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

.video-card--related {
  border: 1px solid var(--border-color);
}

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

.site-footer p {
  font-size: 14px;
  opacity: 0.8;
}

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

.back-to-top.visible {
  opacity: 1;
  pointer-events: all;
}

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

.ui-style-0 { --primary-color: #000; --secondary-color: #ff4757; }
.ui-style-1 { --primary-color: #ff6348; --secondary-color: #ffa502; }
.ui-style-2 { --primary-color: #0099FF; --secondary-color: #FF6700; }
.ui-style-3 { --primary-color: #e74c3c; --secondary-color: #f39c12; }
.ui-style-4 { --primary-color: #e74c3c; --secondary-color: #34495e; }
.ui-style-5 { --primary-color: #e50914; --secondary-color: #b20710; }
.ui-style-6 { --primary-color: #0063e5; --secondary-color: #0063e5; }
.ui-style-7 { --primary-color: #0077b6; --secondary-color: #ffc300; }
.ui-style-8 { --primary-color: #00c853; --secondary-color: #00c853; }
.ui-style-9 { --primary-color: #141414; --secondary-color: #e50914; }
.ui-style-10 { --primary-color: #00C75A; --secondary-color: #00C75A; }
.ui-style-11 { --primary-color: #0099FF; --secondary-color: #FF6700; }
.ui-style-12 { --primary-color: #FF6700; --secondary-color: #ff4500; }
.ui-style-13 { --primary-color: #00A1D6; --secondary-color: #FB7299; }
.ui-style-14 { --primary-color: #003d7a; --secondary-color: #ff6700; }

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

  .main-nav {
    width: 100%;
    overflow-x: auto;
    gap: calc(var(--spacing-unit) * 1);
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .main-nav a {
    flex-shrink: 0;
    padding: calc(var(--spacing-unit) * 1) calc(var(--spacing-unit) * 1.5);
    font-size: 14px;
  }

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

  .hero-intro {
    font-size: 16px;
  }

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

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

  .layout__side--filters {
    position: static;
  }

  .top-list__item {
    flex-direction: column;
    text-align: center;
  }

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

  .top-cover {
    width: 100%;
    height: 200px;
  }

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

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

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

  .video-one-line {
    font-size: 13px;
    -webkit-line-clamp: 1;
  }
}
