/* 全局样式 */
:root {
  --primary: #ef4444;
  --secondary: #f97316;
  --dark: #111827;
}

body {
  font-family: "Inter", "Noto Sans SC", sans-serif;
}

a {
  text-decoration: none;
}

/* 导航栏滚动效果 */
nav {
  transition: all 0.3s ease;
}

nav.scroll {
  background-color: rgba(17, 24, 39, 0.95);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

/* 电影卡片悬停效果 */
.movie-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.3);
}

/* 分类卡片悬停效果 */
.category-card:hover .category-image {
  transform: scale(1.05);
}

/* 平滑滚动 */
html {
  scroll-behavior: smooth;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #374151;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #6b7280;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Line clamp 样式 */
.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* 自定义动画 */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%)
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

@keyframes glow {
  0%, 100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.animate-shimmer {
  animation: shimmer 2s linear infinite;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-glow {
  animation: glow 3s ease-in-out infinite;
}

/* 渐变文字效果 */
.gradient-text {
  background: linear-gradient(45deg, #ef4444, #f97316, #eab308);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* 响应式阴影 */
.shadow-3xl {
  box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.25);
}

.shadow-neon {
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

/* 自定义圆角 */
.rounded-4xl {
  border-radius: 2rem;
}

.rounded-5xl {
  border-radius: 2.5rem;
}

/* 自定义边框 */
.border-3 {
  border-width: 3px;
}

/* 玻璃态效果 */
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 电影海报效果 */
.movie-poster {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  aspect-ratio: 3/4;
}

.movie-poster::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.movie-poster:hover::before {
  transform: translateX(100%);
}

/* 评分星级效果 */
.rating-stars {
  display: inline-flex;
  gap: 2px;
}

.rating-star {
  width: 16px;
  height: 16px;
  background: linear-gradient(45deg, #fbbf24, #f59e0b);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

/* 加载动画 */
.loading-spinner {
  border: 3px solid rgba(239, 68, 68, 0.3);
  border-radius: 50%;
  border-top: 3px solid #ef4444;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 背景粒子效果 */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.8), transparent);
  border-radius: 50%;
  animation: particle-float 8s linear infinite;
}

@keyframes particle-float {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) rotate(360deg);
    opacity: 0;
  }
}

/* 响应式设计增强 */
@media (max-width: 768px) {
  .movie-poster {
    aspect-ratio: 2/3;
  }
  
  .gradient-text {
    font-size: 2.5rem;
  }
}

/* 主题切换按钮 */
.theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
  background: linear-gradient(45deg, #ef4444, #f97316);
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.theme-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.theme-toggle.dark::before {
  transform: translateX(30px);
}

/* 搜索框增强效果 */
.search-input:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

/* 按钮悬停效果 */
.btn-primary {
  background: linear-gradient(45deg, #ef4444, #f97316);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}