/* ============================================================
   金饭碗 · 全站移动端适配（2026-10-24）
   原则：只作用于 <=920px，桌面端零影响；不覆盖各页品牌色
   ============================================================ */
@media (max-width: 920px) {
  html { overflow-x: hidden; }
  /* 2026-11-05：body 不设 overflow-x，避免 iOS Safari/WebView 把 body 变成滚动容器、
     吞掉 fixed 抽屉内部的触摸滚动（表现为「左侧目录打开后滑不动」） */
  body { max-width: 100%; }

  /* ---- 应用页头 / 页签 ---- */
  .app-top { position: static !important; }
  .at-in { padding: 9px 12px !important; gap: 8px !important; }
  .at-brand img { width: 30px !important; height: 30px !important; }
  .at-brand b { font-size: 15px !important; }
  .at-brand span { font-size: 10px !important; }
  .at-tag { display: none !important; }
  .tags-view { padding: 8px 12px 0 !important; gap: 6px !important; }
  .tags-view .tag { padding: 4px 10px !important; font-size: 12px !important; }

  /* ---- 主壳：单列 ---- */
  .shell {
    flex-direction: column !important;
    gap: 12px !important;
    padding: 12px !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
  }
  .main {
    overflow: visible !important;
    padding: 0 !important;
    height: auto !important;
    min-width: 0 !important;
  }

  /* ---- 侧栏 -> 抽屉 ----
     注意：portal_ruoyi_skin.css 在 <=860px 用 html.gj-ruoyi .side{position:static!important;
     width:100%!important} 把侧栏塞回文档流，把整个内容页顶下去一大屏（手机端适配失败根因）。
     此处用 html.gj-ruoyi body 前缀提高特异性夺回，保证任何皮肤下侧栏都是离屏抽屉。 */
  .side, #side,
  html.gj-ruoyi .side, html.gj-ruoyi #side,
  html.gj-ruoyi body .side, html.gj-ruoyi body #side {
    position: fixed !important;
    left: 0; top: 0; bottom: auto;
    z-index: 1200;
    width: 78vw !important;
    min-width: 0 !important;
    max-width: 320px !important;
    height: 100vh !important;
    height: 100dvh !important;   /* 动态视口高度，兼容手机地址栏收放 */
    max-height: 100vh !important;
    max-height: 100dvh !important;
    border-radius: 0 14px 14px 0 !important;
    box-shadow: 0 0 40px rgba(0, 0, 0, .35) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;   /* iOS 惯性滚动 */
    overscroll-behavior-y: contain;      /* 禁止滚动链穿透到背景 */
    touch-action: pan-y;                 /* 明确允许纵向手势 */
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    transform: translateX(-102%) !important;
    transition: transform .22s ease;
  }
  /* 2026-11-06：手机端隐藏桌面皮肤给侧栏定义的常驻滚动条。
     b_console.css 定义 8px、portal_ruoyi_skin.css 定义 6px 深灰条，
     在手机抽屉右边缘形成一条永远可见的「滑动条」。
     只隐藏滚动条外观，overflow-y:auto / touch-action:pan-y 不变，滚动能力不变。 */
  .side, #side,
  html.gj-ruoyi .side, html.gj-ruoyi #side,
  html.gj-ruoyi body .side, html.gj-ruoyi body #side {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .side::-webkit-scrollbar, #side::-webkit-scrollbar,
  html body .side::-webkit-scrollbar,
  html.gj-ruoyi .side::-webkit-scrollbar,
  html.gj-ruoyi body .side::-webkit-scrollbar,
  html.gj-ruoyi body #side::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important;
    background: transparent !important;
  }
  .side::-webkit-scrollbar-thumb, #side::-webkit-scrollbar-thumb,
  html body .side::-webkit-scrollbar-thumb,
  html.gj-ruoyi .side::-webkit-scrollbar-thumb {
    display: none !important;
    background: transparent !important;
  }

  .side.m-open, #side.m-open,
  html.gj-ruoyi .side.m-open, html.gj-ruoyi body .side.m-open { transform: none !important; }

  .m-mask {
    position: fixed; inset: 0;
    overscroll-behavior: contain;
    touch-action: none;
    background: rgba(15, 23, 42, .45);
    z-index: 1190; opacity: 0; pointer-events: none;
    transition: opacity .2s;
  }
  .m-mask.on { opacity: 1; pointer-events: auto; }

  .m-menu-btn {
    position: fixed; left: 12px; bottom: 16px; z-index: 1300;
    width: 48px; height: 48px; border-radius: 50%;
    background: #b45309; color: #fff; border: 0;
    font-size: 20px; line-height: 1;
    display: none; align-items: center; justify-content: center;
    box-shadow: 0 6px 20px rgba(180, 83, 9, .42);
    touch-action: manipulation;
  }
  .m-menu-btn.show { display: flex; }

  /* ---- 布局塌成单列 ---- */
  .grid, .grid2, .grid3, .grid4, .cards, .kpi-row,
  .steps, .cols, .row2, .split, .two-col { grid-template-columns: 1fr !important; }

  /* ---- 内联 style 网格（页面里大量用 style="grid-template-columns:..." 写法）也必须塌成单列，否则横向溢出 ---- */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
  [style*="display:grid"], [style*="display: grid"] { grid-template-columns: 1fr !important; }

  /* ---- 表格横向滚动 ---- */
  .card table, .wrap table, table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }
  table th, table td { white-space: nowrap; }

  /* ---- 触控友好 ---- */
  .btn, .tag, .item, .mi, .navitem, .stab { min-height: 42px; }
  .item, .navitem, .mi { display: flex; align-items: center; }

  /* ---- 媒体与卡片 ---- */
  img, video, iframe { max-width: 100%; }
  .appframe { min-height: 72vh !important; }
  .card { padding: 14px !important; }
  .wrap { padding: 0 12px !important; max-width: none !important; }
  .pg-wrap { padding: 0 12px !important; }

  /* ---- 标题层级 ---- */
  h1 { font-size: 22px !important; }
  .hero h1, .hero-title { font-size: 26px !important; line-height: 1.3 !important; }
  .hero { padding: 40px 0 32px !important; }
  .sec { padding: 30px 0 !important; }

  /* 2026-11-06：手机端「用户属性区」补齐登出入口可见性。
     career.html 页头 .ph-user 内容宽 452px，390px 视口下「退出」按钮被挤到 x=409..452，
     被 html{overflow-x:hidden} 裁掉，用户找不到登出。
     只让这一行可换行 / 次要文案收敛 / 退出按钮不收缩并高亮；不动 DOM 结构，桌面端零影响。 */
  .page-header .ph-user {
    flex-wrap: wrap !important;
    max-width: 100% !important;
    min-width: 0 !important;
    justify-content: flex-end !important;
    row-gap: 4px !important;
  }
  .page-header .ph-user .ph-meta {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  .page-header .ph-user .ph-meta > * { min-width: 0 !important; max-width: 100% !important; }
  .page-header .ph-user.dense .ph-gp {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
  .page-header .ph-user .ph-out,
  .page-header .ph-user .ph-edit { flex: none !important; }
  .page-header .ph-user .ph-out {
    color: #b91c1c !important;
    border-color: #fca5a5 !important;
    background: #fff5f5 !important;
    font-weight: 600 !important;
    z-index: 2;
  }

  /* 2026-11-06：首页已登录时的紧凑「用户属性 + 退出登录」条。
     只作用于 .pn-home，未登录首页不渲染该条，其它门户页顶栏零影响。 */
  .pn-wrap.pn-home .pn-inner { flex-wrap: wrap !important; }
  .pn-wrap.pn-home .pn-user { margin-left: 0 !important; flex: none !important; }
  .pn-wrap.pn-home .pn-user .pn-ubox { padding: 3px 6px !important; gap: 5px !important; }
  .pn-wrap.pn-home .pn-user .pn-uav { width: 26px !important; height: 26px !important; flex: none !important; }
  .pn-wrap.pn-home .pn-user .pn-uname {
    max-width: 88px !important; overflow: hidden !important;
    text-overflow: ellipsis !important; white-space: nowrap !important;
  }
  .pn-wrap.pn-home .pn-user .pn-ulogout { flex: none !important; }
  .pn-wrap.pn-home .pn-user .pn-uprog,
  .pn-wrap.pn-home .pn-user .pn-ulv,
  .pn-wrap.pn-home .pn-user .pn-uid { display: none !important; }
}

@media (max-width: 560px) {
  .cards { grid-template-columns: 1fr !important; }
  .at-brand div > b { font-size: 14px !important; }
  .btn { padding: 10px 14px !important; }
  h1 { font-size: 20px !important; }
  .hero h1, .hero-title { font-size: 23px !important; }
  .m-menu-btn { left: 10px; bottom: 14px; width: 46px; height: 46px; }
}
