:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --bg-color: #f5f5f5;
  --card-bg: #ffffff;
  --text-color: #333333;
  --text-light: #666666;
  --border-color: #e0e0e0;
  --hover-bg: #f0f0f0;
  --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", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: var(--bg-color);
}

.layout-container {
  display: flex;
  min-height: 100vh;
}

.layout__side {
  width: 240px;
  background: var(--card-bg);
  border-right: 1px solid var(--border-color);
  padding: calc(var(--spacing-unit) * 3);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.layout__main {
  flex: 1;
  padding: calc(var(--spacing-unit) * 3);
  max-width: 1400px;
  margin: 0 auto;
}

.site-brand h2 {
  font-size: 24px;
  color: var(--primary-color);
  margin-bottom: calc(var(--spacing-unit) * 3);
}

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

.site-nav {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 4);
}

.nav-link {
  display: block;
  padding: calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 2);
  color: var(--text-color);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: var(--hover-bg);
  color: var(--secondary-color);
}

.nav-link.active {
  background: var(--secondary-color);
  color: white;
}

.side-info {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.8;
}

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

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

.page-subtitle {
  font-size: 16px;
  color: var(--text-light);
}

.intro-section {
  background: var(--card-bg);
  padding: calc(var(--spacing-unit) * 3);
  border-radius: 8px;
  margin-bottom: calc(var(--spacing-unit) * 4);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.intro-content p {
  margin-bottom: calc(var(--spacing-unit) * 2);
  line-height: 1.8;
}

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

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

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

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

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

.video-card {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.3s ease;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 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%;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

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

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

.video-meta {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: calc(var(--spacing-unit));
}

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

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

.top-item {
  display: flex;
  gap: calc(var(--spacing-unit) * 2);
  background: var(--card-bg);
  padding: calc(var(--spacing-unit) * 2);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

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

.top-rank {
  font-size: 28px;
  font-weight: bold;
  color: var(--accent-color);
  min-width: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-item .video-cover {
  width: 200px;
  flex-shrink: 0;
  padding-top: 0;
  height: 112px;
}

.top-item .video-cover img {
  position: relative;
}

.top-item .video-info {
  flex: 1;
  padding: 0;
}

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

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

.page-with-sidebar {
  display: flex;
  gap: calc(var(--spacing-unit) * 3);
}

.sidebar-filters {
  width: 200px;
  flex-shrink: 0;
  background: var(--card-bg);
  padding: calc(var(--spacing-unit) * 3);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  height: fit-content;
  position: sticky;
  top: calc(var(--spacing-unit) * 3);
}

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

.page-with-sidebar .video-grid {
  flex: 1;
}

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

.group-title {
  font-size: 20px;
  color: var(--primary-color);
  margin-bottom: calc(var(--spacing-unit) * 3);
  padding-bottom: calc(var(--spacing-unit));
  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);
}

.detail-page {
  max-width: 1200px;
}

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

.video-player {
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

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

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

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

.detail-title {
  font-size: 36px;
  color: var(--primary-color);
  line-height: 1.3;
}

.detail-info {
  background: var(--card-bg);
  padding: calc(var(--spacing-unit) * 3);
  border-radius: 8px;
  margin-bottom: calc(var(--spacing-unit) * 4);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.info-title {
  font-size: 20px;
  color: var(--primary-color);
  margin-bottom: calc(var(--spacing-unit) * 2);
}

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

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

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

.detail-module {
  background: var(--card-bg);
  padding: calc(var(--spacing-unit) * 3);
  border-radius: 8px;
  margin-bottom: calc(var(--spacing-unit) * 3);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

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

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

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

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

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

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

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

.ui-style-6 {
  --primary-color: #2c5f2d;
  --secondary-color: #00C75A;
  --accent-color: #97ce4c;
  --bg-color: #f8fdf8;
}

@media (max-width: 1024px) {
  .layout__side {
    width: 200px;
  }

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

@media (max-width: 768px) {
  .layout-container {
    flex-direction: column;
  }

  .layout__side {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .site-nav {
    flex-direction: row;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    display: inline-block;
    white-space: nowrap;
  }

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

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

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

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

  .page-with-sidebar {
    flex-direction: column;
  }

  .sidebar-filters {
    width: 100%;
    position: static;
  }

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

  .top-item .video-cover {
    width: 100%;
  }

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

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

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