/* ============================================================
   移动端：原生 App 风格重构
   目标观感：iOS/Android 原生应用 —— 分组卡片、胶囊按钮、
   毛玻璃导航、底部 Tab Bar、安全区、舒服的触摸尺寸
   ============================================================ */

@media (max-width: 920px) {
  /* 桌面两栏 → 单栏 */
  .hero-grid, .clone-layout, .api-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  :root {
    --r-md: 18px;
    --r-lg: 22px;
  }

  html { scroll-padding-top: 76px; }
  body {
    background: var(--bg-0);
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); /* 给 Tab Bar 留位 */
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
  }
  .bg-grid { background-size: 44px 44px; opacity: 0.35; }

  .container { width: calc(100% - 32px); }
  .section-pad { padding-block: 72px; }
  .section-head { margin-bottom: 36px; }
  .section-head p { font-size: 15px; margin-top: 14px; }
  h1 { font-size: clamp(38px, 10.5vw, 54px); line-height: 1.12; }
  h2 { font-size: clamp(28px, 7.5vw, 38px); }

  /* ---------- 顶部导航：App 顶栏 ---------- */
  .site-header { height: 58px; }
  .nav-wrap { gap: 12px; }
  .nav-links { display: none; } /* 导航交给底部 Tab Bar */
  .brand { font-size: 18px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .brand-mark svg { width: 18px; height: 18px; }
  .brand-sub { display: none; }
  .nav-actions { margin-left: auto; gap: 8px; }
  .nav-actions .btn-primary { display: none; }
  .lang-switch { padding: 2px; }
  .lang-switch a { font-size: 11px; padding: 5px 9px; }

  /* ---------- Hero ---------- */
  .hero { padding-top: 56px; padding-bottom: 24px; }
  .hero-badge { font-size: 11px; }
  .hero-lead { font-size: 15.5px; margin-top: 18px; }
  .hero-cta { margin-top: 30px; gap: 10px; }
  .hero-cta .btn { flex: 1; padding: 14px 16px; font-size: 14px; border-radius: 14px; }
  .hero-trust { gap: 12px 20px; margin-top: 34px; font-size: 11.5px; }

  /* ---------- 演示卡片：App 内卡片 ---------- */
  .demo-shell { border-radius: 22px; }
  .demo-body { padding: 18px; }
  .demo-topbar { padding: 11px 14px; }
  .waveform { height: 78px; }
  .demo-textarea { font-size: 14px; min-height: 76px; }
  .demo-row { grid-template-columns: 1fr; gap: 10px; }
  .field-select { padding-block: 13px; font-size: 14px; }
  .demo-actions .btn { padding: 14px; border-radius: 14px; }
  .icon-btn { width: 48px; height: 48px; flex-basis: 48px; }
  .player audio { min-width: 0; }

  /* ---------- 数据条：2×2 分组 ---------- */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0; padding-block: 8px; }
  .stat { padding: 22px 12px; }
  .stat:nth-child(odd) { border-right: 1px solid var(--border); }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .stat + .stat { border-left: 0; }
  .stat strong { font-size: 27px; }

  /* ---------- 功能卡片：单列 iOS 分组样式 ---------- */
  .feature-grid { grid-template-columns: 1fr; gap: 12px; }
  .feature-card { padding: 20px; border-radius: 18px; display: flex; gap: 16px; align-items: flex-start; }
  .feature-card:hover { transform: none; }
  .feature-icon { width: 42px; height: 42px; flex: 0 0 42px; margin-bottom: 0; border-radius: 12px; }
  .feature-icon svg { width: 21px; height: 21px; }
  .feature-card h3 { margin-bottom: 5px; font-size: 16px; }
  .feature-card p { font-size: 13px; }
  .feature-card::after { display: none; }

  /* ---------- 克隆 / API 区 ---------- */
  .clone-visual { padding: 20px; border-radius: 20px; }
  .clone-step { padding: 14px 0; }
  .code-panel pre { font-size: 11.5px; padding: 16px; }
  .api-ep { padding: 11px 12px; }
  .api-ep code { font-size: 11.5px; }
  .api-ep span { font-size: 11px; }

  /* ---------- FAQ ---------- */
  .faq-q { font-size: 14.5px; padding: 19px 34px 19px 0; }
  .faq-a { font-size: 13px; padding-right: 30px; }

  /* ---------- CTA / 页脚 ---------- */
  .final-cta { padding: 56px 20px; border-radius: 24px; margin-inline: 0; }
  .final-cta p { font-size: 14px; }
  .site-footer { margin-top: 72px; padding-top: 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom { margin-top: 36px; }

  /* ---------- 原生 App 底部 Tab Bar ---------- */
  .tabbar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(9, 11, 19, 0.86);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-top: 1px solid var(--border);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; color: var(--text-3); font-size: 10px; font-weight: 600;
    position: relative; transition: color 0.2s;
    -webkit-user-select: none; user-select: none;
  }
  .tab svg { width: 22px; height: 22px; transition: transform 0.25s var(--ease-spring); }
  .tab.active { color: var(--brand-1); }
  .tab.active svg { transform: translateY(-2px) scale(1.08); }
  .tab.active::before {
    content: ""; position: absolute; top: 0; width: 26px; height: 3px;
    border-radius: 0 0 4px 4px; background: var(--brand-1);
  }
  .tab:active svg { transform: scale(0.88); }
}

@media (max-width: 380px) {
  .hero-trust { font-size: 10.5px; }
  .stat strong { font-size: 24px; }
  .feature-card { gap: 12px; padding: 16px; }
}
