/* ============================================================
   新闻文章板块（首页板块 + /news 列表页 + 文章详情页）
   数据来自共码社区官方账号，视觉与官网产品卡片风格保持一致
   ============================================================ */

/* 页面标题（与 about/software/join-contact 内页保持一致，透明导航栏浮于头图之上） */
.page-header {
    background: linear-gradient(180deg, rgba(8, 14, 32, 0.25), rgba(8, 14, 32, 0.45)), url('/assets/Other/news-header.jpg') center center / cover no-repeat;
    color: var(--white);
    padding: 120px 0 80px;
    text-align: center;
    margin-top: 0;
}

/* 强制白色标题：覆盖全局 body :not(.navbar) 黑字规则 */
.page-header .container h1,
.page-header .container p {
    color: #ffffff !important;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.page-header h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
}

.page-header p {
    font-size: 18px;
    opacity: 0.9;
    letter-spacing: 3px;
}

/* ---------- 通用：分类标签 / 元信息 ---------- */
.news-cat {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    color: #0066cc;
    background: rgba(0, 102, 204, 0.1);
    border-radius: 20px;
    white-space: nowrap;
}

.news-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.news-card-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #999;
}

.news-loading,
.news-empty,
.news-detail-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 15px;
}

.news-loading i { font-size: 28px; color: #0066cc; }

/* ---------- 首页：新闻动态板块 ---------- */
.home-news {
    padding: 90px 0;
    background: #f7f9fc;
    position: relative;
}

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

.home-news-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 40px;
}

.home-news-head .section-divider {
    font-size: 13px;
    letter-spacing: 3px;
    color: #0066cc;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 8px;
}

.home-news-head h2 {
    font-size: 32px;
    margin: 0 0 8px;
    color: #111;
}

.home-news-head p {
    margin: 0;
    color: #777;
    font-size: 15px;
}

.home-news-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0066cc;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 10px 20px;
    border: 1px solid rgba(0, 102, 204, 0.3);
    border-radius: 30px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.home-news-all:hover {
    background: #0066cc;
    border-color: #0066cc;
    color: #fff;
}

/* ---------- 首页：1 篇大图 + 3 篇小图（共 4 篇） ---------- */
.home-news-feature {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
}

/* 大图头条卡 */
.news-feature-card {
    position: relative;
    display: block;
    border-radius: 14px;
    overflow: hidden;
    min-height: 420px;
    background: #0d2240;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
    text-decoration: none;
}

.news-feature-cover {
    position: absolute;
    inset: 0;
}

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

.news-feature-card:hover .news-feature-cover img {
    transform: scale(1.04);
}

.news-feature-nocover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: rgba(255, 255, 255, 0.35);
    background: linear-gradient(135deg, #0a1f3d 0%, #123a6b 100%);
}

.news-feature-mask {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(10, 20, 40, 0) 38%, rgba(10, 20, 40, 0.82) 100%);
    transition: background 0.3s ease;
}

.news-feature-card:hover .news-feature-mask {
    background: linear-gradient(180deg, rgba(10, 20, 40, 0.1) 30%, rgba(10, 20, 40, 0.88) 100%);
}

.news-feature-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 28px 30px 30px;
    color: #fff;
}

.news-feature-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.news-feature-meta .news-card-date {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}

.news-cat-on-cover,
.news-cat-oncover {
    color: #0066cc;
    background: rgba(255, 255, 255, 0.95);
}

.news-feature-title {
    font-size: 24px;
    line-height: 1.45;
    font-weight: 700;
    margin: 0 0 10px;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.news-feature-excerpt {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.88);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 右侧两篇小图卡 */
.home-news-side {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

.news-compact-card {
    flex: 1;
    display: flex;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 124px;
}

.news-compact-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.news-compact-cover {
    position: relative;
    flex: 0 0 50%;
    overflow: hidden;
    background: #e9eef5;
}

.news-compact-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
}

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

.news-compact-nocover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8c4d4;
    font-size: 30px;
}

.news-compact-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 10px 14px;
}

.news-compact-body .news-card-date {
    font-size: 11px;
}

.news-compact-body .news-card-more {
    margin-top: auto;
    font-size: 12px;
}

.news-compact-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    color: #1a1a1a;
    margin: 5px 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 新闻卡片（首页 + 列表页共用） ---------- */
.news-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
}

.news-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e9eef5;
}

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

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

.news-card-no-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b8c4d4;
    font-size: 38px;
}

.news-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px 20px;
}

.news-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    margin: 0 0 8px;
    color: #1a1a1a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-excerpt {
    font-size: 13px;
    line-height: 1.7;
    color: #888;
    margin: 0 0 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-more {
    font-size: 13px;
    color: #0066cc;
    font-weight: 500;
}

.news-card-more i {
    transition: transform 0.3s ease;
}

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

/* ---------- /news 列表页 ---------- */
.news-page-section {
    padding: 40px 0 90px;
    min-height: 60vh;
}

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

.news-page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}

.news-page-toolbar #news-count {
    color: #999;
    font-size: 14px;
}

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

/* ---------- /news?id= 文章详情页 ---------- */
#news-detail { display: none; }

.news-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0066cc;
    text-decoration: none;
    font-size: 14px;
    margin: 24px 0 8px;
}

.news-article {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    padding: 48px 56px;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.07);
}

.news-article-header {
    border-bottom: 1px solid #eef1f5;
    padding-bottom: 24px;
    margin-bottom: 28px;
}

.news-article-header h1 {
    font-size: 30px;
    line-height: 1.4;
    color: #111;
    margin: 12px 0 16px;
}

.news-article-author {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #555;
    font-size: 14px;
}

.news-article-author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: #e9eef5;
}

.official-tag {
    display: inline-block;
    padding: 1px 8px;
    font-size: 11px;
    color: #fff;
    background: linear-gradient(135deg, #fa5151 0%, #e64340 100%);
    border-radius: 9px;
}

.news-article-cover {
    margin-bottom: 28px;
    border-radius: 12px;
    overflow: hidden;
}

.news-article-cover img {
    width: 100%;
    display: block;
}

.news-article-content {
    font-size: 16px;
    line-height: 1.9;
    color: #2b2b2b;
    word-break: break-word;
}

.news-article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

.news-article-content a {
    color: #0066cc;
}

.news-article-content p { margin: 0 0 14px; }

.news-article-footer {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid #eef1f5;
    text-align: center;
}

.news-source-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #0066cc;
    color: #fff;
    border-radius: 30px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s ease;
}

.news-source-link:hover { background: #004d99; }

.news-detail-error {
    text-align: center;
    padding: 100px 20px;
    color: #777;
}

.news-detail-error p { font-size: 16px; margin-bottom: 20px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
    .home-news-feature { grid-template-columns: 1fr; }
    .news-feature-card { min-height: 360px; }
    .home-news-side { flex-direction: row; }
    .news-compact-card { flex: 1; min-height: 0; }
    .news-page-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .page-header h1 { font-size: 36px; }
    .home-news { padding: 60px 0; }
    .home-news-head h2 { font-size: 26px; }
    .news-feature-card { min-height: 300px; }
    .news-feature-body { padding: 20px 20px 22px; }
    .news-feature-title { font-size: 19px; }
    .home-news-side { flex-direction: column; }
    .news-page-grid { grid-template-columns: 1fr; }
    .news-article {
        padding: 32px 22px;
        border-radius: 12px;
    }
    .news-article-header h1 { font-size: 23px; }
    .news-page-toolbar { flex-direction: column; align-items: flex-start; gap: 8px; }
}
