/* AGE动漫 - 移动端增强样式 */

/* 移动端导航菜单隐藏样式 */
#mobile-menu {
    display: none;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 搜索建议框样式增强 */
#search-suggestions {
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

#search-suggestions::-webkit-scrollbar {
    width: 4px;
}

#search-suggestions::-webkit-scrollbar-track {
    background: #374151;
}

#search-suggestions::-webkit-scrollbar-thumb {
    background: #9333ea;
    border-radius: 2px;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #9333ea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 移动端优化 */
@media (max-width: 768px) {
    /* 英雄区域移动端优化 */
    .hero-section {
        height: 70vh;
        padding: 2rem 1rem;
    }
    
    /* 卡片网格移动端优化 */
    .anime-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    /* 搜索框移动端样式 */
    .mobile-search {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* 排行榜移动端优化 */
    .ranking-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .ranking-tabs button {
        width: 100%;
        text-align: center;
    }
    
    /* 底部导航移动端优化 */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (max-width: 480px) {
    /* 超小屏幕优化 */
    .anime-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    /* 英雄区域按钮优化 */
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-buttons button {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增大点击区域 */
    .touch-target {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 移除悬停效果 */
    .group:hover .group-hover\:scale-105 {
        transform: none;
    }
    
    /* 添加点击反馈 */
    .touch-feedback:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #111827;
        color: #f9fafb;
    }
}

/* 无障碍性优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .bg-gray-800 {
        background-color: #000000;
        border: 1px solid #ffffff;
    }
    
    .text-gray-400 {
        color: #ffffff;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #9333ea;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7c3aed;
}

/* 选中文本样式 */
::selection {
    background-color: #9333ea;
    color: #ffffff;
}

/* 焦点样式优化 */
*:focus {
    outline: 2px solid #9333ea;
    outline-offset: 2px;
}

/* 图片懒加载占位符 */
.image-placeholder {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
    animation: loading 2s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 弹出模态框动画 */
.modal-enter {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 卡片悬停效果增强 */
.card-3d:hover {
    transform: perspective(1000px) rotateY(5deg) rotateX(5deg);
    transition: transform 0.3s ease;
}

/* 渐变文字效果 */
.gradient-text {
    background: linear-gradient(45deg, #9333ea, #ec4899, #f59e0b);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* 脉冲动画 */
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    from {
        box-shadow: 0 0 5px #9333ea;
    }
    to {
        box-shadow: 0 0 20px #9333ea, 0 0 30px #9333ea;
    }
} 