/* ── Microwants 移动端补丁（技术支持系页面 + 通用）· 2026-07-25 ──
   本文件在页面内联 <style> 之后加载，因此可覆盖同特异性的旧规则。
   解决实测问题：药典页在 390px 下整页横向溢出（scrollWidth 614）、
   顶部固定标签条压住面包屑、首屏过高、触控目标偏小。 */

@media (max-width:900px){
  /* 1) 药典四部切换：原 repeat(4,1fr) 在窄屏未回落，是横向溢出的主因 */
  .yd-acc{grid-template-columns:1fr !important;gap:10px;}
  .yd-ac-full{grid-column:auto !important;margin-top:0;}
  .yd-grid{grid-template-columns:1fr !important;}

  /* 2) 宽表格：横向滚动 + 代号列吸附，避免整页被撑破
        注意 grid/flex 子项默认 min-width:auto，会被宽表格顶开，必须逐层归零 */
  .main,.page,.calc-cols,.calc-cols>.calc-wrap,.yd-acc,.yd-ac,.yd-ep,.prod-section{min-width:0;}
  .tbl-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;width:100%;max-width:100%;min-width:0;padding-bottom:2px;}
  .tbl-scroll>table{min-width:0;font-size:12.5px;}
  /* 药典对照表：列多且每格都是长句，必须给足列宽再横滑，
     否则列被挤到 90px、单行高度能到 1000px 以上（实测） */
  .tbl-scroll>table.yd-table{min-width:940px;table-layout:fixed;}
  .tbl-scroll>table.yd-table th:nth-child(1),.tbl-scroll>table.yd-table td:nth-child(1){width:104px;}
  .tbl-scroll>table.yd-table th:nth-child(2),.tbl-scroll>table.yd-table td:nth-child(2){width:330px;}
  .tbl-scroll>table.yd-table th:nth-child(3),.tbl-scroll>table.yd-table td:nth-child(3){width:290px;}
  .tbl-scroll>table.yd-table th:nth-child(4),.tbl-scroll>table.yd-table td:nth-child(4){width:216px;}
  .tbl-scroll td.yd-code,.tbl-scroll thead th:first-child{
    position:sticky;left:0;background:var(--white,#fff);z-index:2;
    box-shadow:1px 0 0 rgba(0,0,0,.06);}
  .tbl-hint{font-size:11.5px;color:var(--ink-3,#7a7e8e);margin:6px 0 14px;}

  /* 3) 固定标签条不再压住面包屑与标题 */
  body.is-mobile .hero{padding-top:76px !important;}

  /* 4) 首屏更紧凑（原 hero 在 390px 下高 310–403px，占首屏近一半） */
  .hero h1{font-size:clamp(1.55rem,6.4vw,2rem) !important;line-height:1.18;margin-bottom:10px;}
  .hero-desc{font-size:14.5px;line-height:1.75;}
  .breadcrumb{font-size:12.5px;margin-bottom:12px;flex-wrap:wrap;}
  .hero-eyebrow{margin-bottom:10px;}

  /* 5) 触控目标：标签 ≥40px，折叠头与按钮 ≥44px */
  .nav-toggle{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;}
  footer a{padding:4px 0;display:inline-block;}
  body.is-mobile .mob-tab{min-height:40px;display:inline-flex;align-items:center;padding:8px 14px;}
  .faq-q,.yd-ac-h,.trouble-q,.trouble-h{min-height:46px;}
  .calc-btn,.sb-item,.mob-tab-link{min-height:44px;}

  /* 6) 卡片内边距与表单在窄屏收紧 */
  .calc-cols>.calc-wrap{padding:18px 16px;}
  .yd-toolbar input[type=text]{min-width:0;width:100%;}
  .yd-lnum input{width:100%;}
}

@media (max-width:480px){
  body.is-mobile .hero{padding:74px 1rem 26px !important;}
  .sec-h2{font-size:1.35rem !important;line-height:1.3;}
  .tbl-scroll>table{font-size:12px;}
}

@media (max-width:640px){
  /* 手机竖屏：药典表隐去 USP 英文原文列，让「中文释义 / 可提供产品」优先可读
     （英文原文仍在 HTML 源码中，搜索引擎与 AI 抓取不受影响，桌面端照常显示） */
  .tbl-scroll>table.yd-table{min-width:680px;table-layout:auto;}
  .tbl-scroll>table.yd-table th:nth-child(2),
  .tbl-scroll>table.yd-table td:nth-child(2){display:none;}
  .tbl-scroll>table.yd-table th:nth-child(1),
  .tbl-scroll>table.yd-table td:nth-child(1){width:96px;}
  .tbl-scroll>table.yd-table th:nth-child(3),
  .tbl-scroll>table.yd-table td:nth-child(3){width:auto;min-width:300px;}
  .tbl-scroll>table.yd-table th:nth-child(4),
  .tbl-scroll>table.yd-table td:nth-child(4){width:250px;}
}

@media (max-width:640px){
  /* 技术支持首页的三张入口卡：按钮全宽，触控更稳 */
  .entry-btn{display:flex !important;width:100%;justify-content:center;min-height:48px;
             align-items:center;font-size:15px !important;}
}
