/**
 * 新闻动态 - 列表页样式
 */

/* 页面横幅 - 与其他页面保持一致 */
.news-hero {
    width: 100%;
    padding: 120px 0 80px;
    background-size: 100% auto;
    background-position: center top;
    background-repeat: no-repeat;
    position: relative;
    text-align: center;
    overflow: hidden;
    height: 400px;
}

.news-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 95, 180, 0.5);
    z-index: 1;
}

.news-hero-content {
    position: relative;
    z-index: 2;
}

.news-hero-title {
    font-size: 48px;
    font-weight: 700;
    color: white;
    margin-bottom: 20px;
    line-height: 1.2;
}

.news-hero-subtitle {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.9);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

/* 分类筛选 */
.news-filter-section {
    background: #fff;
    border-bottom: 1px solid #e8ecf1;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.news-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.news-filter-bar {
    display: flex;
    gap: 6px;
    padding: 16px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.news-filter-bar::-webkit-scrollbar {
    display: none;
}

.news-filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 22px;
    border: 1px solid #dce3ed;
    border-radius: 20px;
    background: #fff;
    color: #4a5568;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.news-filter-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    background: rgba(26, 95, 180, 0.04);
}

.news-filter-btn.active {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

/* 新闻列表 */
.news-list-section {
    padding: 40px 0 60px;
    background: #f8fafc;
    min-height: 400px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* 新闻卡片 */
.news-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid #eef2f7;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(26, 95, 180, 0.12);
    border-color: rgba(26, 95, 180, 0.15);
}

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

/* 卡片图片 */
.news-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #edf2f7;
}

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

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

.news-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
}

.news-card-placeholder i {
    font-size: 3rem;
    color: #a0aec0;
}

/* 分类标签 */
.news-card-category {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    z-index: 2;
    letter-spacing: 0.5px;
}

.news-card-category.company-news {
    background: rgba(26, 95, 180, 0.9);
}

.news-card-category.industry-news {
    background: rgba(38, 162, 105, 0.9);
}

.news-card-category.tech-sharing {
    background: rgba(165, 105, 189, 0.9);
}

.news-card-category.case-study {
    background: rgba(230, 126, 34, 0.9);
}

/* 卡片正文 */
.news-card-body {
    padding: 20px;
}

.news-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.news-card:hover .news-card-title {
    color: var(--primary-blue);
}

.news-card-excerpt {
    font-size: 0.88rem;
    color: #718096;
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid #f0f4f8;
}

.news-card-date {
    font-size: 0.8rem;
    color: #a0aec0;
}

.news-card-date i {
    margin-right: 4px;
}

.news-card-read-more {
    font-size: 0.82rem;
    color: var(--primary-blue);
    font-weight: 500;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-read-more {
    transform: translateX(3px);
}

.news-card-read-more i {
    margin-left: 4px;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-read-more i {
    transform: translateX(3px);
}

/* 空状态 */
.news-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: #a0aec0;
}

.news-empty i {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
}

.news-empty p {
    font-size: 1.1rem;
}

/* 分页 */
.news-pagination {
    margin-top: 40px;
    text-align: center;
}

.news-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    margin: 0 3px;
    border: 1px solid #dce3ed;
    border-radius: 6px;
    background: #fff;
    color: #4a5568;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.news-pagination .page-numbers:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.news-pagination .page-numbers.current {
    background: var(--primary-blue);
    color: #fff;
    border-color: var(--primary-blue);
}

.news-pagination .page-numbers.next,
.news-pagination .page-numbers.prev {
    font-size: 0.8rem;
}

/* 响应式 */
@media (max-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }
}

@media (max-width: 768px) {
    .news-hero {
        height: 200px;
        background-size: 100% auto;
    }

    .news-hero-title {
        font-size: 1.8rem;
    }

    .news-hero-subtitle {
        font-size: 0.95rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .news-card-image {
        height: 180px;
    }

    .news-filter-btn {
        padding: 6px 16px;
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .news-hero {
        height: 160px;
        background-size: 100% auto;
    }

    .news-hero-title {
        font-size: 1.5rem;
    }
}

/* ==========================================
   视图切换功能
========================================== */

/* 视图切换按钮 */
.news-view-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: flex-end;
}

.news-view-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #dce3ed;
    border-radius: 8px;
    background: #fff;
    color: #718096;
    cursor: pointer;
    transition: all 0.3s ease;
}

.news-view-btn:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.news-view-btn.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
}

.news-view-btn i {
    font-size: 1rem;
}

/* 列表视图 - 默认网格视图 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* 列表视图 */
.news-grid.list-view {
    grid-template-columns: 1fr;
    gap: 16px;
}

.news-grid.list-view .news-card {
    display: flex;
    flex-direction: row;
    border-radius: 12px;
    overflow: hidden;
}

.news-grid.list-view .news-card-link {
    display: flex;
    flex-direction: row;
    width: 100%;
}

.news-grid.list-view .news-card-image {
    width: 320px;
    height: 200px;
    flex-shrink: 0;
}

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

.news-grid.list-view .news-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px 28px;
}

.news-grid.list-view .news-card-title {
    font-size: 1.2rem;
    -webkit-line-clamp: 1;
    margin-bottom: 12px;
}

.news-grid.list-view .news-card-excerpt {
    -webkit-line-clamp: 2;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

.news-grid.list-view .news-card-meta {
    border-top: none;
    padding-top: 0;
}

/* 响应式 - 列表视图 */
@media (max-width: 768px) {
    .news-grid.list-view .news-card {
        flex-direction: column;
    }
    
    .news-grid.list-view .news-card-image {
        width: 100%;
        height: 200px;
    }
    
    .news-grid.list-view .news-card-body {
        padding: 20px;
    }
    
    .news-view-toggle {
        justify-content: center;
    }
}
