body { 
    font-family: 'Noto Sans SC', sans-serif; 
    scroll-behavior: smooth;
}

.loading { 
    display: flex; 
    justify-content: center; 
}

/* 自定义动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
    }
}

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

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

.slide-in-up {
    animation: slideInUp 0.6s ease-out forwards;
}

/* 导航栏增强效果 */
header {
    backdrop-filter: blur(10px);
    background: rgba(31, 41, 55, 0.95);
}

/* 卡片悬停效果增强 */
.group:hover .aspect-video,
.group:hover .aspect-\[3\/4\] {
    transform: scale(1.05);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 按钮增强效果 */
button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* 链接增强效果 */
a {
    transition: all 0.3s ease;
}

/* 分类卡片特殊效果 */
.grid a[href*="tianttyings.mobi"] {
    position: relative;
    overflow: hidden;
}

.grid a[href*="tianttyings.mobi"]:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.grid a[href*="tianttyings.mobi"]:hover:before {
    left: 100%;
}

/* 排行榜数字特效 */
.rounded-full {
    position: relative;
    overflow: hidden;
}

.rounded-full:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.rounded-full:hover:before {
    width: 100%;
    height: 100%;
}

/* 轮播区域特效 */
.aspect-video:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(239, 68, 68, 0.1) 0%, 
        rgba(59, 130, 246, 0.1) 50%, 
        rgba(16, 185, 129, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aspect-video:hover:after {
    opacity: 1;
}

/* 响应式文本截断 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

::-webkit-scrollbar-track {
    background: #374151;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* 选择文本样式 */
::selection {
    background: rgba(239, 68, 68, 0.3);
    color: white;
}

::-moz-selection {
    background: rgba(239, 68, 68, 0.3);
    color: white;
}

/* 搜索框动画 */
input:focus {
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .aspect-video {
        min-height: 200px;
    }
    
    .grid {
        gap: 0.75rem;
    }
}

/* 性能优化 - 减少重绘 */
.group {
    will-change: transform;
}

.group img,
.group .aspect-video,
.group .aspect-\[3\/4\] {
    will-change: transform;
}

/* 深色模式优化 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #111827;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .text-gray-400 {
        color: #D1D5DB;
    }
    
    .bg-gray-800 {
        background-color: #000000;
        border: 1px solid #374151;
    }
}

/* 减少动画效果（用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* 打印样式 */
@media print {
    .sticky,
    .fixed,
    button,
    .bg-gradient-to-r {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
    }
}

/* 页面加载动画 */
.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.page-loading.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(239, 68, 68, 0.3);
    border-top: 3px solid #EF4444;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

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

/* 视频播放器样式（预留） */
.video-player {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.video-player:hover .video-controls {
    transform: translateY(0);
}

/* 自定义工具提示 */
.tooltip {
    position: relative;
}

.tooltip:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip:hover:before {
    opacity: 1;
    visibility: visible;
}

/* 错误状态样式 */
.error-state {
    background: linear-gradient(135deg, #7F1D1D 0%, #991B1B 100%);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

/* 成功状态样式 */
.success-state {
    background: linear-gradient(135deg, #14532D 0%, #166534 100%);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}