/**
 * 排行榜页面专用CSS - 去重精简版
 * 默认样式适配≥768px，<768px样式统一放媒体查询
 */

/* ===== 基础重置与工具类 ===== */
body, dd, dl, dt, h1, h2, h3, h4, h5, h6, li, ol, p, ul {
    margin: 0;
    padding: 0;
}
div, h1, h2, h3, h4, h5, h6, ul {
    box-sizing: border-box;
}
li, ol, ul {
    list-style: none;
      padding-left: 0rem !important;
      margin-bottom: 0rem !important;
}

.container {
  --ri-gutter-x: 1.8rem !important;
}

img {
    max-width: 100%;
    height: auto;
}
a {
    color: #262626;
    text-decoration: none;
    transition: all .2s;
}
a:hover {
    color: #ff6c00;
}
.clearfix:after {
    content: "";
    display: block;
    clear: both;
}
.btn-blue {
    background: #ff6c00;
    border-radius: 4px;
    color: #fff;
}
.btn-blue:hover {
    background: #000;
    color: #fff;
}

/* 修复缩略图显示问题 */
.item-thumb {
    float: left;
    width: 160px;
    height: 106px; /* 统一高度 */
    margin-right: 30px;
    display: flex;
    align-items: center;
    justify-content: center; /* 水平居中 */
    overflow: hidden; /* 隐藏超出部分 */
    border-radius: 4px;
}

/* 确保所有缩略图尺寸一致 */
.thumb {
    display: block;
    width: 100%;
    height: 100%; /* 占满容器 */
    object-fit: cover; /* 保持比例并覆盖容器 */
    border-radius: 4px;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
    min-width: 100%; /* 确保最小宽度 */
    min-height: 100%; /* 确保最小高度 */
    flex-shrink: 0; /* 防止收缩 */
}

/* 没有图片时的备用样式 */
.thumb[src=""],
.thumb:not([src]),
.thumb.no-thumb {
    background-color: #f5f5f5;
    display: flex !important;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    border: 1px solid #e8e8e8;
}

.thumb[src=""]:after,
.thumb:not([src]):after,
.thumb.no-thumb:after {
    content: "暂无图片";
}

/* 图片加载失败的处理 */
.thumb[onerror] {
    background-color: #f5f5f5;
}

.thumb[onerror]:before {
    content: "图片加载失败";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #999;
    font-size: 12px;
}

/* 缩略图悬停效果 */
.thumb:hover {
    opacity: 0.9;
    transform: scale(1.02);
}

/* ===== 容器布局 ===== */
.container {
    max-width: 1330px;
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
    position: relative;
}



/* ===== 暗夜模式 ===== */
[data-bs-theme="dark"] .rank-results .items .item:after {
    content: "";
    display: block;
    clear: both;
    width: 100%;
    height: 40px;
    border-bottom: 1px dashed #fff;
    position: absolute;
    bottom: 0;
    left: 0;
}

[data-bs-theme="dark"] .rank-header ul li a {
  color: #b7b7b7;
  background: #353535;
  }

[data-bs-theme="dark"] .rank-content {
  background: #202020;
}

[data-bs-theme="dark"] .rank-header ul li.current a {
  background: #0e0e0e;
  color: #fff;
}

[data-bs-theme="dark"] .rank-results {
  background: #2f2f2f;
}

[data-bs-theme="dark"] .rank-selects {
  color: #fff;
  background: #242424;
}
[data-bs-theme="dark"] .rank-results .items .item:hover {
  background: #0f0f0f;
}
 [data-bs-theme="dark"] .nav-pages .nav a {
  background: #353535;
  color: #fff;
  border: 1px solid #393939;
 }
/* ===== 排行榜头部导航 ===== */
.rank-header {
    background: #ffbd13;
    position: relative;
    z-index: 0;
}
.rank-header .container {
    height: 260px;
    background: url(../../images/page/rank_header.png) no-repeat top;
}
.rank-header ul {
    position: absolute;
    bottom: 0;
    left: 15px;
    right: 15px;
    display: block;
}
.rank-header ul li {
    float: left;
    width: 25%;
    position: relative;
    box-sizing: border-box;
    height: 70px;
}
.rank-header ul li a {
    display: block;
    width: 100%;
    color: #6a6a6a;
    font-size: 16px;
    line-height: 70px;
    height: 70px;
    text-align: center;
    background: #f8f8f8;
    position: absolute;
    left: 0;
    bottom: 0;
}
.rank-header ul li a i {
    margin-right: 10px;
}
.rank-header ul li a:after {
    content: "";
    display: block;
    position: absolute;
    top: 50%;
    right: 0;
    width: 1px;
    height: 20px;
    margin-top: -10px;
    background: #e8e8e8;
}
.rank-header ul li:first-child a {
    border-radius: 6px 0 0 0;
}
.rank-header ul li:last-child a {
    border-radius: 0 6px 0 0;
}
.rank-header ul li:last-child a:after {
    display: none;
}
.rank-header ul li a:hover {
    color: #ff6c00;
}
.rank-header ul li.current a {
    background: #fff;
    height: 80px;
    line-height: 80px;
    border-radius: 6px 6px 0 0;
    color: #ff6c00;
}
.rank-header ul li.current a:after {
    display: none;
}


/* ===== 排行榜内容区域 ===== */
.rank-content {
    background: #eff1f4;
    padding-bottom: 10px;
    min-height: 100vh;
}
.rank-content .nav-pages {
    text-align: center;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
}


/* ===== 筛选器区域 ===== */
.rank-selects {
    font-size: 14px;
    color: #8f8f8f;
    line-height: 26px;
    background: #fff;
    position: relative;
    z-index: 0;
    padding: 10px 50px 0;
    border-radius: 0 0 6px 6px;
    margin: 0 0 30px;
}
.rank-selects .selects {
    display: block;
}
.rank-selects a {
    color: #8f8f8f;
    display: inline-block;
    padding: 0 6px;
    border-radius: 4px;
}
.rank-selects a:hover {
    color: #ff6c00;
}
.rank-selects .current a {
    background: #ff6c00;
    color: #fff;
}
.rank-selects .select {
    overflow: hidden;
    border-bottom: 1px dashed #e2e2e2;
    position: relative;
    padding: 20px 0 0 50px;
}
.rank-selects .select:last-child {
    border-bottom: none;
    padding-bottom: 40px;
}
.rank-selects .select dt {
    position: absolute;
    left: 0;
    top: 20px;
}
.rank-selects .select dt:after {
    content: "：";
}
.rank-selects .select dd {
    display: inline-block;
    margin: 0 20px 20px;
}
.rank-selects .recent {
    position: absolute;
    right: 50px;
    bottom: 20px;
}
.rank-selects .recent a {
    margin: 0 0 0 15px;
    color: #6a6a6a;
}
.rank-selects .recent .current,
.rank-selects .recent a:hover {
    color: #ff6c00;
}
.rank-selects .selects-mobi {
    display: none;
}


/* ===== 结果统计与列表 ===== */
.rank-results {
    background: #fff;
    border-radius: 6px;
    padding: 20px 50px 10px;
    margin: 0 0 30px;
}
.rank-results .rank-total {
    font-size: 16px;
    color: #7e7e7e;
    margin-bottom: 10px;
}
.rank-results .rank-total em {
    font-style: normal;
    font-weight: 400;
    color: #ff6c00;
}
.rank-results .items {
    margin: 0 -50px;
}
.rank-results .items .item {
    padding: 25px; /* 减少上下padding，让内容更居中 */
    overflow: hidden;
    position: relative;
    font-size: 14px;
    height: 126px; /* 调整高度让内容更居中 */
    display: flex;
    align-items: center; /* 垂直居中 */
}
.rank-results .items .item:after {
    content: "";
    display: block;
    clear: both;
    width: 100%;
    height: 40px;
    border-bottom: 1px dashed #000;
    position: absolute;
    bottom: 0;
    left: 0;
}
.rank-results .items .item:last-child:after {
    border-bottom: none;
}
.rank-results .items .item:hover {
    background: #f8fbff;
}

/* ===== 修复排行榜项目布局 - 精确宽度控制 ===== */

/* 排名序号 - 垂直居中 */
.item-num {
    float: left;
    width: 70px;
    height: 86px; /* 调整高度适应新布局 */
    display: flex;
    align-items: center;
    justify-content: center;
}
.item-num .num {
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    border-radius: 50%;
    background: #ededed;
    color: #b3b3b3;
    font-size: 12px;
    text-align: center;
}
.item-num.num-1 .num,
.item-num.num-2 .num,
.item-num.num-3 .num {

    color: #fff;
    background-repeat: no-repeat;
    background-position: bottom;
    background-color: transparent;
    border-radius: 0;
}
.item-num.num-1 .num {
    background-image: url(../../images/page/rank_one.png);
}
.item-num.num-2 .num {
    background-image: url(../../images/page/rank_two.png);
}
.item-num.num-3 .num {
    background-image: url(../../images/page/rank_three.png);
}

/* 缩略图 - 垂直居中 */
.item-thumb {
    float: left;
    width: 160px;
    height: 86px; /* 调整高度适应新布局 */
    margin-right: 30px;
    display: flex;
    align-items: center;
}


/* 标题 - 精确宽度控制 & 垂直居中 */
.item-title {
    float: left;
    width: 40%; /* 固定宽度，避免挤压其他元素 */
    height: 86px; /* 调整高度适应新布局 */
    margin-right: 30px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.item-title a {
    color: #828282;
    font-size: 15px;
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    line-height: 1.4;
    width: 100%;
}

/* 分类信息 - 多链接处理 & 垂直居中 */
.item-cat {
    float: left;
    width: 180px;
    height: 86px; /* 调整高度适应新布局 */
    margin-right: 30px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.item-cat a {
    color: #a5a8b1;
    display: inline; /* 行内显示，避免换行 */
    vertical-align: middle;
}

.item-cat a:hover {
    color: #ff6c00;
}


/* 作者信息 - 垂直居中 */
.item-author {
    float: left;
    width: 120px;
    height: 86px; /* 调整高度适应新布局 */
    margin-right: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.item-author a {
    color: #a5a8b1;
    display: block;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    width: 100%;
}

.item-author a:hover {
    color: #ff6c00;
}

/* 浏览量信息 - 修复重叠问题 & 垂直居中 */
.item-views {
    float: right;
    text-align: right;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}


/* 非悬停状态 - 浏览量显示 */
.item-views .un-hover {
    color: #a5a8b1;
    display: block;
}

.item-views .un-hover em {
    font-style: normal;
    color: #ff7300;
}

/* 悬停状态 - 按钮组 */
.item-views .hover {
    display: none;
    position: relative;
}

/* 按钮组垂直居中布局 */
.item-views .hover-inner {
    display: flex;
    flex-direction: column;
    gap: 8px; /* 按钮间距 */
    width: 100%;
}

.item-views .hover {
    width: 100%;
    font-size: 13px;
    border-radius: 4px;
    transition: all 0.3s ease; /* 添加悬浮特效 */
}

/* 查看详情按钮悬浮特效 */
.item-views .hover .btn-blue {
    background: #ff6c00;
    color: #fff;
    border: none;
}

.item-views .hover .btn-blue:hover {
    background: #000;
    box-shadow: 0 4px 12px rgba(51, 133, 255, 0.3); /* 悬浮阴影 */
    transform: translateY(-1px); /* 轻微上浮效果 */
}

/* 收藏按钮悬浮特效 */
.item-views .hover .fav {
    border: 1px solid #ff6c00;
    color: #ff6c00;
    background: #fff;
    transition: all 0.3s ease;
}

.item-views .hover .fav:hover {
    background: #ff6c00;
    color: #fff;
    box-shadow: 0 4px 12px rgba(51, 133, 255, 0.3); /* 悬浮阴影 */
    transform: translateY(-1px); /* 轻微上浮效果 */
}

/* 悬停状态切换 */
.item:hover .un-hover {
    display: none;
}

.item:hover .hover {
    display: block;
}


/* ===== 分页导航 ===== */
.nav-pages .nav {
    display: inline-block;
    vertical-align: top;
    margin: 0 -5px;
}
.nav-pages .nav li {
    display: inline;
    margin: 0;
    padding: 0 5px;
}
.nav-pages .nav a {
    display: inline-block;
    text-align: center;
    background: #fff;
    font-size: 14px;
    color: #333;
    line-height: 38px;
    height: 38px;
    padding: 0 15px;
    border: 1px solid #f3f3f3;
    border-radius: 3px;
    box-sizing: border-box;
}
.nav-pages .nav a:hover {
    color: #ff6c00;
    background: #fff;
    border-color: #ff6c00;
}
.nav-pages .nav .disabled a {
    cursor: default;
    color: #333;
    border: none;
    background: transparent;
    padding: 0;
}
.nav-pages .nav .active a {
    background: #ff6c00;
    border-color: #ff6c00;
    color: #fff;
    padding: 0 15px;
}

/* 跳转页面 */
.go-page {
    display: inline-block;
    font-size: 14px;
    color: #333;
    vertical-align: top;
    margin-left: 5px;
}
.go-page .go_em {
    position: relative;
    display: inline-block;
}
.go-page .go_em:hover button {
    display: block;
}
.go-page .txt {
    height: 38px;
    padding: 9px;
    background: #fff;
    line-height: 20px;
    width: 40px;
    box-sizing: border-box;
    border: none;
    border-radius: 3px;
    text-align: center;
    margin: 0 5px;
}
.go-page button {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    width: 100%;
    background: #ff6c00;
    color: #fff;
    border: none;
    border-radius: 3px;
    height: 26px;
    line-height: 26px;
    cursor: pointer;
}

/* ===== 手机端适配 - 480px以下 ===== */
@media (max-width: 480px) {
    /* 容器内边距调整 */
    .container {
        padding: 0 10px;
          --ri-gutter-x: 1.28rem !important;
    }

    .rank-results {
        padding: 15px 20px 10px;
        margin: 0 0 20px;
    }

    .rank-results .items {
        margin: 0 -20px;
    }

    .rank-results .items .item {
        padding: 15px 20px;
        height: auto;
        min-height: 100px;
    }

    /* 排行榜头部导航 - 保持原样，只调整内边距 */
    .rank-header .container {
        height: 200px;
        background-size: cover;
    }

    .rank-header ul {
        left: 10px;
        right: 10px;
    }

    .rank-header ul li a {
        font-size: 14px;
    }

    /* 筛选器区域调整 - 改为更紧凑的布局 */
    .rank-selects {
        padding: 10px 20px;
        margin: 0 0 20px;
    }

    .rank-selects .selects {
        display: none; /* 隐藏桌面端筛选器 */
    }

    .rank-selects .selects-mobi {
        display: block; /* 显示移动端筛选器 */
    }

    .rank-selects .recent {
        position: relative;
        right: auto;
        bottom: auto;
        text-align: center;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px dashed #e2e2e2;
    }

    .rank-selects .recent a {
        margin: 0 8px;
        font-size: 12px;
    }

    /* 移动端筛选器样式优化 */
    .selects-mobi .selects-title {
        display: flex;
        justify-content: space-between;
        margin-bottom: 8px;
    }

    .selects-mobi .m_c_t {
        flex: 1;
        text-align: center;
        padding: 6px 0;
        background: #f8f8f8;
        border-radius: 4px;
        margin: 0 3px;
        font-size: 12px;
    }

    .selects-mobi .items {
        display: none;
        padding: 8px 0;
        border-top: 1px solid #f0f0f0;
    }

    .selects-mobi .items.active {
        display: block;
    }

    .selects-mobi .items span {
        display: inline-block;
        margin: 3px;
        padding: 4px 8px;
        background: #f8f8f8;
        border-radius: 4px;
        font-size: 11px;
    }

    .selects-mobi .items span.current {
        background: #ff6c00;
        color: #fff;
    }

    /* 结果列表项调整 - 隐藏分类和作者，调整标题为两行 */
    .item-num {
        width: 40px;
        height: 60px;
    }

    .item-num .num {
        width: 25px;
        height: 25px;
        line-height: 25px;
        font-size: 12px;
        margin-right: 5px;
    }

    .item-thumb {
        width: 120px;
        height: 60px;
        margin-right: 10px;
    }

    .thumb {
        height: 50px !important;
    }

    /* 隐藏分类和作者模块 */
    .item-cat,
    .item-author {
        display: none !important;
    }

    /* 标题调整为两行显示并保持垂直居中 */
    .item-title {
        width: calc(100% - 150px); /* 调整宽度：40+80+80+30边距 */
        margin-right: 5px;
        height: 60px; /* 固定高度 */
        display: flex;
        align-items: center; /* 垂直居中 */
        white-space: normal;
        overflow: hidden;
    }

    .item-title a {
        font-size: 9px;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* 限制显示两行 */
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-height: 2.8em; /* 两行高度 */
        width: 100%;
    }

    .item-views {
        width: 80px;
        height: 60px; /* 与标题高度保持一致 */
    }

    .item-views .un-hover {
        font-size: 11px;
    }

    .item-views .hover .btn {
    height: 28px;
    line-height: 15px;
    font-size: 8px;
    margin-bottom: 4px;
    border: 1px solid #ff6c00;
    }

    /* 分页导航调整 - 修复显示逻辑 */
    .nav-pages .nav {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
    }

    /* 隐藏所有页码按钮 */
    .nav-pages .nav li:not(.fy) {
        display: none;
    }

    /* 只显示上下页按钮和最多2个页码 */
    .nav-pages .nav li.fy {
        display: inline !important;
    }

    /* 显示当前页和前一页 */
    .nav-pages .nav li.active {
        display: inline !important;
    }

    .nav-pages .nav li.active ~ li:not(.fy):nth-child(-n+2) {
        display: inline !important;
    }

    /* 如果当前页是第一页，显示后两页 */
    .nav-pages .nav li.active:first-child ~ li:not(.fy):nth-child(-n+2) {
        display: inline !important;
    }

    .nav-pages .nav a {
        padding: 0 10px;
        font-size: 12px;
        height: 32px;
        line-height: 32px;
        min-width: 32px;
    }

    .go-page {
        display: none; /* 隐藏跳转页面 */
    }

    /* 确保分页按钮数量控制 */
    .nav-pages .nav li {
        order: 10; /* 默认顺序 */
    }

    .nav-pages .nav li.fy:first-child {
        order: 1; /* 上一页在最前 */
    }

    .nav-pages .nav li:not(.fy) {
        order: 2; /* 页码在中间 */
    }

    .nav-pages .nav li.fy:last-child {
        order: 3; /* 下一页在最后 */
    }

    /* 限制显示的页码数量 */
    .nav-pages .nav li:not(.fy):nth-child(n+4) {
        display: none !important;
    }
    
    
   [data-bs-theme="dark"] .item-title a {
  color: #f7f7f7;
  }
   [data-bs-theme="dark"] .selects-mobi .m_c_t {
    background: #000;
  }
   [data-bs-theme="dark"] .rank-results .rank-total {
  color: #f9f9f9;
  }
}