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

/* 人人视频 - 移动端兼容性增强 */
@media (max-width: 768px) {
  /* 移动端轮播图高度调整 */
  .hero-banner {
    height: 300px !important;
  }
  
  /* 移动端文字大小调整 */
  .hero-title {
    font-size: 2rem !important;
  }
  
  .hero-subtitle {
    font-size: 1.125rem !important;
  }
  
  /* 移动端卡片间距调整 */
  .mobile-card-spacing {
    padding: 1rem !important;
  }
  
  /* 移动端导航栏优化 */
  .mobile-nav {
    padding: 0.5rem !important;
  }
  
  /* 移动端搜索框宽度 */
  .mobile-search {
    width: 100% !important;
  }
  
  /* 移动端按钮调整 */
  .mobile-btn {
    padding: 0.75rem 1.5rem !important;
    font-size: 1rem !important;
  }
  
  /* 移动端栅格调整 */
  .mobile-grid {
    grid-template-columns: repeat(1, 1fr) !important;
  }
  
  .mobile-grid-2 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
  /* 超小屏幕轮播图 */
  .hero-banner {
    height: 250px !important;
  }
  
  /* 超小屏幕文字 */
  .hero-title {
    font-size: 1.5rem !important;
  }
  
  .hero-subtitle {
    font-size: 1rem !important;
  }
  
  /* 超小屏幕卡片 */
  .xs-card {
    padding: 0.75rem !important;
  }
  
  /* 超小屏幕按钮 */
  .xs-btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  /* 触摸设备悬停效果禁用 */
  .hover-effect:hover {
    transform: none !important;
  }
  
  /* 触摸设备按钮大小 */
  .touch-btn {
    min-height: 44px !important;
    min-width: 44px !important;
  }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* 高分辨率文字渲染 */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  /* 深色模式下的滚动条 */
  ::-webkit-scrollbar-track {
    background: #374151;
  }
  
  ::-webkit-scrollbar-thumb {
    background: #6b7280;
  }
  
  ::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
  }
}

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

/* 自定义工具类 */
.aspect-ratio-16-9 {
  aspect-ratio: 16 / 9;
}

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

.text-balance {
  text-wrap: balance;
}

/* 无障碍性优化 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 焦点样式优化 */
.focus-visible:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

/* 性能优化 */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* 防止内容溢出 */
.break-words {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

/* 移动端安全区域 */
.safe-area-inset-top {
  padding-top: env(safe-area-inset-top);
}

.safe-area-inset-bottom {
  padding-bottom: env(safe-area-inset-bottom);
}

/* 移动端触摸优化 */
.touch-manipulation {
  touch-action: manipulation;
}

/* 移动端滚动优化 */
.scroll-smooth {
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}