/* ========= IVD 法规助手 - 移动端适配 ========= */
/* 针对屏幕宽度 ≤ 640px 的优化 */

@media (max-width: 640px) {

  /* ---- 导航栏 ---- */
  nav .flex.justify-between.h-16 {
    flex-wrap: wrap;
    height: auto !important;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  nav .flex.justify-between.h-16 > div:first-child {
    width: 100%;
    justify-content: center;
    margin-bottom: 6px;
  }
  nav .flex.justify-between.h-16 > div:last-child {
    width: 100%;
    justify-content: center;
    gap: 40px !important;
  }
  nav .flex.justify-between.h-16 a {
    padding-top: 6px !important;
    padding-bottom: 6px !important;
    font-size: 15px !important;
  }

  /* ---- 首页英雄区 ---- */
  .text-center h1 {
    font-size: 1.5rem !important;
    line-height: 1.3 !important;
  }
  .text-center p.text-xl {
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
  }

  /* ---- 三个功能卡片 ---- */
  .grid-cols-1.md\:grid-cols-3 {
    gap: 16px !important;
    margin-top: 24px !important;
  }
  .grid-cols-1.md\:grid-cols-3 > a,
  .grid-cols-1.md\:grid-cols-3 > div {
    padding: 16px !important;
  }
  .grid-cols-1.md\:grid-cols-3 h2 {
    font-size: 1.1rem !important;
  }
  .grid-cols-1.md\:grid-cols-3 p {
    font-size: 0.85rem !important;
  }

  /* ---- 功能特点区域 ---- */
  .mt-16.bg-white.rounded-lg.shadow-md.p-8 {
    padding: 16px !important;
    margin-top: 24px !important;
  }
  .mt-16.bg-white.rounded-lg.shadow-md.p-8 h2 {
    font-size: 1.25rem !important;
  }
  .mt-16.bg-white.rounded-lg.shadow-md.p-8 li span.text-lg {
    font-size: 1rem !important;
  }
  .mt-16.bg-white.rounded-lg.shadow-md.p-8 li > span:last-child {
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
  }

  /* ---- 分页区域 ---- */
  .flex.justify-center.items-center.gap-4 {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .flex.justify-center.items-center.gap-4 button,
  .flex.justify-center.items-center.gap-4 a {
    font-size: 0.85rem !important;
    padding: 8px 16px !important;
  }

  /* ---- py-16 大量上下内边距调整为 py-8 ---- */
  .max-w-7xl.mx-auto.px-4.py-16 {
    padding-top: 32px !important;
    padding-bottom: 32px !important;
  }

  /* ---- 法规筛选栏 ---- */
  select, input[type="text"], input[type="search"] {
    font-size: 16px !important; /* 防止iOS缩放 */
  }

  /* ---- 法规卡片列表 ---- */
  a.block.px-4.py-3 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  a.block.px-4.py-3 h3 {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
  }
  a.block.px-4.py-3 span.text-\[11px\],
  a.block.px-4.py-3 span.text-\[10px\] {
    font-size: 10px !important;
  }

  /* ---- 法规详情页 ---- */
  article.prose {
    max-width: 100% !important;
    padding: 0 8px !important;
    font-size: 0.9rem !important;
  }
  article.prose table {
    display: block !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }

  /* ---- 聊天页面 ---- */
  textarea, input[type="text"] {
    font-size: 16px !important;
  }
  .chat-container {
    padding: 8px !important;
  }
  .chat-message {
    font-size: 0.9rem !important;
    max-width: 90% !important;
  }

  /* ---- 通用触摸目标增大 ---- */
  button, a, select, input[type="submit"] {
    min-height: 44px;
  }
}
