/* ===========================================================
   四川冠碟官网 - 新闻动态板块
   沿用 style.css 的主题变量：深蓝 #014fa2 / 橙色 #f08300
   =========================================================== */

/* ---------- 列表页工具条 ---------- */
.news-section { background: var(--white); }
.news-section.home-news { background: var(--bg); border-top: 1px solid var(--gray-200); }

.news-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--gray-200);
}
.news-count { color: var(--gray-600); font-size: 14px; }
.news-count b { color: var(--primary); font-size: 20px; font-family: var(--font-num); margin: 0 4px; }
.news-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.news-filter {
    padding: 7px 18px;
    border: 1px solid var(--gray-200);
    border-radius: 20px;
    background: #fff;
    color: var(--gray-700);
    font-size: 13px;
    line-height: 1.4;
    transition: all var(--trs);
}
.news-filter:hover { border-color: var(--primary); color: var(--primary); }
.news-filter.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(1, 79, 162, .22);
}
.news-empty { text-align: center; color: var(--gray-500); padding: 48px 0; font-size: 14px; }

/* ---------- 新闻卡片（通用） ---------- */
.news-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform var(--trs), box-shadow var(--trs), border-color var(--trs);
}
.news-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    color: inherit;
}
.news-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--gray-100);
}
.news-card-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s cubic-bezier(.4, 0, .2, 1);
}
.news-card:hover .news-card-cover img { transform: scale(1.06); }
.news-noimg {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(120deg, var(--primary-dark), var(--primary-light));
    color: rgba(255, 255, 255, .9);
    font-size: 15px; letter-spacing: 2px;
}
.news-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 5px 12px;
    border-radius: 3px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .16);
}
.news-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.news-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-500);
    font-size: 12.5px;
    margin-bottom: 10px;
}
.news-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.news-year {
    margin-left: auto;
    font-family: var(--font-num);
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-50);
    border-radius: 3px;
    padding: 1px 8px;
}
.news-card-title {
    font-size: 17px;
    line-height: 1.55;
    color: var(--gray-900);
    font-weight: 600;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--trs);
}
.news-card:hover .news-card-title { color: var(--primary); }
.news-card-excerpt {
    color: var(--gray-600);
    font-size: 13px;
    line-height: 1.8;
    margin: 0 0 18px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-more {
    margin-top: auto;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.news-more em { font-style: normal; transition: transform var(--trs); }
.news-card:hover .news-more em { transform: translateX(4px); }

/* ---------- 置顶大卡片（最新一条） ---------- */
.news-feature-wrap { margin-bottom: 28px; }
.news-feature .news-card { flex-direction: row; }
.news-feature .news-card-cover { flex: 0 0 46%; width: 46%; aspect-ratio: auto; min-height: 290px; }
.news-feature .news-card-body { padding: 32px 36px; justify-content: center; }
.news-feature .news-card-title { font-size: 25px; line-height: 1.5; -webkit-line-clamp: 3; line-clamp: 3; }
.news-feature .news-card-excerpt { font-size: 14px; -webkit-line-clamp: 3; line-clamp: 3; margin-bottom: 26px; }
.news-feature .news-badge { top: 18px; left: 18px; font-size: 13px; padding: 6px 14px; }

/* ---------- 卡片网格 ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.news-item[hidden], .news-feature-wrap[hidden] { display: none !important; }
.home-news-more { text-align: center; margin-top: 34px; }

/* ---------- 详情页 ---------- */
.news-detail-section { background: var(--bg); }
.news-article {
    max-width: 960px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.news-article-head { padding: 38px 48px 26px; border-bottom: 1px solid var(--gray-200); }
.news-article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    color: var(--gray-500);
    font-size: 12.5px;
    margin-bottom: 18px;
}
.news-tag {
    color: var(--primary);
    background: var(--primary-50);
    border: 1px solid var(--primary-100);
    border-radius: 3px;
    padding: 3px 12px;
    font-weight: 600;
}
.news-article-head h1 {
    font-size: 29px;
    line-height: 1.55;
    color: var(--gray-900);
    font-weight: 700;
    margin: 0 0 20px;
}
.news-article-rule { width: 58px; height: 4px; border-radius: 2px; background: var(--accent); }

.news-content {
    padding: 34px 48px 44px;
    font-size: 15.5px;
    line-height: 2.05;
    color: var(--gray-700);
    overflow-wrap: break-word;
}
.news-content .news-p { margin: 0 0 18px; }
.news-content .news-p strong { color: var(--primary-dark); font-weight: 700; }
.news-content .news-p--lead { color: var(--primary-dark); }
.news-content .news-caption {
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
    line-height: 1.7;
    margin: -6px 0 26px;
}
.news-content .news-sign {
    text-align: right;
    color: var(--gray-600);
    font-size: 14px;
    margin-top: 30px;
}
.news-content a { color: var(--primary); text-decoration: underline; }

.news-figure { margin: 26px 0 28px; }
.news-figure-grid { display: grid; gap: 12px; }
.news-figure[data-cols="1"] .news-figure-grid { grid-template-columns: 1fr; }
.news-figure[data-cols="2"] .news-figure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.news-figure[data-cols="3"] .news-figure-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* 指定稿件：上 2 张一行、下 3 张一行。用 6 列网格（2 与 3 的最小公倍数），
   前两张各占 3 列、后三张各占 2 列，同行自然等宽。 */
.news-figure--grid-23 .news-figure-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}
.news-figure--grid-23 .news-figure-grid > :nth-child(-n+2) { grid-column: span 3; }
.news-figure--grid-23 .news-figure-grid > :nth-child(n+3) { grid-column: span 2; }
/* 同行等高：统一 4:3 画框，图片等比居中、不裁切不变形；
   height:100% 让同行画框拉伸到同一行高，消除小数舍入造成的 1px 高差 */
.news-figure--grid-23 .news-zoom {
    aspect-ratio: 4 / 3;
    height: 100%;
    background: transparent;
}
.news-figure--grid-23 .news-zoom img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    box-shadow: none;
}
/* 比例接近方形的图填满 4:3 画框：与同排等比例等大小，6px 圆角贴在图片内容上 */
.news-figure--grid-23 .news-zoom--cover img {
    object-fit: cover;
    object-position: center center;
}
/* 每组 7 张：第一行 3 张、第二行 4 张。12 列网格（3 与 4 的最小公倍数），
   前 3 张各占 4 列、后 4 张各占 3 列；统一 4:3 画框保证同行等比例等大小 + 6px 圆角。 */
.news-figure--grid-34 .news-figure-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
}
.news-figure--grid-34 .news-figure-grid > :nth-child(-n+3) { grid-column: span 4; }
.news-figure--grid-34 .news-figure-grid > :nth-child(n+4) { grid-column: span 3; }
.news-figure--grid-34 .news-zoom {
    aspect-ratio: 4 / 3;
    height: 100%;
    background: transparent;
}
.news-figure--grid-34 .news-zoom img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    box-shadow: none;
}
/* 指定稿件：3 张图排成一行。统一 4:3 画框 + cover 等比填满，
   三张尺寸完全一致，6px 圆角贴在图片内容上；灯箱仍展示未裁切的原图。 */
.news-figure--grid-3 .news-figure-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}
.news-figure--grid-3 .news-zoom {
    aspect-ratio: 4 / 3;
    height: 100%;
    border-radius: 6px;
    background: transparent;
}
.news-figure--grid-3 .news-zoom img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    border-radius: 6px;
    box-shadow: none;
}
/* 同一行等比缩放：横竖混排时用等高画框居中，消除高度差造成的空白 */
.news-figure--row .news-figure-grid { align-items: center; }
.news-figure--align .news-zoom {
    height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}
.news-figure--align .news-zoom img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    box-shadow: none;
}
.news-zoom {
    display: block;
    cursor: zoom-in;
    border-radius: 6px;
    overflow: hidden;
    background: var(--gray-100);
}
.news-zoom img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
}
.news-figure figcaption {
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
    line-height: 1.7;
    margin-top: 12px;
}
.news-figure figcaption strong { color: var(--gray-700); }
/* 单图说明：与整组图注同字号、同颜色，置于各自图片正下方 */
.news-cell { min-width: 0; }
.news-cell-caption {
    display: block;
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
    line-height: 1.7;
    margin-top: 10px;
}

/* ---------- 2023-06-15 专属：原尺寸小横幅 + 竖图并排 ---------- */
/* 首图仅 139×78（Word 中居中），按原始像素显示，禁止被 width:100% 拉伸放大 */
.news-figure--native .news-figure-grid { justify-items: center; }
.news-figure--native .news-zoom {
    display: inline-block;
    background: transparent;
}
.news-figure--native .news-zoom img {
    width: auto;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}
/* 两图一行 / 三图一行：源图均为 1051×1400（约 3:4），等比缩小后自然等大；
   align-items:start 防止 <a> 被 grid 拉伸露出背景灰条 */
.news-figure--pair .news-figure-grid,
.news-figure--portrait-row .news-figure-grid { align-items: start; }
.news-cell--titled .news-caption {
    margin: 0 0 12px;
    text-align: center;
    line-height: 1.6;
}

.news-article-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 48px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
    color: var(--gray-500);
    font-size: 13px;
}
.news-article-foot a { color: var(--primary); font-weight: 600; }
.news-article-foot a:hover { color: var(--accent); }

.news-pager {
    max-width: 960px;
    margin: 24px auto 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 14px;
    align-items: stretch;
}
.news-pager-link,
.news-pager-home {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 14px 20px;
    color: var(--gray-700);
    font-size: 13px;
    transition: all var(--trs);
}
.news-pager-link span { color: var(--primary); font-size: 12px; font-weight: 600; }
.news-pager-link b {
    font-weight: 500;
    color: var(--gray-800);
    font-size: 13px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.news-pager-link:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.news-pager-next { text-align: right; }
.news-pager-link.is-disabled { opacity: .5; }
.news-pager-link.is-disabled span { color: var(--gray-500); }
.news-pager-home { justify-content: center; text-align: center; color: var(--primary); font-weight: 600; white-space: nowrap; }
.news-pager-home:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 图片灯箱 ---------- */
.news-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(10, 20, 35, .9);
    animation: newsFade .2s ease both;
    cursor: zoom-out;
}
.news-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.news-lightbox .news-lightbox-close {
    position: absolute;
    top: 20px;
    right: 26px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 24px;
    line-height: 40px;
    text-align: center;
}
@keyframes newsFade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
    .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .news-grid--home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .news-feature .news-card-cover { flex-basis: 44%; width: 44%; min-height: 250px; }
    .news-feature .news-card-body { padding: 24px; }
    .news-feature .news-card-title { font-size: 21px; }
    .news-article-head { padding: 30px 32px 22px; }
    .news-content { padding: 28px 32px 34px; }
    .news-article-foot { padding: 18px 32px; }
}
@media (max-width: 880px) {
    .news-pager { grid-template-columns: 1fr; }
    .news-pager-next, .news-pager-link.is-disabled { text-align: left; }
    .news-pager-home { order: 3; }
    .news-article-head h1 { font-size: 24px; }
}
@media (max-width: 640px) {
    .news-toolbar { flex-direction: column; align-items: flex-start; }
    .news-grid, .news-grid--home { grid-template-columns: 1fr; gap: 18px; }
    .news-feature .news-card { flex-direction: column; }
    .news-feature .news-card-cover { flex-basis: auto; width: 100%; min-height: 0; aspect-ratio: 16 / 10; }
    .news-feature .news-card-body { padding: 20px; }
    .news-feature .news-card-title { font-size: 19px; }
    .news-article-head { padding: 24px 20px 18px; }
    .news-article-head h1 { font-size: 21px; }
    .news-content { padding: 22px 20px 28px; font-size: 15px; line-height: 1.95; }
    .news-article-foot { padding: 16px 20px; }
    .news-figure[data-cols="2"] .news-figure-grid,
    .news-figure[data-cols="3"] .news-figure-grid { grid-template-columns: 1fr; }
    .news-figure--grid-23 .news-figure-grid { grid-template-columns: 1fr; }
    .news-figure--grid-23 .news-figure-grid > :nth-child(n) { grid-column: auto; }
    .news-figure--grid-3 .news-figure-grid { grid-template-columns: 1fr; }
    .news-figure--grid-34 .news-figure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .news-figure--grid-34 .news-figure-grid > :nth-child(n) { grid-column: auto; }
    .news-figure--align .news-zoom { height: 240px; }
    .news-figure { margin: 20px 0 22px; }
    .news-pager-link b { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
    .news-card, .news-card-cover img, .news-more em, .news-pager-link { transition: none !important; }
    .news-card:hover { transform: none; }
    .news-card:hover .news-card-cover img { transform: none; }
    .news-lightbox { animation: none; }
}
