/* 全局样式 */
: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: 640px) {
  /* 头部导航移动端优化 */
  .mobile-menu-button {
    tap-highlight-color: transparent;
  }
  
  /* 英雄区域移动端优化 */
  #home h2 {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  #home p {
    font-size: 1rem;
    line-height: 1.5;
  }
  
  /* 卡片网格移动端优化 */
  .grid {
    gap: 1rem;
  }
  
  /* 视频卡片移动端优化 */
  .aspect-video {
    aspect-ratio: 16/9;
    min-height: 120px;
  }
  
  /* 排行榜移动端优化 */
  #ranking .grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* 页脚移动端优化 */
  footer .grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* 平板端优化 */
@media (min-width: 641px) and (max-width: 1024px) {
  /* 特色卡片区域平板优化 */
  .xl\\:grid-cols-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
  /* 视频专区平板优化 */
  #video .xl\\:grid-cols-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
  /* 移除悬停效果，改为点击效果 */
  .hover\\:scale-105:hover {
    transform: none;
  }
  
  .hover\\:scale-105:active {
    transform: scale(1.02);
  }
  
  /* 增大触摸目标 */
  button, a {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* 话题标签触摸优化 */
  #hot span {
    padding: 0.75rem 1rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* 提升图片质量 */
  .bg-gradient-to-br {
    background-size: 200% 200%;
  }
}

/* 减少动画的用户偏好设置支持 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* 深色模式支持（可选） */
@media (prefers-color-scheme: dark) {
  /* 如果需要深色模式，可以在这里添加样式 */
}

/* 打印样式优化 */
@media print {
  header, footer, .mobile-menu-button {
    display: none !important;
  }
  
  body {
    color: black !important;
    background: white !important;
  }
  
  a {
    text-decoration: underline !important;
  }
}

/* 自定义焦点样式 */
*:focus {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

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

.mobile-menu.hidden {
  transform: translateY(-100%);
  opacity: 0;
}

/* 汉堡菜单动画 */
.hamburger-line {
  transition: all 0.3s ease;
  transform-origin: center;
}

/* 加载状态样式 */
body:not(.loaded) section {
  opacity: 0;
  transform: translateY(20px);
}

/* 无障碍支持 */
.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;
}

/* 防止文本选择在触摸设备上 */
.select-none {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 优化文本渲染 */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}