/* 全局样式 */
: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;
}

/* age动漫网站专用样式 */

/* 移动端优化 */
@media (max-width: 768px) {
  /* 移动端导航栏 */
  #mobile-menu {
    transition: max-height 0.3s ease-in-out;
    overflow: hidden;
  }
  
  /* 移动端搜索框 */
  .mobile-search {
    width: 100% !important;
  }
  
  /* 移动端卡片布局 */
  .mobile-card {
    margin-bottom: 1rem;
  }
  
  /* 移动端文字大小调整 */
  h1 {
    font-size: 2rem !important;
  }
  
  h2 {
    font-size: 1.5rem !important;
  }
  
  /* 移动端按钮优化 */
  button {
    min-height: 44px; /* iOS推荐最小触摸目标 */
  }
  
  /* 移动端间距优化 */
  .mobile-padding {
    padding: 1rem;
  }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
  .grid-cols-2 {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }
  
  .text-4xl {
    font-size: 1.875rem !important;
  }
  
  .text-6xl {
    font-size: 2.25rem !important;
  }
}

/* 搜索功能增强 */
.search-active {
  transform: scale(1.02);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* 导航栏滚动效果增强 */
nav {
  transition: transform 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

/* 卡片悬停效果增强 */
.anime-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

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

.anime-card:active {
  transform: translateY(-4px) scale(1.01);
}

/* 进度条动画 */
.progress-bar {
  position: relative;
  overflow: hidden;
}

.progress-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShine 2s infinite;
}

@keyframes progressShine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* 标签云悬停效果 */
.tag-cloud span {
  transition: all 0.2s ease-in-out;
  position: relative;
  overflow: hidden;
}

.tag-cloud span:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tag-cloud span:active {
  transform: translateY(0);
}

/* 排行榜数字样式 */
.rank-number {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  animation: rankGlow 2s ease-in-out infinite alternate;
}

@keyframes rankGlow {
  0% {
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.5);
  }
  100% {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
  }
}

/* 通知样式 */
.notification {
  backdrop-filter: blur(10px);
  background: rgba(59, 130, 246, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 滚动到顶部按钮 */
.scroll-to-top {
  backdrop-filter: blur(10px);
  background: rgba(59, 130, 246, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.scroll-to-top:hover {
  background: rgba(37, 99, 235, 0.9);
  transform: translateY(-2px);
}

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

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

/* 文字渐变效果 */
.text-gradient {
  background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c);
  background-size: 400% 400%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease-in-out infinite;
}

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

/* 视差滚动效果 */
.parallax {
  transform: translateZ(0);
  will-change: transform;
}

/* 响应式视频容器 */
.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 宽高比 */
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* 性能优化 */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .anime-card {
    border: 2px solid currentColor;
  }
  
  button {
    border: 2px solid currentColor;
  }
}

/* 打印样式 */
@media print {
  nav,
  footer,
  .scroll-to-top,
  .notification {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
}

/* 自定义滚动条增强（深色主题） */
::-webkit-scrollbar-track {
  background: #374151;
}

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

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

/* 焦点可访问性 */
button:focus,
input:focus,
a:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* 选中文本样式 */
::selection {
  background: rgba(59, 130, 246, 0.3);
  color: inherit;
}

/* 移动端触摸优化 */
@media (hover: none) and (pointer: coarse) {
  .anime-card:hover {
    transform: none;
  }
  
  .anime-card:active {
    transform: scale(0.98);
  }
}

/* 横屏模式优化 */
@media screen and (orientation: landscape) and (max-height: 500px) {
  nav {
    height: auto;
    min-height: 60px;
  }
  
  .hero-section {
    height: 80vh;
  }
}

/* 平板设备优化 */
@media screen and (min-width: 768px) and (max-width: 1024px) {
  .grid-cols-5 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  
  .grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}