/* ==========================================================
   base.css · 基础重置 + 全局排版 + 通用工具类
   ========================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--t-main);
  background: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.35;
  color: var(--t-main);
}
h1 { font-size: 40px; }
h2 { font-size: 32px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--c-primary-dark); }

img, svg { display: block; max-width: 100%; }
img { height: auto; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
button { cursor: pointer; border: none; background: none; }

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

::selection {
  background: var(--c-primary);
  color: #fff;
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: rgba(30, 120, 235, .28);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(30, 120, 235, .5); }

/* ---------- 容器与栅格 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}
.container--wide { max-width: 1440px; }

.section { padding: var(--sp-7) 0; }
.section--gray { background: var(--bg-gray); }
.section--dark { background: var(--bg-dark); color: #fff; }
.section--tight { padding: var(--sp-6) 0; }
/* 浅色系层次背景：用于交替排布，避免整站大面积纯白 */
.section--soft { background: var(--bg-soft); }
.section--mist { background: linear-gradient(180deg, #e4eefb 0%, #f0f6fd 100%); }
.section--deep { background: linear-gradient(150deg, #0d1b3a 0%, #17356b 55%, #1e78eb 100%); color: #fff; }
.section--deep .section-head__title,
.section--deep h2 { color: #fff; }
.section--deep .section-head__desc { color: rgba(255, 255, 255, .72); }

.grid {
  display: grid;
  gap: var(--sp-3);
}
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-6 { grid-template-columns: repeat(3, 1fr); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ---------- 区域标题 ---------- */
.section-head {
  text-align: center;
  margin-bottom: var(--sp-5);
}
.section-head__title {
  font-size: 32px;
  font-weight: 700;
  position: relative;
  display: inline-block;
}
.section-head__en {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--t-weak);
  text-transform: uppercase;
  margin-top: 6px;
}
.section-head__line {
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: var(--c-gradient);
  margin: 14px auto 0;
}
.section-head__desc {
  margin-top: 14px;
  color: var(--t-sub);
  font-size: 15px;
}
.section-head--left { text-align: left; }
.section-head--left .section-head__line { margin-left: 0; }
.section-head--white .section-head__title,
.section-head--white h2 { color: #fff; }
.section-head--white .section-head__en { color: rgba(255, 255, 255, .55); }
.section-head--white .section-head__desc { color: rgba(255, 255, 255, .7); }

/* ---------- 文本工具 ---------- */
.text-primary { color: var(--c-primary); }
.text-orange { color: var(--c-orange); }
.text-sub { color: var(--t-sub); }
.text-weak { color: var(--t-weak); }
.text-gradient {
  background: var(--c-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-center { text-align: center; }
.text-ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 滚动入场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }
.reveal--left { transform: translateX(-40px); }
.reveal--right { transform: translateX(40px); }
.reveal--scale { transform: scale(.94); }
.reveal--left.is-in,
.reveal--right.is-in,
.reveal--scale.is-in { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 骨架屏 ---------- */
.skeleton {
  background: linear-gradient(90deg, #eef2f7 25%, #f7f9fc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: skeleton 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes skeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
