/* 热门文章排行榜样式 */
.rank-list-container {
    position: relative;
}

/* 排行榜选项卡 */
.rank-tabs {
    position: relative;
}

.rank-tab-btn {
    position: relative;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.rank-tab-btn:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.5);
}

.rank-tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.dark .rank-tab-btn {
    color: #9ca3af;
}

.dark .rank-tab-btn:hover {
    color: #d1d5db;
    background: rgba(255, 255, 255, 0.1);
}

.dark .rank-tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

/* 排行榜内容 - 紧凑化 */
.rank-content {
    position: relative;
    min-height: 300px;
}

.rank-card {
    --shadow: 0 2px 10px rgba(0,0,0,.06);
    --shadow-hover: 0 4px 16px rgba(0,0,0,.10);
    box-shadow: var(--shadow);
}

.rank-card:hover {
    box-shadow: var(--shadow-hover);
}

/* 统一三榜配色基调，可按需开启
.rank-list#rank-views .rank-card .h-1 { background-image: linear-gradient(90deg, #60a5fa, #a78bfa); }
.rank-list#rank-likes .rank-card .h-1 { background-image: linear-gradient(90deg, #fb7185, #f472b6); }
.rank-list#rank-comments .rank-card .h-1 { background-image: linear-gradient(90deg, #34d399, #22d3ee); }
*/

.rank-list {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.rank-list.hidden {
    display: none;
}

.rank-list.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

/* 排行榜项目 */
.rank-item {
    position: relative;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
}

.rank-item:hover {
    transform: translateX(6px) translateY(-2px);
    border-color: #e5e7eb;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
}

.dark .rank-item:hover {
    border-color: #374151;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* 文章标题多行截断 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    max-height: 2.8em;
}

/* 缩略图容器 */
.rank-item .thumbnail-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.rank-item .thumbnail-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.rank-item:hover .thumbnail-container::before {
    opacity: 1;
}

/* 排名数字样式 */
.rank-number {
    position: relative;
}

.rank-number .w-8.h-8 {
    position: relative;
    overflow: hidden;
}

.rank-number .w-8.h-8::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.rank-item:hover .rank-number .w-8.h-8::before {
    opacity: 1;
}

/* 前三名特殊效果 */
.rank-item:nth-child(1) .rank-number .w-10.h-10 {
    animation: goldGlow 3s ease-in-out infinite alternate;
}

.rank-item:nth-child(2) .rank-number .w-10.h-10 {
    animation: silverGlow 3s ease-in-out infinite alternate;
}

.rank-item:nth-child(3) .rank-number .w-10.h-10 {
    animation: bronzeGlow 3s ease-in-out infinite alternate;
}

@keyframes goldGlow {
    0% {
        box-shadow: 0 0 10px rgba(251, 191, 36, 0.6), 0 0 20px rgba(251, 191, 36, 0.3);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 20px rgba(251, 191, 36, 0.9), 0 0 40px rgba(251, 191, 36, 0.5), 0 0 60px rgba(251, 191, 36, 0.2);
        transform: scale(1.05);
    }
}

@keyframes silverGlow {
    0% {
        box-shadow: 0 0 10px rgba(156, 163, 175, 0.6), 0 0 20px rgba(156, 163, 175, 0.3);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 20px rgba(156, 163, 175, 0.9), 0 0 40px rgba(156, 163, 175, 0.5);
        transform: scale(1.05);
    }
}

@keyframes bronzeGlow {
    0% {
        box-shadow: 0 0 10px rgba(251, 146, 60, 0.6), 0 0 20px rgba(251, 146, 60, 0.3);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 20px rgba(251, 146, 60, 0.9), 0 0 40px rgba(251, 146, 60, 0.5);
        transform: scale(1.05);
    }
}

/* 金银铜图标动画 */
.rank-item .absolute.-top-1.-right-1 {
    animation: medalFloat 0.8s ease-out;
}

@keyframes medalFloat {
    0% {
        transform: scale(0) rotate(180deg) translateY(-10px);
        opacity: 0;
    }
    50% {
        transform: scale(1.3) rotate(90deg) translateY(-5px);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg) translateY(0);
        opacity: 1;
    }
}

/* 金银铜图标悬停效果 */
.rank-item:hover .absolute.-top-1.-right-1 {
    animation: medalSpin 1s ease-in-out infinite;
}

@keyframes medalSpin {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.1) rotate(90deg);
    }
    50% {
        transform: scale(1.2) rotate(180deg);
    }
    75% {
        transform: scale(1.1) rotate(270deg);
    }
}

/* 金牌特殊发光效果 */
.rank-item:nth-child(1) .absolute.-top-1.-right-1 {
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
    animation: goldMedalGlow 2s ease-in-out infinite alternate;
}

@keyframes goldMedalGlow {
    0% {
        box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
        filter: brightness(1);
    }
    100% {
        box-shadow: 0 0 25px rgba(251, 191, 36, 0.9), 0 0 35px rgba(251, 191, 36, 0.4);
        filter: brightness(1.2);
    }
}

/* 银牌发光效果 */
.rank-item:nth-child(2) .absolute.-top-1.-right-1 {
    box-shadow: 0 0 10px rgba(156, 163, 175, 0.5);
    animation: silverMedalGlow 2.5s ease-in-out infinite alternate;
}

@keyframes silverMedalGlow {
    0% {
        box-shadow: 0 0 10px rgba(156, 163, 175, 0.5);
    }
    100% {
        box-shadow: 0 0 20px rgba(156, 163, 175, 0.8);
    }
}

/* 铜牌发光效果 */
.rank-item:nth-child(3) .absolute.-top-1.-right-1 {
    box-shadow: 0 0 8px rgba(251, 146, 60, 0.4);
    animation: bronzeMedalGlow 3s ease-in-out infinite alternate;
}

@keyframes bronzeMedalGlow {
    0% {
        box-shadow: 0 0 8px rgba(251, 146, 60, 0.4);
    }
    100% {
        box-shadow: 0 0 18px rgba(251, 146, 60, 0.7);
    }
}

/* 排名角标动画（缩略图上的小角标） */
.rank-item .absolute.-top-2.-right-2 {
    animation: bounceIn 0.6s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(90deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* 缩略图悬停效果 */
.rank-item .w-16.h-16 {
    position: relative;
    overflow: hidden;
}

.rank-item .w-16.h-16::after {
    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.6s ease;
}

.rank-item:hover .w-16.h-16::after {
    left: 100%;
}

/* 文章标题样式 */
.rank-item h3 {
    position: relative;
    overflow: hidden;
}

.rank-item h3 a {
    position: relative;
    text-decoration: none;
}

.rank-item h3 a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    transition: width 0.3s ease;
}

.rank-item:hover h3 a::after {
    width: 100%;
}

/* 热度指示器动画 */
.rank-item .ri-fire-line,
.rank-item .ri-heart-fill,
.rank-item .ri-message-fill {
    transition: all 0.3s ease;
}

.rank-item:hover .ri-fire-line {
    transform: scale(1.3) rotate(10deg);
    animation: fireFlicker 0.8s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 8px rgba(251, 146, 60, 0.6));
}

.rank-item:hover .ri-heart-fill {
    transform: scale(1.3);
    animation: heartBeat 0.8s ease-in-out infinite;
    filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
}

.rank-item:hover .ri-message-fill {
    transform: scale(1.3);
    animation: messageBounce 0.6s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.6));
}

@keyframes fireFlicker {
    0% {
        filter: brightness(1) hue-rotate(0deg) drop-shadow(0 0 8px rgba(251, 146, 60, 0.6));
    }
    100% {
        filter: brightness(1.4) hue-rotate(15deg) drop-shadow(0 0 12px rgba(251, 146, 60, 0.8));
    }
}

@keyframes heartBeat {
    0%, 100% {
        transform: scale(1.3);
        filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.6));
    }
    50% {
        transform: scale(1.5);
        filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.8));
    }
}

@keyframes messageBounce {
    0% {
        transform: scale(1.3) translateY(0) rotate(0deg);
        filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.6));
    }
    100% {
        transform: scale(1.3) translateY(-3px) rotate(5deg);
        filter: drop-shadow(0 0 12px rgba(34, 197, 94, 0.8));
    }
}

/* 统计标签悬停效果 */
.rank-item .bg-gray-100.dark\\:bg-gray-800 {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.rank-item:hover .bg-gray-100.dark\\:bg-gray-800 {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dark .rank-item:hover .bg-gray-100.dark\\:bg-gray-800 {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 统计标签闪光效果 */
.rank-item .bg-gray-100.dark\\:bg-gray-800::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 ease;
}

.rank-item:hover .bg-gray-100.dark\\:bg-gray-800::before {
    left: 100%;
}

/* 淡入上升动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 640px) {
    .rank-tab-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .rank-tab-btn span {
        display: none;
    }
    
    .rank-tab-btn i {
        font-size: 16px;
    }
    
    .rank-item {
        padding: 12px;
    }
    
    .rank-number .w-8.h-8 {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .rank-item h3 {
        font-size: 14px;
    }
    
    .rank-item .text-xs {
        font-size: 10px;
    }
}

/* 加载状态 */
.rank-list.loading {
    opacity: 0.6;
    pointer-events: none;
}

.rank-list.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态样式 */
.rank-list .text-center {
    padding: 40px 20px;
}

.rank-list .text-center i {
    opacity: 0.5;
    margin-bottom: 8px;
}

/* 滚动条样式 */
.rank-content::-webkit-scrollbar {
    width: 4px;
}

.rank-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 2px;
}

.rank-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.rank-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark .rank-content::-webkit-scrollbar-track {
    background: #1e293b;
}

.dark .rank-content::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark .rank-content::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
