/* 全局样式 */
:root {
  --primary: #f97316;
  --secondary: #374151;
  --accent: #1f2937;
  --text: #ffffff;
  --bg: #111827;
}

body {
  font-family: "Inter", "Helvetica Neue", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a {
  text-decoration: none;
  transition: color 0.3s ease;
}

/* 导航栏滚动效果 */
#navbar.scroll {
  background-color: rgba(31, 41, 55, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

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

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: none;
}

.carousel-slide.active {
  opacity: 1;
  display: flex;
  z-index: 1;
}

.carousel-slide h2 {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-slide p {
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 移动端菜单 */
#mobile-menu {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

#mobile-menu:not(.hidden) {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* 影视卡片悬停效果 */
.bg-gray-700:hover,
.bg-gray-800:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

/* 分类按钮效果 */
.category-btn {
  position: relative;
  overflow: hidden;
}

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

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

/* 评分星级样式 */
.text-yellow-500 {
  filter: drop-shadow(0 0 2px rgba(234, 179, 8, 0.5));
}

/* 渐变背景动画 */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.bg-gradient-to-br {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

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

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #ea580c;
}

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

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* 搜索框焦点效果 */
input[type="text"]:focus {
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
  border-color: #f97316;
}

/* 回到顶部按钮动画 */
@keyframes bounceUp {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.bounce-up {
  animation: bounceUp 2s infinite;
}

/* 响应式图片容器 */
.aspect-ratio-16-9 {
  aspect-ratio: 16/9;
}

.aspect-ratio-4-3 {
  aspect-ratio: 4/3;
}

.aspect-ratio-1-1 {
  aspect-ratio: 1/1;
}

/* 内容加载骨架屏 */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.skeleton {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* 文本截断 */
.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;
}

/* 自定义阴影 */
.shadow-3xl {
  box-shadow: 0 35px 60px -12px rgba(0, 0, 0, 0.35);
}

.shadow-inner-lg {
  box-shadow: inset 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

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

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

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

/* 脉冲动画 */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

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

/* 旋转动画 */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* 响应式媒体查询 */
@media (max-width: 640px) {
  .carousel-container {
    height: 200px;
  }
  
  .carousel-slide h2 {
    font-size: 1.5rem;
  }
  
  .carousel-slide p {
    font-size: 0.875rem;
  }
  
  .grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
  
  .px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 768px) {
  .hidden.md\\:flex {
    display: none !important;
  }
  
  .md\\:hidden {
    display: block !important;
  }
  
  .container {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* 优化打印样式 */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .bg-gray-800,
  .bg-gray-700,
  .bg-gray-900 {
    background: white !important;
    color: black !important;
    border: 1px solid #ddd !important;
  }
}