/* 全站通用样式扩展 */

:root {
  --primary-color: #2c5aa0;
  --primary-hover: #1a3a6b;
  --accent-color: #ff6b6b;
  --bg-light: #f5f5f5;
  --bg-white: #fff;
  --text-dark: #1a1a1a;
  --text-normal: #333;
  --text-light: #666;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 2px 12px rgba(0,0,0,0.12);
  --shadow-lg: 0 6px 20px rgba(0,0,0,0.15);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 20px;
  --spacing-lg: 30px;
}

html {
  scroll-behavior: smooth;
}

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

.container {
  flex: 1;
}

/* 导航增强 */
nav {
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

nav a {
  position: relative;
  transition: color 0.3s ease;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

nav a:hover::after {
  width: 80%;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 15px;
  font-weight: 500;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* 卡片悬停效果增强 */
.video-card,
.video-item,
.rank-item,
.topic-item,
.latest-item,
.related-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.video-card:hover,
.video-item:hover,
.rank-item:hover,
.topic-item:hover,
.latest-item:hover,
.related-card:hover {
  border-color: var(--border-color);
  box-shadow: var(--shadow-md);
}

/* 标签增强 */
.tag {
  transition: all 0.2s ease;
  cursor: default;
}

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

/* 响应式优化 */
@media (max-width: 768px) {
  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

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

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

  .container {
    padding: 15px;
  }

  .info-section,
  .content-section,
  section {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  nav a {
    font-size: 12px;
    padding: 10px 4px;
  }

  h1 {
    font-size: 20px;
  }

  .rank-num {
    font-size: 18px;
    min-width: 30px;
  }
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  z-index: 1000;
}

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

.back-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* 加载动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.video-card,
.video-item,
.rank-item,
.topic-item,
.latest-item {
  animation: fadeIn 0.5s ease-out backwards;
}

.video-card:nth-child(1) { animation-delay: 0.05s; }
.video-card:nth-child(2) { animation-delay: 0.1s; }
.video-card:nth-child(3) { animation-delay: 0.15s; }
.video-card:nth-child(4) { animation-delay: 0.2s; }
.video-card:nth-child(5) { animation-delay: 0.25s; }
.video-card:nth-child(6) { animation-delay: 0.3s; }

/* 打印样式 */
@media print {
  nav,
  footer,
  .back-to-top {
    display: none;
  }

  body {
    background: white;
  }

  .container {
    max-width: 100%;
  }
}
