:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --text-color: #333;
  --light-bg: #f8f9fa;
  --border-color: #ddd;
  --success-color: #27ae60;
  --spacing: 8px;
}

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

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-color);
  background: var(--light-bg);
}

a {
  text-decoration: none;
  color: var(--secondary-color);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-color);
}

ul {
  list-style: none;
}

.main-nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  background: var(--primary-color);
  color: white;
  padding: calc(var(--spacing) * 2) calc(var(--spacing) * 4);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.nav-logo a {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  letter-spacing: 1px;
}

.nav-list {
  display: flex;
  flex-wrap: nowrap;
  gap: calc(var(--spacing) * 3);
}

.nav-list a {
  color: white;
  padding: calc(var(--spacing) * 1.5) calc(var(--spacing) * 2);
  border-radius: 4px;
  transition: background 0.3s, transform 0.2s;
  font-weight: 500;
}

.nav-list a:hover {
  background: rgba(255,255,255,0.15);
  transform: translateY(-2px);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--spacing) * 4);
}

.hero {
  background: white;
  padding: calc(var(--spacing) * 6);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: calc(var(--spacing) * 6);
  text-align: center;
}

.hero h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: calc(var(--spacing) * 3);
  line-height: 1.3;
}

.hero .intro {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #555;
  max-width: 900px;
  margin: 0 auto;
}

section {
  margin-bottom: calc(var(--spacing) * 8);
}

section h2 {
  font-size: 1.75rem;
  color: var(--primary-color);
  margin-bottom: calc(var(--spacing) * 4);
  padding-bottom: calc(var(--spacing) * 2);
  border-bottom: 3px solid var(--secondary-color);
}

.page-intro {
  background: white;
  padding: calc(var(--spacing) * 3);
  border-radius: 6px;
  margin-bottom: calc(var(--spacing) * 4);
  line-height: 1.8;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

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

.video-grid-large {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: calc(var(--spacing) * 4);
}

.video-card {
  background: white;
  padding: calc(var(--spacing) * 3);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
}

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

.video-card h3 {
  font-size: 1.15rem;
  margin-bottom: calc(var(--spacing) * 2);
  color: var(--primary-color);
}

.video-card h3 a {
  color: var(--primary-color);
}

.video-card h3 a:hover {
  color: var(--secondary-color);
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing);
  margin-bottom: calc(var(--spacing) * 2);
  font-size: 0.9rem;
}

.video-meta span {
  background: var(--light-bg);
  padding: calc(var(--spacing) * 0.5) var(--spacing);
  border-radius: 3px;
  color: #666;
}

.video-meta .region {
  background: #e3f2fd;
  color: #1976d2;
}

.video-meta .type {
  background: #f3e5f5;
  color: #7b1fa2;
}

.video-meta .year {
  background: #e8f5e9;
  color: #388e3c;
}

.video-meta .date {
  background: #fff3e0;
  color: #f57c00;
}

.one-line {
  color: #555;
  font-style: italic;
  margin-bottom: calc(var(--spacing) * 1.5);
  line-height: 1.5;
}

.tags {
  font-size: 0.85rem;
  color: #888;
  margin-top: calc(var(--spacing) * 2);
  padding-top: calc(var(--spacing) * 1.5);
  border-top: 1px solid var(--border-color);
}

.rank-badge {
  position: absolute;
  top: calc(var(--spacing) * 2);
  right: calc(var(--spacing) * 2);
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-color), #ff6b6b);
  color: white;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(231,76,60,0.3);
}

.video-list-ranked .video-card {
  padding-right: calc(var(--spacing) * 7);
}

.list-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: calc(var(--spacing) * 3);
}

.list-card {
  background: white;
  padding: calc(var(--spacing) * 4);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: transform 0.3s, box-shadow 0.3s;
  border-left: 4px solid var(--secondary-color);
}

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

.list-card h3 {
  font-size: 1.3rem;
  margin-bottom: calc(var(--spacing) * 2);
  color: var(--primary-color);
}

.list-card p {
  color: #666;
  line-height: 1.6;
}

.topic-group {
  background: white;
  padding: calc(var(--spacing) * 4);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: calc(var(--spacing) * 4);
}

.topic-group h2 {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: calc(var(--spacing) * 1.5);
  margin-bottom: calc(var(--spacing) * 3);
}

.detail-page {
  max-width: 900px;
}

.video-detail {
  background: white;
  padding: calc(var(--spacing) * 6);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.video-detail h1 {
  font-size: 2.2rem;
  color: var(--primary-color);
  margin-bottom: calc(var(--spacing) * 4);
  padding-bottom: calc(var(--spacing) * 3);
  border-bottom: 3px solid var(--secondary-color);
}

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

.video-detail h2 {
  font-size: 1.4rem;
  color: var(--primary-color);
  margin-bottom: calc(var(--spacing) * 2);
  padding-left: calc(var(--spacing) * 1.5);
  border-left: 4px solid var(--secondary-color);
}

.basic-info dl {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: calc(var(--spacing) * 2);
  line-height: 1.8;
}

.basic-info dt {
  font-weight: 600;
  color: #666;
}

.basic-info dd {
  color: var(--text-color);
}

.highlight {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: calc(var(--spacing) * 4);
  border-radius: 8px;
  color: white;
}

.highlight h2 {
  color: white;
  border-left-color: white;
  margin-bottom: calc(var(--spacing) * 2);
}

.one-line-big {
  font-size: 1.2rem;
  line-height: 1.8;
  font-style: italic;
}

.summary p, .review p {
  line-height: 1.8;
  color: #444;
  text-align: justify;
}

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

.related-card {
  background: var(--light-bg);
  padding: calc(var(--spacing) * 3);
  border-radius: 6px;
  transition: background 0.3s, transform 0.2s;
}

.related-card:hover {
  background: #e3f2fd;
  transform: translateY(-2px);
}

.related-card h3 {
  font-size: 1rem;
  margin-bottom: var(--spacing);
}

.related-card h3 a {
  color: var(--primary-color);
}

.related-card p {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: var(--spacing);
  line-height: 1.5;
}

.related-card .meta {
  font-size: 0.85rem;
  color: #888;
}

.site-footer {
  background: var(--primary-color);
  color: white;
  text-align: center;
  padding: calc(var(--spacing) * 4);
  margin-top: calc(var(--spacing) * 8);
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
}

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

  .nav-logo a {
    font-size: 1.2rem;
  }

  .nav-list {
    flex: 1 1 0;
    min-width: 0;
    justify-content: space-between;
    gap: 0;
    margin-left: calc(var(--spacing) * 2);
  }

  .nav-list li {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
  }

  .nav-list a {
    padding: calc(var(--spacing) * 1) calc(var(--spacing) * 0.5);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

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

  .hero {
    padding: calc(var(--spacing) * 3);
  }

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

  .hero .intro {
    font-size: 1rem;
  }

  section h2 {
    font-size: 1.4rem;
  }

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

  .list-links {
    grid-template-columns: 1fr;
  }

  .video-detail {
    padding: calc(var(--spacing) * 3);
  }

  .video-detail h1 {
    font-size: 1.6rem;
  }

  .basic-info dl {
    grid-template-columns: 80px 1fr;
    gap: calc(var(--spacing) * 1.5);
  }

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

@media (max-width: 480px) {
  .nav-logo a {
    font-size: 1rem;
  }

  .nav-list a {
    font-size: 0.75rem;
    padding: calc(var(--spacing) * 0.8) calc(var(--spacing) * 0.3);
  }

  .hero h1 {
    font-size: 1.3rem;
  }

  .hero .intro {
    font-size: 0.95rem;
  }

  .video-detail h1 {
    font-size: 1.4rem;
  }
}

body.ui-style-0 { --secondary-color: #3498db; }
body.ui-style-1 { --secondary-color: #2ecc71; }
body.ui-style-2 { --secondary-color: #9b59b6; }
body.ui-style-3 { --secondary-color: #e67e22; }
body.ui-style-4 { --secondary-color: #1abc9c; }
body.ui-style-5 { --secondary-color: #34495e; }
body.ui-style-6 { --secondary-color: #16a085; }
body.ui-style-7 { --secondary-color: #c0392b; }
body.ui-style-8 { --secondary-color: #2980b9; }
body.ui-style-9 { --secondary-color: #8e44ad; }
body.ui-style-10 { --secondary-color: #27ae60; }
body.ui-style-11 { --secondary-color: #d35400; }
body.ui-style-12 { --secondary-color: #2c3e50; }
body.ui-style-13 { --secondary-color: #7f8c8d; }
body.ui-style-14 { --secondary-color: #c0392b; }
body.ui-style-15 { --secondary-color: #16a085; }
