/* HotRank 小工具轮播样式 */
.hot-rank-widget {
    position: relative;
    overflow: hidden;
}

.hrw-slider {
    display: flex;
    transition: transform 0.4s ease;
}

.hrw-slide {
    min-width: 100%;
    box-sizing: border-box;
    padding: 0 4px;
}

.hrw-slide-header {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    margin-top: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e5e7eb;
    color: #111827;
}

.hrw-slide-icon {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    margin-right: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #fff;
}

.hrw-item {
    display: flex;
    align-items: center;
    padding: 5px 0;
    text-decoration: none;
    color: #374151;
    font-size: 12px;
}
.hrw-item:hover {
    color: #2563eb;
}

.hrw-rank {
    width: 18px;
    text-align: center;
    font-weight: 700;
    font-size: 11px;
    margin-right: 8px;
    color: #9ca3af;
    flex-shrink: 0;
}
.hrw-rank.top3 {
    color: #ef4444;
}

.hrw-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hrw-heat {
    margin-left: 6px;
    font-size: 10px;
    color: #9ca3af;
    flex-shrink: 0;
}

/* Navigation */
.hrw-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.hrw-arrow {
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: #4b5563;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.hrw-arrow:hover {
    background: #e5e7eb;
}
.hrw-arrow:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.hrw-dots {
    display: flex;
    gap: 6px;
}

.hrw-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d1d5db;
    border: none;
    padding: 0;
    cursor: pointer;
}
.hrw-dot.active {
    background: #2563eb;
}
.hrw-dot:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Loading */
.hrw-loading {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
    font-size: 13px;
}

/* ===== 暗色模式适配 ===== */
/* 支持多种常见暗黑模式类名 */
body.hot-rank-dark .hrw-slide-header,
body.dark .hrw-slide-header,
body.dark-mode .hrw-slide-header,
.wp-dark-mode-active .hrw-slide-header {
    border-color: #334155;
    color: #f1f5f9;
}

body.hot-rank-dark .hrw-item,
body.dark .hrw-item,
body.dark-mode .hrw-item,
.wp-dark-mode-active .hrw-item {
    color: #cbd5e1;
}
body.hot-rank-dark .hrw-item:hover,
body.dark .hrw-item:hover,
body.dark-mode .hrw-item:hover,
.wp-dark-mode-active .hrw-item:hover {
    color: #60a5fa;
}

body.hot-rank-dark .hrw-rank,
body.dark .hrw-rank,
body.dark-mode .hrw-rank,
.wp-dark-mode-active .hrw-rank {
    color: #64748b;
}
body.hot-rank-dark .hrw-rank.top3,
body.dark .hrw-rank.top3,
body.dark-mode .hrw-rank.top3,
.wp-dark-mode-active .hrw-rank.top3 {
    color: #f87171;
}

body.hot-rank-dark .hrw-heat,
body.dark .hrw-heat,
body.dark-mode .hrw-heat,
.wp-dark-mode-active .hrw-heat {
    color: #64748b;
}

body.hot-rank-dark .hrw-arrow,
body.dark .hrw-arrow,
body.dark-mode .hrw-arrow,
.wp-dark-mode-active .hrw-arrow {
    background: #334155;
    color: #cbd5e1;
}
body.hot-rank-dark .hrw-arrow:hover,
body.dark .hrw-arrow:hover,
body.dark-mode .hrw-arrow:hover,
.wp-dark-mode-active .hrw-arrow:hover {
    background: #475569;
}

body.hot-rank-dark .hrw-dot,
body.dark .hrw-dot,
body.dark-mode .hrw-dot,
.wp-dark-mode-active .hrw-dot {
    background: #475569;
}
body.hot-rank-dark .hrw-dot.active,
body.dark .hrw-dot.active,
body.dark-mode .hrw-dot.active,
.wp-dark-mode-active .hrw-dot.active {
    background: #3b82f6;
}

body.hot-rank-dark .hrw-loading,
body.dark .hrw-loading,
body.dark-mode .hrw-loading,
.wp-dark-mode-active .hrw-loading {
    color: #64748b;
}

/* 系统级暗黑模式兜底 */
@media (prefers-color-scheme: dark) {
    .hot-rank-widget .hrw-slide-header {
        border-color: #334155;
        color: #f1f5f9;
    }
    .hot-rank-widget .hrw-item {
        color: #cbd5e1;
    }
    .hot-rank-widget .hrw-item:hover {
        color: #60a5fa;
    }
    .hot-rank-widget .hrw-rank {
        color: #64748b;
    }
    .hot-rank-widget .hrw-rank.top3 {
        color: #f87171;
    }
    .hot-rank-widget .hrw-heat {
        color: #64748b;
    }
    .hot-rank-widget .hrw-arrow {
        background: #334155;
        color: #cbd5e1;
    }
    .hot-rank-widget .hrw-arrow:hover {
        background: #475569;
    }
    .hot-rank-widget .hrw-dot {
        background: #475569;
    }
    .hot-rank-widget .hrw-dot.active {
        background: #3b82f6;
    }
    .hot-rank-widget .hrw-loading {
        color: #64748b;
    }
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .hrw-slide-header {
        font-size: 13px;
    }
    .hrw-item {
        font-size: 13px;
        padding: 6px 0;
    }
    .hrw-rank {
        font-size: 11px;
    }
    .hrw-heat {
        font-size: 11px;
    }
    .hrw-arrow {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .hrw-dot {
        width: 8px;
        height: 8px;
    }
}
