/* ====================
   翻页美化样式 - 科技蓝风格 (Refined, Stabilized & Spaced)
   ==================== */

/* 1. 容器布局重置 */
.pages,
.pagelist {
    margin: 60px 0 80px !important;
    text-align: center !important;
    height: auto !important;
    line-height: normal !important;
    overflow: visible !important;
    /* 防止阴影和放大被裁剪 */
}

/* 2. 列表样式重置 */
.pages ul,
.pagelist ul {
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    /* gap: 10px !important;  移除 gap，改用 margin 以兼容旧版布局引擎 */
    padding: 10px !important;
    /* 增加内边距，为放大和阴影留出空间 */
    margin: 0 !important;
    flex-wrap: wrap !important;
    overflow: visible !important;
}

.pages li,
.pagelist li {
    float: none !important;
    display: inline-block !important;
    margin: 0 5px !important;
    /* 默认间距 */
    padding: 0 !important;
    border: none !important;
    background: none !important;

    /* 固定宽高和垂直对齐 */
    width: 40px !important;
    height: 40px !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;

    transition: margin 0.3s ease !important;
    /* 让间距变化也平滑 */
}

/* 关键修复：增加选中项的外边距，补偿 scale(1.1) 带来的视觉重叠 */
.pages li.active,
.pagelist li.active,
.pages li.thisclass,
.pagelist li.thisclass {
    margin: 0 7px !important;
    /* 5px + 2px (补偿) */
}

/* 3. 按钮通用样式 */
.pages li a,
.pagelist li a,
.pages li span,
.pagelist li span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;

    background-color: #fff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 50% !important;

    color: #64748b !important;
    font-size: 14px !important;
    font-family: Arial, sans-serif !important;
    text-decoration: none !important;
    line-height: 1 !important;

    /* 只过渡视觉属性 */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease !important;
    will-change: transform;
    cursor: pointer !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02) !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    /* 确保内部元素无 margin */
}

/* 4. 鼠标悬停状态 */
.pages li a:hover,
.pagelist li a:hover {
    color: #0066ff !important;
    border-color: #0066ff !important;
    background-color: #f0f7ff !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 12px rgba(0, 102, 255, 0.15) !important;
}

/* 5. 选中/激活状态 */
.pages li.active a,
.pagelist li.active a,
.pages li.thisclass,
.pagelist li.thisclass,
.pages li.active span,
.pagelist li.active span {
    background: linear-gradient(135deg, #0066ff 0%, #004098 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
    font-weight: bold !important;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3) !important;
    transform: scale(1.1) !important;
    pointer-events: none !important;

    /* 确保覆盖 */
    padding: 0 !important;
    margin: 0 !important;
    /* 内部元素不需要 margin，由 li 控制 */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
}

/* 6. 隐藏 "首页" 和 "末页" */
.pages li:first-child,
.pagelist li:first-child,
.pages li:last-child,
.pagelist li:last-child {
    display: none !important;
}

/* 7. 图标化 "上一页" 和 "下一页" */
.pages li:nth-child(2) a,
.pagelist li:nth-child(2) a {
    font-size: 0 !important;
}

.pages li:nth-child(2) a::before,
.pagelist li:nth-child(2) a::before {
    content: '‹' !important;
    font-size: 24px !important;
    line-height: 1 !important;
    margin-top: -2px !important;
}

.pages li:nth-last-child(2) a,
.pagelist li:nth-last-child(2) a {
    font-size: 0 !important;
}

.pages li:nth-last-child(2) a::before,
.pagelist li:nth-last-child(2) a::before {
    content: '›' !important;
    font-size: 24px !important;
    line-height: 1 !important;
    margin-top: -2px !important;
}

/* 移动端适配 */
@media (max-width: 768px) {

    .pages,
    .pagelist {
        margin: 30px 0 50px !important;
    }

    .pages ul,
    .pagelist ul {
        gap: 0 !important;
    }

    .pages li,
    .pagelist li {
        width: 34px !important;
        height: 34px !important;
        margin: 0 3px !important;
    }

    .pages li.active,
    .pagelist li.active,
    .pages li.thisclass,
    .pagelist li.thisclass {
        margin: 0 4px !important;
        /* 移动端微调 */
    }

    .pages li a,
    .pagelist li a,
    .pages li span,
    .pagelist li span {
        font-size: 12px !important;
    }
}