/* ==========================================================
   LIST.CSS - 列表页专属样式 (调整为严格 4 列布局和卡片尺寸)
   ========================================================== */

/* 列表头部 */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
}

.filter-sort select, .filter-sort button {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-left: 10px;
    background-color: var(--card-bg);
    cursor: pointer;
    font-size: 15px;
    color: var(--secondary-color);
}

/* 列表网格 - 核心修改：固定 4 列，并固定高度 */
.grid-view {
    display: grid;
    /* 采用 4 列等宽布局，保证在 PC 宽度下，卡片严格为 4 列 */
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* 壁纸卡片 */
.item-card {
    background-color: var(--card-bg);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s, transform 0.3s;
}

.item-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    transform: translateY(-3px);
}

.card-link {
    display: block;
    position: relative;
    /* PC 模式下卡片高度严格设置为 230px */
    height: 230px;
    overflow: hidden;
}

.item-card img {
    width: 100%;
    height: 100%;
    /* 确保图片填充卡片，保持宽高比并居中截取 */
    object-fit: cover;
    transition: transform 0.5s;
}

.item-card:hover img {
    transform: scale(1.05);
}

/* 4K 标记 */
.quality-tag {
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--primary-color);
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 6px 0 6px 0;
    z-index: 10;
    pointer-events: none;
}

/* 信息覆盖层 - 默认隐藏/透明 */
.info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0;
    padding: 0 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0));
    color: white;
    opacity: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: opacity 0.3s ease, height 0.3s ease;
    z-index: 5;
    pointer-events: none;
}

/* 鼠标悬停时显示 */
.card-link:hover .info-overlay {
    height: 40px;
    opacity: 1;
    padding: 0 10px 10px 10px;
}

.overlay-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}
.overlay-res {
    font-size: 12px;
    color: #cccccc;
}

/* 分页 */
.pagination-section {
    margin: 40px 0;
    text-align: center;
}
.pagination {
    display: inline-flex;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.pagination .page-link {
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    margin-left: -1px;
    transition: background-color 0.3s;
    background-color: var(--card-bg);
}
.pagination .current {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: bold;
    z-index: 1;
}

/* 列表页响应式 (Mobile) */
@media (max-width: 768px) {
    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    .filter-sort {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }
    .filter-sort select, .filter-sort button {
        flex-grow: 1;
        margin-left: 0;
    }

    /* 手机屏幕下，强制 2 列 */
    .grid-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .card-link {
        /* 手机模式下卡片高度严格设置为 170px */
        height: 170px;
    }

    /* 调整移动端覆盖层字体大小 */
    .overlay-title {
        font-size: 12px;
    }
    .overlay-res {
        font-size: 10px;
    }
}