/* ==========================================================================
   layout.css — 导航 / 页脚 / 区块容器 / 栅格
   ========================================================================== */

/* ---------- 通用区块 ---------- */

.section {
  padding: 88px var(--gutter);
}

.section--tight {
  padding: 64px var(--gutter);
}

.section--wash {
  background: var(--brand-wash);
}

/* 文档页：整页统一到一条内容列，避免各区块右边缘参差 */
.section--doc > * {
  max-width: 1200px;
}

.section__head {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
}

.section__head .lead {
  max-width: 780px;
}

/* ---------- 顶部导航 ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.nav--plain {
  position: static;
  background: #fff;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav__logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--brand-soft);
  object-fit: contain;
  padding: 3px;
}

.nav__name {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 34px;
}

.nav__link {
  font-size: 15px;
  font-weight: 500;
  color: #4b5563;
  transition: color 0.18s;
}

.nav__link:hover {
  color: var(--brand);
}

.nav__link[aria-current="page"] {
  color: var(--brand);
  font-weight: 600;
}

.nav__toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.nav__toggle:hover {
  background: var(--surface-alt);
}

/* ---------- 页脚 ---------- */

.footer {
  padding: 48px var(--gutter);
  background: var(--surface-footer);
  color: #7d8794;
}

.footer__top {
  display: flex;
  gap: 56px;
  justify-content: space-between;
  padding-bottom: 32px;
}

.footer__brand {
  max-width: 420px;
}

.footer__name {
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.footer__desc {
  font-size: 14px;
  line-height: 1.7;
}

.footer__cols {
  display: flex;
  gap: 56px;
}

.footer__col h3 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 14px;
}

.footer__col li + li {
  margin-top: 10px;
}

.footer__col a {
  font-size: 14px;
  transition: color 0.18s;
}

.footer__col a:hover {
  color: #fff;
}

.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 24px;
  border-top: 1px solid #1f242c;
  font-size: 13px;
  color: #5c6672;
}

/* ---------- 栅格 ---------- */

.grid {
  display: grid;
  gap: 20px;
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---------- 响应式 ---------- */

@media (max-width: 1100px) {
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .section,
  .section--tight {
    padding: 56px var(--gutter);
  }

  .nav__links {
    display: none;
  }

  .nav__toggle {
    display: flex;
  }

  .nav__links.is-open {
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 24px var(--gutter) 32px;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }

  .footer__top {
    flex-direction: column;
    gap: 36px;
  }

  .footer__cols {
    flex-wrap: wrap;
    gap: 36px;
  }

  .footer__bottom {
    flex-direction: column;
    gap: 8px;
  }
}
