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

:root {
  --bg-primary: #000;
  --bg-secondary: #1a1a1a;
  --text-primary: #fff;
  --text-secondary: #aaa;
  --accent: #00A1D6;
  --accent-hover: #0090c0;
  --border: #333;
  --spacing: 8px;
}

body.ui-style-5 {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

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

.site-nav {
  display: flex;
  gap: calc(var(--spacing) * 2);
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

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

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

.site-nav a:hover,
.site-nav a.active {
  color: var(--text-primary);
  background: var(--accent);
}

.main-content {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: calc(var(--spacing) * 3);
}

.layout-sidebar {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: calc(var(--spacing) * 3);
  align-items: start;
}

.layout__side {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: calc(var(--spacing) * 3);
  position: sticky;
  top: 80px;
}

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

.layout__side p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: calc(var(--spacing) * 2);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing);
}

.tag {
  padding: calc(var(--spacing) * 0.5) calc(var(--spacing) * 1.5);
  background: var(--bg-primary);
  border-radius: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.tag:hover {
  background: var(--accent);
  color: var(--text-primary);
}

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

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

.page-header p {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
}

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

.video-card {
  background: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

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

.video-card__link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.video-cover {
  position: relative;
  padding-top: 140%;
  overflow: hidden;
  background: var(--bg-primary);
}

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

.video-info {
  padding: calc(var(--spacing) * 2);
  flex: 1;
  display: flex;
  flex-direction: column;
}

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

.video-one-line,
.video-meta {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-top: auto;
}

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

.video-player {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

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

.player-play-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(0, 161, 214, 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: var(--accent);
  transform: translate(-50%, -50%) scale(1.1);
}

.player-play-icon {
  font-size: 32px;
  color: white;
  margin-left: 4px;
}

.video-player-inner.is-playing .player-play-btn {
  display: none;
}

.detail-main {
  max-width: 1000px;
  margin: 0 auto;
}

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

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

.detail-section {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: calc(var(--spacing) * 3);
  margin-bottom: calc(var(--spacing) * 3);
}

.detail-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: calc(var(--spacing) * 2);
  color: var(--accent);
}

.detail-section p,
.detail-section li {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: calc(var(--spacing) * 1.5);
}

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

.info-item {
  display: flex;
  flex-direction: column;
  gap: calc(var(--spacing) * 0.5);
}

.info-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.info-value {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 500;
}

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

.video-card--related {
  font-size: 14px;
}

.video-card--related .video-title {
  font-size: 14px;
  -webkit-line-clamp: 2;
}

.video-card--related .video-one-line {
  font-size: 12px;
  -webkit-line-clamp: 2;
}

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

.top-list__item {
  counter-increment: top-counter;
  display: grid;
  grid-template-columns: 60px 120px 1fr;
  gap: calc(var(--spacing) * 2);
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: calc(var(--spacing) * 2);
  margin-bottom: calc(var(--spacing) * 2);
  transition: all 0.2s;
}

.top-list__item:hover {
  background: var(--border);
  transform: translateX(8px);
}

.top-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--accent);
  border-radius: 8px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.top-rank::before {
  content: counter(top-counter);
}

.top-list__item:nth-child(1) .top-rank {
  background: linear-gradient(135deg, #FFD700, #FFA500);
}

.top-list__item:nth-child(2) .top-rank {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
}

.top-list__item:nth-child(3) .top-rank {
  background: linear-gradient(135deg, #CD7F32, #8B4513);
}

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

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

.top-info {
  flex: 1;
}

.top-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: calc(var(--spacing) * 1);
  color: var(--text-primary);
}

.top-info p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

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

.group h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: calc(var(--spacing) * 3);
  padding-bottom: calc(var(--spacing) * 2);
  border-bottom: 2px solid var(--accent);
}

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

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

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

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

.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: calc(var(--spacing) * 3);
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: auto;
}

.intro-section {
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: calc(var(--spacing) * 3);
  margin-bottom: calc(var(--spacing) * 4);
}

.intro-section h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: calc(var(--spacing) * 2);
  color: var(--accent);
}

.intro-section p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}

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

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

.module-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.module-more {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.module-more:hover {
  color: var(--accent-hover);
}

@media (max-width: 768px) {
  .site-header {
    padding: calc(var(--spacing) * 1.5) calc(var(--spacing) * 2);
  }

  .header-inner {
    gap: calc(var(--spacing) * 2);
  }

  .site-logo {
    font-size: 20px;
  }

  .site-nav {
    gap: calc(var(--spacing) * 1);
  }

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

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

  .layout__side {
    position: static;
  }

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

  .page-header h1 {
    font-size: 24px;
  }

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

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

  .detail-header h1 {
    font-size: 28px;
  }

  .top-list__item {
    grid-template-columns: 50px 100px 1fr;
    gap: calc(var(--spacing) * 1.5);
    padding: calc(var(--spacing) * 1.5);
  }

  .top-rank {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

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

  .top-info h3 {
    font-size: 16px;
  }

  .top-info p {
    font-size: 13px;
  }

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

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

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