/* 文章排行榜小工具样式 */
.xkzhplugs-ranking-container {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 15px;
}



/* 四大榜单横向排列容器 */
.xkzhplugs-ranking-boards {
    display: flex;
    gap: 20px;
    width: 100%;
    flex-wrap: wrap;
}

.dark-theme .ranking-board-title {
    color: #e0e0e0;
}

.dark-theme .ranking-item {
    border-bottom: 1px solid #333;
}

.dark-theme .ranking-number:not(.top1):not(.top2):not(.top3) {
    background-color: #333;
    color: #999;
}

.dark-theme .ranking-number:not(.top1):not(.top2):not(.top3):hover {
    background-color: #444;
    color: #ccc;
}

.dark-theme .ranking-thumb {
    background-color: #333;
    border-color: #444;
}

.dark-theme .ranking-thumb:hover {
    border-color: #555;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dark-theme .ranking-item:nth-child(2) .ranking-thumb,
.dark-theme .ranking-item:nth-child(3) .ranking-thumb {
    border-color: #333;
}

.dark-theme .ranking-item-featured .ranking-thumb {
    background-color: #252525;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-theme .ranking-title a {
    color: #e0e0e0;
}

.dark-theme .ranking-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.25s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ranking-title a:hover {
    color: #ff6c6c;
    transform: translateX(3px);
}

.dark-theme .ranking-excerpt {
    color: #888;
}

.dark-theme .ranking-meta {
    color: #888;
}

.dark-theme .no-posts {
    color: #888;
}

/* 四大榜单横向排列容器 */
.xkzhplugs-ranking-boards {
    display: flex;
    gap: 20px;
    width: 100%;
    flex-wrap: wrap;
}

/* 单个榜单容器 */
.ranking-board {
    flex: 1;
    min-width: 200px;
    background: #fafafa;
    border-radius: 6px;
    padding: 12px;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ranking-board:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* 榜单标题样式 */
.ranking-board-title {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ff6c6c;
    padding-bottom: 6px;
    text-align: center;
}

/* 不同榜单的标题颜色 */
.hot-board .ranking-board-title {
    border-bottom-color: #ff6c6c;
}

.like-board .ranking-board-title {
    border-bottom-color: #ff9d4a;
}

.comment-board .ranking-board-title {
    border-bottom-color: #4a9eff;
}

.favorite-board .ranking-board-title {
    border-bottom-color: #9c4aff;
}

/* 文章列表 */
.xkzhplugs-ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.ranking-item:hover {
    transform: translateX(5px);
    background-color: rgba(255, 108, 108, 0.03);
}

.ranking-item:last-child {
    border-bottom: none;
}

/* 排名号 - 非第一名文章显示在缩略图外部左边 */
.ranking-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 14px;
    font-weight: bold;
    color: #999;
    margin-right: 12px;
    flex-shrink: 0;
    position: relative;
}

.ranking-number.top1 {
    background: #ff6c6c;
    color: #fff;
    border-radius: 50%;
}

.ranking-number.top2 {
    background: #ff9d4a;
    color: #fff;
    border-radius: 50%;
}

.ranking-number.top3 {
    background: #ffce44;
    color: #fff;
    border-radius: 50%;
}

/* 缩略图 */
/* 普通文章缩略图（非第一名） */
.ranking-thumb {
    width: auto;
    height: 40px;
    margin-right: 10px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
    position: relative;
    display: inline-flex;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.ranking-thumb:hover {
    border-color: #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 第二、三名缩略图的轻微特殊样式 */
.ranking-item:nth-child(2) .ranking-thumb,
.ranking-item:nth-child(3) .ranking-thumb {
    border-color: #f5f5f5;
}

.ranking-item:nth-child(2) .ranking-thumb:hover {
    border-color: #ff9d4a;
}

.ranking-item:nth-child(3) .ranking-thumb:hover {
    border-color: #ffce44;
}

/* 排行第一的文章缩略图 - 独特样式 */
.ranking-item-featured .ranking-thumb {
    width: 100%;
    height: 180px;
    margin-right: 0;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    position: relative;
    overflow: visible;
}

.ranking-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
}







/* 第一名图片的额外装饰效果 */
.ranking-item-featured .ranking-thumb::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 10px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ranking-item-featured .ranking-thumb:hover::before {
    opacity: 0.8;
}

/* 图片中的标题覆盖效果 */
.ranking-thumb-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
}

.ranking-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 排行第一的文章标题 */
.ranking-item-featured .ranking-title-overlay {
    font-size: 12px;
    padding: 15px;
    bottom: 40px; /* 留出空间给下方的统计信息 */
}

/* 图片内的排名号样式 - 仅适用于排行第一的文章 */
.ranking-number-inside {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 排行第一图片内的排名号特殊样式 - 更醒目的设计 */
.ranking-number-inside.top1 {
    background-color: #ff4757;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 3px 12px rgba(255, 71, 87, 0.5);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 3px 12px rgba(255, 71, 87, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 3px 20px rgba(255, 71, 87, 0.9);
        transform: scale(1.08);
    }
    100% {
        box-shadow: 0 3px 12px rgba(255, 71, 87, 0.5);
        transform: scale(1);
    }
}

/* 排行第二文章排名号样式 - 显示在缩略图外部左边 */
.ranking-number.top2 {
    background-color: #ff9d4a;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    margin-right: 10px;
    box-shadow: 0 1px 4px rgba(255, 157, 74, 0.4);
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ranking-number.top2:hover {
    transform: scale(1.2) rotate(5deg);
    box-shadow: 0 2px 8px rgba(255, 157, 74, 0.6);
}

/* 排行第三文章排名号样式 - 显示在缩略图外部左边 */
.ranking-number.top3 {
    background-color: #ffce44;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    margin-right: 10px;
    box-shadow: 0 1px 4px rgba(255, 206, 68, 0.4);
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ranking-number.top3:hover {
    transform: scale(1.2) rotate(-5deg);
    box-shadow: 0 2px 8px rgba(255, 206, 68, 0.6);
}

/* 其他排名号样式 - 显示在缩略图外部左边 */
.ranking-number:not(.top1):not(.top2):not(.top3) {
    background-color: #f0f0f0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: normal;
    color: #666;
    margin-right: 10px;
    z-index: 10;
    transition: all 0.2s ease;
}

.ranking-number:not(.top1):not(.top2):not(.top3):hover {
    background-color: #e0e0e0;
    color: #333;
}

/* 图片内的统计信息样式 */
.ranking-meta-inside {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 15px 11px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
}

/* 时间信息样式 */
.ranking-meta-inside .time {
    opacity: 0.9;
}

/* 统计数据样式 */
.ranking-meta-inside .stats {
    font-weight: 500;
}

/* 调整排行第一文章的布局 */
.ranking-item-featured {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px 0;
}

/* 内容区域 */
.ranking-content {
    flex: 1;
    min-width: 0;
}

.ranking-title {
    margin: 0 0 5px 0;
    font-size: 14px;
    line-height: 1.4;
}

.ranking-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ranking-title a:hover {
    color: #ff6c6c;
}

/* 摘要 */
.ranking-excerpt {
    margin: 0 0 5px 0;
    font-size: 12px;
    color: #999;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 统计信息 */
.ranking-meta {
    display: flex;
    font-size: 12px;
    color: #999;
}

.ranking-meta > span {
    margin-right: 10px;
    position: relative;
}

.ranking-meta > span:last-child {
    margin-right: 0;
}

/* 无文章提示 */
.no-posts {
    text-align: center;
    padding: 30px 0;
    color: #999;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    /* 调整间距和大小，确保图片正常显示 */
    .ranking-board {
        min-width: 180px;
    }
}

@media (max-width: 767px) {
    /* 移动设备上的响应式布局，支持触摸滑动 */
    .xkzhplugs-ranking-boards {
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
        flex-wrap: nowrap;
        gap: 10px;
        padding-bottom: 10px;
    }
    
    /* 移动设备上单个榜单样式调整 */
    .ranking-board {
        min-width: 280px;
        max-width: 280px;
        display: inline-block;
        flex-shrink: 0;
        scroll-snap-align: start;
    }
    
    /* 隐藏横向滚动条但保留功能 */
    .xkzhplugs-ranking-boards::-webkit-scrollbar {
        display: none;
    }
    
    .xkzhplugs-ranking-boards {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    
    /* 移动设备上列表项样式优化 */
    .ranking-item {
        padding: 8px 0;
    }
    
    .ranking-title {
        font-size: 13px;
    }
}

/* 暗夜模式适配 */
.dark-theme .xkzhplugs-ranking-container {
    background: #1a1a1a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark-theme .ranking-board {
    background: #252525;
}

.dark-theme .ranking-board:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.dark-theme .ranking-board-title {
    color: #e0e0e0;
}

.dark-theme .ranking-item {
    border-bottom: 1px solid #333;
}

.dark-theme .ranking-number:not(.top1):not(.top2):not(.top3) {
    background-color: #333;
    color: #999;
}

.dark-theme .ranking-number:not(.top1):not(.top2):not(.top3):hover {
    background-color: #444;
    color: #ccc;
}

.dark-theme .ranking-thumb {
    background-color: #333;
    border-color: #444;
}

.dark-theme .ranking-thumb:hover {
    border-color: #555;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dark-theme .ranking-item:nth-child(2) .ranking-thumb,
.dark-theme .ranking-item:nth-child(3) .ranking-thumb {
    border-color: #333;
}

.dark-theme .ranking-item-featured .ranking-thumb {
    background-color: #252525;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark-theme .ranking-title a {
    color: #e0e0e0;
}

.dark-theme .ranking-title a:hover {
    color: #ff6c6c;
}

.dark-theme .ranking-excerpt {
    color: #888;
}

.dark-theme .ranking-meta {
    color: #888;
}

.dark-theme .no-posts {
    color: #888;
}