/* ==================== 排行榜页面样式 ==================== */
footer {
    display: none;
}
main{
    min-height: 100vh;
    padding-bottom: 0;
}
/* ========== 1. 顶部标签栏 ========== */
.rankTopBar {
    position: fixed;
    top: 135px;
    left: 50%;
    transform: translateX(-50%);
    right: 0;
    z-index: 1001;
    display: flex;
    width: 1080px;
    align-items: center;
    background-color: var(--white-color);
    /*border-bottom: 1px solid var(--color-efefef);*/
    padding: 12px 15px;
    /*border: 1px solid var(--color-efefef);*/
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.rankTopBar-scroll {
    flex: 1;
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: 50px;
    min-width: 0;
}

/* 如果有 fixed-first，给容器留出左侧空间 */
.rankTopBar-scroll:has(.fixed-first) {
    padding-left: 80px;
}

.rankTopBar-scroll::-webkit-scrollbar {
    display: none;
}

/* 确保内容容器可以超出 */
    .rankTopBar-scroll::after {
    content: '';
    flex-shrink: 0;
    width: 1px;
}

.rankTopBar-scroll a {
    flex-shrink: 0;
    font-size: 14px;
    color: var(--color-666);
    padding: 8px 16px;
    border-radius: 20px;
    background-color: var(--color-efefef);
    transition: all 0.3s;
}

.rankTopBar-scroll a:hover,
.rankTopBar-scroll a.active {
    color: var(--white-color);
    background-color: var(--primary-color);
}

/* 固定"全部"在左侧 */
.rankTopBar-scroll a.fixed-first {
    position: absolute;
    left: 15px;
    z-index: 10;
    background-color: var(--white-color);
    border-radius: 0;
}
.rankTopBar-scroll a.fixed-first:hover,
.rankTopBar-scroll a.fixed-first.active {
    color: var(--white-color);
    border-radius: 20px;
    background-color: var(--primary-color);
}



/* 固定展开按钮在右侧 */
.rankTopBar-expand {
    position: absolute;
    right: 15px;
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-666);
    cursor: pointer;
    background-color: var(--white-color);
    border-radius: 4px;
    transition: all 0.3s;
}

.rankTopBar-expand:hover {
    color: var(--primary-color);
}

.rankTopBar-expand svg {
    transition: transform 0.3s;
}

/* 展开时旋转角标 */
.rankTopBar-expand.expanded svg {
    transform: rotate(180deg);
}

/* 展开时隐藏滚动栏 */
.rankTopBar-scroll.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 展开时 rankTopBar 的高度变为 0，不占位 */
.rankTopBar.expanded {
    height: 0;
    min-height: 0;
    padding: 0;
    overflow: visible;
}

/* 展开时展开按钮保持可见 */
.rankTopBar.expanded .rankTopBar-expand {
    top: 12px;
    right: 15px;
}

/* ========== 2. 下拉展开面板 ========== */
.rankTopBar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
}

.rankTopBar-overlay.show {
    display: block;
}

.rankTopBar-panel {
    position: fixed;
    top: 135px; /* 与 rankTopBar 同高度 */
    left: 50%;
    transform: translateX(-50%);
    width: 1080px;
    background-color: var(--white-color);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 1001;
}

.rankTopBar-overlay.show .rankTopBar-panel {
    max-height: 400px;
}

.rankTopBar-panel-header {
    display: none;
}

.rankTopBar-panel-close {
    display: none;
}

.rankTopBar-panel-content {
    padding: 20px;
    padding-right: 60px; /* 为展开按钮留出右侧空间 */
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 400px;
}

.rankTopBar-panel-content a {
    flex-shrink: 0;
    font-size: 14px;
    color: var(--color-666);
    padding: 8px 16px;
    border-radius: 20px;
    background-color: var(--color-f5f5f5);
    transition: all 0.3s;
}

.rankTopBar-panel-content a:hover,
.rankTopBar-panel-content a.active {
    color: var(--white-color);
    background-color: var(--primary-color);
}

/* ========== 3. 主容器布局 ========== */
.rankMainContainer {
    display: flex;
    gap: 15px;
    padding-top: 61px;
    height: calc(100vh - 135px);
    transition: padding-top 0.3s ease;
}

/* 展开时调整主容器的上边距 */
/* .rankTopBar.expanded ~ .rankMainContainer {
    padding-top: 15px;
} */

/* 左侧导航栏 */
.rankLeftBar {
    flex-shrink: 0;
    width: 150px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: var(--white-color);
    border-radius: 8px;
    padding: 15px;
    /*border: 1px solid var(--color-efefef);*/
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 130px;
    height: fit-content;
    margin-top: 15px;
    height: calc(100vh - 230px);
}

.rankLeftBar a {
    font-size: 15px;
    color: var(--color-333);
    padding: 12px 16px;
    border-radius: 6px;
    text-align: center;
    transition: all 0.3s;
    background-color: var(--color-f5f5f5);
}

.rankLeftBar a:hover {
    color: var(--primary-color);
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.rankLeftBar a.active {
    color: var(--white-color);
    background-color: var(--primary-color);
    font-weight: bold;
}

/* 右侧内容区域 */
.rankRightContent {
    flex: 1;
    min-width: 0;
    height: calc(100vh - 230px);
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 15px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.rankRightContent::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}
.rankRightContent .listBox {
    counter-reset: rank-counter;
}

/* ========== 4. 排行榜内容区域（小说模式） ========== */

/* 列表项基础样式 */
.innerWrap {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.sectionTitle{
    border: 0;
    margin-bottom: 15px;
}
.sectionTitle h2{
    font-size: 12px;
    font-weight: normal;
    padding: 0;
}
.rankRightContent .listBox-w3 .listItem {
    width: calc(33.33% - 10px);
}

.rankRightContent .listBox-w3 .listItem:nth-child(-n+3){
    margin-top: 0;
}
.rankRightContent .listBox-w5 .listItem:nth-child(-n+5) {
    margin-top: 0;
}
.rankRightContent .listBox-w6 .listItem:nth-child(-n+6) {
    margin-top: 0;
}
.rankRightContent .listImgBox em {
    bottom: 3px;
    right: 3px;
    top: auto;
    left: auto;
}
/* 排名数字 */
.rankRightContent .listImgBox::before {
    content: counter(rank-counter);
    counter-increment: rank-counter;
    position: absolute;
    top: auto;
    bottom: 0;
    left: 0;
    width: 24px;
    height: 24px;
    font-size: 12px;
    font-weight: bold;
    color: var(--white-color);
    background: linear-gradient(120deg, var(--primary-color-2), var(--primary-color));
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* ========== 5. 前三名特殊样式 ========== */
/*.rankRightContent .listBox .listItem:nth-child(-n+3) {
    background: linear-gradient(120deg, #3d3d45, #1d1d25);
}*/
.rankRightContent .listBox .listItem:nth-child(-n+3) .listImgBox::before {
    font-size: 80px;
    width: auto;
    height: auto;
    background: none;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    bottom: 0;
    left: 0;
    top: auto;
    line-height: 1;
}
.rankRightContent .listBox-w3 .listItem:nth-child(-n+3) .listImgBox::before{
    font-size: 60px;
}


/* ========== 7. 移动端响应式 ========== */
@media screen and (max-width: 1080px) {
    /* 隐藏导航栏中的部分内容，但保留 promotion */
    nav{
        height: 0;
    }
    nav .navListItem-nav,
    nav .navListItem-promotion {
        display: none !important;
    }

    /* header高度 */
    header {
        height: 50px !important;
    }

    /* main上边距 */
    main {
        padding-top: 50px !important;
    }

    /* 搜索框 */
    .headerInner .searchBox {
        top: 6px !important;
        right: 10px !important;
        width: 36px !important;
        height: 36px !important;
        background-color: transparent !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .searchBox input,
    .searchBox .searchText {
        display: none !important;
    }

    .searchBox .searchImg {
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
        background-color: none;
        border-radius: 50% !important;
        box-shadow: none;
        width: 36px !important;
        height: 36px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* 顶部标签栏 */
    .rankTopBar {
        top: 50px;
        padding: 8px 10px;
        width: 100%;
        box-shadow: none;
        border: 0;
    }

    .rankTopBar-scroll {
        padding-right: 40px;
    }

    /* 如果有 fixed-first，移动端也留出左侧空间 */
    .rankTopBar-scroll:has(.fixed-first) {
        padding-left: 60px;
    }

    .rankTopBar-scroll a {
        font-size: 12px;
        padding: 6px 12px;
    }

    .rankTopBar-scroll a.fixed-first {
        left: 10px;
    }

    

    .rankTopBar-expand {
        right: 10px;
        width: 28px;
        height: 28px;
        background-color: var(--white-color);
    }

    /* 移动端下拉面板 */
    .rankTopBar-panel {
        top: 50px; /* 移动端与 header 同高度 */
        width: 100%;
        border-radius: 0;
    }
    
    .rankTopBar-overlay.show .rankTopBar-panel {
        max-height: 400px;
    }
    
    .rankTopBar-panel-content {
        padding: 15px;
        padding-right: 40px; /* 移动端为展开按钮留出右侧空间 */
        gap: 8px;
    }
    
    /* 移动端展开时展开按钮位置 */
    .rankTopBar.expanded .rankTopBar-expand {
        top: 8px;
        right: 10px;
    }

    /* 主容器 */
    .rankMainContainer {
        gap: 0;
        padding-top: 45px;
        height: calc(100vh - 50px - 54px);
    }
    .rankRightContent {
        margin-top: 0;
        height: calc(100vh - 95px - 54px);
    }
    /* 左侧导航 */
    .rankLeftBar {
        width: 80px;
        padding: 8px;
        gap: 6px;
        top: 95px;
        margin-top: 0;
        border: 0;
        border-radius: 0;
        height: calc(100vh - 95px - 54px);
    }

    .rankLeftBar a {
        font-size: 13px;
        padding: 10px 8px;
    }


    .innerWrap {
        box-shadow: none;
    }
    .sectionTitle{
        border: 0;
        margin-bottom: 12px;
    }
    .rankRightContent .listBox-w3 .listItem{
        width: 100%;
    }
    .rankRightContent .listBox-w3 .listItem:first-child {
        margin-top: 0px!important;
    }
    .rankRightContent .listBox-w5 .listItem:nth-child(-n+2) {
        margin-top: 0 !important;
    }
    .rankRightContent .listBox-w6 .listItem:nth-child(-n+3) {
        margin-top: 0 !important;
    }
    
}

/* ========== 查看更多按钮 ========== */
.seeMore {
    width: 100%;
    text-align: center;
    padding: 30px 0;
    display: inline-block;
    margin-top: 20px;
    font-size: 14px;
    color: var(--primary-color)!important;
    text-decoration: none;
}

.seeMore:hover {
    color: var(--primary-active-color)!important;
}
