@charset "utf-8";
/* ==========================================================================
   主站 PC 外壳 · 响应式补丁（2026-09-24 任务 #210）
   --------------------------------------------------------------------------
   【为什么需要这个文件】
   主站 PC 端沿用 2019 年的固定宽模板：
       .page-head { min-width: 1190px }        ← public.css:14
       .page-head .nav { min-width: 1190px }   ← public.css:110
       .main { width: 1190px }                 ← public.css:17
       .w, #main, #selection… { width: 1170px }← style.css:260
       .footer { min-width: 1170px }           ← style.css:2424
   ＋ 各页面视图自带的 <style> 块里还有一批：
       .yc_box / .yc_dqwz_B 1190px             ← views/article/view.php
       .newpage_L 859px / .newpage_R 290px     ← views/article/view.php
       .diy-main 1100px / .main .left 800px    ← views/diy/index.php
   只要其中**任何一处**保留硬性宽度，手机（390×844）打开时 Chrome 就会
   「缩放到适应」(shrink-to-fit)：实测整页缩放 0.328、正文可视字号 3.9px，
   等于不可读。

   【★ 必须理解的机制：为什么 media query 会「不匹配」】
   shrink-to-fit 会把 **layout viewport 一起撑到内容宽度**
   （实测文章页被撑到 1210、选号大厅被撑到 523）。
   而 `@media (max-width:768px)` 是拿 layout viewport 去比较的 ⇒
   内容越宽、断点越不匹配 ⇒ 移动端规则永远不生效，形成死锁。
   ⇒ 所以本文件必须在 **≤1190 这一档**就先把「所有顶层外壳」压到视口宽，
     让 layout viewport 一开始就不被撑开，后面的 ≤980 / ≤768 才谈得上生效。

   【加载位置】
   注册点**不在 layout**，而在 frontend/assets/AppAsset.php 的 $css 数组末尾。
   实测 layout 里的 registerCssFile() 输出会早于 bundle 里的
   public.css / style.css / index.css（顺序：theme → site-theme → …
   → share → public → style → index），放在 layout 等于「先加载、后被覆盖」。

   【设计口径】
   · base 层（>1190px）刻意不写任何规则：桌面端渲染与改动前逐像素一致。
   · 四档断点 1190 / 980 / 768 / 480，向下逐级放开。
   · 「兜底网」只用 max-width / min-width，**不写 width** ——
     只允许收缩、不允许撑破，因此不会把原本正常的桌面布局改大。
   ========================================================================== */

/* --------------------------------------------------------------------------
   ① ≤1190px：容器由「固定宽」改为「流体」
   -------------------------------------------------------------------------- */
@media (max-width: 1190px) {

    /* ★★ 第一优先级：清掉硬性最小宽度。
       它们才是「整页被缩放」的直接原因 —— 只要还剩一个，页面就还是 0.328 倍。 */
    .page-head,
    .page-head .top,
    .page-head .nav,
    .footer,
    .m-banner {
        min-width: 0 !important;
    }

    /* ★★ 第二优先级：body 直挂的页面外壳一律「最多视口宽」。
       老模板每张页面都自带一个固定宽包裹层（.page-head / .yc_box / .yc_dqwz_B /
       .diy-main / .positionBar / .footer …），点名不现实且一定漏；这里统一设上限。
       注意只用 max-width：max-width 会覆盖 width，所以
       `.yc_box{width:1190px}` 在 390 视口下自动变成 390，无需再写 width:auto。 */
    body > div,
    body > section,
    body > main,
    body > article {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    /* 固定宽容器 → 宽度自适应、上限仍是原设计宽 */
    .main,
    .page-head .main,
    .page-head .top .main,
    .page-head .pheader.main,
    .page-head .nav .main,
    .w, #header, #selection, #filter, #main, #links, #footer, #RelateWord,
    .music-head, .music-body, .music-foot, .banner-ad,
    .footer .foot-body,
    .product-detail-head,
    .productContent .tabHead {
        width: auto !important;
        max-width: 1190px;
        box-sizing: border-box;
    }

    /* 左右各留 10px 呼吸位（桌面下 .main 的 margin:0 auto 不受影响） */
    .main,
    .footer .foot-body {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* 导航背景遮罩条 #bj 原本按 1190 宽 + left:50%/margin-left:-595px 居中，
       流体化之后必须跟着改，否则露出 595px 的横向溢出 */
    #bj {
        left: 0 !important;
        right: 0;
        margin-left: 0 !important;
        width: auto !important;
    }

    /* ★ 分页器的「float + relative left:50%」居中黑魔法（style.css:1234 / 1240）：
       .page-cont{float:left;position:relative;left:50%}
       .page-inner{float:left;position:relative;left:-50%}
       position:relative 的偏移不受父级裁剪，会**计入 scrollable overflow** ——
       实测选号大厅 documentElement.scrollWidth 被它顶到 523（父级只有 375）。
       改为标准居中写法，视觉一致但不再产生溢出。 */
    .page-navigator .page-cont,
    .page-navigator .page-inner {
        float: none !important;
        position: static !important;
        left: 0 !important;
    }

    .page-navigator .page-inner {
        display: inline-block;
    }

    /* 媒体类元素不允许撑破容器 */
    img, video, iframe, embed, object, table {
        max-width: 100%;
    }

    /* 表格允许在自己内部横向滚动，而不是把整页顶宽 */
    table {
        display: block;
        overflow-x: auto;
    }
}

/* --------------------------------------------------------------------------
   ② ≤980px：右侧栏先收，主栏撑满
   -------------------------------------------------------------------------- */
@media (max-width: 980px) {

    /* style.css 的两栏骨架：#infolist.cleft 830px + #rightframe.cright 160px */
    #infolist.cleft,
    #rightframe.cright {
        width: auto !important;
        float: none !important;
    }

    /* 文章详情的两栏：.newpage_L 859px(float:left) + .newpage_R 290px(float:right)
       —— 视图内联样式，见 views/article/view.php */
    .newpage_L,
    .newpage_R {
        width: auto !important;
        float: none !important;
        clear: none !important;
        padding-left: 0;
        padding-right: 0;
    }

    .newpage_R {
        padding-left: 0;
    }

    /* DIY 页两栏：.diy-main 1100px / .diy-main .left 800px */
    .diy-main,
    .diy-main .left {
        width: auto !important;
        float: none !important;
    }

    /* 头部右侧 288×80 的广告位在小屏只会挤爆一行，直接隐藏 */
    .index_top_picture {
        display: none !important;
    }
}

/* --------------------------------------------------------------------------
   ③ ≤768px：纵向堆叠（手机）
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {

    body {
        font-size: 14px;
        -webkit-text-size-adjust: 100%;
    }

    /* ---- 顶部信息条 ---- */
    .page-head .top {
        height: auto !important;
        padding: 3px 0;
        line-height: 22px;
    }

    .page-head .top .main {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 4px 10px;
    }

    .page-head .top .zcxx,
    .page-head .top .fright {
        float: none !important;
        clear: none !important;
    }

    .page-head .top .menu,
    .page-head .top .menu li {
        height: 22px;
    }

    /* ---- LOGO / 主菜单 / 搜索框：由横排改为纵向堆叠 ---- */
    .page-head .pheader {
        height: auto !important;
        padding-bottom: 10px;
    }

    .logo,
    .page-head .pheader .menu2,
    .page-head .pheader .serch {
        float: none !important;
        clear: none !important;
    }

    .logo {
        width: auto !important;
        height: auto !important;
        margin: 10px auto 0 !important;
        text-align: center;
    }

    .logo img {
        width: 200px !important;
        height: auto !important;
    }

    .page-head .pheader .menu2 {
        margin: 6px 0 0 !important;
    }

    .page-head .pheader .menu2 > ul {
        display: flex;
        flex-wrap: wrap;
        gap: 2px;
        justify-content: center;
    }

    .page-head .pheader .menu2 li > a {
        font-size: 14px;
        height: 24px;
        padding: 6px 8px;
    }

    .page-head .pheader .serch {
        width: auto !important;
        max-width: 420px;
        margin: 10px auto 0 !important;
        height: auto;
    }

    .top-scrolldoorFrame,
    .top-scrollUl {
        width: auto !important;
    }

    .serchbd {
        width: auto !important;
        max-width: none;
    }

    .sbd {
        width: 100% !important;
        box-sizing: border-box;
    }

    /* 城市选择器面板原本固定 385px */
    .menu2 .city,
    .cityfl,
    .rcc-con,
    .rcc-con div > span {
        width: auto !important;
    }

    .menu2 .city {
        left: 0 !important;
        right: 0;
        padding: 0 10px;
    }

    /* ---- 主导航：换行平铺，不再横向撑开 1190px ---- */
    .page-head .nav {
        height: auto !important;
    }

    .page-head .nav .main {
        display: flex;
        flex-wrap: wrap;
        padding: 0;
    }

    .nav li {
        float: none !important;
        width: auto !important;
        min-width: 0;
        flex: 1 1 24%;
        height: 36px;
        line-height: 36px;
        font-size: 14px;
    }

    .nav li > a {
        height: 36px;
        line-height: 36px;
    }

    .nav li:last-child {
        float: none !important;
        flex: 1 1 100%;
        width: 100% !important;
    }

    .nav li:last-child a {
        width: 100% !important;
    }

    /* 下拉子菜单原本 position:absolute + left:-100px + 固定 800/400px，
       窄屏改为就地铺开，避免整体溢出 */
    .nav .childnav {
        position: static !important;
        left: 0 !important;
        width: auto !important;
        height: auto !important;
        padding: 4px 6px;
    }

    .nav .childnav > span {
        margin: 0 3px;
    }

    /* ---- 内容区固定宽块 ---- */
    .product-detail-head,
    .productContent .tabHead,
    .music-head,
    .music-body,
    .music-foot,
    .banner-ad {
        width: auto !important;
    }

    /* 文章详情的右侧「热门 / 号码」小格子原本 289px 宽 + 143px 两列 */
    .dp_hmlist1,
    .hot-article .link a,
    .hmbt-more {
        width: auto !important;
    }

    .dp_hmlist1 li,
    .dp_hmlist1 li a {
        width: 50% !important;
    }

    /* 内容图按比例缩放；导航/按钮里的小图标不动，避免把雪碧图拉变形 */
    .w img,
    #main img,
    #selection img,
    .productContent img,
    .article img,
    .content img {
        height: auto;
    }

    /* ---- 页脚 ---- */
    .footer .foot-body .foot-info {
        float: none !important;
        height: auto !important;
        padding-top: 12px;
    }

    .b_nav li {
        width: auto !important;
        float: none !important;
    }

    /* ★★ 兜底网 ★★
       老模板里「px 固定宽 + float」的组合数以百计（1170/1100/1080/975/901/859/
       830/570/520/290…），逐个点名既不现实也一定会漏；漏掉一个，整页就又会被
       撑到那个宽度、断点继续失效。
       这里给**所有页面外壳内的后代**设上限：只许收缩、不许撑破。
       只写 max-width / min-width / box-sizing，不写 width ——
       因此对 >768px 的桌面端零影响。 */
    .main *,
    .w *,
    #main *,
    #selection *,
    #filter *,
    #links *,
    #footer *,
    #RelateWord *,
    .page-head *,
    .footer *,
    body > div *,
    body > section *,
    body > main * {
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    /* ★ 兜底网的「白名单」：轮播 / 跑马灯的内部轨道必须比容器宽，这是设计使然
       （溢出的那部分由父级 overflow:hidden 裁掉）。若不豁免，max-width:100%
       会把轨道压成容器宽，轮播与跑马灯会直接坏掉。 */
    .swiper-wrapper,
    .swiper-slide,
    .swiper-container,
    .top-scrollUl,
    .top-scrolldoorFrame,
    .liMarquee,
    [class*="marquee-"] {
        max-width: none !important;
    }
}

/* --------------------------------------------------------------------------
   ④ ≤480px：小屏微调
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {

    .main,
    .footer .foot-body {
        padding-left: 8px;
        padding-right: 8px;
    }

    .logo img {
        width: 168px !important;
    }

    .nav li {
        flex: 1 1 32%;
        font-size: 13px;
    }

    .page-head .pheader .menu2 li > a {
        padding: 5px 6px;
    }
}
