/* Global Styles */
* {
  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;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Header */
.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: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
}

.logo a {
  font-size: 24px;
  font-weight: bold;
  color: #2c3e50;
}

.main-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 8px;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}

.nav-list li a {
  display: block;
  padding: 8px 16px;
  color: #555;
  transition: all 0.3s;
  white-space: nowrap;
  font-size: 14px;
}

.nav-list li a:hover {
  color: #3498db;
  background: #f0f0f0;
  border-radius: 4px;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 60px 20px;
  text-align: center;
}

.hero-title {
  font-size: 32px;
  margin-bottom: 20px;
  line-height: 1.4;
}

.hero-desc {
  font-size: 18px;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
}

/* Intro Section */
.intro-section {
  padding: 40px 20px;
  background: #fff;
}

.site-intro {
  max-width: 900px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 2;
  color: #555;
  text-align: justify;
}

/* Content Sections */
.featured-section,
.recent-section,
.top-section {
  padding: 40px 20px;
}

.section-title {
  font-size: 28px;
  margin-bottom: 30px;
  color: #2c3e50;
  position: relative;
  padding-left: 15px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 24px;
  background: #3498db;
  border-radius: 2px;
}

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

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

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

.video-card__link {
  display: block;
}

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

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

.video-info {
  padding: 16px;
}

.video-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2c3e50;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

/* List Pages */
.list-page {
  min-height: calc(100vh - 200px);
  padding: 40px 20px;
}

.page-header {
  margin-bottom: 40px;
  text-align: center;
}

.page-header h1 {
  font-size: 32px;
  margin-bottom: 16px;
  color: #2c3e50;
}

.page-desc {
  font-size: 16px;
  color: #666;
  line-height: 1.8;
  max-width: 800px;
  margin: 0 auto;
}

/* L3 - Top List */
.top-list__items {
  list-style: none;
}

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

.rank-badge {
  font-size: 24px;
  font-weight: bold;
  color: #3498db;
  min-width: 40px;
  text-align: center;
}

.item-cover {
  width: 120px;
  flex-shrink: 0;
}

.item-cover img {
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.item-info {
  flex: 1;
}

.item-info h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

.item-info h3 a:hover {
  color: #3498db;
}

.item-meta {
  font-size: 14px;
  color: #999;
  margin-bottom: 8px;
}

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

/* L2 - With Sidebar */
.page--with-sidebar {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 30px;
}

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

.layout__side--filters h2 {
  font-size: 20px;
  margin-bottom: 16px;
}

.layout__main--content h1 {
  font-size: 28px;
  margin-bottom: 24px;
}

/* L4 - Grouped */
.group {
  margin-bottom: 50px;
}

.group__title {
  font-size: 24px;
  margin-bottom: 24px;
  color: #2c3e50;
  padding-bottom: 12px;
  border-bottom: 2px solid #3498db;
}

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

/* Detail Page */
.detail-page {
  background: #fff;
}

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

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

.video-header {
  padding: 40px 20px 20px;
  background: #fff;
}

.video-main-title {
  font-size: 36px;
  color: #2c3e50;
  text-align: center;
}

.video-basic-info {
  padding: 20px;
  background: #f9f9f9;
  margin: 20px 0;
}

.video-basic-info h2 {
  font-size: 20px;
  margin-bottom: 20px;
  color: #2c3e50;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.info-item {
  display: flex;
  font-size: 15px;
  line-height: 1.8;
}

.info-item .label {
  font-weight: 600;
  color: #555;
  min-width: 80px;
}

.info-item .value {
  color: #333;
}

/* Detail Modules */
.detail-module {
  padding: 40px 20px;
  border-bottom: 1px solid #eee;
}

.detail-module h2 {
  font-size: 24px;
  margin-bottom: 20px;
  color: #2c3e50;
}

.detail-module p {
  font-size: 16px;
  line-height: 1.8;
  color: #555;
  margin-bottom: 12px;
}

.summary-content p,
.review-content p {
  text-indent: 2em;
  text-align: justify;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.tag {
  display: inline-block;
  padding: 6px 16px;
  background: #e3f2fd;
  color: #1976d2;
  border-radius: 20px;
  font-size: 14px;
}

.genre-info {
  font-size: 15px;
  color: #666;
  margin-top: 16px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Footer */
.site-footer {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 30px 20px;
  text-align: center;
  margin-top: 60px;
}

.footer-container p {
  font-size: 14px;
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.3s;
  z-index: 1000;
}

.back-to-top.visible {
  display: flex;
}

.back-to-top:hover {
  background: #2980b9;
  transform: translateY(-3px);
}

/* Responsive */
@media (max-width: 768px) {
  .header-container {
    flex-direction: row;
    align-items: center;
    padding: 10px 15px;
    min-height: 50px;
  }

  .logo a {
    font-size: 18px;
  }

  .nav-list {
    gap: 4px;
  }

  .nav-list li a {
    padding: 6px 10px;
    font-size: 13px;
  }

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

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

  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
  }

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

  .video-title {
    font-size: 14px;
  }

  .video-one-line {
    font-size: 13px;
  }

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

  .layout__side--filters {
    order: 2;
  }

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

  .item-cover {
    width: 100%;
  }

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

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

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

/* UI Style Variants */
.ui-style-0 { --primary-color: #3498db; --accent-color: #e74c3c; }
.ui-style-1 { --primary-color: #e67e22; --accent-color: #e74c3c; }
.ui-style-2 { --primary-color: #3498db; --accent-color: #e67e22; }
.ui-style-3 { --primary-color: #e74c3c; --accent-color: #f39c12; }
.ui-style-4 { --primary-color: #c0392b; --accent-color: #3498db; }
.ui-style-5 { --primary-color: #e74c3c; --accent-color: #34495e; }
.ui-style-6 { --primary-color: #1e88e5; --accent-color: #fdd835; }
.ui-style-7 { --primary-color: #1976d2; --accent-color: #fbc02d; }
.ui-style-8 { --primary-color: #00c853; --accent-color: #263238; }
.ui-style-9 { --primary-color: #212121; --accent-color: #fff; }
.ui-style-10 { --primary-color: #00C75A; --accent-color: #fff; }
.ui-style-11 { --primary-color: #0099FF; --accent-color: #ff6b6b; }
.ui-style-12 { --primary-color: #FF6700; --accent-color: #ff4081; }
.ui-style-13 { --primary-color: #00A1D6; --accent-color: #FB7299; }
.ui-style-14 { --primary-color: #1a237e; --accent-color: #ff6f00; }

body[class*="ui-style"] .hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
}

body[class*="ui-style"] .section-title::before {
  background: var(--primary-color);
}

body[class*="ui-style"] .nav-list li a:hover {
  color: var(--primary-color);
}

body[class*="ui-style"] .tag {
  background: color-mix(in srgb, var(--primary-color) 20%, white);
  color: var(--primary-color);
}

body[class*="ui-style"] .back-to-top {
  background: var(--primary-color);
}