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

/* 人人视频 2025 - 自定义样式 */
/* 版本: v2025.1.0 */

/* 基础动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInLeft {
    from { 
        opacity: 0; 
        transform: translateX(-50px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(50px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(239, 68, 68, 0.5); }
    50% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.8); }
}

/* 动画类 */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-glow {
    animation: glow 2s infinite;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* 导航栏过渡效果 */
nav {
    transition: transform 0.3s ease-in-out;
}

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

/* 轮播图过渡效果 */
#carousel {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 卡片悬停效果 */
.group:hover .group-hover\:scale-105 {
    transform: scale(1.05);
}

.group:hover .group-hover\:shadow-xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* 按钮过渡效果 */
button, .btn {
    transition: all 0.3s ease;
}

/* 输入框聚焦效果 */
input:focus {
    outline: none;
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* 链接悬停效果 */
a {
    transition: color 0.3s ease;
}

/* 加载状态样式 */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent
    );
    animation: shimmer 1.5s infinite;
}

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

/* 响应式字体 */
@media (max-width: 640px) {
    .text-responsive {
        font-size: clamp(0.875rem, 2.5vw, 1rem);
    }
    
    .text-responsive-lg {
        font-size: clamp(1.125rem, 4vw, 1.5rem);
    }
    
    .text-responsive-xl {
        font-size: clamp(1.5rem, 6vw, 2.25rem);
    }
}

/* 网格布局优化 */
.grid-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 640px) {
    .grid-responsive {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
}

/* 图片懒加载优化 */
.lazy-image {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-image.loaded {
    opacity: 1;
}

/* 渐变背景动画 */
.gradient-animation {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

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

/* 毛玻璃效果 */
.backdrop-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 阴影效果 */
.shadow-glow {
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.shadow-glow-lg {
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.4);
}

/* 边框动画 */
.border-animation {
    position: relative;
    overflow: hidden;
}

.border-animation::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ef4444, transparent);
    animation: borderMove 2s infinite;
}

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

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

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

/* 硬件加速 */
.hardware-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .mobile-optimized {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    /* 移动端滚动优化 */
    .mobile-scroll {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
    
    /* 移动端字体优化 */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

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

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

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .dark-mode-enhanced {
        background-color: #0f172a;
        color: #f8fafc;
    }
}

/* 焦点可见性 */
.focus-visible:focus {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

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

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-inside: avoid;
    }
}

/* 自定义属性（CSS变量） */
:root {
    --primary-color: #ef4444;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --text-color: #f8fafc;
    --bg-color: #0f172a;
    --border-color: #374151;
    --shadow-color: rgba(0, 0, 0, 0.25);
    --transition-speed: 0.3s;
    --border-radius: 0.5rem;
    --spacing-unit: 1rem;
}

/* 实用工具类 */
.center-absolute {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.full-screen {
    width: 100vw;
    height: 100vh;
}

.aspect-ratio-16-9 {
    aspect-ratio: 16/9;
}

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

.truncate-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.truncate-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* 浏览器兼容性 */
.flexbox-fallback {
    display: block;
}

.supports-grid {
    display: grid;
}

@supports (display: grid) {
    .flexbox-fallback {
        display: none;
    }
}

@supports not (display: grid) {
    .supports-grid {
        display: flex;
        flex-wrap: wrap;
    }
}

/* 性能监控 */
.perf-monitor {
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 9999;
    display: none;
}

.perf-monitor.show {
    display: block;
}

/* 优化类 */
.optimize-rendering {
    contain: layout style paint;
}

.optimize-compositing {
    transform: translateZ(0);
}

.optimize-memory {
    content-visibility: auto;
    contain-intrinsic-size: 200px;
}