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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

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

.site-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-logo {
  font-size: 1.25rem;
  font-weight: bold;
  color: #333;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-link {
  color: #666;
  text-decoration: none;
  padding: 0.5rem 0;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
  color: #e74c3c;
}

.home-main,
.list-main,
.detail-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.hero-section {
  text-align: center;
  padding: 3rem 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 8px;
  margin-bottom: 2rem;
}

.hero-title {
  font-size: 1.75rem;
  line-height: 1.4;
}

.site-intro {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.site-intro p {
  line-height: 1.8;
  color: #555;
}

.video-section {
  margin-bottom: 3rem;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #333;
  border-left: 4px solid #e74c3c;
  padding-left: 1rem;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.video-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px 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: #ddd;
}

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

.video-info {
  padding: 1rem;
}

.video-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-one-line {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.page-desc {
  color: #666;
  font-size: 1rem;
}

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

.top-list__item {
  background: #fff;
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.top-list__rank {
  font-size: 1.5rem;
  font-weight: bold;
  color: #e74c3c;
  min-width: 40px;
  text-align: center;
}

.top-list__cover {
  width: 120px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #ddd;
}

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

.top-list__info {
  flex: 1;
}

.top-list__title {
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.top-list__title a {
  color: #333;
  text-decoration: none;
}

.top-list__title a:hover {
  color: #e74c3c;
}

.top-list__meta {
  font-size: 0.875rem;
  color: #999;
  margin-bottom: 0.25rem;
}

.top-list__desc {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.5;
}

.page--with-sidebar .layout__with-sidebar {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
}

.layout__side--filters {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  height: fit-content;
}

.layout__side--filters h3 {
  margin-bottom: 1rem;
  color: #333;
}

.page--grouped .group {
  margin-bottom: 3rem;
}

.group__title {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #333;
  border-left: 4px solid #e74c3c;
  padding-left: 1rem;
}

.group__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.video-player-section {
  margin-bottom: 2rem;
}

.video-player {
  max-width: 900px;
  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(231, 76, 60, 0.9);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  transition: all 0.3s;
}

.player-play-btn:hover {
  background: rgba(231, 76, 60, 1);
  transform: translate(-50%, -50%) scale(1.1);
}

.detail-header {
  margin-bottom: 2rem;
}

.detail-header h1 {
  font-size: 2rem;
  color: #333;
}

.detail-info,
.detail-module,
.related-section {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.detail-info h2,
.detail-module h2,
.related-section h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: #333;
  border-left: 4px solid #e74c3c;
  padding-left: 1rem;
}

.info-list {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.75rem;
}

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

.info-list dd {
  color: #333;
}

.detail-module p {
  line-height: 1.8;
  color: #555;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: #f0f0f0;
  border-radius: 16px;
  font-size: 0.875rem;
  color: #666;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.site-footer {
  background: #333;
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
  margin-top: 4rem;
}

.back-to-top {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  width: 48px;
  height: 48px;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 99;
}

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

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

@media (max-width: 768px) {
  .video-grid,
  .group__grid,
  .related-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }

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

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

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

  .top-list__cover {
    width: 100%;
    height: auto;
    padding-top: 56.25%;
    position: relative;
  }

  .top-list__cover img {
    position: absolute;
    top: 0;
    left: 0;
  }

  .hero-title {
    font-size: 1.25rem;
  }

  .site-nav {
    gap: 1rem;
    white-space: nowrap;
    overflow-x: auto;
  }

  .nav-link {
    font-size: 0.875rem;
  }
}

body.ui-style-5 {
  --primary-color: #e74c3c;
  --secondary-color: #667eea;
}

body.ui-style-5 .hero-section {
  background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

body.ui-style-5 .nav-link:hover,
body.ui-style-5 .nav-link.active {
  color: var(--primary-color);
}