/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.6; color: #333; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Navigation */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-logo { font-size: 24px; font-weight: bold; }
.nav-links { display: flex; gap: 25px; }
.nav-links a { padding: 8px 12px; transition: color 0.3s; }
.nav-links a:hover { color: #e50914; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 40px 20px;
  background: #f8f8f8;
  margin-top: 60px;
  color: #666;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 80px 20px;
  text-align: center;
}
.hero-content h1 { font-size: 32px; margin-bottom: 20px; line-height: 1.4; }
.hero-desc { font-size: 18px; opacity: 0.95; max-width: 800px; margin: 0 auto; }

/* Intro Section */
.intro-section { padding: 40px 20px; background: #f9f9f9; }
.intro-section p { font-size: 16px; line-height: 1.8; color: #555; }

/* Video Section */
.video-section { padding: 50px 0; }
.section-title {
  font-size: 28px;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 3px solid #e50914;
  display: inline-block;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
}

/* Video Card */
.video-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}
.video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.video-cover {
  position: relative;
  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: 15px; }
.video-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-one-line {
  font-size: 14px;
  color: #666;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video-meta {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #999;
}
.video-meta span {
  padding: 2px 8px;
  background: #f0f0f0;
  border-radius: 3px;
}

/* List Pages */
.page-header {
  text-align: center;
  padding: 40px 0;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 40px;
}
.page-header h1 { font-size: 32px; margin-bottom: 15px; }
.page-header p { font-size: 16px; color: #666; }

.list-main { min-height: 60vh; padding: 20px 0; }

/* Top List (L3) */
.page--top .top-list__items { list-style: none; }
.top-item {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: #fff;
  margin-bottom: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  align-items: center;
}
.top-rank {
  font-size: 32px;
  font-weight: bold;
  color: #e50914;
  min-width: 50px;
  text-align: center;
}
.top-cover {
  width: 120px;
  flex-shrink: 0;
}
.top-cover img {
  border-radius: 6px;
}
.top-info { flex: 1; }
.top-info h3 {
  font-size: 20px;
  margin-bottom: 10px;
}
.top-info h3 a:hover { color: #e50914; }
.top-info p {
  color: #666;
  margin-bottom: 10px;
}

/* Grouped (L4) */
.page--grouped .group { margin-bottom: 50px; }
.group__title {
  font-size: 24px;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e50914;
}

/* Sidebar (L2) */
.page--with-sidebar .container > * {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 30px;
}
.layout__side--filters {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 8px;
  align-self: start;
  position: sticky;
  top: 80px;
}

/* Detail Page */
.video-player-section {
  background: #000;
  padding: 20px 0;
}
.video-player {
  max-width: 1000px;
  margin: 0 auto;
}
.video-player-inner {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
}
.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-radius: 50%;
  font-size: 32px;
  color: #e50914;
  transition: all 0.3s;
}
.player-play-btn:hover {
  background: #fff;
  transform: translate(-50%, -50%) scale(1.1);
}
.player-play-icon { display: block; padding-left: 5px; }

.detail-main { padding-bottom: 60px; }
.detail-header {
  padding: 40px 0 30px;
  border-bottom: 2px solid #e0e0e0;
}
.detail-header h1 { font-size: 36px; }

.detail-info, .detail-module, .related-section {
  padding: 30px 0;
  border-bottom: 1px solid #e0e0e0;
}
.detail-info h2, .detail-module h2, .related-section h2 {
  font-size: 24px;
  margin-bottom: 20px;
}
.info-list {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 15px;
  font-size: 15px;
}
.info-list dt {
  font-weight: 600;
  color: #666;
}
.info-list dd { color: #333; }

.tags-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  padding: 6px 14px;
  background: #f0f0f0;
  border-radius: 20px;
  font-size: 14px;
  transition: background 0.3s;
}
.tag:hover { background: #e50914; color: #fff; }

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 40px;
  right: 40px;
  width: 50px;
  height: 50px;
  background: #e50914;
  color: white;
  border-radius: 50%;
  font-size: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 99;
}
.back-to-top.show { opacity: 1; visibility: visible; }

/* UI Style Variants */
.ui-style-0 .hero-section { background: linear-gradient(135deg, #000 0%, #434343 100%); }
.ui-style-1 .hero-section { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%); }
.ui-style-2 .hero-section { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.ui-style-3 .hero-section { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.ui-style-4 .hero-section { background: linear-gradient(135deg, #30cfd0 0%, #330867 100%); }
.ui-style-5 .site-nav { background: #141414; color: #fff; }
.ui-style-6 .hero-section { background: linear-gradient(135deg, #0f2027 0%, #2c5364 100%); }
.ui-style-7 .hero-section { background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); }
.ui-style-8 .hero-section { background: linear-gradient(135deg, #134e5e 0%, #71b280 100%); }
.ui-style-9 .site-nav { background: #0a0a0a; color: #fff; border: none; }
.ui-style-10 .hero-section { background: linear-gradient(135deg, #00C75A 0%, #00a047 100%); }
.ui-style-11 .hero-section { background: linear-gradient(135deg, #0099FF 0%, #0077cc 100%); }
.ui-style-12 .hero-section { background: linear-gradient(135deg, #FF6700 0%, #ff5722 100%); }
.ui-style-13 .hero-section { background: linear-gradient(135deg, #00A1D6 0%, #FB7299 100%); }
.ui-style-14 .hero-section { background: linear-gradient(135deg, #003366 0%, #004488 100%); }

/* Mobile Responsive */
@media (max-width: 768px) {
  .site-nav { flex-wrap: nowrap; padding: 12px 15px; }
  .site-logo { font-size: 18px; flex-shrink: 0; }
  .nav-links {
    gap: 8px;
    font-size: 13px;
    white-space: nowrap;
  }
  .nav-links a { padding: 6px 8px; }

  .hero-content h1 { font-size: 22px; }
  .hero-desc { font-size: 15px; }

  .video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .video-cover { padding-top: 120%; }
  .video-info { padding: 10px; }
  .video-title { font-size: 14px; }
  .video-one-line { font-size: 12px; }

  .top-item { flex-direction: column; text-align: center; }
  .top-cover { width: 150px; margin: 0 auto; }

  .page--with-sidebar .container > * {
    grid-template-columns: 1fr;
  }
  .layout__side--filters { position: static; }

  .detail-header h1 { font-size: 26px; }
  .info-list { grid-template-columns: 80px 1fr; gap: 10px; }

  .back-to-top { bottom: 20px; right: 20px; width: 45px; height: 45px; }
}

@media (max-width: 480px) {
  .video-grid { grid-template-columns: 1fr; }
  .nav-links { gap: 5px; font-size: 12px; }
  .nav-links a { padding: 5px 6px; }
}