/* 全局样式 */
:root {
  --primary: #165dff;
}

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

a {
  text-decoration: none;
}

/* 导航栏滚动效果 */
#navbar.scroll {
  background-color: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* 轮播图 */
.carousel-item.active {
  opacity: 1;
  z-index: 1;
}

/* 移动端菜单 */
#mobileMenu.active {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* 漫画卡片悬停效果 */
.comic-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

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

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

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

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

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

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

/* 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%);
  }
}

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

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

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

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

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

/* 555电影网专用样式 */
/* 导航栏滚动效果 */
nav {
  transition: transform 0.3s ease-in-out;
}

nav.-translate-y-full {
  transform: translateY(-100%);
}

/* 轮播图容器 */
#hero-carousel {
  transition: transform 0.5s ease-in-out;
}

/* 移动端菜单动画 */
#mobile-menu {
  transition: all 0.3s ease-in-out;
}

/* 卡片悬停效果增强 */
.group:hover .group-hover\:bg-black\/40 {
  background-color: rgba(0, 0, 0, 0.4);
}

/* 点击缩放效果 */
.transform.scale-95 {
  transform: scale(0.95);
  transition: transform 0.15s ease-in-out;
}

/* 搜索框焦点效果 */
input[type="text"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
}

/* 按钮悬停效果 */
button:hover {
  transform: translateY(-1px);
  transition: transform 0.2s ease-in-out;
}

/* 排行榜项悬停效果 */
.ranking-item:hover {
  transform: translateX(5px);
  transition: transform 0.2s ease-in-out;
}

/* 渐变文字效果 */
.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 自定义渐变背景 */
.gradient-bg-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg-secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-bg-accent {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* 加载动画 */
.loading-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 淡入动画 */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

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

/* 触摸设备优化 */
@media (pointer: coarse) {
  .group:hover .group-hover\:bg-black\/40 {
    background-color: rgba(0, 0, 0, 0.2);
  }
}

/* 移动端专用样式 */
@media (max-width: 768px) {
  /* 轮播图高度调整 */
  #hero-carousel {
    height: 300px;
  }
  
  /* 移动端搜索框样式 */
  input[type="text"] {
    font-size: 16px; /* 防止iOS缩放 */
  }
  
  /* 移动端卡片间距 */
  .mobile-card-spacing {
    margin-bottom: 1rem;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .text-gray-400 {
    color: #6b7280 !important;
  }
  
  .bg-gray-800 {
    background-color: #1f2937 !important;
  }
}

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