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

:root {
  --spacing-unit: 8px;
  --primary-color: #0099FF;
  --secondary-color: #FF6B35;
  --text-color: #333;
  --bg-color: #fff;
  --border-color: #e0e0e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

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);
}

body.ui-style-11 {
  --primary-color: #0099FF;
  --secondary-color: #FF6B35;
  --bg-color: #f8f9fa;
}

.site-header {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

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

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

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

.site-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;
  font-size: 15px;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--primary-color);
  background: rgba(0, 153, 255, 0.1);
}

main {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--spacing-unit) * 3);
  min-height: 60vh;
}

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

.hero-content h1 {
  font-size: 28px;
  margin-bottom: calc(var(--spacing-unit) * 2);
  line-height: 1.4;
}

.hero-subtitle {
  font-size: 18px;
  opacity: 0.9;
}

.site-intro {
  background: white;
  padding: calc(var(--spacing-unit) * 4);
  border-radius: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 4);
  box-shadow: var(--shadow);
}

.site-intro h2 {
  margin-bottom: calc(var(--spacing-unit) * 2);
  color: var(--primary-color);
}

.site-intro p {
  line-height: 1.8;
  text-align: justify;
}

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

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

.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: calc(var(--spacing-unit) * 2);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

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

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

.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));
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 48px;
}

.video-meta {
  font-size: 13px;
  color: #666;
  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;
}

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

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

.video-player {
  width: 100%;
  background: #000;
  border-radius: calc(var(--spacing-unit) * 2);
  overflow: hidden;
}

.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%;
  border: none;
  background: rgba(255,255,255,0.9);
  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);
  margin-left: 4px;
}

.video-header h1 {
  font-size: 32px;
  margin-bottom: calc(var(--spacing-unit) * 3);
  line-height: 1.3;
}

.video-basic-info {
  background: white;
  padding: calc(var(--spacing-unit) * 4);
  border-radius: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 4);
  box-shadow: var(--shadow);
}

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

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

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

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

.detail-module {
  background: white;
  padding: calc(var(--spacing-unit) * 4);
  border-radius: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 4);
  box-shadow: var(--shadow);
}

.detail-module h2 {
  font-size: 20px;
  margin-bottom: calc(var(--spacing-unit) * 3);
  color: var(--primary-color);
}

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

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

.tag {
  display: inline-block;
  padding: calc(var(--spacing-unit)) calc(var(--spacing-unit) * 2);
  background: rgba(0, 153, 255, 0.1);
  color: var(--primary-color);
  border-radius: calc(var(--spacing-unit));
  font-size: 14px;
}

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

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

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

.video-card--related {
  background: white;
  border-radius: calc(var(--spacing-unit) * 2);
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

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

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

.page--grid .video-grid {
  margin-top: calc(var(--spacing-unit) * 4);
}

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

.layout__side--filters {
  background: white;
  padding: calc(var(--spacing-unit) * 4);
  border-radius: calc(var(--spacing-unit) * 2);
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 80px;
}

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

.layout__side--filters p {
  font-size: 14px;
  line-height: 1.8;
  color: #666;
}

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

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

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

.top-list__item:nth-child(1) .top-rank {
  color: #FFD700;
}

.top-list__item:nth-child(2) .top-rank {
  color: #C0C0C0;
}

.top-list__item:nth-child(3) .top-rank {
  color: #CD7F32;
}

.top-cover {
  width: 150px;
  height: 85px;
  border-radius: calc(var(--spacing-unit));
  overflow: hidden;
  background: #f0f0f0;
}

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

.top-info h3 {
  font-size: 18px;
  margin-bottom: calc(var(--spacing-unit));
}

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

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

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

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

.page--grouped .groups-container {
  margin-top: calc(var(--spacing-unit) * 4);
}

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

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

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

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

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

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

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

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

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

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

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

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

  .hero-content h1 {
    font-size: 20px;
  }

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

  .video-grid {
    grid-template-columns: 1fr;
  }

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

  .video-title {
    min-height: auto;
  }

  .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 1fr;
    grid-template-rows: auto auto;
    gap: calc(var(--spacing-unit) * 2);
  }

  .top-rank {
    font-size: 24px;
    grid-row: 1 / 3;
  }

  .top-cover {
    width: 100%;
    height: 120px;
    grid-column: 2;
  }

  .top-info {
    grid-column: 2;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .info-list {
    grid-template-columns: 80px 1fr;
  }

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

@media (max-width: 480px) {
  .site-nav a {
    padding: calc(var(--spacing-unit) * 0.5) calc(var(--spacing-unit));
    font-size: 13px;
  }
}
