/* ============================================================
   百数云 · AI 元数据引擎 — 响应式样式
   Module 2/3: Media Queries (Tablet + Mobile)
   ============================================================ */

/* ================= Tablet (≤ 1024px) ================= */
@media (max-width: 1024px) {
  :root { --header-h: 64px; }

  /* Nav collapses to hamburger */
  .hero-meta-page {
    padding: 110px 0 70px;
    min-height: auto;
  }
  .hero-meta-inner {
    text-align: center;
    padding: 0 16px;
  }
  .hero-meta-inner .hero-actions {
    justify-content: center;
  }

  .site-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 84vw);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    background: var(--paper);
    box-shadow: -20px 0 60px rgba(10, 20, 40, 0.18);
    padding: calc(var(--header-h) + 24px) 32px 40px;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease);
    overflow-y: auto;
    z-index: 999;
  }
  .site-nav.open { transform: translateX(0); }
  .site-header.dark-on-hero .site-nav { background: var(--ink-2); }
  .nav-list { flex-direction: column; align-items: stretch; gap: 6px; }
  .nav-list a {
    display: block;
    font-size: 17px;
    font-weight: 700;
    padding: 13px 8px;
    border-bottom: 1px solid var(--line-2);
  }
  .site-header.dark-on-hero .nav-list a { border-color: rgba(255, 255, 255, 0.08); }
  .nav-list a::after { display: none; }
  .nav-list a.active { color: var(--bronze); }
  .site-header.dark-on-hero .nav-list a.active { color: var(--bronze-lit); }
  .nav-cta { margin-top: 20px; }

  .nav-toggle { display: flex; position: relative; z-index: 1001; }
  /* Keep in sync with the same rule in style.css (@max-width:800px):
     z-index 199 (< .nav 200) so the drawer/dropdown stays sharp above the
     dim layer; NO backdrop-filter — user explicitly wants the menu crisp. */
  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 20, 40, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
    z-index: 199;
  }
  .nav-overlay.show { opacity: 1; visibility: visible; }

  /* Architecture stacks into 3 rows */
  .arch { grid-template-columns: 1fr 1fr; gap: 14px; }
  .arch-arrows { display: none; }
  .arch-engine { grid-column: 1 / -1; grid-row: 1; }
  .arch-sources { grid-row: 2; }
  .arch-arrow-main { display: none; }
  .arch-llm { grid-row: 2; }
  .arch-lbl { margin-bottom: 10px; }

  /* Architecture figure（位图版：收窄留白，让图尽量大） */
  .arch-figure { margin-top: 24px; padding: 12px; }
  .arch-figure img { border-radius: var(--radius-sm); }

  /* Flywheel 2x2 */
  .flywheel { grid-template-columns: 1fr 1fr; }
  .fw-arrow { display: none; }
  .fw-loop { grid-column: 1 / -1; }

  /* Tell grid 2x2 */
  .tell-grid { grid-template-columns: repeat(2, 1fr); }
  .report-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ================= Mobile (≤ 768px) ================= */
@media (max-width: 768px) {
  :root { --header-h: 60px; }

  .section { padding: 64px 0; }

  .grid-3, .grid-2 { grid-template-columns: 1fr; gap: 16px; }

  /* Hero */
  .hero { min-height: auto; }
  .hero-inner { padding-top: calc(var(--header-h) + 20px); }
  .hero-actions .btn, .hero-cta-row .btn { width: 100%; }

  /* Split comparison stacks */
  .split { grid-template-columns: 1fr; gap: 18px; }
  .split-card { min-height: 0; padding: 30px 24px; }

  /* What we are — fix "AI 元数据引擎" icon crowding on mobile */
  .plain-hero {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 20px;
    padding: 28px 24px;
    margin-top: 22px;
  }
  .plain-icon {
    margin: 0 auto;
    width: 160px;            /* lock width → stays 160x160 square (was a tall narrow strip) */
    height: 160px;
    aspect-ratio: 1 / 1;
    font-size: 19px;         /* a touch smaller so 3 lines fit comfortably */
    line-height: 1.4;
  }
  .plain-copy .c-role {
    text-align: center;
    margin-top: 6px;
    margin-bottom: 12px;
  }
  .plain-copy p {
    margin-bottom: 16px;     /* give paragraphs breathing room */
    font-size: 15px;
    line-height: 1.8;
  }
  .plain-key {
    text-align: left;
    margin-top: 18px;
    padding: 14px 18px;
    font-size: 14.5px;
  }

  /* Shot */
  .shot-wrap { grid-template-columns: 1fr; }
  .shot-copy { text-align: center; }
  .shot-copy .s-tag { display: block; }
  .s-quote { text-align: left; }

  /* CTA grid stacks, form on top */
  .cta-grid { grid-template-columns: 1fr; }
  .cta-copy { order: 2; text-align: center; }
  .cta-lead { margin-left: auto; margin-right: auto; }
  .cta-points { text-align: left; max-width: 400px; margin: 0 auto 10px; }
  .contact-form { order: 1; }

  /* Footer */
  .footer-inner { grid-template-columns: 1fr; gap: 32px; text-align: center; }
  .footer-brand p { margin-left: auto; margin-right: auto; }
  .footer-bottom-inner { justify-content: center; text-align: center; }

  /* Cases */
  .case-story-grid { grid-template-columns: 1fr; gap: 14px; }
  .case-metrics { grid-template-columns: 1fr; gap: 10px; }
  .case-m { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .case-m .m-v { margin-bottom: 0; }

  /* Steps */
  .step-hot { order: -1; }
  .steps { gap: 18px; }

  /* Guarantee */
  .gs { min-width: 100%; }

  /* QR Block */
  .qr-row { gap: 20px; justify-content: center; }
  .qr-item { width: 100%; max-width: 260px; }
}

/* ================= Small Mobile (≤ 480px) ================= */
@media (max-width: 480px) {
  .tell-grid { grid-template-columns: 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .brand-text { font-size: 15px; }
  .brand-text small { font-size: 8px; }
  .quote-source { padding: 20px 20px 0; }
  .back-top { right: 14px; bottom: 14px; width: 40px; height: 40px; }
  .qr-row { gap: 12px; }

  /* "AI 元数据引擎" block — tighten further on small screens */
  .plain-hero { padding: 22px 16px; gap: 16px; }
  .plain-icon { width: 140px; height: 140px; font-size: 17px; }
  .plain-copy p { font-size: 14.5px; line-height: 1.75; }
  .plain-copy .c-role { font-size: 12.5px; margin-bottom: 10px; }

  /* 架构图是位图，小屏整张缩到不可读，改为容器内横向滚动看细节 */
  .arch-figure { padding: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .arch-figure img { min-width: 640px; }
  .arch-figure .arch-hint {
    display: block;
    margin: 10px 0 2px;
    font-size: 12.5px;
    color: var(--ink-5);
    text-align: center;
    /* 提示本身不参与横向滚动区宽度计算 */
    position: sticky;
    left: 0;
  }
}

/* ================= Print ================= */
@media print {
  .site-header, .back-top, .scroll-hint, .nav-toggle { display: none !important; }
  .hero { min-height: auto; }
  body { background: #fff; }
}
