/**
 * news-front.css - AI教程资源列表页
 * ------------------------------------------------------------------
 * 设计取向（与 ai-apps.css 同一套色板，两页风格统一）：
 *   底色白 → 区块 #f5f8fd 圆角 → 卡片白，靠「三层底色」分区，不靠描边堆叠
 *   主色 #4a6cf7，标题 #131b2b，辅助文字 #8792a6，分隔线 #eaeff7
 * ------------------------------------------------------------------
 * 结构与旧版差异：
 *   1. 新增 .news-hero（H1 + 统计），H1 从轮播下面提到页面顶部
 *   2. 新增 .news-feature（左轮播 + 右编辑推荐），取代原先「顶部 3 张大卡」
 *   3. 分类从 .news-category-tab 换成 .news-cat-chip（带文章数）
 *   4. 分页不再复用 page.css 的 .pagination（那套带 !important），改用 .news-pager
 *   5. 侧栏「随机文章」删除，换成「热门教程」+「全部分类」
 * ------------------------------------------------------------------
 */

.news-page {
    --nf-ink: #131b2b;
    --nf-ink2: #48536a;
    --nf-mute: #8792a6;
    --nf-line: #eaeff7;
    --nf-soft: #f5f8fd;
    --nf-blue: #4a6cf7;
    padding-bottom: 8px;
}

/* ============================================================
   1. Hero
   ============================================================ */
.news-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 2px 2px 18px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--nf-line);
}

.news-hero-l {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.news-hero-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: linear-gradient(135deg, #6b8bff, #4a6cf7);
    box-shadow: 0 6px 16px -5px rgba(74, 108, 247, .55);
    color: #fff;
    font-size: 21px;
    line-height: 1;
}

.news-hero-txt {
    min-width: 0;
}

.news-hero-txt h1 {
    font-size: 25px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -.3px;
    color: var(--nf-ink);
    margin: 0;
}

.news-hero-txt p {
    margin: 5px 0 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--nf-mute);
}

.news-hero-stats {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex-shrink: 0;
}

.news-hero-stats li {
    min-width: 74px;
    padding: 7px 13px;
    text-align: center;
    background: #fff;
    border: 1px solid var(--nf-line);
    border-radius: 12px;
}

.news-hero-stats b {
    display: block;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--nf-ink);
    font-variant-numeric: tabular-nums;
}

.news-hero-stats span {
    display: block;
    font-size: 11px;
    color: var(--nf-mute);
    margin-top: 1px;
    white-space: nowrap;
}

/* ============================================================
   2. 头条区：左轮播 + 右编辑推荐
   ============================================================ */
.news-feature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 306px;
    gap: 16px;
    /* 固定高度让左右两块等高：1440 下左栏 878x420 ≈ 2.09:1，1280 下 ≈ 1.77:1（正好 16:9）。
       旧版是 380 高 x 1109 宽（2.92:1），16:9 的封面被裁掉约 39% 的高度。 */
    height: 420px;
    margin-bottom: 20px;
}

.news-feature.is-full {
    grid-template-columns: minmax(0, 1fr);
}

.news-feature-media {
    min-width: 0;
    height: 100%;
}

/* ---------- 轮播 ---------- */
.news-slider {
    position: relative;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    background: var(--nf-soft);
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform .55s cubic-bezier(.4, 0, .2, 1);
}

.slider-slide {
    flex: 0 0 100%;
    height: 100%;
}

.slider-slide > a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.slide-image {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #e9eef7;
}

.slide-image > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .6s ease;
}

.slider-slide:hover .slide-image > img {
    transform: scale(1.03);
}

.slide-overlay {
    position: absolute;
    inset: auto 0 0 0;
    z-index: 2;
    padding: 56px 22px 34px;
    color: #fff;
    background: linear-gradient(180deg, rgba(11, 17, 32, 0) 0%, rgba(11, 17, 32, .55) 45%, rgba(11, 17, 32, .86) 100%);
}

.slide-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 9px;
    margin-bottom: 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .2);
    border: 1px solid rgba(255, 255, 255, .28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .3px;
    color: #fff;
}

.slide-overlay h3 {
    font-size: 21px;
    line-height: 1.4;
    font-weight: 700;
    margin: 0 0 7px;
    color: #fff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slide-overlay .slide-date {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: rgba(255, 255, 255, .82);
}

/* 箭头：桌面默认半隐，hover 显现 */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, .34);
    border-radius: 50%;
    background: rgba(17, 24, 39, .28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 11;
    opacity: 0;
    transition: opacity .25s ease, background .25s ease;
}

.slider-container:hover .slider-btn,
.slider-btn:focus-visible {
    opacity: 1;
}

.slider-btn:hover {
    background: rgba(255, 255, 255, .9);
    color: var(--nf-ink);
    border-color: #fff;
}

.slider-prev { left: 12px; }
.slider-next { right: 12px; }

.slider-dots {
    position: absolute;
    left: 22px;
    bottom: 15px;
    display: flex;
    gap: 6px;
    z-index: 11;
}

.slider-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .45);
    cursor: pointer;
    transition: all .3s ease;
}

.slider-dot.active {
    width: 18px;
    background: #fff;
}

.slider-count {
    position: absolute;
    right: 16px;
    bottom: 14px;
    z-index: 11;
    font-size: 11px;
    color: rgba(255, 255, 255, .85);
    background: rgba(0, 0, 0, .3);
    border-radius: 20px;
    padding: 2px 9px;
    font-variant-numeric: tabular-nums;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.slider-count b {
    color: #fff;
    font-weight: 700;
}

.news-slider-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #b9c3d4;
    font-size: 13px;
    min-height: 320px;
}
.news-slider-empty i { font-size: 34px; }

/* ---------- 编辑推荐 ---------- */
.news-feature-side {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    padding: 14px 16px 10px;
    background: var(--nf-soft);
    border-radius: 16px;
}

.fs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 10px;
    margin-bottom: 4px;
    border-bottom: 1px solid #e3ebf7;
}

.fs-head h2 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--nf-ink);
}

.fs-head h2 i {
    font-size: 15px;
    color: #ff9f43;
}

.fs-count {
    font-size: 11px;
    color: var(--nf-mute);
    background: #fff;
    border-radius: 20px;
    padding: 2px 8px;
}

.fs-list {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.fs-list li {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
}

.fs-list li + li {
    border-top: 1px solid #e8eefa;
}

.fs-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 2px;
    text-decoration: none;
}

.fs-idx {
    flex: 0 0 22px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.5;
    color: #c2cfe6;
    font-variant-numeric: tabular-nums;
}

.fs-list li:first-child .fs-idx { color: var(--nf-blue); }

.fs-body {
    min-width: 0;
    display: block;
}

.fs-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    font-size: 13.5px;
    line-height: 1.5;
    font-weight: 600;
    color: #26324a;
    transition: color .2s ease;
}

.fs-item:hover .fs-title { color: var(--nf-blue); }

.fs-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    font-size: 11px;
    color: var(--nf-mute);
}

.fs-meta em {
    font-style: normal;
    color: #5b78e8;
    background: #e8eeff;
    border-radius: 5px;
    padding: 1px 6px;
}

/* ============================================================
   3. 分类胶囊
   ============================================================ */
.news-cat-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

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

.news-cat-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 13px;
    border-radius: 9px;
    background: var(--nf-soft);
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 500;
    color: #55617a;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s ease;
}

.news-cat-chip span {
    font-size: 11px;
    color: #9aa6bb;
    font-variant-numeric: tabular-nums;
}

.news-cat-chip:hover {
    background: #e8effb;
    color: #2b3550;
}

.news-cat-chip.is-active {
    background: var(--nf-blue);
    color: #fff;
    box-shadow: 0 5px 14px -6px rgba(74, 108, 247, .8);
}

.news-cat-chip.is-active span { color: rgba(255, 255, 255, .78); }

/* 胶囊条是 overflow-x:auto，默认焦点环的上下边会被裁掉只剩两段弧，
   换成内描边，键盘操作时仍是完整的圆角框 */
.news-cat-chip:focus { outline: none; }

.news-cat-chip:focus-visible {
    outline: none;
    box-shadow: inset 0 0 0 2px #4a6cf7;
}

.news-cat-chip.is-active:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .9);
}

/* ============================================================
   4. 主栏 + 侧栏
   ============================================================ */
.news-layout {
    display: flex;
    gap: 22px;
    align-items: flex-start;
}

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

.news-main-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.news-main-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--nf-ink);
    display: flex;
    align-items: center;
    gap: 7px;
}

.news-main-head h2::before {
    content: "";
    width: 3px;
    height: 15px;
    border-radius: 2px;
    background: linear-gradient(180deg, #6b8bff, #4a6cf7);
}

.news-main-sub {
    font-size: 12px;
    color: var(--nf-mute);
    white-space: nowrap;
}

/* ---------- 卡片网格 ---------- */
.news-grid {
    display: grid;
    /* 原来 212px 在 1286px 的主栏里会堆到 5 列（每列仅 244px），标题三行也放不下；
       提到 248px 后宽屏稳定在 4 列（约 305px），标题基本能完整显示。 */
    grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
    gap: 16px;
}

.news-card {
    min-width: 0;
    background: #fff;
    border: 1px solid var(--nf-line);
    border-radius: 14px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.news-card:hover {
    transform: translateY(-3px);
    border-color: #cfdcf7;
    box-shadow: 0 12px 26px -12px rgba(29, 52, 105, .22);
}

.news-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.news-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #f1f5fc, #e6edf8);
    overflow: hidden;
    /* 图片加载失败 / 没有封面时，退化成居中的占位图标，不会露出破图与 alt 文字 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-thumb-ph {
    color: #c3cfe2;
    font-size: 26px;
    line-height: 1;
}

.news-thumb img {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

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

.news-tag {
    position: absolute;
    left: 8px;
    top: 8px;
    z-index: 2;
    height: 21px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #3f5bd7;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(16, 30, 60, .1);
}

.news-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 11px 13px 12px;
}

/* h3/p 直接做 flex 子项时会被 blockify，-webkit-line-clamp 在 Safari/Firefox 上
   容易失效（Chrome 尚能保留）。套一层普通 block，clamp 在各种引擎下都稳定。 */
.news-text {
    flex: 1 1 auto;
    min-height: 0;
}

.news-body h3 {
    margin: 0 0 6px;
    font-size: 14.5px;
    line-height: 1.5;
    font-weight: 600;
    color: #1b2437;
    /* 两行时 240px 宽的卡片一行只放得下 17 字，长标题必被切；
       三行在 4 列（约 305px）下能装 60 余字，基本覆盖全站标题。 */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card:hover .news-body h3 { color: var(--nf-blue); }

.news-body p {
    margin: 0 0 10px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #7b879c;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 9px;
    border-top: 1px solid #f1f5fb;
    font-size: 11.5px;
    color: #9aa6bb;
}

.news-meta span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.news-meta i { font-size: 12px; }

/* ---------- 兼容旧卡片结构 ----------
   tag.php 等页面仍按「封面链接 + 正文」两层写卡片：
     <a class="news-cover-link"><img class="news-cover"></a>
     <div class="news-body"><span class="news-category">…</span>…
   本文件已改版为 .news-thumb 结构，这里给旧结构补上等价样式，
   免得那些页面因为共用本文件而掉图、掉标签样式。 */
.news-card .news-cover-link {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5fc, #e6edf8);
}

.news-card .news-cover-link .news-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

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

.news-card .news-cover-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c3cfe2;
    font-size: 26px;
}

.news-card .news-body .news-category {
    align-self: flex-start;
    margin-bottom: 7px;
    padding: 1px 8px;
    border-radius: 6px;
    background: #eef3ff;
    color: #3f5bd7;
    font-size: 11px;
    font-weight: 600;
}

.news-card .news-body h3 a {
    color: inherit;
    text-decoration: none;
}

/* ---------- 空状态 ---------- */
.news-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 54px 20px 60px;
    background: var(--nf-soft);
    border-radius: 16px;
    text-align: center;
}

.news-empty i {
    font-size: 38px;
    color: #c3cfe2;
    margin-bottom: 4px;
}

.news-empty b {
    font-size: 15px;
    color: #3a465e;
}

.news-empty p {
    margin: 0;
    font-size: 12.5px;
    color: var(--nf-mute);
}

.news-empty-btn {
    margin-top: 12px;
    height: 32px;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    border-radius: 9px;
    background: var(--nf-blue);
    color: #fff;
    font-size: 13px;
    text-decoration: none;
    box-shadow: 0 5px 14px -6px rgba(74, 108, 247, .8);
}

/* ============================================================
   5. 分页
   ============================================================ */
.news-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--nf-line);
}

.pager-info {
    font-size: 12px;
    color: var(--nf-mute);
}

.pager-info b {
    color: #3a465e;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pager-btns {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pager-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 9px;
    border: 1px solid var(--nf-line);
    background: #fff;
    color: #4d5a72;
    font-size: 13px;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
    transition: all .2s ease;
}

.pager-btn:hover {
    border-color: #c7d6f5;
    background: #f2f6ff;
    color: var(--nf-blue);
}

.pager-btn.is-current {
    background: var(--nf-blue);
    border-color: var(--nf-blue);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 5px 14px -6px rgba(74, 108, 247, .8);
}

.pager-btn.is-disabled {
    color: #c3cbd9;
    background: #fafcff;
    cursor: not-allowed;
}

.pager-arrow {
    padding: 0 9px;
    color: #48536a;
}

.pager-gap {
    padding: 0 2px;
    color: #b9c3d4;
    font-size: 13px;
}

/* ============================================================
   6. 侧栏
   ============================================================ */
.news-sidebar {
    flex: 0 0 296px;
    width: 296px;
    position: sticky;
    top: 16px;
    align-self: flex-start;
}

.news-sidebar .sidebar-card {
    background: #fff;
    border: 1px solid var(--nf-line);
    border-radius: 14px;
    padding: 14px 14px 10px;
    margin-bottom: 14px;
}

.news-sidebar .sidebar-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    padding-bottom: 9px;
    border-bottom: 1px solid #f1f5fb;
    font-size: 14px;
    font-weight: 700;
    color: var(--nf-ink);
}

.news-sidebar .sidebar-title i {
    font-size: 15px;
    color: #8fa4c8;
}

.news-sidebar .sidebar-card:first-child .sidebar-title i { color: #ff8a3d; }

/* ---------- 热门教程 ---------- */
.hot-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.hot-item {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    padding: 8px 0;
}

.hot-item + .hot-item {
    border-top: 1px solid #f4f7fc;
}

.hot-rank {
    font-size: 12px;
    font-weight: 800;
    color: #c2cfe6;
    font-variant-numeric: tabular-nums;
}

.hot-item.is-top .hot-rank { color: #ff8a3d; }
.hot-item.is-top:nth-child(1) .hot-rank { color: #f04438; }

.hot-title {
    font-size: 13px;
    line-height: 1.45;
    color: #35405a;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s ease;
}

.hot-title:hover { color: var(--nf-blue); }

.hot-num {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: #a8b3c6;
    font-variant-numeric: tabular-nums;
}

.hot-num i { font-size: 11px; }

/* ---------- 全部分类 ---------- */
.cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 8px;
    border-radius: 8px;
    text-decoration: none;
    transition: background .18s ease;
}

.cat-row:hover { background: var(--nf-soft); }

.cat-name {
    font-size: 13px;
    color: #40506b;
}

.cat-num {
    font-size: 11px;
    color: #a8b3c6;
    background: var(--nf-soft);
    border-radius: 20px;
    padding: 1px 8px;
    font-variant-numeric: tabular-nums;
}

.cat-row.is-active .cat-name { color: var(--nf-blue); font-weight: 600; }
.cat-row.is-active .cat-num { background: #e8eeff; color: #3f5bd7; }

/* ---------- 关于本栏目（补白 + 站内导流） ---------- */
.sidebar-about p {
    margin: 2px 0 10px;
    font-size: 12.5px;
    line-height: 1.7;
    color: #7b879c;
}

.sidebar-more {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12.5px;
    color: var(--nf-blue);
    text-decoration: none;
}

.sidebar-more:hover { text-decoration: underline; }

/* ============================================================
   7. 响应式
   ============================================================ */
@media (max-width: 1280px) {
    .news-feature { grid-template-columns: minmax(0, 1fr) 282px; }
    .news-sidebar { flex: 0 0 272px; width: 272px; }
}

@media (max-width: 1100px) {
    .news-feature { grid-template-columns: minmax(0, 1fr); height: auto; }
    .news-feature-media, .news-feature-side { height: auto; }
    .news-slider { height: 336px; }
    .news-feature-side { padding: 12px 14px 8px; }
    .fs-list { flex-direction: row; gap: 0; flex: 0 0 auto; }
    .fs-list li { flex: 1 1 0; min-width: 0; padding-right: 12px; }
    .fs-list li + li { border-top: 0; border-left: 1px solid #e8eefa; padding-left: 12px; }
    .fs-item { padding: 8px 0 4px; align-items: flex-start; }
    .fs-idx { display: none; }
    .news-layout { gap: 18px; }
    .news-sidebar { flex: 0 0 258px; width: 258px; }
}

@media (max-width: 992px) {
    .news-layout { flex-direction: column; }
    .news-sidebar { width: 100%; flex: 1 1 auto; position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
    .news-sidebar .sidebar-card { margin-bottom: 0; }
}

@media (max-width: 768px) {
    .news-hero { padding-bottom: 14px; margin-bottom: 12px; gap: 10px; }
    .news-hero-icon { flex-basis: 38px; width: 38px; height: 38px; font-size: 18px; border-radius: 11px; }
    .news-hero-txt h1 { font-size: 21px; }
    .news-hero-txt p { font-size: 12px; }
    .news-hero-stats { gap: 6px; width: 100%; }
    .news-hero-stats li { flex: 1 1 0; min-width: 0; padding: 6px 4px; }
    .news-hero-stats b { font-size: 15px; }

    .news-feature { height: auto; }
    /* 768 一带容器约 728px，固定 218px 会把 16:9 封面裁成 3.3:1 的窄条，
       改成随视口平滑过渡：768→306px(2.4:1)，500 以下回落到 218px。 */
    .news-slider { height: clamp(218px, 40vw, 306px); border-radius: 13px; }
    .slide-overlay { padding: 40px 14px 30px; }
    .slide-overlay h3 { font-size: 15px; }
    .slide-badge { height: 19px; font-size: 10px; margin-bottom: 5px; }
    .slide-overlay .slide-date { font-size: 11px; }
    .slider-btn { width: 30px; height: 30px; font-size: 17px; opacity: .55; }
    .slider-container:hover .slider-btn { opacity: .55; }
    .slider-dots { left: 14px; bottom: 11px; }
    .slider-count { right: 10px; bottom: 9px; font-size: 10px; }

    .news-feature-side { padding: 10px 12px 4px; border-radius: 13px; }
    .fs-head h2 { font-size: 14px; }
    .fs-list { flex-direction: column; }
    /* 竖排时必须把 flex 基准改回 auto：父级高度是 auto，
       留着 flex:1 1 0 会让后两条算成 0 高度（之前就是这个原因被吃掉）。 */
    .fs-list li { flex: 0 0 auto; min-height: auto; padding: 0; }
    .fs-list li + li { border-left: 0; border-top: 1px solid #e8eefa; }
    .fs-idx { display: block; }
    .fs-item { align-items: flex-start; padding: 11px 2px; }
    /* 单列时标题一律单行 + 省略号：两行 clamp 会让「1 行 / 2 行 / 2 行」参差，
       长标题还容易掉出一个孤字（如「测」），换成单行后三条高度一致。 */
    .fs-title {
        display: block;
        -webkit-line-clamp: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 13px;
    }
    .fs-meta { margin-top: 3px; }

    .news-cat-bar { margin-bottom: 14px; }
    .news-cat-chip { height: 30px; font-size: 12.5px; padding: 0 11px; }

    .news-main-head h2 { font-size: 15px; }
    .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .news-body { padding: 9px 10px 10px; }
    .news-body h3 { font-size: 13.5px; margin-bottom: 4px; }
    .news-body p { display: none; }
    .news-meta { padding-top: 7px; font-size: 11px; }
    .news-tag { left: 6px; top: 6px; height: 19px; font-size: 10px; padding: 0 6px; }

    .news-sidebar { grid-template-columns: 1fr; gap: 12px; }
    .news-pager { justify-content: center; }
    .pager-info { width: 100%; text-align: center; }
}

@media (max-width: 600px) {
    /* 分类胶囊会横向溢出，右缘做渐隐提示「还能往右滑」 */
    .news-cat-bar {
        -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent 100%);
        mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent 100%);
    }
}

@media (max-width: 420px) {
    .news-slider { height: 186px; }
    .slide-overlay h3 { font-size: 14px; -webkit-line-clamp: 2; }
    .news-grid { grid-template-columns: 1fr; }
    .news-body p { display: -webkit-box; }
}

/* ============================================================
   8. 深色模式
   ============================================================ */
body.dark-mode .news-page { --nf-ink: #e8eefb; --nf-ink2: #b9c5da; --nf-mute: #8794ad; --nf-line: #26304a; --nf-soft: #1b2438; }
body.dark-mode .news-hero { border-bottom-color: #26304a; }
body.dark-mode .news-hero-stats li { background: #151d2e; border-color: #26304a; }
body.dark-mode .news-hero-txt h1, body.dark-mode .news-hero-stats b { color: #e8eefb; }

body.dark-mode .news-slider, body.dark-mode .news-slider-empty { background: #151d2e; }
body.dark-mode .news-feature-side { background: #151d2e; }
body.dark-mode .fs-head { border-bottom-color: #26304a; }
body.dark-mode .fs-head h2 { color: #e8eefb; }
body.dark-mode .fs-count { background: #1b2438; color: #8794ad; }
body.dark-mode .fs-list li + li { border-top-color: #26304a; border-left-color: #26304a; }
body.dark-mode .fs-title { color: #d7e0f0; }
body.dark-mode .fs-meta em { background: #223055; color: #8ba4f5; }

body.dark-mode .news-cat-chip { background: #1b2438; color: #96a3ba; }
body.dark-mode .news-cat-chip:hover { background: #22304d; color: #d3dcf0; }
body.dark-mode .news-cat-chip.is-active { background: #4a6cf7; color: #fff; }

body.dark-mode .news-main-head h2 { color: #e8eefb; }
body.dark-mode .news-card { background: #151d2e; border-color: #26304a; }
body.dark-mode .news-card:hover { border-color: #3a4a76; box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .6); }
body.dark-mode .news-thumb { background: linear-gradient(135deg, #1b2438, #22304d); }
body.dark-mode .news-thumb-ph { color: #3a4a6b; }
body.dark-mode .news-tag { background: rgba(21, 29, 46, .86); color: #8ba4f5; }
body.dark-mode .news-body h3 { color: #dfe7f5; }
body.dark-mode .news-body p { color: #8794ad; }
body.dark-mode .news-meta { border-top-color: #26304a; color: #7b879c; }

body.dark-mode .news-empty { background: #151d2e; }
body.dark-mode .news-empty b { color: #d7e0f0; }

body.dark-mode .news-pager { border-top-color: #26304a; }
body.dark-mode .pager-btn { background: #151d2e; border-color: #26304a; color: #b9c5da; }
body.dark-mode .pager-btn:hover { background: #22304d; border-color: #3a4a76; color: #8ba4f5; }
body.dark-mode .pager-btn.is-current { background: #4a6cf7; border-color: #4a6cf7; color: #fff; }
body.dark-mode .pager-btn.is-disabled { background: #131a29; color: #4a5570; }

body.dark-mode .news-sidebar .sidebar-card { background: #151d2e; border-color: #26304a; }
body.dark-mode .news-sidebar .sidebar-title { color: #e8eefb; border-bottom-color: #26304a; }
body.dark-mode .hot-item + .hot-item { border-top-color: #222c44; }
body.dark-mode .hot-title { color: #cbd5e8; }
body.dark-mode .cat-row:hover { background: #1b2438; }
body.dark-mode .cat-name { color: #b9c5da; }
body.dark-mode .cat-num { background: #1b2438; color: #8794ad; }
body.dark-mode .sidebar-about p { color: #8794ad; }
body.dark-mode .sidebar-more { color: #8ba4f5; }
body.dark-mode .news-card .news-cover-link { background: linear-gradient(135deg, #1b2438, #22304d); }
body.dark-mode .news-card .news-cover-placeholder { color: #3a4a6b; }
body.dark-mode .news-card .news-body .news-category { background: #223055; color: #8ba4f5; }
