/* ============================================================
   style.css
   ============================================================ */

/* ---------- 第一部分：文章面板 ---------- */
.panel-container {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}
.article-panel {
    flex: 1 1 calc(25% - 15px);
    min-width: 280px;
    padding: 15px;
    border: 1px solid #e5e5e5;
    background-color: #FFF;
    box-shadow: #fff;
    border-radius: 4px;
    margin-top: 15px;
}
.panel-title {
    font-size: 16px;
    font-weight: bold;
    color: #212529;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}
.article-list {
    margin-top: 10px;
}
.article-list li {
    padding: 6px 0;
    border-bottom: 1px dashed #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    padding-right: 15px;
}
.article-list li:last-child {
    border-bottom: none;
}
.article-list li::after {
    content: "";
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 4px solid #999;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: border-color 0.2s;
}
.article-list a {
    color: #666;
    text-decoration: none;
    display: block;
}
.article-list a:hover {
    color: #007bff;
}
.article-list li:hover::after {
    border-left-color: #007bff;
}

@media (max-width: 768px) {
    .article-panel {
        flex: 1 1 calc(50% - 15px);
    }
}
@media (max-width: 576px) {
    .article-panel {
        flex: 1 1 100%;
    }
}
.display {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
}

/* ============================================================
   第二部分：热榜模块（强制固定 5 行，适配所有浏览器）
   ============================================================ */
.hot-rank-container {
    width: 100%;
    max-width: 100%;
    margin: 15px auto;
    font-family: "Microsoft Yahei", Arial, sans-serif;
}

.hot-rank-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 8px;
    padding: 0 5px;
}

.hot-rank-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 12px 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}
.hot-rank-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hot-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f5f5f5;
    flex-shrink: 0;
}
.hot-title-group {
    display: flex;
    flex-direction: column;
}
.hot-card-main-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 3px;
    line-height: 1.2;
}
.hot-card-subtitle {
    font-size: 12px;
    color: #999;
}

.hot-more-btn {
    font-size: 12px;
    color: #ff4400;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
}
.hot-more-btn:not(.disabled):hover {
    background: #fff5f0;
    color: #ff2200;
}
.hot-more-btn.disabled {
    color: #ccc;
}

/* ===== 核心修复：强制容器高度 = 5行，超出滚动 ===== */
.hot-list-wrapper {
    flex: 1;
    height: 150px !important;        /* 5行 × 30px */
    max-height: 150px !important;
    overflow: hidden !important;
    margin-bottom: 10px;
}

.hot-card-list {
    height: 100%;
    max-height: 100%;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-right: 6px;
}

/* 滚动条美化（保留） */
.hot-card-list::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
.hot-card-list::-webkit-scrollbar-track {
    background: #f8f8f8;
    border-radius: 2px;
}
.hot-card-list::-webkit-scrollbar-thumb {
    background: #e0e0e0;
    border-radius: 2px;
    transition: background 0.2s ease;
}
.hot-card-list::-webkit-scrollbar-thumb:hover {
    background: #ff4400;
}
.hot-card-list {
    scrollbar-width: thin;
    scrollbar-color: #e0e0e0 #f8f8f8;
}

/* ===== 强制固定每个列表项的高度，消除浏览器差异 ===== */
.hot-card-item {
    display: flex;
    align-items: center;
    height: 30px !important;
    min-height: 30px !important;
    max-height: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 30px !important;
    border-bottom: 1px dashed #f0f0f0;
    overflow: hidden !important;
    box-sizing: border-box !important;
    flex-shrink: 0;
}

/* 所有子元素也强制 border-box，防止内边距撑大 */
.hot-card-item * {
    box-sizing: border-box !important;
}

.hot-rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f5f5f5;
    color: #666;
    font-size: 12px;
    margin-right: 8px;
    flex-shrink: 0;
    line-height: 20px;
}

.hot-item-title {
    flex: 1;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
    line-height: 30px !important;
    height: 30px !important;
    display: block;
}
.hot-item-title:hover {
    color: #ff4400;
}

.hot-item-num {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
    flex-shrink: 0;
}

/* 前三名特殊样式（保留） */
.hot-top-item {
    font-weight: 500;
}
.hot-top-item:nth-child(1) .hot-rank-num {
    background: #ff4400;
    color: #fff;
}
.hot-top-item:nth-child(2) .hot-rank-num {
    background: #ff8800;
    color: #fff;
}
.hot-top-item:nth-child(3) .hot-rank-num {
    background: #ffaa00;
    color: #fff;
}

.hot-card-footer {
    font-size: 12px;
    color: #999;
    text-align: left;
    flex-shrink: 0;
}

.hot-empty-tip {
    text-align: center;
    padding: 30px 0;
    color: #999;
    font-size: 14px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ============================================================
   响应式：所有断点下依旧保持 5 行
   ============================================================ */
@media (min-width: 768px) and (max-width: 1199px) {
    .hot-rank-cards {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 10px;
    }
    .hot-rank-card {
        padding: 15px;
    }
    .hot-card-item {
        height: 28px !important;
        min-height: 28px !important;
        max-height: 28px !important;
        line-height: 28px !important;
    }
    .hot-item-title {
        line-height: 28px !important;
        height: 28px !important;
    }
    .hot-list-wrapper {
        height: 140px !important;    /* 5行 × 28px */
        max-height: 140px !important;
    }
}

@media (max-width: 768px) {
    .hot-rank-cards {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 0 10px;
    }
    .hot-rank-card {
        padding: 15px;
    }
    .hot-card-main-title {
        font-size: 15px;
    }
    .hot-card-item {
        height: 26px !important;
        min-height: 26px !important;
        max-height: 26px !important;
        line-height: 26px !important;
    }
    .hot-item-title {
        font-size: 13px;
        line-height: 26px !important;
        height: 26px !important;
    }
    .hot-rank-num {
        width: 18px;
        height: 18px;
        font-size: 11px;
        line-height: 18px;
    }
    .hot-list-wrapper {
        height: 130px !important;    /* 5行 × 26px */
        max-height: 130px !important;
    }
    .hot-card-list::-webkit-scrollbar {
        width: 3px;
    }
}

@media (max-width: 480px) {
    .hot-rank-container {
        padding: 0 5px;
    }
    .hot-card-item {
        height: 24px !important;
        min-height: 24px !important;
        max-height: 24px !important;
        line-height: 24px !important;
    }
    .hot-item-title {
        line-height: 24px !important;
        height: 24px !important;
    }
    .hot-item-num {
        font-size: 11px;
    }
    .hot-card-footer {
        font-size: 11px;
    }
    .hot-list-wrapper {
        height: 120px !important;    /* 5行 × 24px */
        max-height: 120px !important;
    }
}

/* ---------- 第二个 style 块中的规则 ---------- */
@media (max-width: 768px) {
    .yc {
        display: none;
    }
}