/* 分页样式 */
.pager {
    margin: 0.6rem 0;
    text-align: center;
}

.pager ul {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.12rem;
    flex-wrap: wrap;
}

.pager ul li {
    margin: 0;
    padding: 0;
}

.pager ul li a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 0.48rem;
    height: 0.48rem;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #666;
    text-decoration: none;
    font-size: 0.18rem;
    font-weight: 400;
    border-radius: 0.08rem;
    transition: all 0.3s ease;
    position: relative;
    min-width: 0.48rem;
    box-sizing: border-box;
}

.pager ul li a:hover {
    border-color: #6fba2c;
    color: #6fba2c;
    background: #f8fff8;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(111, 186, 44, 0.15);
}

.pager ul li a.active {
    background: linear-gradient(135deg, #6fba2c, #00a0da);
    border-color: #6fba2c;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(111, 186, 44, 0.3);
}

.pager ul li a.active:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 12px rgba(111, 186, 44, 0.4);
}

/* 上一页/下一页按钮 */
.pager ul li a.prev,
.pager ul li a.next {
    font-size: 0;
}

.pager ul li a.prev::before {
    content: "‹";
    font-size: 0.28rem;
    font-weight: bold;
    line-height: 1;
}

.pager ul li a.next::before {
    content: "›";
    font-size: 0.28rem;
    font-weight: bold;
    line-height: 1;
}

.pager ul li a.prev:hover::before,
.pager ul li a.next:hover::before {
    color: #6fba2c;
}

.pager ul li a.active.prev::before,
.pager ul li a.active.next::before {
    color: #fff;
}

/* 省略号样式 */
.pager ul li a.more {
    border: none;
    background: transparent;
    color: #999;
    font-weight: bold;
    cursor: default;
    min-width: 0.2rem;
    width: auto;
    height: auto;
    box-shadow: none;
}

.pager ul li a.more:hover {
    background: transparent;
    border: none;
    transform: none;
    box-shadow: none;
    color: #999;
}

/* 禁用状态 */
.pager ul li a[href=""] {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pager ul li a[href=""]:hover {
    border-color: #e0e0e0;
    color: #999;
    background: #fff;
    transform: none;
    box-shadow: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .pager {
        margin: 0.4rem 0;
    }
    
    .pager ul {
        gap: 0.06rem;
    }
    
    .pager ul li a {
        width: 0.36rem;
        height: 0.36rem;
        min-width: 0.36rem;
        font-size: 0.14rem;
        border-radius: 0.06rem;
    }
    
    .pager ul li a.prev::before,
    .pager ul li a.next::before {
        font-size: 0.18rem;
    }
    
    /* 移动端隐藏部分页码 */
    .pager ul li:nth-child(n+8):not(:last-child):not(.active) {
        display: none;
    }
    
    .pager ul li a.more {
        display: none;
    }
}

@media (max-width: 480px) {
    .pager ul li a {
        width: 0.32rem;
        height: 0.32rem;
        min-width: 0.32rem;
        font-size: 0.12rem;
    }
    
    .pager ul li a.prev::before,
    .pager ul li a.next::before {
        font-size: 0.14rem;
    }
    
    /* 更小屏幕只显示当前页和前后页 */
    .pager ul li:nth-child(n+6):not(:last-child):not(.active) {
        display: none;
    }
}

/* 动画效果 */
@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pager ul li {
    animation: pageFadeIn 0.3s ease forwards;
}

.pager ul li:nth-child(1) { animation-delay: 0.1s; }
.pager ul li:nth-child(2) { animation-delay: 0.15s; }
.pager ul li:nth-child(3) { animation-delay: 0.2s; }
.pager ul li:nth-child(4) { animation-delay: 0.25s; }
.pager ul li:nth-child(5) { animation-delay: 0.3s; }
.pager ul li:nth-child(6) { animation-delay: 0.35s; }
.pager ul li:nth-child(7) { animation-delay: 0.4s; }
.pager ul li:nth-child(8) { animation-delay: 0.45s; }
.pager ul li:nth-child(9) { animation-delay: 0.5s; }
.pager ul li:nth-child(10) { animation-delay: 0.55s; }
.pager ul li:nth-child(11) { animation-delay: 0.6s; }
.pager ul li:nth-child(12) { animation-delay: 0.65s; }
.pager ul li:nth-child(13) { animation-delay: 0.7s; }
.pager ul li:nth-child(14) { animation-delay: 0.75s; }
.pager ul li:nth-child(15) { animation-delay: 0.8s; }

/* 焦点状态 */
.pager ul li a:focus {
    outline: 2px solid #6fba2c;
    outline-offset: 2px;
}

/* 加载状态 */
.pager.loading ul li a {
    pointer-events: none;
    opacity: 0.7;
}

.pager.loading ul li a::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0.2rem;
    height: 0.2rem;
    margin: -0.1rem 0 0 -0.1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #6fba2c;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 分页交互增强样式 */
.pager ul li a:active {
    transform: scale(0.95);
}

.pager ul li a.active:active {
    transform: scale(0.95) translateY(-2px);
}

/* 工具提示样式 */
.pager ul li a[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 0.1rem 0.2rem;
    border-radius: 0.04rem;
    font-size: 0.2rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 0.1rem;
}

.pager ul li a[title]:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 0.05rem solid transparent;
    border-top-color: rgba(0, 0, 0, 0.8);
    margin-bottom: 0.05rem;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .pager ul li a {
        border-width: 2px;
    }
    
    .pager ul li a.active {
        border-width: 3px;
    }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
    .pager ul li a {
        transition: none;
    }
    
    .pager ul li {
        animation: none;
    }
    
    .pager ul li a:hover {
        transform: none;
    }
    
    .pager ul li a.active:hover {
        transform: none;
    }
}

/* JavaScript交互样式 */
.pager ul li a.clicked {
    transform: scale(0.9);
    transition: transform 0.1s ease;
}

.pager ul li a.pressed {
    transform: scale(0.95);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pager ul li a.touch-active {
    background: #f0f8f0;
    border-color: #6fba2c;
    color: #6fba2c;
}

/* 加载状态动画 */
.pager.loading {
    pointer-events: none;
}

.pager.loading::after {
    content: "加载中...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 0.2rem 0.4rem;
    border-radius: 0.1rem;
    font-size: 0.24rem;
    z-index: 1000;
}

/* 无障碍支持 */
.pager ul li a:focus-visible {
    outline: 3px solid #6fba2c;
    outline-offset: 2px;
    border-radius: 0.1rem;
}

/* 打印样式 */
@media print {
    .pager {
        display: none;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .pager ul li a {
        background: #2a2a2a;
        border-color: #444;
        color: #ccc;
    }
    
    .pager ul li a:hover {
        background: #3a3a3a;
        border-color: #6fba2c;
        color: #6fba2c;
    }
    
    .pager ul li a.active {
        background: linear-gradient(135deg, #6fba2c, #00a0da);
        border-color: #6fba2c;
        color: #fff;
    }
    
    .pager ul li a.more {
        background: transparent;
        color: #888;
    }
}
