/* ==========================================================================
   GridCMS · 移动端适配（≤760px）与触控细节
   加载顺序：main.css → theme-copper.css → 组件 → mobile.css（本文件最后）
   ========================================================================== */

/* ---------- 基础：字号与间距节奏 ---------- */
@media (max-width: 760px) {
  html { -webkit-text-size-adjust: 100%; }

  .section { padding: 56px 0; }
  .section-sm { padding: 30px 0; }
  .container, .container-wide { padding-left: 18px; padding-right: 18px; }

  .h-1 { font-size: 26px; line-height: 1.3; }
  .h-2 { font-size: 23px; line-height: 1.32; }
  .lead { font-size: 14px; line-height: 1.75; }

  /* 标题内换行在窄屏容易断得难看，允许自然折行 */
  .h-1 br, .h-2 br { display: none; }

  /* ---------- 首屏 ---------- */
  .hero { padding: 78px 0 24px; }
  .hero-inner { gap: 28px; }
  .hero-badge { font-size: 10.5px; padding: 6px 12px; letter-spacing: .1em; }
  .hero .lead { font-size: 14px; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  /* 遥测条：4 行 → 2×2 */
  .telemetry {
    margin-top: 26px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .telemetry .t-cell {
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    padding: 12px 14px;
  }
  .telemetry .t-cell:nth-child(1),
  .telemetry .t-cell:nth-child(2) { border-top: none; }
  .telemetry .t-cell:nth-child(odd) { border-left: none; }
  .telemetry .t-label { font-size: 10px; }
  .telemetry .t-num { font-size: 20px; }

  /* 首屏双卡：单列，图更高更好认 */
  .hero-duo { gap: 12px; }
  .hero-duo .hshot img { aspect-ratio: 4 / 3; }
  .hcap { padding: 12px 14px 14px; }

  /* ---------- 指标条 ---------- */
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid .stat-cell { padding: 18px 14px; }
  .stats-grid .s-num { font-size: 26px; }
  .stats-grid .s-label { font-size: 11px; line-height: 1.5; }
  .stats-note { font-size: 11px; text-align: left; padding: 0 4px; }

  /* ---------- 数据流四步 ---------- */
  .flow-grid, .pipeline { grid-template-columns: 1fr; }
  .step, .flow-step { padding: 18px 16px; }

  /* ---------- 产品双卡 ---------- */
  .duo-grid { grid-template-columns: 1fr; gap: 14px; }
  .duo-grid > .duo-card { padding: 22px 18px; }
  .duo-grid .duo-card h3 { font-size: 21px; margin: 12px 0 8px; }
  .duo-grid .duo-card p { font-size: 13.5px; line-height: 1.7; }
  .duo-grid .duo-img { margin-top: 14px; border-radius: 10px; }
  .duo-grid .duo-foot { margin-top: 16px; gap: 12px; }
  .duo-grid .duo-foot .btn { width: 100%; justify-content: center; }

  /* ---------- SKU ---------- */
  .sku-grid { grid-template-columns: 1fr; gap: 14px; }
  .sku-card { padding: 22px 18px; }
  .sku-card .sku-foot { flex-wrap: wrap; gap: 12px; }
  .sku-card .sku-foot .btn { width: 100%; justify-content: center; }

  /* ---------- 能力卡 ---------- */
  .cap-grid { grid-template-columns: 1fr; gap: 12px; }
  .cap-card { padding: 20px 18px; }
  .cap-card h3 { font-size: 17px; }
  .cap-card p { font-size: 13.5px; line-height: 1.7; }

  /* ---------- 场景横向滚动 ---------- */
  .h-scroll { gap: 14px; padding-left: 18px; padding-right: 18px; }
  .h-scroll .sol-card { flex: 0 0 84vw; }
  .h-scroll .sol-card h3 { font-size: 19px; }
  .h-scroll .sol-body { padding: 16px 16px 18px; }
  .h-scroll-nav { display: none; }

  /* ---------- 终端 / 代码 ---------- */
  .api-wrap { grid-template-columns: 1fr; gap: 22px; }
  .terminal, .term-block, .code-block { border-radius: 12px; }
  .term-body, .terminal pre {
    font-size: 11.5px !important;
    line-height: 1.7;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .term-head { padding: 10px 12px; }
  .term-head .term-title { font-size: 10.5px; }
  .api-step { padding: 14px 0; }
  .api-step h3 { font-size: 15px; }

  /* ---------- 表格 ---------- */
  .table-wrap, .spec-table, .data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 560px; }

  /* ---------- 定价 ---------- */
  .price-grid, .prices { grid-template-columns: 1fr !important; gap: 14px; }
  .price-card { padding: 24px 20px; }
  .price-card .price-amount b { font-size: 30px; }

  /* ---------- 安全 / 页脚 ---------- */
  .sec-grid { grid-template-columns: 1fr; }
  .sec-item { padding: 18px 0; }
  .foot-main { grid-template-columns: 1fr !important; gap: 26px; padding-bottom: 34px; }
  .foot-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    font-size: 11.5px;
    padding: 16px 0 20px;
  }
  .site-footer { padding-top: 48px; }

  /* ---------- 表单：避免 iOS 聚焦缩放 ---------- */
  input, textarea, select, .form-field input { font-size: 16px; }

  /* ---------- 触控友好 ---------- */
  .btn { min-height: 44px; }
  .site-nav a, .foot-col a { padding-top: 6px; padding-bottom: 6px; }
}

/* ---------- 小屏（≤400px）进一步收紧 ---------- */
@media (max-width: 400px) {
  .container, .container-wide { padding-left: 14px; padding-right: 14px; }
  .h-1 { font-size: 24px; }
  .stats-grid { grid-template-columns: 1fr; }
  .telemetry { grid-template-columns: 1fr; }
  .telemetry .t-cell { border-left: none; }
  .telemetry .t-cell:nth-child(2) { border-top: 1px solid var(--border); }
}

/* ---------- 平板微调（761–1024px） ---------- */
@media (min-width: 761px) and (max-width: 1024px) {
  .section { padding: 80px 0; }
  .duo-grid { gap: 18px; }
  .duo-grid > .duo-card { padding: 28px 26px; }
  .cap-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 移动端菜单（浅色主题） ---------- */
@media (max-width: 960px) {
  .mobile-menu {
    background: rgba(251, 251, 248, .98);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }
  .mobile-menu nav a { color: var(--text); font-size: 19px; padding: 14px 0; }
  .mobile-menu nav a small { color: var(--text-faint); }
  .mobile-menu-head { margin-bottom: 22px; }
  .mobile-menu .btn { margin-top: 24px; }
  .menu-toggle { display: flex; }
  .site-nav { display: none; }
}

/* ---------- 价格档位表：移动端堆叠 ---------- */
@media (max-width: 700px) {
  .compare-table { display: block; overflow: visible; min-width: 0; }
  .compare-table thead { display: none; }
  .compare-table tbody, .compare-table tr, .compare-table th, .compare-table td { display: block; width: auto !important; }
  .compare-table tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: #fff;
  }
  .compare-table tbody th {
    font-size: 15px;
    font-weight: 700;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
  }
  .compare-table td { padding: 6px 0; border: 0; font-size: 13.5px; }
  .compare-table td::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 96px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: .06em;
    color: var(--text-faint);
  }
  .table-wrap { overflow: visible; }
  .table-wrap table { min-width: 0; }
}

/* ---------- 数据表堆叠（data-stack） ---------- */
@media (max-width: 700px) {
  table[data-stack] { display: block; min-width: 0; border: 0; }
  table[data-stack] thead { display: none; }
  table[data-stack] tbody, table[data-stack] tr,
  table[data-stack] th, table[data-stack] td { display: block; width: auto !important; }
  table[data-stack] tr {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 14px 14px 10px;
    margin-bottom: 10px;
  }
  table[data-stack] td { border: 0; padding: 4px 0; font-size: 13.5px; line-height: 1.65; }
  table[data-stack] td:first-child {
    font-weight: 700; font-size: 14.5px; color: var(--text);
    padding: 0 0 8px; margin-bottom: 6px;
    border-bottom: 1px dashed var(--border);
  }
  table[data-stack] td:first-child::before { display: none; }
  table[data-stack] td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .08em;
    color: var(--text-faint);
    margin-bottom: 2px;
  }
}

/* 堆叠表格：取消桌面端固定行高，否则内容重叠 */
@media (max-width: 700px) {
  table[data-stack] tbody tr,
  table[data-stack] tr { height: auto !important; }
  table[data-stack] tbody th,
  table[data-stack] td { display: block; }
}
