/* 热榜组件核心样式 */

/* 1. 基础容器样式 */
.index-hl {
    margin-bottom: 2rem;
}

/* 根容器：热榜主体容器 */
.hotlist {
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-fast) ease,
                box-shadow var(--transition-fast) ease;
    overflow: hidden;
}
.dark-mode .hotlist{box-shadow:none}

.hotlist>.card {
    border: 0;
    background: var(--card-bg);
}



/* 2. 头部区域样式 */
.hotlist .io-hot-header {
    padding: 12px 12px 6px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    background-color: transparent;
}

/* 标题区域 */
.hotlist .text-md {
    display: flex;
    align-items: center;
}

/* 热榜标题 */
.hotlist .io-hot-title {
    font-size: 1rem;
    font-weight: 400;
    margin-left: 10px;
    color: var(--text);
}

/* 时间标识 */
.hotlist .io-hot-slug {
    /* padding: 4px 12px; */
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--text-lighter);
    border-radius: 12px;
    font-size: 0.75rem;
    backdrop-filter: blur(3px);
    transition: background-color var(
    --transition-fast) ease;
}

.hotlist .io-hot-header:hover .io-hot-slug {
    background-color: rgba(255, 255, 255, 0.3);
}


/* 3. 内容区域样式 */
.hotlist .io-hot-body {
    max-height: 300px;
    padding: 16px 20px;
    margin: 0 0 10px 0;
    margin-right: 8px; /* 滚动条与右边缘间距 */
    overflow-x: hidden;
    overflow-y: auto;
}
.index-hl .hotlist .io-hot-body{max-height: 160px;}

/* 热榜列表容器 */
.hotlist .io-hot-body ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 列表项样式 */
.hotlist .io-hot-body li {
    display: flex;
    align-items: center;
    padding: 3px 0;
    transition: background-color var(--transition-fast) ease;
}

.hotlist .io-hot-body li>div {
    display: flex;
    align-items: center;
}

/* 移除多余边距 */
.hotlist .io-hot-body li.mb-2 {
    margin-bottom: 0 !important;
}

.hotlist .io-hot-body li:last-child {
    border-bottom: none;
}

/* 列表项hover效果 */
.hotlist .io-hot-body li:hover {
    background-color: var(--primary-alpha-5);
}

.hotlist .io-hot-body li:hover a {
    color: var(--primary-dark);
}


/* 4. 排名数字样式 */
.hotlist .hot-rank {
    font-weight: 300;
    font-size: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast) ease;
}

/* 排名颜色区分 */
.hotlist .io-hot-body li:nth-child(1) .hot-rank {
    color: #FE2D46;
}

.hotlist .io-hot-body li:nth-child(2) .hot-rank {
    color: #f60;
}

.hotlist .io-hot-body li:nth-child(3) .hot-rank {
    color: #FAA90E;
}


/* 5. 链接与热度值样式 */
/* 热榜链接 */
.hotlist .io-hot-body a {
    color: var(--text);
    text-decoration: none;
    transition: all var(--transition-fast) ease;
    line-height: 1.5;
    font-size: 13px;
    flex: 1;
    padding: 0 10px 0 10px;
    word-break: break-word;
}

/* 热度值 */
.hotlist .io-hot-body li > div:last-child {
    color: var(--text-lighter);
    font-size: 0.85rem;
    transition: color var(--transition-fast) ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.hotlist .io-hot-body li > div:last-child i {
    font-size: 0.75rem;
    opacity: 0.7;
}

.hotlist .io-hot-body li:hover > div:last-child {
    color: var(--primary);
}


/* 6. 滚动条样式（优化透明与间距） */
/* 滚动条整体 */
.hotlist .io-hot-body::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

/* 滚动条轨道（完全透明） */
.hotlist .io-hot-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0);
    border: none;
    box-shadow: none;
    margin: 0;
}

/* 滚动条滑块 */
.hotlist .io-hot-body::-webkit-scrollbar-thumb {
    background-color: rgba(200, 200, 200, 0.3);
    border-radius: 3px;
    border: none;
    transition: background-color 0.2s ease;
}

/* 滑块hover效果 */
.hotlist .io-hot-body::-webkit-scrollbar-thumb:hover {
    background-color: rgba(150, 150, 150, 0.8);
}


/* 7. 适配favicon图标 */
.iconfont {
    font-family: initial; /* 移除原有图标字体样式 */
    width: 16px;
    height: 16px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
    vertical-align: middle;
}

    
.iconfont.icon-100000 {background-image: url("/static/img/baidu.png");}
.iconfont.icon-100001 {background-image: url("/static/img/36kr.png");}
.iconfont.icon-100003 {background-image: url("/static/img/bilibili.png");}
.iconfont.icon-100005 {background-image: url("/static/img/lssdjt.png");}
.iconfont.icon-100007 {background-image: url("/static/img/weibo.png");}
.iconfont.icon-100020 {background-image: url("/static/img/douyin.png");}
.iconfont.icon-100015 {background-image: url("/static/img/zhihu.png");}
.iconfont.icon-100028 {background-image: url("/static/img/ithome.png");}
.iconfont.icon-100030 {background-image: url("/static/img/hupu.png");}


/* 8. 加载状态样式 */
/*.hotlist .loading {*/
/*    font-size: 12px;*/
/*    justify-content: center;*/
/*    min-height: 50px;*/
/*    display: flex;*/
/*    align-items: center;*/
/*}*/

/* 加载状态容器 */
.hotlist .loading-state {
    padding: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* 加载动画 */
.hotlist .loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #eee;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 加载文本 */
.hotlist .loading-text {
    color: var(--text-lighter);
    font-size: 0.9rem;
}

/* 重试按钮 */
.hotlist .retry-btn {
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--card-bg);
    color: var(--primary);
    cursor: pointer;
    font-size: 0.8rem;
    display: none; /* 默认隐藏 */
}

.hotlist .retry-btn:hover {
    background: var(--primary-alpha-5);
}

/* 加载失败状态 */
.hotlist.loading-failed .loading-spinner {
    display: none;
}

.hotlist.loading-failed .retry-btn {
    display: inline-block;
}

.hotlist.loading-failed .loading-text {
    color: var(--danger); /* 失败时文本变红 */
}

/* 加载完成后隐藏加载容器 */
.hotlist.loaded .loading-state {
    display: none;
}

/* 加载动画定义 */
@keyframes spin {
    to { transform: rotate(360deg); }
}


/* 9. 响应式调整 */
@media (max-width: 991px) {
    .hotlist .io-hot-header {
        padding: 14px 16px;
    }
    
    .hotlist .io-hot-title {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .hotlist .io-hot-body li {
        padding: 10px 15px;
    }
    
    .hotlist .io-hot-body a {
        font-size: 0.85rem;
        padding: 0 8px;
    }
    
    .hotlist .hot-rank {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
}


/* 10. 深色模式适配 */
.dark-mode .hotlist {
    background-color: var(--dark-card-bg);
    border-color: var(--border);
}

.dark-mode .hotlist .io-hot-header {
    filter: brightness(0.9) saturate(1.1);
}

.dark-mode .hotlist .io-hot-body li:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.dark-mode .hotlist .io-hot-body a:hover {
    color: var(--primary-light);
}

.dark-mode .hotlist .io-hot-body li:hover > div:last-child {
    color: var(--primary-light);
}

.dark-mode .hotlist .io-hot-body li:nth-child(n+11) .hot-rank {
    background-color: rgba(91, 155, 243, 0.1);
}

/* 深色模式滚动条 */
.dark-mode .hotlist .io-hot-body::-webkit-scrollbar-thumb {
    background-color: rgba(100, 100, 100, 0.3);
}

.dark-mode .hotlist .io-hot-body::-webkit-scrollbar-thumb:hover {
    background-color: rgba(150, 150, 150, 0.7);
}
