/* ============================================================
   纽约华人网360 — 移动端体验增强 (mobile-polish)
   全站通用的手机端 UI 优化，由 pwa.js 注入到 <head>，
   并在少数未加载 pwa.js 的页面中直接 <link> 引入。
   原则：只做低风险、渐进增强的规则；桌面端不受影响。
   ============================================================ */

/* ── 1. 基础触感与排版 ─────────────────────────────────── */
html{
  -webkit-text-size-adjust:100%;   /* 防止 iOS 横屏时文字被自动放大 */
  text-size-adjust:100%;
}
body{
  -webkit-font-smoothing:antialiased;     /* 手机端文字更清晰锐利 */
  -moz-osx-font-smoothing:grayscale;
}
/* 去除移动端点击时的灰/蓝高亮块，交互更接近原生 App */
a,button,input,select,textarea,label,summary,
.p-item,.lt-card,.mob-cat-card,.mob-quick-item,.mob-nav a,
.sf-pill,.lt-tab,.hot-tag,.faq-q,.today-notice-item,[onclick]{
  -webkit-tap-highlight-color:transparent;
}

/* ── 2. 键盘可达性：聚焦轮廓（仅键盘，不影响鼠标/触摸点击） ── */
a:focus-visible,button:focus-visible,
input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:2px solid var(--p,#1a6fc4);
  outline-offset:2px;
}

/* ── 3. iOS 输入框聚焦自动放大修复 ────────────────────────
   iOS Safari 会在聚焦 font-size < 16px 的输入框时自动缩放整页，
   导致布局抖动、横向溢出。手机端将文本类输入统一为 16px。 */
@media(max-width:899px){
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=button]):not([type=submit]):not([type=reset]),
  textarea,select{
    font-size:16px !important;
  }
}

/* ── 4. iPhone 安全区域（刘海 / 底部 Home Indicator） ──────
   底部固定导航与页面内容预留系统手势条空间，避免被遮挡。
   非刘海机型 env()=0，对老设备零影响。 */
@media(max-width:899px){
  .mob-nav{
    padding-bottom:env(safe-area-inset-bottom,0px);
  }
  /* 仅对存在底部导航的页面追加底部内边距，避免内容被导航盖住 */
  body:has(.mob-nav){
    padding-bottom:calc(60px + env(safe-area-inset-bottom,0px));
  }
  /* 顶部毛玻璃导航在已安装 PWA / 横屏刘海机型预留顶部安全区 */
  .mob-header{
    padding-top:calc(10px + env(safe-area-inset-top,0px));
  }
}

/* ── 5. 横向滚动容器：顺滑惯性滚动，避免连带翻页 ──────────── */
.today-notice,.lt-filter-tabs,.img-carousel-wrap,.media-scroller,.sub-tags{
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
}

/* ── 6. 触摸目标：保证可点击元素有足够的点按高度（无障碍 ≥40px） ── */
@media(max-width:899px){
  .footer-nav a,.footer-legal a,.footer-areas a{
    display:inline-flex;align-items:center;min-height:32px;
  }
}
