/* ============================================
   移动端阅读体验优化 (2026-09-09)
   - 正文字号 >= 16px
   - 行高 >= 1.8
   - 无横向滚动
   - 点击区域 >= 44px
   ============================================ */

@media (max-width: 768px) {
  /* 正文：字号 17px、行高 1.9 */
  #content,
  .markdown-body,
  .tailwind-typography {
    font-size: 17px !important;
    line-height: 1.9 !important;
    letter-spacing: 0.01em;
  }

  #content p,
  .markdown-body p,
  .tailwind-typography p {
    font-size: 17px !important;
    line-height: 1.9 !important;
    margin-bottom: 1.1em;
  }

  /* 标题层级收缩，避免手机上过大 */
  #content h1, .markdown-body h1 { font-size: 1.6rem !important; line-height: 1.4 !important; }
  #content h2, .markdown-body h2 { font-size: 1.35rem !important; line-height: 1.45 !important; }
  #content h3, .markdown-body h3 { font-size: 1.15rem !important; line-height: 1.5 !important; }

  /* 代码/表格不撑破屏幕 */
  #content pre,
  .markdown-body pre {
    font-size: 13.5px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  #content img,
  .markdown-body img {
    max-width: 100% !important;
    height: auto !important;
  }

  #content table,
  .markdown-body table {
    display: block;
    overflow-x: auto;
    max-width: 100%;
    font-size: 14px;
  }

  /* 全局防横向滚动 */
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* 点击区域 >= 44px：导航链接、标签、按钮 */
  .menu-dropdown a,
  #filters a,
  nav a,
  .pagination a,
  article a,
  #content a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* 段落内链接保持内联，不强行撑高（避免排版炸开） */
  #content p a,
  .markdown-body p a {
    min-height: auto;
    display: inline;
  }

  button,
  .i-tabler-x,
  [role='button'] {
    min-height: 44px;
    min-width: 44px;
  }

  /* 评论区输入框别太小 */
  #waline input,
  #waline textarea,
  .wl-input,
  .wl-editor {
    font-size: 16px !important; /* iOS 上 <16px 会触发自动缩放 */
    line-height: 1.7;
  }

  /* 精选/分类导航在手机上可横向滑动 */
  .flex.flex-wrap.items-center.gap-2 {
    gap: 0.5rem;
  }
}
