/**
 * 分页样式优化
 * 符合2026年SEO和可访问性标准
 */

/* 分页容器 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin: 2rem 0;
    padding: 0;
    list-style: none;
}

/* 分页项 */
.page-item {
    margin: 0;
}

/* 分页链接 */
.page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: #3a3a3a;
    background-color: #fff;
    border: 1px solid #dee2e6;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0.25rem;
}

.page-link:hover {
    z-index: 2;
    color: #fff;
    background-color: #e7062b;
    border-color: #e7062b;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(231, 6, 43, 0.3);
}

.page-link:focus {
    z-index: 3;
    outline: 2px solid #e7062b;
    outline-offset: 2px;
    box-shadow: 0 0 0 0.2rem rgba(231, 6, 43, 0.25);
}

/* 当前页 */
.page-item.active .page-link {
    z-index: 1;
    color: #fff;
    background-color: #e7062b;
    border-color: #e7062b;
    font-weight: 600;
    cursor: default;
}

.page-item.active .page-link:hover {
    transform: none;
}

/* 禁用状态 */
.page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    cursor: not-allowed;
    background-color: #fff;
    border-color: #dee2e6;
    opacity: 0.5;
}

/* 上一页/下一页图标 */
.page-link i {
    font-size: 1rem;
    vertical-align: middle;
}

/* 屏幕阅读器专用文本 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 响应式设计 */
@media (max-width: 576px) {
    .pagination {
        gap: 0.125rem;
    }
    
    .page-link {
        padding: 0.375rem 0.5rem;
        font-size: 0.875rem;
    }
    
    /* 在小屏幕上隐藏部分页码 */
    .page-item:not(.active):not(:first-child):not(:last-child):not(:nth-child(2)):not(:nth-last-child(2)) {
        display: none;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .page-link {
        color: #e9ecef;
        background-color: #212529;
        border-color: #495057;
    }
    
    .page-link:hover {
        color: #fff;
        background-color: #e7062b;
        border-color: #e7062b;
    }
    
    .page-item.disabled .page-link {
        color: #6c757d;
        background-color: #212529;
        border-color: #495057;
    }
}

/* 打印样式 */
@media print {
    .pagination {
        display: none;
    }
}

/* 动画效果 */
@keyframes pageLoad {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pagination {
    animation: pageLoad 0.3s ease-out;
}

/* 省略号样式 */
.page-link[aria-label="…"] {
    pointer-events: none;
    cursor: default;
}

.page-link[aria-label="…"]:hover {
    background-color: #fff;
    border-color: #dee2e6;
    color: #3a3a3a;
    transform: none;
    box-shadow: none;
}
