/* ==========================================================================
   blocks.css · 跨页面共享的区块
   skip-link / 站头 / 导航 / Hero / 区块头 / 页头 / 数据条 / 深色 CTA / 页脚
   --------------------------------------------------------------------------
   ⚠️ 组件级的 @media 一律紧跟组件定义写在本文件内。
      写到 layout.css 里会被后加载的同名规则静默盖掉（同优先级、后者胜）。
   ========================================================================== */

/* ---------- 跳转到主内容 ---------- */
.skip-link {
  position: fixed;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 11px 20px;
  border-radius: var(--r-xs);
  background: var(--brand);
  color: #fff;
  font-size: var(--fs-xs);
  transition: top 0.15s ease;
}
.skip-link:focus { top: 16px; text-decoration: none; }

/* ==========================================================================
   站头 + 导航
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-6);
  min-height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand__mark {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
}
.brand__name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand--invert .brand__name { color: var(--text-invert); }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-9);
}
.site-nav__list {
  display: flex;
  align-items: center;
  gap: 34px;
}
.site-nav__list a {
  display: block;
  padding-block: 4px;
  border-bottom: 2px solid transparent;
  color: var(--text-body);
  font-size: var(--fs-body);
  font-weight: 500;
}
.site-nav__list a:hover { color: var(--brand-ink); text-decoration: none; }
.site-nav__list a[aria-current="page"] {
  color: var(--brand-ink);
  border-bottom-color: var(--brand);
}

/* 汉堡按钮：独立存在，不依赖页头里任何其它元素。
   它和 .site-nav 一起构成移动端的完整入口。 */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* 移动端导航：渐进增强。
   无 JS 时导航静态展开 —— 手机上永远有入口，不会出现「点不开也没链接」；
   html.js 存在时才折叠成汉堡菜单。 */
@media (max-width: 940px) {
  .site-header__row {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: var(--sp-4) 0;
  }
  .site-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .site-nav__list a {
    padding-block: 14px;
    border-bottom: 1px solid var(--line-soft);
  }
  .site-nav__cta {
    margin-block: var(--sp-5);
    align-self: flex-start;
  }

  .js .site-header__row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-6);
    padding-block: 0;
  }
  .js .nav-toggle { display: flex; }
  .js .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    padding: var(--sp-2) var(--gutter) var(--sp-6);
    background: var(--card);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 32px rgba(26, 22, 20, 0.09);
  }
  .js .site-nav.is-open { display: flex; }
}

/* ==========================================================================
   首页 Hero
   ========================================================================== */
.hero { padding-block: 76px 64px; }

.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 664px;
  align-items: center;
  gap: var(--sp-11);
}

.hero__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-6);
  min-width: 0;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
}
.hero__meta { color: var(--text-muted); font-size: var(--fs-xs); }

/* 三台手机错落排开：两小一大，总宽 196+16+240+16+196 = 664 */
.hero__wall {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.hero__wall .media--phone { width: 196px; }
.hero__wall .media--phone-lg { width: 240px; }

@media (max-width: 1200px) {
  .hero__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-9);
  }
  .hero__body {
    align-items: center;
    text-align: center;
  }
  .hero__cta { justify-content: center; }
  .hero__wall { justify-content: center; }
}

@media (max-width: 760px) {
  .hero { padding-block: var(--sp-9) var(--sp-10); }
  .hero__wall { gap: var(--sp-3); width: 100%; }
  /* 图位可伸缩、有上限，折行交给 flex 自己判断，不写死列数 */
  .hero__wall .media--phone {
    flex: 1 1 0;
    width: auto;
    max-width: 148px;
  }
  .hero__wall .media--phone-lg {
    flex: 1.18 1 0;
    width: auto;
    max-width: 176px;
  }
}

/* ==========================================================================
   区块头 / 页头
   ========================================================================== */
.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.section-head--center {
  align-items: center;
  text-align: center;
}
.section-head__desc {
  color: var(--text-muted);
  font-size: var(--fs-body);
}
/* 深色区里的区块头 */
.section-head--deep h2 { color: var(--text-invert); }
.section-head--deep .section-head__desc { color: var(--text-invert-mute); }

.page-hero { padding-block: var(--sp-12) var(--sp-9); }
.page-hero .container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-4);
}
.page-hero__lead {
  color: var(--text-muted);
  font-size: var(--fs-lead);
  line-height: 1.75;
}

@media (max-width: 640px) {
  .page-hero { padding-block: var(--sp-9) var(--sp-7); }
}

/* ==========================================================================
   数据条（红底）
   ========================================================================== */
.data-bar {
  padding: var(--sp-9) var(--sp-10);
  border-radius: var(--r-lg);
  background: var(--brand);
}
.data-bar__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-5);
}
.data-bar__list li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.data-bar__list strong {
  font-family: var(--font-num);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}
.data-bar__list span {
  max-width: 100%;          /* 极窄屏（<340px）让标签换行，而不是撑出单元格造成横向溢出 */
  font-size: var(--fs-xs);
  color: var(--text-on-brand);
  text-align: center;
}

@media (max-width: 760px) {
  .data-bar { padding: var(--sp-8) var(--sp-6); }
  /* 数据条的数字与标签都是居中的，折成 2 列会把第 3 项单独挤到左半边、
     整条明显偏左。三项就保持三列，靠缩小字号与间距腾空间。 */
  .data-bar__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sp-5) var(--sp-4);
  }
  .data-bar__list strong { font-size: 30px; }
}

/* ==========================================================================
   深色 CTA 条
   ========================================================================== */
.cta-band {
  padding-block: 92px;
  background: var(--deep);
}
.cta-band .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-5);
  text-align: center;
}
.cta-band h2 { color: var(--text-invert); }
.cta-band__sub {
  color: var(--text-invert-mute);
  font-size: var(--fs-body);
}
/* 设计稿这里用的 #6E6459 压深底只有 3.24:1，不达标，统一改用 invert-mute */
.cta-band__note {
  color: var(--text-invert-mute);
  font-size: var(--fs-xs);
}

@media (max-width: 640px) {
  .cta-band { padding-block: var(--sp-12); }
}

/* ==========================================================================
   页脚
   ========================================================================== */
.site-footer { background: var(--deep); }

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-10);
  padding-block: var(--sp-12) var(--sp-8);
}

.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-10);
}

.site-footer__brand {
  flex: 0 0 330px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.site-footer__brand p {
  color: var(--text-invert-mute);
  font-size: var(--fs-xs);
  line-height: 1.9;
}

.site-footer__col {
  flex: 1 1 0;
  min-width: 140px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}
.site-footer__title {
  font-family: var(--font-num);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--accent);
}
.site-footer__col a {
  color: var(--text-invert-mute);
  font-size: var(--fs-sm);
  line-height: 2.15;
}
.site-footer__col a:hover { color: var(--text-invert); }
/* 当前页：页脚里也标一下，避免「关于我们」「用户评价」这两页在页脚里看不出自己在哪 */
.site-footer__col a[aria-current="page"] { color: var(--text-invert); }

.site-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-5);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--line-deep);
  color: var(--text-invert-mute);
  font-size: var(--fs-xs);
}

@media (max-width: 940px) {
  .site-footer__brand { flex: 1 1 100%; }
  .site-footer__top { gap: var(--sp-8); }
}

@media (max-width: 640px) {
  .site-footer__inner { padding-block: var(--sp-10) var(--sp-6); gap: var(--sp-8); }
  .site-footer__bottom {
    flex-direction: column;
    gap: var(--sp-2);
  }
}
