/* ============================================================================
   cntronics-mobile.css  ——  移动端样式（自已验证原型拷入，再按 B1 规格补齐）
   ----------------------------------------------------------------------------
   隔离原则（硬约束，违反即返工）：
   1. 本文件所有规则必须包在 @media 里，且断点只往下（≤1080 / ≤768 / ≤430）。
      任何一条跑到媒体查询外面，就会影响桌面版 —— 不允许。
   2. 本文件不改 static/css/cntronics.css 里的任何一条规则、任何一个值。
   3. 不新增全局选择器（html/body/* 这种），只针对具体组件类。
   4. 只覆盖「列定义 / 尺寸 / 间距 / 显示形态」，不重写组件视觉（颜色、字重、圆角、
      边框沿用桌面值）。
   5. 模板层改动只做「纯增量 + 桌面隐藏」：新增的汉堡按钮/抽屉在桌面上 display:none。
   ========================================================================== */

/* ==========================================================================
   基础规则（唯一允许写在媒体查询外的部分）
   ----------------------------------------------------------------------------
   这四个类是 B1 要新增到模板里的移动专用元素。桌面端必须完全不可见、不占位，
   所以在基础层就给 display:none，媒体查询里再打开。
   安全性：这些 class 只存在于新增元素上，不可能命中任何现有桌面元素。
   guard.py 的静态检查对这几个选择器有白名单（--allow-base）。
   ========================================================================== */
.m-nav-toggle,
.m-channels,
.m-drawer,
.m-drawer-mask {
    display: none;
}

/* ==========================================================================
   ≤1080px：小笔记本 / 平板横屏。4 列卡片降 2 列，侧栏收窄。
   ========================================================================== */
@media (max-width: 1080px) {
    .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    /* 桌面 .home-top:has(.home-side-banners) 是 650px 626px；.home-side-banners 本身
       写死了 width:626px + height:420px + grid 310px×2。只改 grid-template-columns
       不够 —— 容器宽度仍被 626px 钉住，在 260px 的列里右溢 334px（实测）。
       必须同时把 width/height 归零，子卡也改成 100%。 */
    .home-top:has(.home-side-banners) { grid-template-columns: minmax(0, 1fr) 260px; }

    .home-side-banners {
        grid-template-columns: minmax(0, 1fr);
        width: auto;
        height: auto;
        min-width: 0;
    }

    .home-side-banners .home-side-card,
    .home-side-banners .home-side-banner {
        grid-row: auto;
        width: 100%;
        height: auto;
        min-width: 0;
    }

    .home-side-banners .home-side-card img,
    .home-side-banners .home-side-banner img { width: 100%; height: auto; object-fit: cover; }
}

/* ==========================================================================
   ≤768px：平板竖屏 / 折叠屏展开 / 手机横屏。头部换形态，主列侧栏改上下。
   ========================================================================== */
@media (max-width: 768px) {
    :root { --content: calc(100% - 24px); }

    /* ---------------- 头部：汉堡 + 频道条 ---------------- */
    .site-header {
        display: flex;
        align-items: center;
        gap: 4px;
        height: 56px;
        padding: 0 6px;
        position: sticky;
        top: 0;
        z-index: 60;
        background: #fff;
        border-bottom: 1px solid var(--line);
    }

    /* 头部 logo 是真实图片 static/img/logo.png（155×64 透明底，宽高比 2.42）。
       桌面 .logo img{height:42px;width:auto}；移动端降到 36px，为汉堡/搜索/登录让位。
       保持 width:auto，绝不写死宽度 —— 写死会把图压扁。
       logo 是首页入口（可点），命中区补到 44px 高（图仍 36px），满足触控 ≥44。 */
    .site-header .logo {
        flex: 0 0 auto;
        margin-right: auto;
        display: flex;
        align-items: center;
        min-height: 44px;
    }
    .site-header .logo img { height: 36px; width: auto; }

    /* 桌面主导航整条隐藏：触屏上 hover 巨幕会卡住，必须 display:none 而不是 visibility */
    .site-nav { display: none; }
    .primary-nav { display: none; }
    .mega { display: none !important; }

    /* 搜索不另建表单。默认只留 44×44 图标，点开后同一个 form 落到头部下方。 */
    .nav-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }

    .nav-tools .nav-search {
        width: 44px;
        height: 44px;
        margin: 0;
        padding: 0;
        border-radius: 0;
        background: transparent;
        flex: 0 0 auto;
    }

    .nav-tools .nav-search input {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .nav-tools .nav-search button {
        position: static;
        width: 44px;
        height: 44px;
    }

    .site-header.is-search-open .nav-search {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        z-index: 2;
        display: flex;
        width: auto;
        height: 44px;
        margin: 0;
        padding: 0 8px 0 12px;
        border-radius: 0;
        background: #fff;
        border-bottom: 1px solid var(--line);
    }

    .site-header.is-search-open .nav-search input {
        position: static;
        width: 100%;
        height: 44px;
        margin: 0;
        padding: 0 40px 0 4px;
        overflow: visible;
        clip: auto;
        white-space: normal;
        font-size: 16px;
    }

    .site-header.is-search-open .nav-search button {
        position: absolute;
        top: 0;
        right: 8px;
        width: 44px;
        height: 44px;
    }

    /* 设计稿 `.lg{font-size:12.5px;color:green;border:1px solid green;
       border-radius:13px;padding:4px 10px}` —— 胶囊描边，不是平铺文字按钮 */
    .nav-login {
        height: auto;
        min-height: 32px;
        min-width: 44px;
        margin-left: 0;
        padding: 4px 10px;
        border: 1px solid var(--green);
        border-left: 1px solid var(--green);
        border-radius: 13px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 12.5px;
        line-height: 1.4;
        color: var(--green);
        background: #fff;
    }

    .nav-account {
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }

    .nav-account .nav-avatar {
        width: 44px;
        height: 44px;
        min-width: 44px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* 新增件：基础层已 display:none，这里打开 */
    .m-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        flex: 0 0 auto;
        border: 0;
        background: none;
        color: #4a4a4a;
        cursor: pointer;
    }

    /* 频道条：与桌面主导航同一数据源，6 项，一屏放下 */
    .m-channels {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        height: 44px;
        padding: 0 12px;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        position: sticky;
        top: 56px;
        z-index: 55;
        background: #fff;
        border-bottom: 1px solid var(--line);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(90deg, #000 62%, rgba(0, 0, 0, .15) 96%, transparent 100%);
        mask-image: linear-gradient(90deg, #000 62%, rgba(0, 0, 0, .15) 96%, transparent 100%);
    }

    .m-channels::-webkit-scrollbar { display: none; }
    .m-channels a,
    .m-channels span {
        flex: 0 0 auto;
        font-size: 13.5px;
        line-height: 44px;
        color: #444;
        position: relative;
    }

    .m-channels .is-current { color: var(--green); font-weight: 600; }

    .m-channels .is-current::after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: 0;
        width: 20px;
        height: 2px;
        transform: translateX(-50%);
        background: var(--green);
        border-radius: 2px;
    }

    /* ---------------- 抽屉 ----------------
       关闭时也保持 display:flex + translateX(-100%)，才能做出 0.25s 滑入。
       position:fixed 不占文档流；基础层的 display:none 仍盖住 ≥769px。 */
    .m-drawer-mask {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, .55);
        opacity: 0;
        pointer-events: none;
        z-index: 80;
        transition: opacity .25s;
    }

    .m-drawer-mask.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .m-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 80%;
        background: #fff;
        z-index: 90;
        box-shadow: 4px 0 18px rgba(0, 0, 0, .16);
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform .25s ease, visibility 0s linear .25s;
    }

    .m-drawer.is-open {
        transform: translateX(0);
        visibility: visible;
        transition: transform .25s ease, visibility 0s;
    }

    .m-dsearch {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 10px 4px 10px 12px;
        border-bottom: 1px solid var(--line);
    }

    .m-dsearch-slot { flex: 1 1 auto; min-width: 0; }

    .m-dsearch .nav-search {
        position: relative;
        display: flex;
        width: 100%;
        height: 44px;
        margin: 0;
        border-radius: 22px;
        background: #f5f5f5;
    }

    .m-dsearch .nav-search input {
        position: static;
        width: 100%;
        height: 44px;
        margin: 0;
        padding: 0 44px 0 16px;
        overflow: visible;
        clip: auto;
        white-space: normal;
        font-size: 16px;
    }

    .m-dsearch .nav-search button {
        position: absolute;
        top: 0;
        right: 0;
        width: 44px;
        height: 44px;
    }

    .m-drawer-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        flex: 0 0 auto;
        border: 0;
        background: none;
        color: #666;
        cursor: pointer;
    }

    .m-dnav {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .m-acc,
    .m-dlink {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        min-height: 46px;
        padding: 0 14px;
        border: 0;
        border-bottom: 1px solid #f2f2f2;
        background: none;
        color: #333;
        font: inherit;
        font-size: 15px;
        line-height: 1.4;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
    }

    .m-acc::after {
        content: "";
        width: 8px;
        height: 8px;
        flex: 0 0 auto;
        border-right: 1.5px solid #bbb;
        border-bottom: 1.5px solid #bbb;
        transform: rotate(-45deg);
    }

    .m-ditem.is-open > .m-acc::after {
        transform: rotate(45deg);
        border-color: var(--green);
    }

    .m-ditem.is-current > .m-acc,
    .m-dlink.is-current { color: var(--green); font-weight: 600; }

    .m-ext { margin-left: 2px; color: #aaa; font-size: 12px; }

    .m-sub { display: none; padding: 4px 14px 14px; }

    /* 手风琴：默认收起，点开才展开。少了这条 display:none，.m-sub 一直 block，
       class 变了但视觉没变化 —— 用户会报「展开收起没有效果」。 */
    .m-ditem.is-open > .m-sub { display: block; }

    .m-sub-label {
        margin: 8px 0;
        font-size: 12px;
        line-height: 1.4;
        color: #8d97a6;
    }

    .m-sub-label a { color: inherit; }

    .m-chips {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 0 0 8px;
        padding: 0;
        list-style: none;
    }

    .m-chips a,
    .m-chips span {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 8px 12px;
        border-radius: 5px;
        background: #f6f7f6;
        color: #444;
        font-size: 13px;
        line-height: 1.4;
    }

    /* ---------------- 抽屉里的标签区（桌面 mega 的 4 组标签在移动端的落点） ----------------
       位置：.m-dnav 末尾，即「物料采购」与底部登录/注册之间那块空白。
       标签数据来自 NavigationSettings.menu_groups，与桌面 mega 同源，不另造内容。 */
    .m-dtags {
        margin: 0;
        /* 紧凑：标签区要完整落在「物料采购」到登录/注册之间约 238px 的空白里，
           否则第 4 组「电子元器件」的胶囊会被底部按钮遮掉（实测过）。 */
        padding: 8px 14px 8px;
        border-top: 1px solid #f2f2f2;
    }

    .m-dtags-head {
        margin: 0 0 6px;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.4;
        color: #333;
    }

    .m-dtags-head a { color: inherit; text-decoration: none; }

    .m-dtag-group { margin: 0 0 6px; }

    .m-dtag-group:last-child { margin-bottom: 0; }

    .m-dtag-title {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        margin: 0 0 4px;
        font-size: 12px;
        line-height: 1.4;
        color: #8d97a6;
    }

    .m-dtag-title a {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        width: 100%;
        color: inherit;
        text-decoration: none;
    }

    .m-dtag-more { flex: 0 0 auto; margin-left: 8px; color: #aaa; }

    /* 正常换行，不做横向滑动：滑动方案会把胶囊裁在抽屉右边缘（实测看起来像坏了），
       而且标签区下方仍剩 190px 空白。换行后 4 组标签正好填满
       「物料采购」到登录/注册之间那块空白，超出部分随 .m-dnav 一起纵向滚动。 */
    .m-dtag-list {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .m-dtag-list li { max-width: 100%; min-width: 0; }

    /* 胶囊标签：视觉 30px 高、圆角 15px，与 .tags-tabs 的胶囊语言一致。
       长供应商名（ALPSALPINE(阿尔卑斯阿尔派) 之类）超出时省略号，不撑破抽屉。 */
    .m-dtag-list a {
        display: block;
        max-width: 200px;
        min-height: 28px;
        padding: 5px 10px;
        border: 1px solid #ececec;
        border-radius: 14px;
        background: #f7f8f7;
        color: #555;
        font-size: 12.5px;
        line-height: 16px;
        text-decoration: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        box-sizing: border-box;
    }

    .m-drawer-foot {
        display: flex;
        gap: 9px;
        padding: 10px 12px;
        border-top: 1px solid var(--line);
        background: #fff;
    }

    .m-logout { display: flex; flex: 1 1 auto; margin: 0; }

    .m-login,
    .m-register {
        flex: 1 1 auto;
        height: 44px;
        border-radius: 22px;
        font: inherit;
        font-size: 14px;
        cursor: pointer;
    }

    .m-login {
        border: 0;
        background: var(--green);
        color: #fff;
    }

    .m-register {
        border: 1px solid var(--green);
        background: #fff;
        color: var(--green);
    }

    /* ---------------- 版心与页面 ---------------- */
    .layout,
    .page-main { width: var(--content); }

    .page-main { padding-bottom: 16px; }

    /* ---------------- 通用：主列 + 侧栏 → 上下 ---------------- */
    .home-banners,
    .home-ad-row,
    .home-lower,
    .template-article .wrapper,
    .template-whitepaper .wrapper,
    .template-category .cat-layout,
    .template-search .search-layout,
    .kb-top,
    .kb-body,
    .tag-layout,
    .template-tag .tag-layout,
    .template-tag .home-ad-row {
        display: block;
    }

    /* 桌面 .home-banners 是 grid + 写死 height:90px（「通栏 + 侧栏横条」并排）。
       移动端两条广告上下堆叠后 90px 装不下第二条 → 第二条溢出到 .home-grid 上，
       表现为「首页广告和内容重叠」。必须归零高度。 */
    .home-banners {
        height: auto;
        min-height: 0;
    }

    /* 桌面 .template-category .cat-layout.has-hero > .cat-recommend 写死
       height:310px + overflow:hidden，只装得下 3 条；移动端 5 条要 392px，
       后 2 条被裁掉 —— 这就是「特别推荐只剩 3 条」的原因。 */
    .template-category .cat-layout.has-hero > .cat-recommend,
    .template-category .cat-recommend.home-widget,
    .home-widget,
    .home-widget.cat-recommend,
    .kb-recommend {
        height: auto !important;
        max-height: none;
        overflow: visible;
    }

    .home-side,
    .cat-side,
    .kb-side,
    .tag-side,
    .detail-right,
    .list-left {
        width: 100%;
        margin-top: 14px;
    }

    /* 侧栏原先靠 margin-top:auto 贴底，单列后要复位 */
    .kb-side-bottom,
    .cat-side-bottom,
    .article-side-bottom,
    .tag-side-bottom,
    .paper-side-bottom { margin-top: 0; }

    /* ---------------- 首页 ---------------- */
    .template-homepage .page-main { padding-top: 10px; }

    .home-top:has(.home-side-banners) { display: block; }

    /* 轮播高度必须在移动断点里以「同特异性或更高」覆盖掉桌面的写死值。
       桌面有 .template-homepage .home-slide .home-media{height:420px} 等 4 处写死，
       只写 .home-slide{height:auto} 会被压回去；而高度一旦被写死，aspect-ratio
       会反过来按高度推宽度（实测 .kb-slider 变成 970px 宽 → 页面横滑 214px）。 */
    .home-slider,
    .template-homepage .home-slider {
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 650 / 420;
    }

    .home-slide,
    .home-slides > .home-slide,
    .template-homepage .home-slide {
        width: 100%;
        height: 100%;
        min-height: 0;
        flex: 0 0 100%;
    }

    .home-slide img,
    .home-slide .home-media,
    .template-homepage .home-slide .home-media,
    .template-homepage .home-slide img {
        display: block;
        width: 100%;
        height: 100%;
        min-height: 0;
        object-fit: cover;
    }

    /* 首页两张侧栏大卡：并排 → 上下 */
    .home-side-banners {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        width: 100%;
        height: auto;
        min-height: 0;
        margin-top: 10px;
    }

    .home-side-banners .home-side-card,
    .home-side-banners .home-side-banner { width: 100%; height: auto; }

    .home-side-card img,
    .home-side-banner img { width: 100%; height: auto; display: block; }

    /* 4 列卡片网格 → **2 列**（设计稿 pages-v2.html `.grid{grid-template-columns:1fr 1fr}`）。
       ⚠ 必须在 ≤768 里写：只在 ≤430 写时，iPhone 16 Pro Max(440) 会落进断点空档沿用 2 列平板规则。 */
    .home-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 10px;
    }

    .home-card { width: 100%; }

    .home-card .home-card-media,
    .home-card img {
        width: 100%;
        height: auto;
        aspect-ratio: 310 / 200;
        object-fit: cover;
    }

    /* 卡片标题：设计稿 `.gcard strong{font-size:14px;line-height:1.42}` */
    .home-grid .home-card strong,
    .home-card strong {
        padding: 7px 8px 3px;
        font-size: 14px;
        line-height: 1.42;
        font-weight: 600;
        max-height: none;
        -webkit-line-clamp: 2;
    }

    /* 日期：设计稿 `.gmeta{font-size:11.5px;padding:0 8px 8px}` */
    .home-card .home-meta {
        padding: 0 8px 8px;
        font-size: 11.5px;
        line-height: 1.4;
    }

    /* 分类角标：设计稿 `.lbl{font-size:10px;line-height:18px;padding:0 6px}` */
    .home-card-label {
        width: auto;
        min-width: 0;
        height: 18px;
        padding: 0 6px;
        font-size: 10px;
        line-height: 18px;
        font-weight: 400;
        border-radius: 0 9px 9px 0;
    }

    /* 首页 feed / 栏目列表：同一套文章行 */
    .home-row,
    .cat-row {
        grid-template-columns: 132px minmax(0, 1fr);
        gap: 10px;
        margin-bottom: 12px;
        padding-bottom: 10px;
        border-bottom: 1px solid #f0f0f0;
    }

    .home-row-media,
    .cat-thumb { width: 132px; }

    .cat-thumb img,
    .cat-thumb-empty,
    .home-row-media img,
    .home-row-media .home-media {
        width: 132px;
        height: 85px;
        object-fit: cover;
    }

    .home-row h2,
    .cat-copy .title {
        margin: 0;
        font-size: 16px;
        line-height: 1.4;
    }

    /* 桌面 .home-row h2 写死 height:30px + nowrap + ellipsis（特异性 0,1,1），
       移动端同特异性但必须显式归零，否则标题不换行、被裁成 30px 高，
       hscroll 仍是 0（祖先 overflow:hidden 吃掉了），表现为长标题静默截断。 */
    .home-row h2 {
        height: auto;
        margin: 0 0 6px;
        overflow: hidden;
        white-space: normal;
        text-overflow: clip;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    /* 桌面 .template-category .cat-row 是 248px 缩略图（特异性 0,2,0），
       单写 .cat-row 压不住，实测 375 下标题列 left=300、溢出 654px。
       以下四条必须照抄桌面层级。 */
    .template-category .cat-row {
        grid-template-columns: 132px minmax(0, 1fr);
        gap: 10px;
        margin-bottom: 12px;
        padding: 12px 0;
    }

    .template-category .cat-thumb img,
    .template-category .cat-thumb-empty {
        width: 132px;
        height: 85px;
        object-fit: cover;
    }

    .template-category .cat-copy {
        min-height: 0;
        min-width: 0;
    }

    .template-category .cat-copy .title {
        height: auto;
        min-height: 0;
        margin: 0 0 6px;
        font-size: 16px;
        line-height: 1.4;
        white-space: normal;
        text-overflow: clip;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .template-category .cat-copy p:not(.cat-meta) {
        font-size: 13px;
        line-height: 1.6;
        -webkit-line-clamp: 2;
    }

    /* ---------------- 标签详情页的文章行 ----------------
       桌面 .template-tag .cat-row（0,2,0）是 grid 248px + 1fr、gap 20px、
       padding 20px 20px 24px；图片 .template-tag .cat-thumb img 是 248×160。
       漏掉这条时实测 390px 下：文字列只剩 58px、标题折成 5 行、
       图片 248×160 溢出 132×85 的缩略图容器 —— 用户描述为
       「标签页的文章列表没有按栏目页来」。必须照抄 .template-tag 前缀。 */
    /* 桌面的分隔线是绝对定位的 ::after，left:calc(20px + 248px + 20px) = 288px、
       right:20px —— 在 366px 宽里只剩 58px 一段贴在右边，看起来像乱线。
       移动端统一用行自身的 border-bottom（随内容高度走），把 ::after 去掉。 */
    .template-tag .cat-row:not(:last-child)::after {
        content: none;
        display: none;
    }

    .template-tag .cat-row {
        border-bottom: 1px solid #f0f0f0;
    }

    .template-tag .cat-thumb,
    .template-tag .cat-thumb img,
    .template-tag .cat-thumb-empty {
        width: 132px;
    }

    .template-tag .cat-thumb img,
    .template-tag .cat-thumb-empty {
        height: 85px;
        object-fit: cover;
    }

    .template-tag .cat-copy {
        min-height: 0;
        min-width: 0;
    }

    .template-tag .cat-copy .title {
        height: auto;
        min-height: 0;
        margin: 0 0 6px;
        font-size: 16px;
        line-height: 1.4;
        white-space: normal;
        text-overflow: clip;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* 相关推荐：桌面是「文本左 / 155px 缩略图右」，靠显式 grid-column 定位
       （.cat-thumb{grid-column:2} / .cat-copy{grid-column:1}）。只改
       grid-template-columns 而不重置 grid-column，会出现「标题被塞进 120px 列、
       缩略图跑到第二列」的错位（实测标题宽 120、被压成 3 行）。
       移动端统一成缩略图左、文字右。 */
    .template-article .article-related .cat-row,
    .template-whitepaper .article-related .cat-row {
        grid-template-columns: 132px minmax(0, 1fr);
        gap: 12px;
    }

    .template-article .article-related .cat-thumb,
    .template-whitepaper .article-related .cat-thumb {
        order: 0;
        grid-column: 1;
        grid-row: 1;
        width: 132px;
    }

    .template-article .article-related .cat-copy,
    .template-whitepaper .article-related .cat-copy {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    /* 桌面在小图上隐藏了分类角标，移动端保持隐藏（与桌面一致） */
    .template-article .article-related .home-card-label,
    .template-whitepaper .article-related .home-card-label { display: none; }

    .template-article .article-related .cat-thumb img,
    .template-article .article-related .cat-thumb-empty,
    .template-whitepaper .article-related .cat-thumb img,
    .template-whitepaper .article-related .cat-thumb-empty {
        width: 132px;
        height: 85px;
        object-fit: cover;
    }

    /* 日期一行、标签另起一行（桌面是同一 <p> 里的两个 span）。
       注意：桌面用的是 .home-row .home-row-meta 与 .cat-copy .cat-meta（后代选择器），
       单写 .cat-meta 特异性不够，会被压回 display:flex + space-between（实测），
       所以这里必须照抄桌面层级。 */
    .home-row .home-row-meta,
    .cat-copy .cat-meta,
    .template-category .cat-copy .cat-meta,
    .template-article .article-related .cat-copy .cat-meta,
    .template-whitepaper .article-related .cat-copy .cat-meta,
    .template-tag .cat-copy .cat-meta {
        display: block;
        width: 100%;
        min-width: 0;
        height: auto;
        max-height: none;
        overflow: visible;
        margin-top: 6px;
        padding-top: 0;
        font-size: 12px;
        line-height: 1.4;
        color: #999;
        -webkit-line-clamp: unset;
    }

    /* 桌面 .cat-tags 是 justify-content:flex-end（右对齐），窄栏里遇上长标签
       会把内容顶出右边缘（375 实测溢出 1.6px）。移动端改左对齐。 */
    .home-row .home-tags,
    .cat-copy .cat-tags,
    .template-category .cat-tags,
    .template-tag .cat-copy .cat-tags {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 3px 10px;
        max-width: 100%;
        min-width: 0;
        margin-top: 3px;
        font-size: 12px;
        line-height: 1.5;
    }

    .home-tags a,
    .cat-tags a { color: var(--green); white-space: normal; }

    /* 标签逐个也是可点目标（如「TDK」只有 3 字符，实测 22×26，宽度低于
       24px 下限）。补 min-width 并居中，不影响换行与对齐。 */
    .home-row .home-tags a,
    .cat-copy .cat-tags a,
    .template-category .cat-tags a,
    .template-tag .cat-copy .cat-tags a {
        display: inline-block;
        min-width: 24px;
        min-height: 24px;
        line-height: 24px;
        text-align: center;
    }

    /* 首页区块标题 / 侧栏 widget */
    .home-side { margin-top: 16px; }

    .home-widget { width: 100%; margin-bottom: 10px; }

    .home-widget ul li { font-size: 14px; line-height: 1.55; padding: 6px 0; }

    /* 设计稿 `.pills{flex-wrap:wrap;gap:7px}` / `.pills a{12.5px;padding:6px 12px;
       border-radius:14px;border:1px solid #e8e8e8;background:#fff}` —— 换行不是横滑 */
    .home-pills {
        display: flex;
        flex-wrap: wrap;
        gap: 7px;
    }

    .home-pills a,
    .home-pills span {
        flex: 0 0 auto;
        padding: 6px 12px;
        border: 1px solid #e8e8e8;
        border-radius: 14px;
        background: #fff;
        color: #555;
        font-size: 12.5px;
        line-height: 1.5;
        white-space: nowrap;
    }

    /* 长尾介绍 */
    .home-intro { font-size: 14px; line-height: 1.7; }

    /* ---------------- 栏目 / 频道概览 ---------------- */
    .template-category .cat-layout > .cat-hero,
    .template-category .cat-layout > .cat-recommend,
    .template-category .cat-layout > .cat-main,
    .template-category .cat-layout > .cat-side {
        grid-column: auto;
        grid-row: auto;
    }

    .template-category .cat-layout,
    .kb-page { display: block; }

    /* 同理：这几处的桌面高度写死在 .cat-layout.has-hero > .cat-hero 与 .kb-page 下，
       特异性高于单类选择器，必须原样带上父级才有覆盖力。 */
    .cat-hero .home-slider,
    .template-category .cat-layout.has-hero > .cat-hero .home-slider,
    .template-category .cat-main > .home-slider,
    .kb-page .kb-slider,
    .kb-slider {
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 970 / 310;
        margin: 0 0 10px;
    }

    .template-category .cat-layout.has-hero > .cat-hero .home-slide,
    .template-category .cat-main > .home-slider .home-slide,
    .kb-page .kb-slide,
    .kb-page .home-slide,
    .kb-slider .home-slide {
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    .template-category .cat-layout.has-hero > .cat-hero .home-slide img,
    .template-category .cat-layout.has-hero > .cat-hero .home-slide .home-media,
    .template-category .cat-main > .home-slider .home-slide img,
    .template-category .cat-main > .home-slider .home-slide .home-media,
    .kb-page .home-slide img,
    .kb-page .home-slide .home-media,
    .kb-slider .home-slide img,
    .kb-slider .home-slide .home-media {
        display: block;
        width: 100%;
        height: 100%;
        min-height: 0;
        object-fit: cover;
    }

    /* 矮条：标题单行省略，圆点右上，箭头热区 44×44 */
    .cat-hero .home-slide-title,
    .kb-slider .home-slide-title {
        font-size: 13px;
        line-height: 1.3;
        padding: 16px 26px 7px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        -webkit-line-clamp: 1;
    }

    /* ---------------- 轮播箭头：按设计稿 .slider .nav / .slider.is-short .nav ----------------
       桌面是 35×67 灰色圆角块、左右各内缩 9px、margin-top:-34px（0,1,0）。
       设计稿是「44×44 全透明热区 + 贴边 left/right:0 + ::before 画视觉块」：
         大图   .slider .nav::before          28×44  rgba(0,0,0,.3)
         矮条   .slider.is-short .nav::before  18×26  rgba(0,0,0,.24) 圆角 2px
       坑1：视觉块 ::before 是定位元素，会盖住按钮里的原生文本节点 —— 箭头字符必须改由
            ::after + z-index:1 画，否则只看见一块灰疙瘩。
       坑2：桌面用 margin-top:-34px 配 top:50%，高度换成 44 后必须清零改 translateY(-50%)，
            否则垂直偏移 12px。
       坑3：桌面 .home-dots{display:none}，栏目页矮条设计稿要求圆点可见（右上）——
            只写 top/right 不写 display 等于没显示。 */
    .home-prev,
    .home-next {
        top: 50%;
        width: 44px;
        height: 44px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        color: transparent;      /* 原生 ‹ › 文本隐藏，改由 ::after 画在视觉块之上 */
        font-size: 0;
        line-height: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        transform: translateY(-50%);
    }

    .home-prev { left: 0; }
    .home-next { right: 0; }

    .home-prev::before,
    .home-next::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 28px;
        height: 44px;
        margin: -22px 0 0 -14px;
        border-radius: 0;
        background: rgba(0, 0, 0, 0.3);
    }

    .home-prev::after,
    .home-next::after {
        position: relative;
        z-index: 1;
        color: #fff;
        font-size: 18px;
        line-height: 1;
    }

    .home-prev::after { content: "‹"; }
    .home-next::after { content: "›"; }

    /* 矮条轮播（栏目页 / 知识课堂 970×310）：视觉块 18×26、圆角 2px、字号 14 */
    .cat-hero .home-prev::before,
    .cat-hero .home-next::before,
    .kb-slider .home-prev::before,
    .kb-slider .home-next::before {
        width: 18px;
        height: 26px;
        margin: -13px 0 0 -9px;
        border-radius: 2px;
        background: rgba(0, 0, 0, 0.24);
    }

    .cat-hero .home-prev::after,
    .cat-hero .home-next::after,
    .kb-slider .home-prev::after,
    .kb-slider .home-next::after {
        font-size: 14px;
    }

    .cat-hero .home-dots,
    .kb-slider .home-dots {
        /* 桌面只有 .template-homepage .home-dots 带 position:absolute（1387 行），
           栏目页继承的是 .home-dots{display:none}，没有定位 —— 只写 top/right 会被忽略，
           圆点整块跑到轮播图下方。必须显式补 position。 */
        position: absolute;
        top: 7px;
        right: 8px;
        bottom: auto;
        left: auto;
        z-index: 3;
        display: flex;
        justify-content: flex-end;
    }

    /* 矮条只有 117px 高，圆点若沿用 44×44 热区：① 整行撑到 132px 宽、点心间距 44px，
       跟设计稿 6px 点 + 4px 间距差太远；② 与右侧箭头热区纵向重叠 16px。
       矮条圆点改 24×24（WCAG AA 最小触控），点心间距 24px，视觉仍是 6px。
       大图轮播（首页 236px 高）空间够，保持 44×44。 */
    .cat-hero .home-dots .home-dot,
    .kb-slider .home-dots .home-dot,
    .cat-hero .home-dots .home-dot.is-active,
    .kb-slider .home-dots .home-dot.is-active {
        width: 24px;
        height: 24px;
    }

    /* 圆点视觉 6×6（选中态是 33×9 胶囊），触控框撑到 44×44，
       图形改由 ::before 画，保证 border-box 也是 44 —— 不只是伪元素热区。
       注意桌面是 .template-homepage .home-dot（0,2,0），单写 .home-dot 压不住。 */
    .home-dots .home-dot,
    .template-homepage .home-dots .home-dot {
        position: relative;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        background: none;
    }

    .home-dots .home-dot::before,
    .template-homepage .home-dots .home-dot::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: 6px;
        height: 6px;
        margin: -3px 0 0 -3px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.55);
    }

    .home-dots .home-dot.is-active,
    .template-homepage .home-dots .home-dot.is-active {
        width: 44px;
        height: 44px;
        background: none;
    }

    .home-dots .home-dot.is-active::before,
    .template-homepage .home-dots .home-dot.is-active::before {
        width: 13px;
        height: 6px;
        margin: -3px 0 0 -6.5px;
        border-radius: 3px;
        background: #fff;
    }

    .home-dots { gap: 0; }

    .cat-recommend { margin: 0 0 12px; }

    /* kicker 标题条 */
    .dl-kicker { padding: 10px 12px; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
    .dl-label { font-size: 16px; }
    .position { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* 分页：单行不换行（用户定），按设计稿 .pager a 的 36px 高。
       桌面是 justify-content:center + flex-wrap:nowrap；移动端若保留居中再开 overflow，
       左侧「首页/«」会被挤到 x<0 且滚不回来（412px 实测 -107px），右侧「»/尾页」也在屏外。
       本页最多 14 项（首页 « … 8 个页码 … » 尾页），44px 见方共需 616px，351px 内放不下；
       故 min-width 收到 24（WCAG 2.5.8 AA 下限）、gap 0、字号 11，实测总宽 336px，一行放下。 */
    .cat-pager {
        gap: 0;
        justify-content: center;
        flex-wrap: nowrap;
        overflow: hidden;
        padding: 0;
    }
    .cat-pager a,
    .cat-pager span {
        flex: 0 0 auto;
        min-width: 24px;
        height: 36px;
        padding: 0 1px;
        font-size: 11px;
        white-space: nowrap;
    }
    .cat-pager .cat-pager-gap { padding: 0; }

    /* 比 375 更窄时再收一档，避免 14 项被裁 */
    @media (max-width: 365px) {
        .cat-pager a,
        .cat-pager span { min-width: 0; padding: 0; font-size: 10px; }
    }

    /* ---------------- 文本型小链接热区补到 ≥24 ---------------- */
    /* 「更多」/ 面板标题行、侧栏列表项、标签胶囊、上下篇、面包屑、
       正文标签。这些是独立可点元素（不是句子内联词），WCAG 2.5.8 要求 ≥24×24。 */
    .home-widget header a,
    .home-widget ul li a,
    .home-tags a,
    .cat-tags a,
    .art-tags a,
    .next-art p a,
    .dl-kicker .position a {
        display: inline-block;
        min-height: 24px;
        padding: 4px 0;
    }

    .home-widget ul li a { display: block; }

    /* 桌面 .template-homepage .home-widget li a 是 nowrap + ellipsis（0,3,1），
       单写 .home-widget ul li a 压不住 —— 「特别推荐」5 条标题全被截成一行。 */
    .template-homepage .home-widget li a,
    .home-widget.cat-recommend li a {
        display: -webkit-box;
        min-height: 24px;
        padding: 4px 0;
        overflow: hidden;
        white-space: normal;
        text-overflow: clip;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.5;
    }

    /* 首页大轮播标题：**单行**。桌面是 height:40px + nowrap。
       写两行会把左右切换按钮挤变形（用户要求单行），所以 1 行 + 省略号。 */
    .home-slider .home-slide-title {
        height: auto;
        max-height: none;
        padding: 8px 12px 10px;
        overflow: hidden;
        line-height: 1.4;
        white-space: nowrap;
        text-overflow: ellipsis;
        display: block;
        -webkit-line-clamp: 1;
    }

    /* 首页大轮播：标题改成两行后会压到原本居底的圆点，圆点统一挪到右上
       （与栏目页矮条一致），避免白点压在白色标题文字上。 */
    .home-slider .home-dots,
    .template-homepage .home-slider .home-dots {
        top: 8px;
        right: 10px;
        bottom: auto;
        left: auto;
        justify-content: flex-end;
    }

    .art-tags a { padding: 4px 8px; }

    .next-art p { line-height: 1.6; }

    /* 登录按钮：规格要求 ≥36，实机 44 更稳（头部 56px 装得下） */
    .nav-login { min-height: 44px; padding: 4px 12px; }

    /* ---------------- 文章页 ---------------- */
    .template-article .page-main,
    .template-whitepaper .page-main { padding-top: 10px; }

    .title-box h1 { font-size: 21px; line-height: 1.45; }
    .title-box p { font-size: 12px; line-height: 1.8; }

    .content { font-size: 16px; line-height: 1.75; }
    .content p { margin: 0 0 14px; }
    .content img { max-width: 100%; height: auto; }
    .content table { display: block; width: 100%; overflow-x: auto; }
    .content iframe { max-width: 100%; }

    .art-tags { display: flex; flex-wrap: wrap; gap: 6px; }
    .next-art p { font-size: 13.5px; line-height: 1.6; }

    /* 相关推荐：与主列表同一套行 */
    .article-related .cat-list { display: block; }

    /* ---------------- 知识课堂 ---------------- */
    .kb-block h2 { height: auto; min-height: 44px; padding: 8px 12px; font-size: 16px; }

    /* 区块标题本身是 h2 里的 <a>，桌面靠 h2 撑高，a 只有 16px 行高。 */
    .kb-block h2 > a {
        display: inline-flex;
        align-items: center;
        min-height: 28px;
    }

    /* 广告横幅内的文字链接在 768 下只有 20px 高，补到 44 保证可点。 */
    .home-side-banner {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .kb-card {
        display: grid;
        grid-template-columns: 132px minmax(0, 1fr);
        gap: 12px;
        padding: 11px 12px;
    }

    .kb-thumb {
        flex: 0 0 132px;
        width: 132px;
        height: 85px;
        align-self: start;
    }

    .kb-thumb img { width: 132px; height: 85px; object-fit: cover; }

    .kb-card h3 { font-size: 15.5px; line-height: 1.4; }

    /* 桌面 .kb-card h3 是「一行放不下就省略」（nowrap + ellipsis），
       移动端必须改成两行折行，否则长标题被静默裁掉。 */
    .kb-card h3 {
        height: auto;
        white-space: normal;
        text-overflow: clip;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .kb-meta {
        display: block;
        width: 100%;
        min-width: 0;
        margin-top: 4px;
        font-size: 12px;
        line-height: 1.4;
        color: #999;
    }

    /* 桌面是 .kb-card p.kb-meta（0,2,1）display:flex + space-between，
       会把日期和标签挤成左右两栏。必须照抄层级才压得住。 */
    .kb-card p.kb-meta,
    .kb-card > div > p.kb-meta {
        display: block;
        width: 100%;
        min-width: 0;
        margin-top: 4px;
        padding-top: 0;
        text-align: left;
    }

    /* 桌面 .cat-tags 是 justify-content:flex-end（右对齐），窄栏里长标签会被顶出右缘。
       .kb-meta 里的标签同理（之前漏了 justify-content，实测被压成右对齐两行）。 */
    .kb-meta .cat-tags {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 3px 8px;
        margin-top: 3px;
    }

    /* ---------------- 搜索页 ---------------- */
    .template-search .page-main { padding-top: 10px; }
    .bps-title { font-size: 17px; }

    .search-res-list li h2,
    .search-res-list .title { font-size: 16px; line-height: 1.4; }

    .search-res-list li { padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
    .search-res-list p { font-size: 13px; line-height: 1.6; }

    /* 桌面 .template-search .search-res-list h3 写死 height:30px + nowrap（0,2,1），
       同理必须显式归零，标签页标题 .template-tag .cat-copy .title 也一样（0,3,0）。 */
    .template-search .search-res-list h3 {
        height: auto;
        font-size: 16px;
        line-height: 1.4;
        white-space: normal;
        text-overflow: clip;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .template-search .search-res-list li { height: auto; min-height: 0; }

    .template-tag .cat-copy .title {
        height: auto;
        min-height: 0;
        margin: 0 0 6px;
        font-size: 16px;
        line-height: 1.4;
        white-space: normal;
        text-overflow: clip;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* ---------------- 标签总览 / 厂商索引 / 元器件 ----------------
       桌面是「左侧竖排 tabs 241px + 右侧网格」，移动端 tabs 改 1 行横滑，网格 2 列 */
    .tags-catalog {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    /* 桌面 .tags-tabs 是 flex-direction:column + min-height:862px（左侧竖排 221×52）。
       移动端要「1 行横滑胶囊」——**必须显式写 flex-direction:row**，
       只写 display:flex + overflow-x 会保留 column，4 个 tab 仍竖排成 4 行
       （实测每个宽 366 高 34、总高 170），看起来完全没改。 */
    .tags-tabs {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 7px;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 0 26px 10px 0;
        background: none;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        mask-image: linear-gradient(90deg, #000 calc(100% - 30px), rgba(0, 0, 0, .25) 96%, transparent);
    }

    .tags-tabs::-webkit-scrollbar { display: none; }

    /* 设计稿 `.tabs a{font-size:12.5px;padding:6px 12px;border-radius:14px}` */
    .tags-tabs a {
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        height: auto;
        padding: 6px 12px;
        border: 1px solid #e8e8e8;
        border-radius: 14px;
        background: #fff;
        color: #555;
        font-size: 12.5px;
        line-height: 1.5;
        white-space: nowrap;
    }

    /* 桌面的左侧绿条装饰块在横滑胶囊形态下不适用 */
    .tags-tabs a::before,
    .tags-tabs a.is-active::before { display: none; content: none; }

    /* 设计稿 `.tabs a.on{background:#eef4ea;border-color:#cfe2c4;color:var(--g);font-weight:600}` */
    .tags-tabs a.is-active {
        background: #eef4ea;
        border-color: #cfe2c4;
        color: var(--green);
        font-weight: 600;
    }

    .tags-catalog-main { width: 100%; }

    /* 设计稿 `.ptitle{font-size:17px}` */
    .tags-catalog-title { font-size: 17px; }

    .tag-cover-grid,
    .template-tags .mfr-grid,
    .mfr-grid,
    .comp-chips {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .comp-chips { display: flex; flex-wrap: wrap; }

    .mfr-letters {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 6px;
        scrollbar-width: none;
    }

    .mfr-letters::-webkit-scrollbar { display: none; }

    .mfr-letters a { flex: 0 0 auto; width: 30px; height: 30px; font-size: 13px; }

    /* ---------------- 搜索区：完全按设计稿 pages-v2.html 的 .msearch / .sf ---------------- */
    /* 桌面包了 227×Banner 背景图 + 居中列布局；移动端设计稿是「无背景、整宽一行表单」。
       .template-tags .mfr-search-form input / button 是 (0,2,1)，单类选择器压不住 —— 实测
       input 高 64px、button 125×64px、form 只有 302px 宽（被 227px 高的居中容器挤小）。 */
    /* 桌面 .mfr-search 是全宽 banner（贴视口边），因为桌面包了 227px 背景图。
       移动端设计稿 `main{padding:12px}` 且搜索区**无背景**，所以要收进版心。
       用左右 margin 而不是 padding，避免 content-box 下 100% 宽度溢出。 */
    .mfr-search,
    .template-tags .mfr-search {
        display: block;
        width: auto;
        height: auto;
        min-height: 0;
        margin: 0 12px 12px;
        padding: 0;
        background: none;
    }

    .mfr-search-form,
    .template-tags .mfr-search-form {
        display: flex;
        align-items: center;
        width: 100%;
        height: 44px;
        border: 1px solid var(--line);
        border-radius: 4px;
        background: #fff;
        overflow: hidden;
        box-sizing: border-box;
    }

    .mfr-search-form input,
    .template-tags .mfr-search-form input,
    .mfr-search-form input[type="search"] {
        flex: 1 1 auto;
        width: auto;
        min-width: 0;
        height: 44px;
        padding: 0 12px;
        border: 0;
        border-radius: 0;
        outline: none;
        background: transparent;
        color: #333;
        font-size: 13.5px;
        box-sizing: border-box;
    }

    .mfr-search-form input::placeholder,
    .template-tags .mfr-search-form input::placeholder {
        color: #aaa;
    }

    .mfr-search-form button,
    .template-tags .mfr-search-form button {
        flex: 0 0 88px;
        width: 88px;
        height: 44px;
        border: 0;
        border-radius: 0;
        background: var(--green);
        color: #fff;
        font-size: 14px;
        font-weight: 500;
        line-height: 44px;
        cursor: pointer;
    }

    .mfr-hot,
    .template-tags .mfr-hot {
        margin: 8px 0 0;
        font-size: 12px;
        line-height: 1.6;
        color: #999;
    }

    /* 热门词是行内流，366px 下一行放不下会换行；中文不加 nowrap 会词内断开
       （实测「通信广电」被拆成「通信广」+「电」）。 */
    .mfr-hot a,
    .template-tags .mfr-hot a {
        display: inline-block;
        margin-right: 10px;
        color: #666;
        white-space: nowrap;
    }

    /* ---------------- 标签详情 ---------------- */
    .tag-page > .home-ad-row { display: block; }

    /* 桌面 nav.tag-filters 是 flex + nowrap + gap:28px，窄屏一排放不下会右溢。
       改横向可滑，与频道条同一套。 */
    .tag-filters,
    .template-tag .tag-filters {
        display: flex;
        flex-wrap: nowrap;
        gap: 14px;
        overflow-x: auto;
        padding: 0 0 8px;
        scrollbar-width: none;
    }

    .tag-filters::-webkit-scrollbar { display: none; }

    .tag-filters a {
        flex: 0 0 auto;
        font-size: 13px;
        padding: 6px 0;
        white-space: nowrap;
    }

    /* 设计稿原为 `.profile{grid:84px minmax(0,1fr);gap:12px;...}`（logo 左 / 文字右）。
       用户 2026-11-25 定：**标签介绍放到封面下方** —— 84px 的 logo 列会把简介
       挤成 220px 宽、9 行还是被截断；改单列后简介拿到 344px 通栏，行数减少且更完整。
       ⚠ 桌面 `.template-tag .tag-profile`（3664 行）是 display:flex（0,2,0），
       只写 `.tag-profile`(0,1,0) 压不住 —— 实测 computed display 仍是 flex、两者仍并排。 */
    .tag-profile,
    .template-tag .tag-profile {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        padding: 11px;
        margin-bottom: 10px;
        background: #fff;
        border: 1px solid #e8e8e8;
        border-radius: 6px;
        align-items: start;
    }

    /* flex:0 0 84px 在 grid 里没有意义但会保留，一并归零 */
    .tag-logo,
    .template-tag .tag-logo {
        flex: 0 0 auto;
        order: 0;
    }

    /* 桌面 .tag-profile-copy 写死 height:160px + overflow:hidden（0,2,0），
       单列后必须放开，否则简介还是被截断在 160px。 */
    .tag-profile-copy,
    .template-tag .tag-profile-copy {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        overflow: visible;
        order: 0;
    }

    /* 桌面 .template-tag .tag-profile p（0,2,1）是 -webkit-line-clamp:5 —— 那是给
       160px 高的侧栏排版算的。单列通栏后 5 行还是切掉几十字，简介要完整显示。 */
    .tag-profile p,
    .template-tag .tag-profile p {
        display: block;
        height: auto;
        max-height: none;
        -webkit-line-clamp: unset;
        -webkit-box-orient: initial;
        overflow: visible;
        font-size: 14px;
        line-height: 1.75;
    }

    /* 封面图：桌面 .template-tag .tag-logo 是 248×160 的侧栏缩略框，模板里
       {% image tag_profile.cover max-496x312 %} 是 496×312 的宽幅配图。
       原先移动端照设计稿压成 84×56，配图细节全挤在一起（截图里看着像乱码）。
       单列卡片里改回整宽等比，按 496×312 比例留位、cover 裁切。 */
    .tag-logo,
    .template-tag .tag-logo {
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        aspect-ratio: 496 / 312;
        padding: 0;
        background: #fff;
        border: 1px solid #e8e8e8;
        border-radius: 6px;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* 没有封面时模板仍输出空 .tag-logo，别留一块空白 */
    .tag-logo:empty,
    .template-tag .tag-logo:empty { display: none; }

    .tag-logo img,
    .template-tag .tag-logo img,
    .tag-profile-copy + .tag-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .tag-profile-copy { height: auto; min-height: 0; }

    /* 设计稿 `.pcopy h1{font-size:18px;font-weight:700}` */
    .tag-profile-copy h1 {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
        line-height: 1.3;
    }

    /* 设计稿 `.supgrid{grid:1fr 1fr;gap:10px}` / `.sup{padding:8px}` / `.slogo{height:44px}` */
    /* 桌面 .template-tag .tag-suppliers 是 3 列（0,2,0），同样要带前缀 */
    .tag-suppliers,
    .template-tag .tag-suppliers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-top: 10px;
    }

    .tag-supplier,
    .template-tag .tag-supplier {
        padding: 8px;
        text-align: center;
    }

    .tag-supplier-logo,
    .template-tag .tag-supplier-logo {
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #eef1f5;
        border-radius: 3px;
    }

    .tag-supplier-logo img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

    .tag-supplier-name {
        display: block;
        margin-top: 6px;
        font-size: 12px;
        line-height: 1.35;
    }

    /* ---------------- 产品手册 / 白皮书下载页：封面 + 信息 ----------------
       桌面（含 ≤720px）是 `.template-whitepaper .bps_info{grid-template-columns:248px minmax(0,1fr);gap:19px}`，
       特异性 (0,2,0)。原来这里只写 `.bps_info`(0,1,0) 压不住，实测 390px 下：
         - 右列只剩 59px，标题 20px 在 59px 宽里折成 5-6 行，元数据同样碎成一列
         - `.dl-cover` 宽 112 但内部 `.home-media`/img 仍是 248×160 → 溢出 136px
         - `.btn_bps` 写死 182px，x=299 → right=481，**整页横滑 91px**
       移动端改为：封面(112) + 标题并排一行，元数据与按钮各占整行。只改排版，不动 DOM。 */
    .template-whitepaper .bps_info {
        grid-template-columns: 112px minmax(0, 1fr);
        grid-template-rows: auto auto auto;
        column-gap: 12px;
        row-gap: 0;
        min-height: 0;
        align-items: start;
    }

    .template-whitepaper .dl-cover {
        /* 桌面是 grid-row:1/-1（纵向贯穿封面列），移动端只占标题行 */
        grid-column: 1;
        grid-row: 1;
        width: 112px;
        align-self: start;
    }

    /* 真实封面（img）：比例各不相同（200×114、568×320、横幅型 logo），
       用 contain 不裁边 —— 用 cover 会把扁长 logo 的品牌名切掉（实测基创 ZEILON 被切）。
       加 1px 描边 + 白底：contain 会在框内留白，没有边框时三张封面视觉大小不一，
       看着像没对齐（实测像素位置完全一致，但肉眼判断会误判）。 */
    .template-whitepaper .dl-cover img {
        display: block;
        width: 112px;
        height: 72px;          /* 248:160 → 112:72，等比 */
        border: 1px solid #ececec;
        border-radius: 4px;
        object-fit: contain;
        background: #fff;
        box-sizing: border-box;
    }

    /* 无封面占位：桌面 .home-media 的 background 是 default-cover.png（248×160，图上写着「暂无封面」）。
       ⚠ 这里绝不能写 background 简写 —— 实测会把那张图一起抹掉，只剩一块无色灰块，
       视觉上像「图片加载失败」。只调尺寸，背景交给桌面规则（比例 1.55 与 112×72 完全一致）。 */
    .template-whitepaper .dl-cover .home-media {
        display: block;
        width: 112px;
        height: 72px;
        min-height: 0;
        border: 1px solid #ececec;
        border-radius: 4px;
        background-size: cover;
        background-position: center;
        box-sizing: border-box;
    }

    .template-whitepaper .bps_download h1,
    .template-whitepaper .bps_info h1 {
        grid-column: 2;
        grid-row: 1;
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.4;
        text-align: left;
        /* 375px 下 187px 标题列装不下 12 个汉字 @16px，会折成「11 字 + 1 字」孤字。
           balance 让两行均分（6+6），比掉字/缩字号更稳。 */
        text-wrap: balance;
    }

    .template-whitepaper .bps_info ul {
        /* 跨两列，元数据一行放得下全部 4 项，不再逐项折行 */
        grid-column: 1 / -1;
        grid-row: 2;
        gap: 4px 16px;
        margin: 12px 0 0;
        font-size: 12px;
        line-height: 1.45;
    }

    .template-whitepaper .bps_info ul li { white-space: nowrap; }

    .template-whitepaper .dl-action {
        grid-column: 1 / -1;
        grid-row: 3;
        margin: 12px 0 0;
        align-self: start;
    }

    /* 桌面写死 182×48，移动端要整宽才好点；这个尺寸也正是横滑的根因 */
    .template-whitepaper .btn_bps {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: none;
        height: 44px;
        box-sizing: border-box;
    }

    /* 描述里的规格表由桌面 CSS（1683 行）完整定义：width:100%、border-collapse、单元格 padding。
       这里**不要**加 table-layout:fixed —— 旧手册的 <td width="80"> 是 HTML 属性，
       在 fixed 布局下会被 overflow-wrap:anywhere 压成 3px，整列文字竖排、看起来像重叠（实测过）。
       只兜住极端宽内容，其余交给 auto 布局。 */
    .template-whitepaper .dl-desc table {
        max-width: 100%;
        table-layout: auto;
    }

    .template-whitepaper .dl-desc td,
    .template-whitepaper .dl-desc th {
        word-break: normal;
        overflow-wrap: break-word;
    }

    .dl-preview,
    .dl-preview-stage { max-width: 100%; }

    /* 桌面 .article-ad-bottom 是 grid: minmax(0,1fr) + 310px（通栏 + 小横条并排）。
       移动端没有这条规则时，366px 宽里 1fr 只剩 366-310-10 = 46px，
       970×90 的通栏被挤成 46×4（zoom 0.047），也就是用户看到的「底部通栏大小不对」。
       改成上下堆叠，两条各自整宽。 */
    .template-article .article-ad-bottom,
    .template-whitepaper .article-ad-bottom,
    .template-article .home-ad-row,
    .template-whitepaper .home-ad-row {
        display: block;
        width: auto;
        height: auto;
        min-height: 0;
        margin-top: 12px;
    }

    .template-article .article-ad-bottom > .home-ad-slot,
    .template-article .article-ad-bottom > .ad-slot,
    .template-whitepaper .home-ad-row > .home-ad-slot,
    .template-whitepaper .home-ad-row > .ad-slot {
        width: 100%;
        margin-bottom: 12px;
    }

    .template-article .article-ad-bottom > *:last-child,
    .template-whitepaper .home-ad-row > *:last-child { margin-bottom: 0; }

    /* ---------------- 广告位：整宽等比，不裁不拉伸 ---------------- */
    .home-ad-slot,
    .home-ad-row .home-ad-slot {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: auto !important;
        min-height: 0;
        margin-bottom: 12px;
        padding: 0;
        overflow: hidden;
    }

    /* 通栏 970×90 / 横条 310×90：iframe 里是固定尺寸素材（970×90 的 <ins>），
       父容器变窄后右侧被裁、且 height:auto 对 iframe 无效（回落 300×150）。
       这里先让 iframe 保持原始像素尺寸，由 mobile-nav.js 按容器宽等比缩放。
       ⚠ 必须 flex-start：iframe 布局宽 970 > 容器 366，居中会让它左移 302px，
       transform-origin:0 0 之后整条横幅被推出左边、看起来只剩一小截残片。 */
    .home-ad-slot.is-wide,
    .home-ad-slot.is-90,
    .home-ad-slot.is-200 {
        justify-content: flex-start;
        align-items: flex-start;
    }

    .home-ad-slot.is-wide iframe,
    .home-ad-slot.is-90 iframe,
    .home-ad-slot.is-200 iframe {
        flex: 0 0 auto;
        width: auto;
        height: auto;
        max-width: none;
        transform-origin: 0 0;
    }

    /* 矩形 300×250：设计稿要求也整宽（→ 366×305），与通栏同宽才成「广告带」。
       居中保持 300 会左右各留 33px 空白，视觉上把三连广告拆散了。
       桌面 .template-category .cat-side .home-ad-slot.is-250 有 padding:5px（0,4,0），
       不清掉可用宽度只有 356，矩形就缩不成 366。 */
    .home-ad-slot.is-250,
    .template-homepage .home-side .home-ad-slot.is-250,
    .template-category .cat-side .home-ad-slot.is-250,
    .template-search .cat-side .home-ad-slot.is-250,
    .cat-side-bottom .home-ad-slot.is-250,
    .detail-right .home-ad-slot.is-250,
    .article-side-bottom .home-ad-slot.is-250,
    .template-article .detail-right .home-ad-slot.is-250,
    .template-whitepaper .detail-right .home-ad-slot.is-250,
    .template-article .article-side-bottom .home-ad-slot.is-250,
    .template-whitepaper .paper-side .home-ad-slot.is-250,
    .template-tag .tag-side .home-ad-slot.is-250,
    .tag-side .home-ad-slot.is-250,
    .tag-side-bottom .home-ad-slot.is-250,
    .template-tag .tag-side-bottom .home-ad-slot.is-250,
    .kb-side .home-ad-slot.is-250,
    .kb-side-bottom .home-ad-slot.is-250,
    .template-knowledge .kb-side .home-ad-slot.is-250,
    .template-knowledge .kb-side-bottom .home-ad-slot.is-250,
    .paper-side .home-ad-slot.is-250,
    .cat-hero .home-ad-slot.is-250 {
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
        width: 100%;
        height: auto !important;
        padding: 0;
        box-sizing: border-box;
    }

    .home-ad-slot.is-250 iframe {
        flex: 0 0 auto;
        width: 300px;
        height: 250px;
        max-width: none;
    }

    /* 图片型广告一律整宽等比（含矩形位：设计稿 ad-250 也是 366×305） */
    .home-ad-slot img,
    .home-ad-slot .ad-item,
    .home-ad-slot .ad-item img,
    .template-homepage .home-side .home-ad-slot.is-250 img,
    .template-category .cat-side .home-ad-slot.is-250 img,
    .template-search .cat-side .home-ad-slot.is-250 img,
    .detail-right .home-ad-slot.is-250 img,
    .cat-side-bottom .home-ad-slot.is-250 img {
        display: block;
        width: 100%;
        height: auto;
        max-width: 100%;
    }

    .home-ad-slot.is-250 .ad-item {
        width: 100%;
        height: auto;
    }

    /* 图片型通栏/横条：按原始比例占满整宽 */
    .home-ad-slot.is-wide .ad-item,
    .home-ad-slot.is-wide .ad-item img,
    .home-ad-slot.is-90 .ad-item,
    .home-ad-slot.is-90 .ad-item img,
    .home-ad-slot.is-200 .ad-item,
    .home-ad-slot.is-200 .ad-item img {
        width: 100%;
        height: auto;
    }

    .home-ad-slot.is-wide .ad-item,
    .home-ad-slot.is-90 .ad-item,
    .home-ad-slot.is-200 .ad-item { height: auto; }

    /* 通栏 970×90：等比后 366×34，允许但不再强制 90px 高 */
    .home-ad-slot.is-wide,
    .home-ad-slot.is-90,
    .home-ad-slot.is-200,
    .home-ad-slot.is-250 { height: auto !important; }

    /* ad_promo 变体（首页 .home-promo / .home-promo-ad）：桌面 img 是
       height:90px + width:auto + object-fit:contain，窄屏下 970 宽的图会按高度
       撑成 970px 宽 → 文字被右边缘裁掉。这里改成整宽等比。 */
    .home-banners > .home-promo,
    .home-banners > .home-promo-ad,
    .home-banners > iframe.home-promo,
    .home-banners > iframe.home-promo-ad {
        display: block;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 0;
        margin: 0 0 12px;
    }

    .home-banners > .home-promo img,
    .home-banners > .home-promo-ad img {
        display: block;
        width: 100%;
        height: auto;
        max-width: 100%;
        object-fit: contain;
        object-position: center;
    }

    /* 没有素材时的纯文字 slogan：26px 在 366 宽下会溢出，收小并允许换行 */
    .home-promo {
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 6px;
        padding: 12px;
    }

    .home-promo strong { font-size: 16px; line-height: 1.35; }

    .home-promo span {
        margin-left: 0;
        padding: 4px 10px;
        font-size: 12px;
    }

    .home-promo-ad {
        padding: 12px;
        font-size: 14px;
        line-height: 1.4;
    }

    /* 首页「无 side_banners」时的大卡，桌面固定 626/310 宽 */
    .home-feature {
        display: block;
        width: 100%;
        height: auto;
        margin-bottom: 10px;
    }

    .home-feature img,
    .home-feature .home-media {
        width: 100%;
        height: auto;
        aspect-ratio: 310 / 230;
        object-fit: cover;
    }

    /* ---------------- 页脚 ----------------
       桌面（cntronics.css:540-620）：
         .site-footer{background:#141a25;color:#f2f2f2;padding:42px 0 26px;font-size:12px;font-weight:600}
         .footer-main{grid:auto minmax(0,1fr) auto auto; column-gap:48px}
         .footer-nav{grid:repeat(4,minmax(0,1fr))} + .footer-nav ul{display:contents}
         .footer-qr img{width:112px;height:auto}
       所以移动端只做三件事：外层 4 列改堆叠、导航 4 列改 1 列、间距收窄。
       内容、颜色、字重、字号一律不动。 */
    .site-footer { padding: 22px 0 18px; }

    /* 桌面 .footer-main 是 4 列 grid：品牌 / 导航 / 联系方式 / 二维码。
       默认品牌和导航各占 1fr，二维码 auto；联系方式与二维码并排在同一行。
       移动端保留这个关系：品牌、导航跨两列，联系方式 + 二维码排最后一行。 */
    .footer-main {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 12px;
        align-items: start;
    }

    .footer-brand {
        grid-column: 1 / -1;
        margin-bottom: 14px;
    }

    .footer-nav { grid-column: 1 / -1; }

    .footer-brand img { height: 40px; width: auto; }

    /* ul 是 display:contents，6 个 li 直接参与父级 grid。
       第一项「网站服务」桌面是标题（无链接），移动端独占一行当小标题；
       其余 5 个链接一行 3 个（3 + 2）。
       366px 内容宽下每列约 114px，「投稿信箱」等 4 字标题 12px 刚好放得下。 */
    .footer-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0 8px;
        margin-bottom: 12px;
    }

    .footer-nav li:first-child {
        grid-column: 1 / -1;
        margin-bottom: 2px;
        color: #8d97a6;
    }

    .footer-nav li { white-space: nowrap; }

    /* 联系方式：桌面是 white-space:nowrap、单行不换。
       占了左列（1fr）后宽度只有 ~250px，「反馈意见：editor@eecnt.com」放得下，
       但保险起见允许换行，避免长邮箱撑破。 */
    .footer-contact {
        grid-column: 1;
        margin-bottom: 0;
        white-space: normal;
        line-height: 1.9;
        min-width: 0;
        word-break: break-all;
    }

    /* 二维码落在右列，与联系方式顶部对齐。
       桌面只给 img 定宽 112px，容器无固定高；这里同样只改 img 宽度，
       别给容器写死 height（图是 161×176，不是正方形）。 */
    .footer-qr {
        grid-column: 2;
        margin: 0;
        justify-self: end;
    }

    .footer-qr img { width: 92px; height: auto; }

    /* 版权行：桌面一行放得下，390px 下要断 3 行。
       默认 CJK 会在词中间断（「权益所有」被拆成 版/权所有），
       word-break:keep-all 禁止在中文词内断行，只在 | 和空格处断。 */
    .footer-copy {
        margin: 16px 0 0;
        padding-top: 14px;
        line-height: 1.9;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    .footer-copy span { margin: 0 4px; }

    /* 友情链接：模板里是「链接 | 链接 | …」纯文本，窄屏换行时行首会挂个孤立竖线。
       居中放大这个问题，改左对齐后至少每行左边线对齐。 */
    .footer-friends {
        margin-top: 12px;
        line-height: 1.9;
        text-align: left;
        word-break: keep-all;
    }

    .footer-friends p:first-child { color: #8d97a6; }

    .footer-friends a { white-space: nowrap; }

    /* ======================================================================
       统一文章行
       首页 feed(.home-row) / 栏目列表与为您推荐(.cat-row) / 频道概览与知识课堂
       (.kb-card) 桌面本来就是同一套「缩略图 + 标题 + 摘要 + 日期」行，
       移动端必须继续一致。实测不统一时：kb 用 104×68、cat 用 120×173（被 grid
       stretch 拉高）、标题 15.5 vs 16px、摘要 3 行 vs 2 行 —— 视觉上是两种组件。
       ====================================================================== */
    .home-row,
    .cat-row,
    .kb-card,
    .template-category .cat-row,
    .template-article .article-related .cat-row,
    .template-whitepaper .article-related .cat-row,
    .template-tag .cat-row {
        display: grid;
        grid-template-columns: 132px minmax(0, 1fr);
        gap: 12px;
        align-items: start;
        /* 分隔线用 border-bottom 跟随实际内容高度；行本身不得写死 height */
        height: auto;
        min-height: 0;
        margin: 0 0 10px;
        padding: 11px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .home-row-media,
    .cat-thumb,
    .kb-thumb,
    .template-category .cat-thumb,
    .template-article .article-related .cat-thumb,
    .template-whitepaper .article-related .cat-thumb {
        position: relative;
        display: block;
        width: 132px;
        height: 85px;
        min-height: 0;
        align-self: start;
        overflow: hidden;
        border-radius: 4px;
    }

    .home-row-media img,
    .home-row-media .home-media,
    .cat-thumb img,
    .cat-thumb-empty,
    .kb-thumb img,
    .kb-thumb .home-media,
    .template-category .cat-thumb img,
    .template-category .cat-thumb-empty,
    .template-article .article-related .cat-thumb img,
    .template-article .article-related .cat-thumb-empty,
    .template-whitepaper .article-related .cat-thumb img,
    .template-whitepaper .article-related .cat-thumb-empty {
        display: block;
        width: 132px;
        height: 85px;
        min-height: 0;
        object-fit: cover;
        border-radius: 4px;
    }

    .home-row h2,
    .cat-copy .title,
    .kb-card h3,
    .template-category .cat-copy .title,
    .template-tag .cat-copy .title {
        height: auto;
        min-height: 0;
        margin: 0 0 5px;
        font-size: 16px;
        font-weight: 700;
        line-height: 1.4;
        white-space: normal;
        text-overflow: clip;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* ⚠ 必须排除 meta 段：.cat-meta / .home-row-meta / .kb-meta 也是 <p>，
       被这条的 max-height 锁住后，里面的标签会溢出 → 分隔线穿过标签（实测）。
       分隔线用 border-bottom 跟随内容高度，不要给容器定高。 */
    .home-row p:not(.home-row-meta):not(.home-meta),
    .cat-copy p:not(.cat-meta),
    .kb-card > div > p:not(.kb-meta) {
        height: auto;
        /* 桌面写死 height:72px，光靠 -webkit-line-clamp 在 block 化之后不生效，
           文本会露出 3~4 行且末行被拦腰截断（无省略号）。
           max-height 按「2 行 × 行高」硬切，两种浏览器都能得到干净的 2 行。 */
        max-height: calc(2 * 1.6 * 13px);
        margin: 0 0 5px;
        font-size: 13px;
        line-height: 1.6;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .home-row-meta,
    .cat-meta,
    .kb-meta {
        font-size: 12px;
        line-height: 1.5;
    }

    /* 缩略图上角标：三种行统一成 20px 高的小标签（桌面 80×30 / 77×28） */
    .home-card-label,
    .kb-badge,
    .template-category .cat-thumb .home-card-label {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 2;
        width: auto;
        min-width: 0;
        height: 18px;
        padding: 0 6px;
        border-radius: 0 9px 9px 0;
        font-size: 10px;
        line-height: 18px;
        font-weight: 400;
    }

    /* ======================================================================
       首页 16 张卡片：移动端只显示前 8 张（设计稿：
       「4 列卡片网格 → 移动端 1 列，只显示前 8 条 + 查看全部」）。
       全 16 张单列会让页面多出 5000px 纯图片流。
       ====================================================================== */
    .home-grid .home-card:nth-child(n + 9) { display: none; }

    .home-grid.is-expanded .home-card:nth-child(n + 9) { display: block; }

    .home-grid-more {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 44px;
        margin: 2px 0 0;
        padding: 0 12px;
        border: 1px dashed #cfe0c5;
        border-radius: 6px;
        background: #fff;
        color: var(--green);
        font: inherit;
        font-size: 13.5px;
        cursor: pointer;
    }
}

/* ==========================================================================
   ≤430px：手机（375/390/414）
   ========================================================================== */
@media (max-width: 430px) {
    :root { --content: calc(100% - 24px); }

    /* 设计稿 pages-v2.html `.catrow{grid-template-columns:132px minmax(0,1fr);gap:12px}`
       统一 132×85、标题 16px，窄屏不再另缩一档（另缩就是不一致的来源）。 */
    .home-row,
    .cat-row,
    .kb-card,
    .template-category .cat-row,
    .template-article .article-related .cat-row,
    .template-whitepaper .article-related .cat-row,
    .template-tag .cat-row {
        grid-template-columns: 132px minmax(0, 1fr);
        gap: 12px;
    }

    .home-row h2,
    .cat-copy .title,
    .kb-card h3,
    .template-category .cat-copy .title,
    .template-tag .cat-copy .title {
        font-size: 16px;
    }
}
