:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --accent-color: #f39c12;
  --success-color: #27ae60;
  --danger-color: #e74c3c;
  --text-dark: #2c3e50;
  --text-light: #666;
  --bg-light: #f5f5f5;
  --bg-white: #ffffff;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  transition: color 0.3s ease, background-color 0.3s ease;
}

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

.video-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.video-card a {
  display: block;
  transition: color 0.3s ease;
}

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

.video-list > div:hover {
  background-color: #f8f9fa;
}

.related-grid > div:hover {
  box-shadow: var(--shadow-sm);
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.3s ease, transform 0.2s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn:hover {
  background: var(--secondary-color);
  transform: scale(1.05);
  color: white;
}

.btn-secondary {
  background: var(--accent-color);
}

.btn-secondary:hover {
  background: #e67e22;
}

@media (max-width: 768px) {
  .container {
    padding: 0 0.8rem;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

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

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

  h1 {
    font-size: 1.6rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  article {
    padding: 1.5rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--primary-color);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: none;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background 0.3s ease, transform 0.3s ease;
  z-index: 1000;
}

.back-to-top:hover {
  background: var(--secondary-color);
  transform: scale(1.1);
}

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

.ui-style-3 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.hero {
  animation: fadeIn 0.8s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.video-card,
.ranking-list > div,
.video-list > div {
  animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--bg-light);
  color: var(--text-light);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin: 0.2rem;
  transition: background 0.3s ease;
}

.tag:hover {
  background: var(--primary-color);
  color: white;
}
