/* ============================================================
   新闻模块样式 - news.css
   设计：深色卡片风格，与Hero Section视觉衔接
   ============================================================ */

/* ============================================================
   首页最新动态网格 (取代旧版 Ticker)
   ============================================================ */
.news-preview-grid-section {
    background: linear-gradient(180deg, var(--neutral-900) 0%, var(--neutral-950) 100%);
    padding: 60px 24px;
    position: relative;
}

.news-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.news-preview-header {
    max-width: 1200px;
    margin: 0 auto 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.news-preview-header h2 {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: white;
    font-weight: 700;
}

.news-preview-more {
    color: var(--brand-accent);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap var(--transition-fast);
}

.news-preview-more:hover {
    gap: 10px;
}

/* ============================================================
   通用新闻卡片 (垂直布局架构)
   ============================================================ */
.news-card {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.news-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.news-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
    background: rgba(0,0,0,0.2);
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

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

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

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
}

.news-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-summary {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.news-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition-fast);
}

.news-card:hover .news-tag {
    background: rgba(0, 201, 167, 0.12);
    color: var(--brand-accent);
    border-color: rgba(0, 201, 167, 0.2);
}

/* ============================================================
   独立新闻中心页面 (#news)
   ============================================================ */
.news-center-page {
    min-height: 100vh;
    background: var(--neutral-900);
    padding: 100px 24px 60px;
}

.news-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
}

.news-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: white;
    font-weight: 700;
    margin-bottom: 16px;
}

.news-header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.6);
}

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

.news-category-tab {
    padding: 8px 20px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.news-category-tab:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.news-category-tab.active {
    color: var(--bg-dark);
    background: var(--brand-accent);
    border-color: var(--brand-accent);
}

/* 新闻列表大网格 (新闻中心用) */
.news-list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 32px;
    max-width: 1200px;
    margin: 0 auto;
}

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

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.page-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.page-btn.active {
    background: var(--brand-accent);
    color: var(--bg-dark);
    border-color: var(--brand-accent);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 响应式 */
@media (max-width: 768px) {
    .news-preview-grid, .news-list-grid {
        grid-template-columns: 1fr;
    }
    .news-preview-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* ============================================================
   新闻详情页样式
   ============================================================ */

.news-detail-page {
    min-height: 100vh;
    background: var(--neutral-100);
}

.news-detail-header {
    background: linear-gradient(135deg, var(--neutral-950) 0%, var(--neutral-900) 100%);
    padding: 120px 24px 60px;
    text-align: center;
}

.news-detail-header .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin-bottom: 24px;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.news-detail-header .back-link:hover {
    color: white;
    text-decoration: none;
}

.news-detail-header h1 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

.news-detail-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.news-detail-body {
    max-width: 800px;
    margin: -30px auto 0;
    padding: 48px 40px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-elevated);
    position: relative;
    z-index: 1;
}

.news-detail-body p {
    margin-bottom: 20px;
    line-height: 1.8;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.news-detail-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

.news-detail-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 32px 0;
}

.news-detail-images img {
    width: 100%;
    height: 195px;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-thin);
}

.news-detail-images.single {
    grid-template-columns: 1fr;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.news-detail-footer {
    text-align: center;
    padding: 40px 24px 60px;
}

@media (max-width: 768px) {
    /* 详情页正文 */
    .news-detail-body {
        margin: -20px 16px 0;
        padding: 32px 20px;
    }
    .news-detail-body p {
        font-size: 0.95rem;
    }
    
    /* 详情页图片单列 */
    .news-detail-images {
        grid-template-columns: 1fr;
    }

    /* 详情页 header 间距缩小 */
    .news-detail-header {
        padding: 80px 16px 40px;
    }
    .news-detail-header h1 {
        font-size: 1.3rem;
    }

    /* meta 信息换行 */
    .news-detail-meta {
        gap: 8px 16px;
    }
    
    /* 标签列表换行 */
    .news-detail-meta .news-tag {
        font-size: 0.68rem;
    }

    /* Lightbox 移动端全宽 */
    .news-lightbox {
        padding: 16px;
    }
    .news-lightbox img {
        max-width: 96vw;
        max-height: 80vh;
        border-radius: 4px;
    }
    .news-lightbox-close {
        top: 12px;
        right: 12px;
    }
}

/* 详情页图片可点击提示 */
.news-detail-images img {
    cursor: zoom-in;
    transition: opacity var(--transition-fast);
}

.news-detail-images img:hover {
    opacity: 0.88;
}

/* Lightbox 图片放大覆盖层 */
.news-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.25s ease;
    padding: 32px;
}

.news-lightbox.active {
    opacity: 1;
}

.news-lightbox img {
    max-width: 90vw;
    max-height: 88vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
    transform: scale(0.92);
    transition: transform 0.3s ease;
}

.news-lightbox.active img {
    transform: scale(1);
}

.news-lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    transition: color var(--transition-fast);
}

.news-lightbox-close:hover {
    color: white;
}

.news-lightbox-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
}
