/* ============================================================
   base.css — 设计令牌 / 重置 / 排版 / 容器
   ============================================================ */

:root {
  /* 颜色 */
  --c-bg: #f7f4ee;
  --c-bg-alt: #efeae0;
  --c-bg-dark: #0b3d4a;
  --c-bg-dark-2: #0f4b5a;
  --c-ink: #0f1b1e;
  --c-ink-soft: #3a4a4e;
  --c-ink-mute: #6b787c;
  --c-primary: #0b3d4a;
  --c-primary-2: #145766;
  --c-mint: #3fb8af;
  --c-amber: #e8a33d;
  --c-amber-dark: #c9871f;
  --c-line: #d9d2c5;
  --c-line-dark: rgba(255, 255, 255, 0.14);
  --c-white: #ffffff;

  /* 圆角与阴影 */
  --radius: 10px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 10px rgba(11, 61, 74, 0.06);
  --shadow-md: 0 14px 36px rgba(11, 61, 74, 0.12);
  --shadow-lg: 0 28px 60px rgba(11, 61, 74, 0.18);

  /* 间距与容器 */
  --max-w: 1240px;
  --gutter: clamp(20px, 4vw, 40px);
  --section-py: clamp(20px, 2.5vw, 30px);

  /* 字体 */
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC",
    "Microsoft Yahei", system-ui, -apple-system, sans-serif;
  --font-display: "Fraunces", "Noto Serif SC", "Times New Roman", serif;

  /* 缓动 */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- 重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-ink);
  background: var(--c-bg);
  font-feature-settings: "tnum" 1, "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
  touch-action: manipulation;
  overscroll-behavior-y: none;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

ul,
ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
  touch-action: manipulation;
}

button {
  border: none;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
  /* 防止 iOS 缩放:字号 ≥ 16px */
  font-size: 16px;
}

/* iOS 安全区适配(刘海/底部 Home 指示条) */
.safe-top { padding-top: env(safe-area-inset-top); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

:focus-visible {
  outline: 2px solid var(--c-mint);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 容器 ---------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- 排版基础 ---------- */
h1,
h2,
h3,
h4,
h5 {
  line-height: 1.2;
  font-weight: 600;
}

p {
  color: var(--c-ink-soft);
}

/* ---------- 区块标题组件(全局复用) ---------- */
.section-head {
  max-width: 720px;
  margin-bottom: clamp(36px, 5vw, 64px);
}

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-mint);
  margin-bottom: 18px;
}

.section-eyebrow .eyebrow-line {
  width: 36px;
  height: 1px;
  background: var(--c-mint);
  display: inline-block;
}

.eyebrow-light {
  color: var(--c-amber);
}
.eyebrow-light .eyebrow-line {
  background: var(--c-amber);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  color: var(--c-ink);
  letter-spacing: 0.01em;
  margin-bottom: 18px;
}

.section-sub {
  font-size: 16px;
  color: var(--c-ink-soft);
  max-width: 60ch;
}

.section-foot {
  margin-top: clamp(36px, 4vw, 56px);
  display: flex;
  justify-content: center;
}

/* ---------- 入场动画基类 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 序列入场:为同区块子元素设置递增 delay */
[data-reveal][data-delay="1"] { transition-delay: 0.08s; }
[data-reveal][data-delay="2"] { transition-delay: 0.16s; }
[data-reveal][data-delay="3"] { transition-delay: 0.24s; }
[data-reveal][data-delay="4"] { transition-delay: 0.32s; }

/* ---------- 滚动条/选区 ---------- */
::selection {
  background: var(--c-primary);
  color: var(--c-bg);
}

/* ---------- 下划线链接 ---------- */
.link-underline {
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.link-underline:hover {
  color: var(--c-amber);
}

/* ---------- 回到顶部按钮 ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-primary);
  color: var(--c-white);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out),
    background 0.3s var(--ease-out);
  /* 适配 iOS 底部安全区 */
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--c-primary-2);
  transform: translateY(-2px);
}
.back-to-top:active {
  transform: translateY(0);
}
.back-to-top svg {
  width: 22px;
  height: 22px;
}

/* ---------- 减弱动画(无障碍) ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 移动端基础优化 ---------- */
@media (max-width: 768px) {
  /* 触摸目标 ≥44px(无障碍标准) */
  .btn {
    min-height: 44px;
    padding-block: 12px;
  }
  .back-to-top {
    width: 44px;
    height: 44px;
    right: 16px;
  }
}

