/**
 * resources.html 移动端适配（2026-06-13）
 * 覆盖 MICOUNT 学习总览 / TOC / AI 专节 / 表格横滑
 */
@media (max-width: 767px) {
  body:has(#learning-resources-2026),
  body:has(#resources-page-toc) {
    overflow-x: clip;
  }

  #learning-resources-2026,
  #resources-ai-2026,
  #resources-page-toc,
  #quick-index-section,
  #third-party-section,
  #feature-updates-section,
  #troubleshooting-section {
    max-width: 100%;
    min-width: 0;
  }

  /* 有二级导航的 resources 页：网格强制单列 */
  body:has(#learning-resources-2026) .grid[class*="md:grid-cols"],
  body:has(#resources-page-toc) .grid[class*="md:grid-cols"],
  body:has(#learning-resources-2026) .grid[class*="lg:grid-cols"],
  body:has(#resources-page-toc) .grid[class*="lg:grid-cols"] {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* 页内 TOC：可横滑 + 换行 */
  #resources-page-toc .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  #resources-page-toc .flex.flex-wrap {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
    gap: 0.5rem;
  }

  #resources-page-toc .flex.flex-wrap::-webkit-scrollbar {
    display: none;
  }

  #resources-page-toc .flex.flex-wrap a {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* 表格：容器内横滑，不撑破 viewport */
  .resources-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .resources-table-wrap table {
    min-width: min(640px, 100%);
  }

  .resources-table-hint {
    display: block;
    font-size: 0.7rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
  }

  /* Hero / section 间距（有 platform-subnav 时） */
  body:has(.platform-subnav) section[class*="pt-28"],
  body:has(.platform-subnav) section[class*="pt-24"] {
    padding-top: 1.25rem !important;
  }

  body:has(#learning-resources-2026) section[class*="py-12"],
  body:has(#learning-resources-2026) section[class*="py-10"] {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }

  /* 卡片 hover 缩放易致窄屏溢出 */
  body:has(#learning-resources-2026) .hover\:scale-105,
  body:has(#resources-page-toc) .hover\:scale-105 {
    transform: none !important;
  }

  /* AI 区 CTA 按钮堆叠全宽 */
  #resources-ai-2026 .flex.flex-wrap.justify-center {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  #resources-ai-2026 .flex.flex-wrap.justify-center a {
    width: 100%;
    justify-content: center;
    margin-left: 0 !important;
    margin-top: 0.5rem;
  }

  #resources-ai-2026 .flex.flex-wrap.justify-center a:first-child {
    margin-top: 0;
  }

  /* traffic hub 已有规则，resources 页 footer 前 hub 换行 */
  body:has(#learning-resources-2026) .site-traffic-hub .traffic-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 768px) {
  .resources-table-hint {
    display: none;
  }
}
