/* ==========================================================================
   新闻中心页面样式
   依赖 style.css 中定义的全局 CSS 变量（--primary-color 等）
   ========================================================================== */

.news-hero {
    padding: 160px 22px 80px;
    background: #f1f4f5;
    text-align: center;
}

.news-hero h1 {
    font-size: 56px;
    font-weight: 600;
    margin-bottom: 16px;
}

.news-hero p {
    font-size: 24px;
    color: var(--text-secondary);
}

.news-section {
    padding: 80px 22px;
    background: #ffffff;
}

/* 分类标签 */
.news-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 48px;
}

.news-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 28px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #675b55;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.25s ease, background 0.25s ease;
}

.news-tab:hover {
    color: #1c65b1;
}

.news-tab.active {
    background: #1c65b1;
    color: #fff;
}

/* 加载 / 状态提示 */
.news-state {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    padding: 60px 0;
}

/* 内容区：加载时整体淡出，保留高度避免闪动 */
.news-content-wrap {
    transition: opacity 0.25s ease;
}

.news-content-wrap.is-loading {
    opacity: 0.45;
    pointer-events: none;
}

/* 头条卡片网格 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

.news-grid:empty {
    margin-bottom: 0;
}

.news-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.news-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 24px;
}

/* 日期置于卡片左上角 */
.news-date {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.news-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 图片位于标题下方 */
.news-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 16px 0;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #0071e3 0%, #00c7be 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-cover-emoji {
    font-size: 60px;
}

.news-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 资讯列表 */
.news-list {
    display: flex;
    flex-direction: column;
}

.news-list-link {
    color: inherit;
    text-decoration: none;
}

.news-list-item {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 28px 0;
    border-bottom: 1px dashed #675b55;
}

.news-list-main {
    flex: 1;
    min-width: 0;
}

.news-list-title {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-list-item:hover .news-list-title {
    color: var(--primary-color);
}

.news-list-excerpt {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-list-thumb {
    flex-shrink: 0;
    width: 220px;
    aspect-ratio: 16 / 9;
    height: auto;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: linear-gradient(135deg, #0071e3 0%, #00c7be 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-list-thumb .news-cover-emoji {
    font-size: 40px;
}

/* 分页 */
.news-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 50px;
}

.news-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.news-page-btn:hover:not(.is-disabled):not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.news-page-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    cursor: default;
}

.news-page-btn.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.news-page-ellipsis {
    color: var(--text-secondary);
    padding: 0 4px;
}

/* 响应式 */
@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-tabs {
        gap: 8px;
        margin-bottom: 32px;
    }

    .news-tab {
        padding: 8px 18px;
        font-size: 14px;
    }

    .news-list-item {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 16px;
    }

    .news-list-thumb {
        width: 100%;
        aspect-ratio: 16 / 9;
        height: auto;
    }

    .news-list-title {
        -webkit-line-clamp: 2;
    }

}
