/* =========================================================
   三体游戏 - 站点样式
   设计方向：深色科幻、轻量、无第三方依赖
   结构：变量 → 基础重置 → 布局 → 组件 → 响应式
   ========================================================= */

/* ---------- 1. 设计变量 ---------- */
:root {
  --bg: #05070d;
  --bg-soft: #0a0e18;
  --panel: rgba(255, 255, 255, 0.035);
  --line: rgba(255, 255, 255, 0.09);
  --text: #e8edf7;
  --muted: #99a4ba;
  --cyan: #4fd1ff;
  --violet: #7c5cff;
  --radius: 16px;
  --container: 1120px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 2. 基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* 固定头部占位，避免锚点跳转被遮挡 */
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, p, dl, dd {
  margin: 0;
}

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

/* 仅供屏幕阅读器读取的隐藏文本 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

/* ---------- 3. 顶部导航 ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(5, 7, 13, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* 滚动后由 JS 添加，增强层次 */
.site-header.is-scrolled {
  background: rgba(5, 7, 13, 0.85);
  border-bottom-color: var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* 用纯 CSS 画一个简单的星环标志，避免额外图片请求 */
.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  position: relative;
  box-shadow: 0 0 18px rgba(79, 209, 255, 0.55);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
}

.site-nav {
  display: flex;
  gap: 8px;
}

.site-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

/* 移动端菜单按钮默认隐藏 */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  padding: 11px 10px;
  gap: 5px;
  flex-direction: column;
  justify-content: center;
}

.nav-toggle-bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

/* ---------- 4. 首屏 ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: calc(var(--header-h) + 40px) 0 80px;
  isolation: isolate;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

/* 两层径向光晕，营造深空氛围 */
.hero-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 55% at 50% 38%, rgba(79, 209, 255, 0.16), transparent 70%),
    radial-gradient(45% 40% at 68% 62%, rgba(124, 92, 255, 0.14), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  text-align: center;
  max-width: 820px;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.34em;
  color: var(--cyan);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero-title {
  font-size: clamp(44px, 8vw, 92px);
  line-height: 1.06;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, #ffffff 20%, #bfe9ff 50%, #b7a8ff 80%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 22px;
}

.hero-desc {
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 18px);
  max-width: 560px;
  margin: 0 auto 34px;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease), box-shadow 0.2s ease,
    background 0.2s ease, border-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(120deg, var(--cyan), var(--violet));
  color: #051018;
  box-shadow: 0 10px 30px rgba(79, 209, 255, 0.22);
}

.btn-primary:hover {
  box-shadow: 0 14px 38px rgba(79, 209, 255, 0.32);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

/* 首屏底部的滚动提示 */
.hero-scroll {
  position: absolute;
  bottom: 26px;
  left: 50%;
  translate: -50% 0;
  width: 22px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  justify-items: center;
  padding-top: 7px;
}

.hero-scroll span {
  width: 3px;
  height: 7px;
  border-radius: 3px;
  background: var(--cyan);
  animation: scroll-dot 1.8s ease-in-out infinite;
}

@keyframes scroll-dot {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(9px); }
}

/* ---------- 5. 通用区块 ---------- */
.section {
  padding: clamp(72px, 10vw, 120px) 0;
}

.section-alt {
  background: linear-gradient(180deg, transparent, var(--bg-soft) 18%, var(--bg-soft) 82%, transparent);
  border-block: 1px solid rgba(255, 255, 255, 0.04);
}

.section-head {
  margin-bottom: 42px;
}

.section-head.center {
  text-align: center;
  max-width: 620px;
  margin-inline: auto;
  margin-bottom: 54px;
}

.section-kicker {
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--cyan);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.25;
  font-weight: 600;
}

.section-sub {
  color: var(--muted);
  margin-top: 14px;
}

/* ---------- 6. 关于 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}

.about-body p {
  color: var(--muted);
  margin-bottom: 18px;
}

.about-body p:last-of-type {
  margin-bottom: 0;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 34px;
}

.about-stats > div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.about-stats dt {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.about-stats dd {
  font-size: 15px;
  font-weight: 500;
}

/* ---------- 7. 卡片 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.card {
  position: relative;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  transition: transform 0.3s var(--ease), border-color 0.3s ease,
    background 0.3s ease;
}

/* 悬停时顶部出现一条渐变光带 */
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 209, 255, 0.28);
  background: rgba(255, 255, 255, 0.055);
}

.card:hover::before {
  opacity: 1;
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 18px;
  color: var(--cyan);
  background: rgba(79, 209, 255, 0.1);
  border: 1px solid rgba(79, 209, 255, 0.22);
}

.card-icon svg {
  width: 22px;
  height: 22px;
}

.card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
}

.card p {
  color: var(--muted);
  font-size: 14.5px;
}

/* ---------- 8. 声明 ---------- */
.notice {
  max-width: 760px;
}

.notice p:last-child {
  color: var(--muted);
  margin-top: 18px;
}

/* ---------- 9. 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 30px 0;
  background: rgba(0, 0, 0, 0.25);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--muted);
}

.footer-record a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.footer-record a:hover {
  color: var(--cyan);
}

/* ---------- 10. 滚动进入动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* 尊重系统“减少动态效果”设置 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .hero-scroll span {
    animation: none;
  }
}

/* ---------- 11. 响应式 ---------- */
@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-stats {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    padding: 12px 24px 18px;
    background: rgba(5, 7, 13, 0.96);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    /* 默认收起，由 JS 切换 is-open */
    display: none;
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 12px 10px;
    border-radius: 8px;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}
