:root {
  --primary-color: #e50914;
  --primary-dark: #b20710;
  --bg-light: #f5f5f5;
  --text-dark: #222;
  --text-medium: #555;
  --text-light: #666;
  --border-color: #ddd;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

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

.site-header {
  background: #fff;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo a {
  color: var(--primary-color);
  transition: opacity 0.3s;
}

.logo a:hover {
  opacity: 0.8;
}

.main-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.main-nav a {
  color: var(--text-dark);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.3s, color 0.3s;
  white-space: nowrap;
}

.main-nav a:hover {
  background: var(--bg-light);
  color: var(--primary-color);
}

.main-nav a.active {
  background: var(--primary-color);
  color: #fff;
}

main {
  flex: 1;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

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

.hero-section h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero-section p {
  font-size: 1.1rem;
  line-height: 1.8;
  opacity: 0.95;
  max-width: 800px;
  margin: 0 auto;
}

.section {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.section h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
}

.intro-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-medium);
  text-align: justify;
}

.intro-text p {
  margin-bottom: 1rem;
}

.intro-text a {
  color: var(--primary-color);
  text-decoration: underline;
}

.intro-text a:hover {
  color: var(--primary-dark);
}

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

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

.video-card {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  border: 1px solid #f0f0f0;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.rank-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--primary-color);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.video-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.video-title a {
  color: var(--text-dark);
  transition: color 0.3s;
}

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

.video-meta {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.meta-item {
  background: #f0f0f0;
  color: var(--text-medium);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.meta-date {
  background: #e7f3ff;
  color: #1976d2;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.video-genre {
  color: var(--text-medium);
  font-size: 0.95rem;
  margin: 0.5rem 0;
}

.video-tags {
  color: #777;
  font-size: 0.85rem;
  margin: 0.3rem 0;
}

.video-desc {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-top: 0.5rem;
  line-height: 1.6;
}

.nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 2rem 0;
}

.nav-links a {
  background: var(--primary-color);
  color: #fff;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.3s, transform 0.2s;
}

.nav-links a:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.page-header {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.page-header p {
  color: var(--text-light);
  line-height: 1.8;
  font-size: 1rem;
}

.detail-header {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.detail-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-dark);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.info-item {
  padding: 0.5rem 0;
}

.info-label {
  font-weight: 600;
  color: var(--text-light);
  display: inline-block;
  min-width: 60px;
}

.info-value {
  color: var(--text-dark);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.tag {
  background: #f0f0f0;
  padding: 0.3rem 0.8rem;
  border-radius: 16px;
  font-size: 0.9rem;
  color: var(--text-medium);
  transition: background 0.3s;
}

.tag:hover {
  background: #e0e0e0;
}

.one-line {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 1rem 1.5rem;
  margin: 1rem 0;
  font-size: 1.1rem;
  color: #856404;
  border-radius: 4px;
}

.summary-text {
  font-size: 1rem;
  line-height: 1.8;
  color: #444;
  text-align: justify;
}

.review-box {
  background: #e7f3ff;
  border-left: 4px solid #2196F3;
  padding: 1rem 1.5rem;
  margin: 1rem 0;
  font-style: italic;
  color: #0d47a1;
  border-radius: 4px;
  line-height: 1.7;
}

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

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

.site-footer p {
  font-size: 0.95rem;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
  }

  .logo {
    font-size: 1.2rem;
  }

  .main-nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.3rem;
  }

  .main-nav a {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.4rem 0.3rem;
    font-size: 0.85rem;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-section {
    padding: 2rem 1.5rem;
  }

  .hero-section h1 {
    font-size: 1.8rem;
  }

  .hero-section p {
    font-size: 1rem;
  }

  .section {
    padding: 1.5rem;
  }

  .section h2 {
    font-size: 1.5rem;
  }

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

  .page-header h1,
  .detail-header h1 {
    font-size: 1.5rem;
  }

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

  .nav-links {
    flex-direction: column;
  }

  .nav-links a {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 1rem 0.5rem;
  }

  .main-nav a {
    font-size: 0.75rem;
    padding: 0.3rem 0.2rem;
  }

  .hero-section h1 {
    font-size: 1.5rem;
  }

  .hero-section p {
    font-size: 0.95rem;
  }

  .video-card {
    padding: 1rem;
  }

  .rank-badge {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
}

body.ui-style-8 {
  --primary-color: #e50914;
  --primary-dark: #b20710;
}

body.ui-style-8 .hero-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.ui-style-8 .video-card:hover {
  border-color: var(--primary-color);
}
