/* mobile.css — 手机端适配（只在 ≤640px 生效，桌面端样式完全不受影响） */

@media (max-width: 640px) {

  /* ============ 1. 导航：兼容两套模板（.nav-in/.navl 首页模板，.nav-inner/.nav-links 博客模板） ============ */
  .nav-inner, .nav-in {
    height: auto !important;
    min-height: 52px;
    flex-wrap: wrap !important;
    padding: 8px 14px !important;
    gap: 4px 10px !important;
  }
  .nav-links, .navl {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100%;
    gap: 6px 14px !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    list-style: none;
  }
  .nav-links li, .navl li { white-space: nowrap; }
  .nav-links a, .navl a {
    white-space: nowrap !important;
    font-size: 0.86rem !important;
    line-height: 1.7;
  }
  .nav-cta, .nav-ct {
    padding: 5px 12px !important;
    font-size: 0.8rem !important;
    border-radius: 8px;
  }
  .nav-brand { font-size: 0.98rem !important; }
  /* 首页模板：缩小 logo 与链接字号，把 3 行压回 2 行 */
  .nav-in img { height: 22px !important; width: auto !important; }
  .navl { gap: 4px 10px !important; }
  .navl a { font-size: 0.82rem !important; padding: 2px 0 !important; }
  .nav .nav-in { row-gap: 2px !important; }

  /* ============ 2. 容器内边距 ============ */
  .article-wrap, .wrap, .sec-in, .hero-in, .hero-card {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* ============ 3. 正文排版 ============ */
  .article-content, .article-content p, .article-content li, .sec p {
    font-size: 1rem !important;
    line-height: 1.9 !important;
  }
  h1, .article-content h1, .hero h1 { font-size: 1.55rem !important; line-height: 1.35 !important; }
  h2, .article-content h2 { font-size: 1.2rem !important; line-height: 1.4 !important; margin-top: 28px !important; }
  h3, .article-content h3 { font-size: 1.06rem !important; }
  .article-meta { font-size: 0.8rem !important; gap: 10px !important; }

  /* ============ 4. 表格：横向滚动，不再撑破页面 ============ */
  .article-content table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    font-size: 0.84rem !important;
    white-space: normal;
    border-collapse: collapse;
  }
  .article-content thead, .article-content tbody, .article-content tr {
    display: table;
    width: 100%;
    table-layout: auto;
  }
  .article-content th, .article-content td {
    padding: 8px 10px !important;
    font-size: 0.84rem !important;
  }
  .geo-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 16px 0 !important;
  }
  .geo-table-wrap th, .geo-table-wrap td {
    padding: 8px 10px !important;
    font-size: 0.82rem !important;
    white-space: normal !important;
  }

  /* ============ 5. 卡片 / 图片 / 代码 ============ */
  .geo-svc-grid { grid-template-columns: 1fr !important; }
  .geo-services, .geo-author, .geo-cta, .geo-tldr { padding: 16px !important; }
  .geo-cta a { display: block !important; margin: 8px 0 !important; }
  .geo-tldr p { font-size: 0.95rem !important; line-height: 1.8 !important; }
  img, svg, video { max-width: 100% !important; height: auto !important; }
  pre, code { white-space: pre-wrap !important; word-break: break-word; }

  /* 长 URL / 长英文串必须能断行，否则整页横向溢出 */
  .article-content :where(p, li, td, dd, span),
  .wrap :where(p, li, td, dd, span),
  .sec :where(p, li, td, dd, span),
  .geo-tldr p {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
  }
  .article-content a, .wrap a, .sec a {
    overflow-wrap: anywhere !important;
    word-break: break-all !important;
  }
  .article-content ul, .article-content ol,
  .wrap ul, .wrap ol, .sec ul, .sec ol {
    padding-left: 1.15em !important;
    margin-left: 0 !important;
  }


  /* ============ 6. 首屏与按钮 ============ */
  .hero { padding-top: 6px !important; }
  .hero-btns, .hero-b { gap: 8px !important; }
  .btn { font-size: 0.95rem !important; padding: 11px 18px !important; }

  /* ============ 7. 页脚与博客卡片 ============ */
  .grid2, .geo-related, .geo-svc-grid { grid-template-columns: 1fr !important; }
  .card { padding: 16px !important; }
  .ft, .ft-in { font-size: 0.78rem !important; line-height: 1.8 !important; }
}
