﻿/* 虫虫漫画 - 自定义样式 */

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, #a855f7, #ec4899);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, #9333ea, #db2777);
}

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

/* 自定义动画 */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.6);
  }
}

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

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

/* 品牌图标动画 */
.brand-icon {
  animation: float 3s ease-in-out infinite;
}

/* 搜索框聚焦效果 */
.search-input:focus {
  transform: scale(1.02);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

/* 按钮悬停效果 */
.btn-primary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.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 ease;
}

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

/* 导航链接下划线效果 */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #a855f7, #ec4899);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

/* 排行榜数字徽章 */
.rank-badge {
  position: relative;
  overflow: hidden;
}

.rank-badge::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
}

.rank-badge:hover::before {
  top: -100%;
  left: -100%;
}

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

/* 图片懒加载占位 */
.img-placeholder {
  background: linear-gradient(45deg, #f3f4f6, #e5e7eb, #f3f4f6);
  background-size: 400% 400%;
  animation: shimmer 2s ease-in-out infinite;
}

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

/* 加载动画 */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid #a855f7;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* 移动端优化 */
@media (max-width: 768px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.125rem;
  }
  
  .manga-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 平板端优化 */
@media (min-width: 768px) and (max-width: 1024px) {
  .manga-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 桌面端优化 */
@media (min-width: 1024px) {
  .manga-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .category-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  .auto-dark {
    background-color: #1f2937;
    color: #f9fafb;
  }
  
  .auto-dark-card {
    background-color: #374151;
    border-color: #4b5563;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .high-contrast {
    border: 2px solid currentColor;
  }
  
  .gradient-bg {
    background: #000 !important;
    color: #fff !important;
  }
}

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

/* 打印样式 */
@media print {
  .no-print {
    display: none !important;
  }
  
  .print-friendly {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }
}
