/* ============ 移动端增强（三个页面共用） ============ */
:root{
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

/* 顶部避开刘海 */
header{
  padding-top: calc(12px + var(--safe-t)) !important;
  padding-left: calc(18px + var(--safe-l)) !important;
  padding-right: calc(18px + var(--safe-r)) !important;
}

/* 底部避开 home 指示条 */
footer{
  padding-bottom: calc(24px + var(--safe-b)) !important;
}

/* 输入框字号 >=16px，避免 iOS 聚焦时自动放大 */
@media (max-width: 768px){
  input, select, textarea, button{ font-size: 16px !important; }
  #q, #kw, #url{ font-size: 16px !important; }
  /* 触摸目标最小 44px */
  .btn, .chip, #probeBtn, #vipBtn, #jmBtn, .ep, .acts button, .acts a{
    min-height: 38px;
  }
  /* 卡片更紧凑 */
  .card .acts button, .card .acts a{ min-height: 40px; }
  /* 阅读器底部 */
  .rfoot{ padding-bottom: calc(9px + var(--safe-b)) !important; }
  /* 滚动更顺滑 */
  .rbody, #rBody{ -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
}

/* 禁用长按选中图片（阅读器里误触烦人） */
#rBody img{ -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* 禁用双击缩放（PWA 里会让点击有延迟） */
html{ touch-action: manipulation; }

/* 安装提示条 */
#installBar{
  position: fixed;
  left: 50%; bottom: calc(16px + var(--safe-b));
  transform: translate(-50%, 20px);
  z-index: 500;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 11px 14px 11px 18px;
  background: #1b1f26;
  border: 1px solid #323844;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  font-size: 13px;
  color: #e6e9ee;
  max-width: calc(100vw - 32px);
  opacity: 0;
  transition: all .22s ease;
}
#installBar.on{ display: flex; opacity: 1; transform: translate(-50%, 0); }
#installBar b{ font-weight: 600; }
#installBar .ib-btns{ display: flex; gap: 7px; margin-left: auto; }
#installBar button{
  padding: 7px 14px; border-radius: 7px; cursor: pointer;
  font-size: 12.5px; font-family: inherit; border: 1px solid #323844;
  background: transparent; color: #8b95a5; white-space: nowrap;
}
#installBar button.go{
  background: rgba(79,156,249,.16);
  border-color: rgba(79,156,249,.4);
  color: #4f9cf9; font-weight: 600;
}
#installBar button:active{ opacity: .7; }

/* 移动端底部导航（可选，仅小屏显示） */
@media (max-width: 640px){
  #installBar{ font-size: 12.5px; padding: 10px 12px 10px 14px; }
}
