/* ============================================================
   Base — 全局基础、背景纹理、排版、动效
   ============================================================ */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-mono);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text-primary);
  background-color: var(--bg-base);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 网格纹理 + 聚光渐变：参考站的标志性背景 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-subtle) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, black 30%, transparent 75%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(ellipse 50% 40% at 80% -10%, rgba(203, 172, 249, 0.08), transparent),
    radial-gradient(ellipse 40% 35% at 10% 110%, rgba(0, 255, 153, 0.05), transparent);
}

::selection {
  background: var(--accent);
  color: var(--bg-base);
}

/* ---- 排版 ---- */
h1, h2, h3 {
  line-height: var(--leading-tight);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---- 布局工具 ---- */
.container {
  width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.section {
  padding-block: var(--section-gap);
}

.section-title {
  font-size: clamp(var(--text-4xl), 4vw, var(--text-5xl));
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-title .accent {
  color: var(--text-primary);
}

.eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ---- 按语言显隐（配合 i18n.js 切换 <html lang>） ---- */
html[lang="zh-CN"] .only-en {
  display: none;
}

html[lang="en"] .only-zh {
  display: none;
}

/* ---- 动效 ---- */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(8px); }
}

/* 入场显现用 transition 而非 animation：
   animation 的 forwards 填充会持续占用 transform，覆盖悬停变换（如卡片旋转） */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 尊重减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
