﻿/* 全局重置 & 基础 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: #f5f7fa;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.news-container {
    max-width: 1200px;
    width: 100%;
    background: transparent;
}

/* 头部 */
.page-header {
    margin-bottom: 28px;
    border-bottom: 2px solid #e0e7ef;
    padding-bottom: 14px;
}

    .page-header h1 {
        font-size: 1.9rem;
        font-weight: 600;
        color: #1e293b;
        letter-spacing: 0.5px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

        .page-header h1 small {
            font-size: 0.9rem;
            font-weight: 400;
            color: #64748b;
            margin-left: auto;
        }

/* 新闻列表 - 网格 */
.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

/* 新闻卡片 */
.news-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04), 0 2px 6px rgba(0, 0, 0, 0.02);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #edf2f7;
}

    .news-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 16px 32px rgba(0, 0, 0, 0.07);
    }

/* 图片区域 */
.news-image {
    width: 100%;
    height: 200px;
    background-color: #e9edf3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

    .news-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.3s ease;
    }

.news-card:hover .news-image img {
    transform: scale(1.02);
}

/* 文字内容 */
.news-content {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.news-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    color: #0b1a33;
    text-decoration: none;
    transition: color 0.15s;
    /* 两行省略，保持整洁 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

    .news-title a {
        color: inherit;
        text-decoration: none;
    }

        .news-title a:hover {
            color: #2563eb;
        }

.news-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
    margin-top: 4px;
    color: #64748b;
    font-size: 0.9rem;
    border-top: 1px solid #f0f4fa;
    padding-top: 14px;
}

.news-date {
    display: flex;
    align-items: center;
    gap: 6px;
}

    .news-date::before {
        content: "📅";
        font-size: 0.9rem;
        opacity: 0.7;
    }

.news-source {
    background: #f1f5f9;
    padding: 2px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #334155;
    letter-spacing: 0.3px;
}

/* 响应式 平板 & 桌面 */
@media (min-width: 600px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 28px;
    }

    .news-image {
        height: 180px;
    }
}

@media (min-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 30px;
    }

    .news-image {
        height: 200px;
    }

    .page-header h1 {
        font-size: 2.2rem;
    }

    .news-content {
        padding: 20px 22px 22px;
    }

    .news-title {
        font-size: 1.3rem;
    }
}

/* 针对小屏手机优化 */
@media (max-width: 420px) {
    .news-image {
        height: 160px;
    }

    .news-title {
        font-size: 1.05rem;
    }

    .news-content {
        padding: 14px 16px 16px;
    }

    .page-header h1 {
        font-size: 1.5rem;
    }
}

/* 辅助布局 */
.footer-note {
    margin-top: 40px;
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
    width: 100%;
}

/* 图片加载占位效果 (懒加载友好) */
.news-image img:not([src]) {
    opacity: 0;
}

.news-image img {
    background: #dce2ec;
}
/* 分页控件 */
.pagination-wrapper {
    margin-top: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

    .pagination-wrapper a, .pagination-wrapper span {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        border-radius: 10px;
        background: white;
        border: 1px solid #e2e8f0;
        color: #1e293b;
        font-size: 0.95rem;
        text-decoration: none;
        transition: all 0.15s;
        font-weight: 500;
    }

        .pagination-wrapper a:hover {
            background: #f1f5f9;
            border-color: #b9c4d4;
        }

    .pagination-wrapper .current {
        background: #2563eb;
        border-color: #2563eb;
        color: white;
        pointer-events: none;
    }

    .pagination-wrapper .disabled {
        opacity: 0.5;
        pointer-events: none;
        background: #f8fafc;
    }

    .pagination-wrapper .ellipsis {
        border: none;
        background: transparent;
        pointer-events: none;
    }

.pagination-info {
    text-align: center;
    margin-top: 14px;
    color: #64748b;
    font-size: 0.9rem;
}