/* ============================================================
 * WorkBuddy 移动端 SEO 补丁 · v3 · 2026-12-05（48px 触摸目标）
 * 解决：触摸目标 <48px、中文正文字号偏小、图片 CLS
 * 作用域：仅移动端 (max-width:768px)，桌面端零影响
 * v3：触摸目标从 44 提升到 48（Google 2026）；原 v2：补充主题按钮（hamburger/search/toggle）与卡片标题链接
 * ============================================================ */
@media (max-width: 768px) {
  /* 1) 主导航链接 */
  nav a, nav button,
  [class*="navbar"] a, [class*="mainnav"] a,
  [id*="mainnav"] a, [class*="menu-item"] > a,
  .ztw-lang-btn, .lang-btn, .lang-menu a {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
  }
  /* 2) 主题移动端按钮（hamburger/search/toggle）：主题CSS用 min-height:0 覆盖，需提权 */
  button.dt_mobilenav-topbar-toggle,
  button.dt_navbar-search-toggle,
  button.hamburger,
  button.dt_mobilenav-mainmenu-toggle,
  [class*="mobilenav"] button,
  [class*="navbar-search"] button {
    min-width: 48px !important;
    min-height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  /* 3) 内容卡片标题链接（inline → inline-flex，保证触摸高度） */
  .dt_item_title > a, [class*="item_title"] > a {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
  }
  /* 4) 页脚链接 */
  footer a, .footer a, .site-footer a,
  [class*="site-footer"] a, [class*="footer-bottom"] a {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    padding-top: .55rem;
    padding-bottom: .55rem;
  }
  /* 5) 社交图标链接 */
  .social-links a, .social a, [class*="social-icon"] a,
  [class*="share"] a, a[aria-label]:empty {
    min-width: 48px;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* 6) 中文正文 ≥16px：不限定容器，覆盖全站正文段落 */
  html[lang="zh-CN"] p, html[lang="zh-Hans"] p, html[lang="zh"] p,
  .blog-post p, .blog-list-item p {
    font-size: 16px;
    line-height: 1.75;
  }
  /* 7) 表格不撑破视口 */
  table { max-width: 100%; }
}

/* === WorkBuddy v4 补充（2026-12-05）：提高特异性，主题 min-height:44px 覆盖 === */
@media (max-width: 768px) {
  /* 主题卡片按钮/横幅（44px → 48px），用 !important 覆盖内联/高特异性主题规则 */
  html body a[class*="btn"], html body button[class*="btn"],
  html body .dt_button, html body [class*="dt_button"],
  html body a[class*="button"], html body .elementor-button,
  html body nav a, html body nav button,
  html body [class*="navbar"] a, html body [class*="mobilenav"] button,
  html body footer a, html body [class*="footer"] a {
    min-height: 48px !important;
  }
  /* 纯图标/无文字按钮宽高都补足 */
  html body button:empty, html body a:empty,
  html body [class*="toggle"], html body [class*="hamburger"] {
    min-width: 48px !important;
    min-height: 48px !important;
  }
}
