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

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

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

body.ui-style-0 {
  --primary-color: #fe2c55;
  --bg-color: #000;
  --text-color: #fff;
}

body.ui-style-1 {
  --primary-color: #ff4500;
  --bg-color: #121212;
  --text-color: #f0f0f0;
}

body.ui-style-2 {
  --primary-color: #ff6600;
  --bg-color: #ffffff;
  --text-color: #333333;
}

body.ui-style-3 {
  --primary-color: #ff2742;
  --bg-color: #ffffff;
  --text-color: #333333;
}

body.ui-style-4 {
  --primary-color: #e50914;
  --bg-color: #ffffff;
  --text-color: #000000;
}

body.ui-style-5 {
  --primary-color: #e50914;
  --bg-color: #141414;
  --text-color: #ffffff;
}

body.ui-style-6 {
  --primary-color: #1e3a8a;
  --bg-color: #0f172a;
  --text-color: #e2e8f0;
}

body.ui-style-7 {
  --primary-color: #3b82f6;
  --bg-color: #0f172a;
  --text-color: #f1f5f9;
}

body.ui-style-8 {
  --primary-color: #10b981;
  --bg-color: #1a1a1a;
  --text-color: #f5f5f5;
}

body.ui-style-9 {
  --primary-color: #ffffff;
  --bg-color: #000000;
  --text-color: #ffffff;
}

body.ui-style-10 {
  --primary-color: #00C75A;
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
}

body.ui-style-11 {
  --primary-color: #0099FF;
  --bg-color: #fafafa;
  --text-color: #333333;
}

body.ui-style-12 {
  --primary-color: #FF6700;
  --bg-color: #ffffff;
  --text-color: #333333;
}

body.ui-style-13 {
  --primary-color: #00A1D6;
  --bg-color: #ffffff;
  --text-color: #212121;
}

body.ui-style-14 {
  --primary-color: #1e40af;
  --bg-color: #ffffff;
  --text-color: #1f2937;
}

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

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

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

.site-nav a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 16px;
  white-space: nowrap;
  transition: color 0.3s;
}

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

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

.site-intro {
  text-align: center;
  margin-bottom: calc(var(--spacing-unit) * 6);
  padding: calc(var(--spacing-unit) * 4) calc(var(--spacing-unit) * 2);
}

.main-title {
  font-size: 32px;
  margin-bottom: calc(var(--spacing-unit) * 2);
  color: var(--text-color);
}

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

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

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

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

.video-card {
  background: var(--bg-color);
  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 4px 12px rgba(0, 0, 0, 0.1);
}

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

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

.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(--text-color);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-meta {
  font-size: 14px;
  color: #666;
}

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

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

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

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

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

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

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

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

.top-item {
  display: flex;
  align-items: center;
  gap: calc(var(--spacing-unit) * 2);
  padding: calc(var(--spacing-unit) * 2);
  margin-bottom: calc(var(--spacing-unit) * 2);
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: box-shadow 0.3s;
}

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

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

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

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

.top-info {
  flex: 1;
}

.top-info .video-title a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
}

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

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

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

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

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

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

.video-player {
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.video-player-inner {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
}

.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: rgba(255, 255, 255, 1);
  transform: translate(-50%, -50%) scale(1.1);
}

.player-play-icon {
  font-size: 36px;
  color: #000;
  margin-left: 4px;
}

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

.detail-title {
  font-size: 36px;
  color: var(--text-color);
}

.detail-info {
  margin-bottom: calc(var(--spacing-unit) * 4);
  padding: calc(var(--spacing-unit) * 3);
  background: var(--hover-bg);
  border-radius: 8px;
}

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

.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: #666;
}

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

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

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

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

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

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

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

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

.site-footer {
  background: var(--hover-bg);
  border-top: 1px solid var(--border-color);
  padding: calc(var(--spacing-unit) * 4) 0;
  text-align: center;
  color: #666;
  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;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 1000;
}

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

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .site-nav {
    gap: calc(var(--spacing-unit) * 1.5);
    font-size: 14px;
  }

  .site-nav a {
    font-size: 14px;
  }

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

  .intro-text {
    font-size: 14px;
  }

  .section-title {
    font-size: 20px;
  }

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

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

  .video-title {
    font-size: 14px;
    -webkit-line-clamp: 1;
  }

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

  .layout__side--filters {
    position: static;
  }

  .top-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .top-rank {
    position: absolute;
    top: calc(var(--spacing-unit) * 2);
    left: calc(var(--spacing-unit) * 2);
  }

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

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .group__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .site-nav {
    width: 100%;
    justify-content: space-between;
  }

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