/* ==============================================
   H5 / Mobile Responsive Enhancements
   共享样式 — AI 产业趋势报告系列
   覆盖 26 份报告 + 首页
   ============================================== */

/* ===========================================
   通用 H5 变量覆盖与基础优化
   =========================================== */
:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

/* ===========================================
   Tablet Portrait — 768px 以下
   =========================================== */
@media (max-width: 768px) {
  /* --- Container --- */
  .container { padding: 0 24px; }
  .nav-inner { padding: 0 24px; }

  /* --- Navigation: 压缩间距 --- */
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 12px; }
  .nav-logo { font-size: 12px; }

  /* --- Hero --- */
  .hero { padding: 64px 0 40px; }
  .hero-layout { grid-template-columns: 1fr; gap: 32px; }
  .hero-title { font-size: clamp(30px, 7vw, 48px); margin-bottom: 18px; }
  .hero-sub { font-size: 14px; margin-bottom: 28px; }
  .hero-meta { gap: 14px; }
  .hero-meta-item { font-size: 10px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
  .hero::after { width: 100%; height: 400px; top: -60px; }

  /* --- Stats --- */
  .stat-card { padding: 16px; }
  .stat-value { font-size: 20px; }
  .stat-value .unit { font-size: 12px; }
  .stat-delta { font-size: 10px; }

  /* --- Section --- */
  .section-title { font-size: clamp(24px, 5vw, 34px); }
  .section-sub { font-size: 14px; margin-bottom: 28px; }

  /* --- Trends --- */
  .trends { padding: 48px 0 24px; }
  .trends-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .trend-card { padding: 22px; }
  .trend-card-title { font-size: 15px; }
  .trend-card-desc { font-size: 12px; }
  .trend-card-stat { font-size: 20px; }
  .trend-icon { width: 36px; height: 36px; font-size: 18px; }

  /* --- Timeline --- */
  .timeline-grid { grid-template-columns: 1fr; gap: 32px; padding: 48px 0; }
  .timeline-steps { gap: 0; }

  /* --- Market --- */
  .market { padding: 48px 0; }
  .market-grid { grid-template-columns: 1fr; gap: 28px; }

  /* --- FDA / Data Section --- */
  .fda { padding: 48px 0; }
  .fda-grid { grid-template-columns: 1fr; gap: 28px; }
  .fda-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .fda-stat { padding: 16px 14px; }
  .fda-stat-val { font-size: 22px; }
  .fda-stat-label { font-size: 11px; }
  .fda-bar-row { gap: 10px; }
  .fda-bar-year { font-size: 10px; width: 30px; }
  .fda-bar-total { font-size: 10px; width: 30px; }

  /* --- Challenges --- */
  .challenges { padding: 48px 0; }
  .chal-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .chal-card { padding: 22px; }
  .chal-num { font-size: 36px; }
  .chal-title { font-size: 15px; }

  /* --- Predictions --- */
  .predictions { padding: 48px 0; }
  .pred-item { grid-template-columns: 36px 1fr; padding: 20px 22px; gap: 14px; }
  .pred-meta { display: none; }
  .pred-num { font-size: 16px; }
  .pred-title { font-size: 14px; }
  .pred-desc { font-size: 12px; }

  /* --- Footer --- */
  footer { padding: 40px 0 28px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; align-items: flex-start; }
  .footer-heading { font-size: 10px; }
  .footer-text { font-size: 12px; }

  /* --- Divider --- */
  .divider { margin: 0 0 48px; }
}

/* ===========================================
   Phone — 480px 以下
   =========================================== */
@media (max-width: 480px) {
  /* --- Container --- */
  .container { padding: 0 16px; }
  .nav-inner { padding: 0 16px; height: 48px; }

  /* --- Navigation: 隐藏文字链接，仅留 Logo + Badge --- */
  .nav-links { display: none; }
  .nav-logo { font-size: 11px; gap: 7px; }
  .nav-logo-dot { width: 7px; height: 7px; }
  .nav-badge { font-size: 9px; padding: 2px 7px; }

  /* --- Hero --- */
  .hero { padding: 48px 0 28px; }
  .hero-eyebrow { margin-bottom: 16px; }
  .hero-tag { font-size: 10px; }
  .hero-line { max-width: 36px; }
  .hero-layout { gap: 24px; }
  .hero-title { font-size: clamp(25px, 8vw, 34px); margin-bottom: 14px; }
  .hero-sub { font-size: 13px; line-height: 1.65; margin-bottom: 22px; }
  .hero-meta { gap: 10px; }
  .hero-meta-item { font-size: 9px; gap: 5px; }
  .hero-meta-dot { width: 4px; height: 4px; }
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero::after { height: 300px; top: -40px; opacity: 0.7; }

  /* --- Stats --- */
  .stat-card { padding: 14px; border-radius: 10px; }
  .stat-label { font-size: 8px; }
  .stat-value { font-size: 18px; }
  .stat-value .unit { font-size: 11px; }
  .stat-delta { font-size: 9px; padding: 2px 6px; }

  /* --- Section --- */
  .section-label { font-size: 10px; margin-bottom: 10px; }
  .section-title { font-size: clamp(21px, 6vw, 27px); margin-bottom: 8px; }
  .section-sub { font-size: 13px; margin-bottom: 22px; }

  /* --- Trends: 单列 --- */
  .trends { padding: 36px 0 16px; }
  .trends-grid { grid-template-columns: 1fr; gap: 10px; }
  .trend-card { padding: 18px; border-radius: 10px; }
  .trend-icon { width: 32px; height: 32px; font-size: 16px; margin-bottom: 12px; border-radius: 8px; }
  .trend-card-label { font-size: 9px; margin-bottom: 6px; }
  .trend-card-title { font-size: 14px; margin-bottom: 6px; }
  .trend-card-desc { font-size: 12px; margin-bottom: 14px; }
  .trend-card-stat { font-size: 18px; }
  .trend-card-stat-label { font-size: 10px; }

  /* --- Timeline --- */
  .timeline-grid { padding: 36px 0; gap: 20px; }
  .timeline-step { gap: 12px; padding-bottom: 18px; }
  .step-dot { width: 8px; height: 8px; margin-top: 4px; }
  .step-phase { font-size: 9px; }
  .step-title { font-size: 12px; }
  .step-desc { font-size: 11px; }
  .step-badge { font-size: 9px; padding: 2px 6px; margin-top: 4px; }

  /* --- Market --- */
  .market { padding: 36px 0; }
  .market-grid { gap: 20px; }
  .market-chart-title { font-size: 9px; margin-bottom: 14px; }
  /* SVG scale down */
  .market-grid svg { max-width: 100%; height: auto; }

  /* --- FDA section --- */
  .fda { padding: 36px 0; }
  .fda-grid { gap: 20px; }
  .fda-bars { gap: 8px; }
  .fda-bar-row { gap: 7px; }
  .fda-bar-year { font-size: 9px; width: 26px; }
  .fda-bar-bg { height: 18px; border-radius: 3px; }
  .fda-bar-fill { border-radius: 3px; }
  .fda-bar-count { font-size: 9px; padding-right: 5px; }
  .fda-bar-total { font-size: 9px; width: 26px; }
  .fda-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .fda-stat { padding: 14px 12px; }
  .fda-stat-val { font-size: 20px; }
  .fda-stat-label { font-size: 10px; }
  .fda-stat-sub { font-size: 9px; }

  /* --- Challenges --- */
  .challenges { padding: 36px 0; }
  .chal-grid { grid-template-columns: 1fr; gap: 10px; }
  .chal-card { padding: 18px; border-radius: 10px; }
  .chal-num { font-size: 30px; margin-bottom: 8px; }
  .chal-title { font-size: 14px; margin-bottom: 6px; }
  .chal-desc { font-size: 12px; }
  .chal-pills { margin-top: 12px; gap: 5px; }
  .chal-pill { font-size: 9px; padding: 2px 6px; }

  /* --- Predictions --- */
  .predictions { padding: 36px 0; }
  .pred-list { gap: 8px; }
  .pred-item { grid-template-columns: 24px 1fr; padding: 16px; gap: 10px; border-radius: 10px; }
  .pred-num { font-size: 14px; }
  .pred-title { font-size: 13px; margin-bottom: 4px; }
  .pred-desc { font-size: 11px; }

  /* --- Footer --- */
  footer { padding: 32px 0 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 18px; margin-bottom: 28px; }
  .footer-heading { font-size: 9px; margin-bottom: 10px; }
  .footer-text { font-size: 11px; }
  .footer-bottom { padding-top: 16px; }
  .footer-copy { font-size: 9px; }

  /* --- Divider --- */
  .divider { margin: 0 0 32px; }

  /* --- Animation: 减少动画偏移 --- */
  .animate-in { transform: translateY(14px); transition: opacity 0.45s ease, transform 0.45s ease; }
}

/* ===========================================
   小屏手机 — 375px 以下
   =========================================== */
@media (max-width: 375px) {
  .container { padding: 0 12px; }
  .nav-inner { padding: 0 12px; height: 44px; }
  .nav-logo { font-size: 10px; }

  .hero { padding: 36px 0 20px; }
  .hero-title { font-size: clamp(22px, 9vw, 28px); }
  .hero-sub { font-size: 12px; }
  .hero-stats { gap: 6px; }
  .hero-meta { gap: 6px; }

  .section-title { font-size: 20px; }
  .section-sub { font-size: 12px; }

  .trends-grid { gap: 8px; }
  .trend-card { padding: 14px; }
  .trend-card-title { font-size: 13px; }

  .pred-item { padding: 14px; gap: 8px; }
  .pred-num { font-size: 13px; }
  .pred-title { font-size: 12px; }

  .stat-card { padding: 12px; }
  .stat-value { font-size: 16px; }
  .stat-value .unit { font-size: 10px; }

  .footer-bottom { padding-top: 12px; }
  .footer-copy { font-size: 8px; }
}

/* ===========================================
   Landing Page (首页) 专项 H5 适配
   =========================================== */
/* 首页有独立的 .hero-logo, .cat-reports 等结构 */
body .hero-logo { font-size: 12px; }
body .hero-stats-row { gap: 24px; }

@media (max-width: 768px) {
  body .hero-logo { font-size: 11px; padding: 6px 16px; }
  body .hero-stats-row { gap: 20px; }
  body .hero-stat-val { font-size: 26px; }
  body .hero-stat-val .unit { font-size: 14px; }
  body .hero-stat-label { font-size: 10px; }
  body .hero-sub { font-size: 14px; }
  body .cat-reports { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  body .cat-name { font-size: 20px; }
  body .cat-group { margin-bottom: 56px; }
  body .categories { padding: 40px 0 80px; }
  body .footer-desc { font-size: 12px; }
  body .footer-links { gap: 20px; }
}

@media (max-width: 480px) {
  body .hero { padding: 64px 0 40px; }
  body .hero-logo { font-size: 10px; padding: 5px 14px; margin-bottom: 24px; }
  body .hero-logo-dot { width: 6px; height: 6px; }
  body .hero-title { font-size: clamp(32px, 10vw, 42px); }
  body .hero-sub { font-size: 13px; margin-bottom: 32px; }
  body .hero-stats-row { gap: 16px; }
  body .hero-stat-val { font-size: 24px; }
  body .hero-stat-val .unit { font-size: 13px; }
  body .hero-stat-label { font-size: 9px; }
  body .hero-scroll { margin-top: 36px; }
  body .hero-scroll-text { font-size: 9px; }
  body .hero-scroll-arrow { height: 22px; }
  body .cat-header { flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
  body .cat-index { font-size: 10px; }
  body .cat-name { font-size: 18px; }
  body .cat-count { font-size: 10px; }
  body .cat-reports { grid-template-columns: 1fr; gap: 8px; }
  body .cat-group { margin-bottom: 40px; }
  body .categories { padding: 24px 0 60px; }
  body .report-card { padding: 16px 18px; border-radius: 10px; }
  body .report-card-icon { width: 36px; height: 36px; font-size: 18px; border-radius: 8px; }
  body .report-card-vol { font-size: 9px; }
  body .report-card-title { font-size: 13px; }
  body .report-card-desc { font-size: 11px; }
  body .report-card-sub { font-size: 8px; margin-top: 6px; }
  body .report-card-arrow { font-size: 12px; }
  body footer { padding: 48px 0 28px; }
  body .footer-desc { font-size: 11px; margin-bottom: 28px; }
  body .footer-links { gap: 16px; }
  body .footer-links a { font-size: 10px; }
  body .footer-bottom { font-size: 9px; }
}

@media (max-width: 375px) {
  body .hero { padding: 48px 0 28px; }
  body .hero-title { font-size: clamp(26px, 11vw, 34px); }
  body .hero-sub { font-size: 12px; }
  body .hero-stats-row { gap: 12px; }
  body .hero-stat-val { font-size: 22px; }
  body .cat-name { font-size: 16px; }
  body .report-card { padding: 14px; gap: 12px; }
  body .report-card-icon { width: 32px; height: 32px; font-size: 16px; }
}

/* ===========================================
   触控友好增强（所有设备）
   =========================================== */
@media (hover: none) and (pointer: coarse) {
  /* 增大可触控区域 */
  .nav-links a {
    padding: 8px 4px;
    display: inline-block;
  }

  .pred-item {
    cursor: default;
    -webkit-tap-highlight-color: rgba(255,255,255,0.05);
  }

  .report-card {
    cursor: default;
    -webkit-tap-highlight-color: rgba(255,255,255,0.05);
  }

  /* 禁止 hover 时的 transform 动画在触控设备上触发 */
  .trend-card:hover { transform: none; }
  .stat-card:hover { transform: none; }

  /* 用 active 状态替代 */
  .trend-card:active { background: var(--bg-2); border-color: var(--border-strong); }
  .stat-card:active { border-color: var(--border-strong); }
}
