/* 半糖次元 - 二次元漫画网站样式 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Ma+Shan+Zheng&display=swap');

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #1f2937;
    overflow-x: hidden;
    font-size: 15px;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* 按钮特效 */
.btn-glow {
    position: relative;
    overflow: hidden;
}

.btn-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.8s;
}

.btn-glow:hover::before {
    left: 100%;
}

/* 输入框样式 */
.input-glow {
    transition: all 0.4s ease;
}

.input-glow:focus {
    box-shadow: 0 0 25px rgba(236, 72, 153, 0.4);
    border-color: #ec4899;
}

/* 导航栏特效 */
.nav-blur {
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

/* 页面过渡动画 */
.page-transition {
    animation: slideInUp 1s ease-out;
}

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

/* 排行榜选项卡样式 */
.ranking-tab {
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.ranking-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s;
}

.ranking-tab:hover::before {
    left: 100%;
}

.ranking-tab.active {
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(236, 72, 153, 0.6);
}

/* 排行榜项目动画 */
.ranking-item {
    transition: all 0.4s ease;
    position: relative;
}

.ranking-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(236, 72, 153, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 16px;
}

.ranking-item:hover::before {
    opacity: 1;
}

/* 计数器动画 */
.counter {
    display: inline-block;
}

/* 返回顶部按钮 */
#back-to-top {
    transition: all 0.4s ease;
}

#back-to-top.show {
    transform: translateY(0);
    opacity: 1;
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ec4899, #3b82f6);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #db2777, #2563eb);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 2.5rem !important;
    }
    
    h2 {
        font-size: 1.8rem !important;
    }
    
    h3 {
        font-size: 1.4rem !important;
    }
    
    .ranking-item {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .ranking-item > * {
        margin-bottom: 0.75rem;
    }
}

/* 加载动画 */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(236, 72, 153, 0.3);
    border-top: 5px solid #ec4899;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

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

/* 文本渐变效果 */
.text-gradient {
    background: linear-gradient(135deg, #ec4899, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 数据可视化效果 */
.data-bar {
    height: 6px;
    background: linear-gradient(90deg, #ec4899, #3b82f6);
    border-radius: 3px;
    animation: dataFlow 2.5s ease-in-out infinite;
}

@keyframes dataFlow {
    0%, 100% {
        transform: scaleX(0.7);
    }
    50% {
        transform: scaleX(1);
    }
}

/* 全屏加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .card-hover:hover {
        transform: none;
        box-shadow: none;
    }
    
    .ranking-item:hover::before {
        opacity: 0;
    }
    
    .btn-glow:hover::before {
        left: -100%;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .text-gradient {
        background: #000;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    .page-transition,
    .card-hover,
    .ranking-item,
    .ranking-tab {
        animation: none;
        transition: none;
    }
}

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

/* 无障碍支持 */
.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;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* 自定义动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* 渐变边框效果 */
.gradient-border {
    position: relative;
    background: linear-gradient(45deg, #ec4899, #3b82f6);
    padding: 2px;
    border-radius: 16px;
}

.gradient-border::before {
    content: '';
    position: absolute;
    inset: 2px;
    background: white;
    border-radius: 14px;
    z-index: -1;
}

/* 脉冲效果 */
.pulse-effect {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

/* 旋转效果 */
.rotate-effect {
    transition: transform 0.6s ease;
}

.rotate-effect:hover {
    transform: rotate(360deg);
}

/* 缩放效果 */
.scale-effect {
    transition: transform 0.3s ease;
}

.scale-effect:hover {
    transform: scale(1.1);
}

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

.shadow-glow:hover {
    box-shadow: 0 0 40px rgba(236, 72, 153, 0.5);
}