/* 全局样式 */
:root {
  --primary: #dc2626;
  --primary-dark: #b91c1c;
  --secondary: #1f2937;
  --accent: #f59e0b;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-dark: #111827;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

a {
  text-decoration: none;
}

/* 导航栏样式 */
#navbar {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.5);
  transition: all 0.3s ease;
}

#navbar.scroll {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* Logo样式 */
.logo {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 轮播图样式 */
.carousel-container {
  position: relative;
  overflow: hidden;
}

.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  z-index: 0;
}

.carousel-item.active {
  opacity: 1;
  z-index: 1;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 渐变遮罩 */
.carousel-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.1) 100%);
  z-index: 1;
}

.carousel-item .absolute {
  z-index: 2;
}

/* 电影卡片样式 */
.movie-card {
  transition: all 0.3s ease;
  cursor: pointer;
}

.movie-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.movie-card img {
  transition: transform 0.3s ease;
}

.movie-card:hover img {
  transform: scale(1.05);
}

/* 分类标签样式 */
.category-tag {
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.category-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.category-tag.active {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
  border-color: #dc2626;
}

/* 排行榜样式 */
.ranking-item {
  transition: all 0.3s ease;
  cursor: pointer;
}

.ranking-item:hover {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  transform: translateX(4px);
}

/* 移动端菜单样式 */
#mobileMenu {
  transform: translateY(-100%);
  opacity: 0;
  transition: all 0.3s ease;
}

#mobileMenu.active {
  transform: translateY(0);
  opacity: 1;
}

/* 滚动容器样式 */
.movie-scroll-container {
  scrollbar-width: thin;
  scrollbar-color: #dc2626 #f3f4f6;
}

.movie-scroll-container::-webkit-scrollbar {
  height: 8px;
}

.movie-scroll-container::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 4px;
}

.movie-scroll-container::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-radius: 4px;
}

.movie-scroll-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
}

/* 按钮样式 */
.btn-primary {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.4);
}

/* 搜索框样式 */
.search-input {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.search-input:focus {
  background: white;
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* 标签样式 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-new {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
}

.badge-hot {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

.badge-rating {
  background: rgba(0, 0, 0, 0.8);
  color: white;
  backdrop-filter: blur(10px);
}

/* 文字截断 */
.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 fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* 应用动画 */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
  animation: fadeInRight 0.6s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .carousel-container {
    height: 300px;
  }
  
  .movie-card {
    width: 200px;
  }
  
  .movie-card img {
    height: 280px;
  }
  
  .ranking-item {
    padding: 0.5rem;
  }
  
  .ranking-item img {
    width: 40px;
    height: 56px;
  }
}

@media (max-width: 480px) {
  .carousel-container {
    height: 250px;
  }
  
  .movie-card {
    width: 160px;
  }
  
  .movie-card img {
    height: 220px;
  }
  
  .category-tag {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* 加载状态 */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

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

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #b91c1c, #991b1b);
}

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

/* 焦点样式 */
*:focus {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

/* 选择文本样式 */
::selection {
  background: rgba(220, 38, 38, 0.2);
  color: #dc2626;
}

/* 打印样式 */
@media print {
  .no-print {
    display: none !important;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  :root {
    --primary: #000000;
    --text-primary: #000000;
    --bg-primary: #ffffff;
  }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}