/* ==========================================================================
   STRODIO ASTROLABE DESIGN SYSTEM (星舵信标设计语言)
   Visual Metaphor: Deep Horizon & Beacon Pulse (深空视界与信标脉冲)
   ========================================================================== */

:root {
  /* ---------- 1. Color Palette: Dark Horizon (Default) ---------- */
  --bg-space: #080a10;
  --bg-surface: #0f131d;
  --bg-surface-elevated: #161c2b;
  --bg-surface-active: #1d2538;
  --bg-glass: rgba(12, 16, 25, 0.78);
  --bg-glass-card: rgba(18, 23, 36, 0.65);

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-beacon: rgba(255, 178, 36, 0.4);
  --line-beacon-hover: rgba(255, 178, 36, 0.7);

  --text-high: #f4f6fb;
  --text-base: #cad1e2;
  --text-muted: #8c96af;
  --text-dim: #5c667e;

  /* Beacon Gold (主信标暖光：温暖、高能、引导) */
  --beacon-gold: #ffb429;
  --beacon-gold-hover: #ffc252;
  --beacon-gold-glow: rgba(255, 180, 41, 0.28);
  --beacon-gold-soft: rgba(255, 180, 41, 0.12);
  --beacon-gold-ink: #160e00;

  /* Vector Cyan (航向矢量青：精密工程、Unity 科技感、雷达测绘) */
  --vector-cyan: #00e5ff;
  --vector-cyan-glow: rgba(0, 229, 255, 0.32);
  --vector-cyan-soft: rgba(0, 229, 255, 0.1);

  /* Live Pulse (运行状态绿) */
  --pulse-live: #22c55e;
  --pulse-live-glow: rgba(34, 197, 94, 0.35);

  /* Legacy Semantic Aliases (保持与现有 HTML 语义平滑兼容) */
  --bg: var(--bg-space);
  --bg-soft: var(--bg-surface);
  --card: var(--bg-surface-elevated);
  --text: var(--text-high);
  --muted: var(--text-base);
  --brand: var(--beacon-gold);
  --brand-soft: var(--beacon-gold-soft);
  --brand-ink: var(--beacon-gold-ink);
  --accent: var(--vector-cyan);

  /* ---------- 2. Typography Ladder (Fluid Clamp) ---------- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;

  --fs-xs: clamp(0.72rem, 0.68rem + 0.2vw, 0.78rem);       /* ~11.5px - 12.5px */
  --fs-sm: clamp(0.82rem, 0.78rem + 0.2vw, 0.88rem);       /* ~13px - 14px */
  --fs-base: clamp(0.95rem, 0.91rem + 0.2vw, 1.02rem);     /* ~15px - 16.3px */
  --fs-md: clamp(1.08rem, 1.02rem + 0.3vw, 1.18rem);       /* ~17px - 19px */
  --fs-lg: clamp(1.25rem, 1.15rem + 0.5vw, 1.45rem);       /* ~20px - 23px */
  --fs-xl: clamp(1.55rem, 1.35rem + 1.0vw, 1.95rem);       /* ~25px - 31px */
  --fs-display: clamp(2.15rem, 1.7rem + 2.2vw, 3.25rem);   /* ~34px - 52px */

  --lh-tight: 1.18;
  --lh-snug: 1.35;
  --lh-base: 1.68;
  --lh-relaxed: 1.82;

  /* ---------- 3. Spacing & Geometry Scale ---------- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --radius: var(--radius-md);

  --maxw: 1060px;

  /* ---------- 4. Depth & Elevation Shadows ---------- */
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 12px 28px -6px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--line);
  --shadow-card-hover: 0 20px 40px -8px rgba(0, 0, 0, 0.7), 0 0 24px -4px var(--beacon-gold-glow), 0 0 0 1px var(--line-beacon);
  --shadow-glow-gold: 0 0 32px -4px var(--beacon-gold-glow);
  --shadow-glow-cyan: 0 0 32px -4px var(--vector-cyan-glow);

  /* ---------- 5. Motion Durations & Easings ---------- */
  --transition-fast: 160ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-normal: 240ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   LIGHT HORIZON THEME (白昼星图模式)
   ========================================================================== */
@media (prefers-color-scheme: light) {
  :root {
    --bg-space: #f6f8fc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #edf1f8;
    --bg-surface-active: #e2e8f4;
    --bg-glass: rgba(246, 248, 252, 0.85);
    --bg-glass-card: rgba(255, 255, 255, 0.78);

    --line: rgba(15, 23, 42, 0.08);
    --line-strong: rgba(15, 23, 42, 0.16);
    --line-beacon: rgba(180, 83, 9, 0.35);
    --line-beacon-hover: rgba(180, 83, 9, 0.65);

    --text-high: #0b111e;
    --text-base: #334155;
    --text-muted: #55637a;
    --text-dim: #8290a8;

    /* Beacon Ochre (浅色下选用对比度达标的琥珀赭金，确保正文与按键无障碍 AA 级) */
    --beacon-gold: #b45309;
    --beacon-gold-hover: #92400e;
    --beacon-gold-glow: rgba(180, 83, 9, 0.2);
    --beacon-gold-soft: rgba(180, 83, 9, 0.1);
    --beacon-gold-ink: #ffffff;

    --vector-cyan: #0891b2;
    --vector-cyan-glow: rgba(8, 145, 178, 0.2);
    --vector-cyan-soft: rgba(8, 145, 178, 0.1);

    --pulse-live: #15803d;
    --pulse-live-glow: rgba(21, 128, 61, 0.24);

    --shadow-sm: 0 2px 8px -2px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 10px 24px -4px rgba(15, 23, 42, 0.08), 0 0 0 1px var(--line);
    --shadow-card-hover: 0 18px 36px -6px rgba(15, 23, 42, 0.14), 0 0 0 1px var(--line-beacon);
  }
}

/* ==========================================================================
   RESET & GLOBAL BASELINE
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: var(--bg-space);
}

body {
  margin: 0;
  background-color: var(--bg-space);
  color: var(--text-base);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  position: relative;
}

/* Starfield coordinate ambient layer */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1.5px 1.5px at 120px 80px, rgba(255, 255, 255, 0.18), transparent),
    radial-gradient(1px 1px at 340px 260px, rgba(255, 180, 41, 0.22), transparent),
    radial-gradient(1.5px 1.5px at 580px 140px, rgba(0, 229, 255, 0.2), transparent),
    radial-gradient(1px 1px at 780px 420px, rgba(255, 255, 255, 0.16), transparent),
    radial-gradient(1.5px 1.5px at 940px 190px, rgba(255, 255, 255, 0.15), transparent);
  background-size: 1000px 600px;
  opacity: 0.8;
}

@media (prefers-color-scheme: light) {
  body::before {
    opacity: 0.35;
    background-image:
      radial-gradient(1.5px 1.5px at 120px 80px, rgba(15, 23, 42, 0.12), transparent),
      radial-gradient(1.5px 1.5px at 580px 140px, rgba(8, 145, 178, 0.14), transparent),
      radial-gradient(1.5px 1.5px at 940px 190px, rgba(180, 83, 9, 0.12), transparent);
  }
}

a {
  color: var(--beacon-gold);
  text-decoration: none;
  transition: color var(--transition-fast), text-decoration-color var(--transition-fast);
}

a:hover {
  color: var(--beacon-gold-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Accessibility Focus Ring (Beacon Aperture) */
:focus-visible {
  outline: 2px solid var(--beacon-gold);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* Accessible Skip Link */
.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--beacon-gold);
  color: var(--beacon-gold-ink);
  padding: var(--space-3) var(--space-5);
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700;
  font-size: var(--fs-sm);
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.skip:focus {
  left: 0;
}

/* ==========================================================================
   LANGUAGE-SPECIFIC POLISH (中英文专用微排版)
   ========================================================================== */
/* 中文特定微调：增强行高、标点悬挂与汉字间距防拥挤 */
:lang(zh),
:lang(zh-Hans),
html[lang^="zh"] body {
  line-height: var(--lh-relaxed);
  letter-spacing: 0.012em;
  word-break: break-word;
}

:lang(zh) h1, :lang(zh-Hans) h1,
:lang(zh) h2, :lang(zh-Hans) h2,
:lang(zh) h3, :lang(zh-Hans) h3 {
  letter-spacing: -0.01em;
  font-weight: 700;
}

/* 英文特定微调：标题微紧缩，富有力量感 */
:lang(en) h1,
:lang(en) h2 {
  letter-spacing: -0.025em;
}

/* ==========================================================================
   HEADER & NAVIGATION (天体磨砂星舵导航)
   ========================================================================== */
header.site {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: background var(--transition-normal), border-color var(--transition-normal);
}

header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 68px;
}

/* Brand Mark: Prism Star Rudder (星舵三维星棱镜) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--text-high);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.brand:hover {
  text-decoration: none;
  opacity: 0.95;
  transform: translateY(-1px);
}

.brand img {
  display: block;
  border-radius: var(--radius-sm);
  box-shadow: 0 0 12px var(--beacon-gold-glow);
}

.brand .mark {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ffc84a 0%, #ff981a 50%, #e67300 100%);
  display: grid;
  place-items: center;
  color: #1a0f00;
  font-weight: 800;
  font-size: 15px;
  box-shadow: 0 2px 10px rgba(255, 166, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
}

.brand .mark::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%);
  transform: rotate(25deg);
  pointer-events: none;
}

nav.site {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  font-size: var(--fs-sm);
  font-weight: 500;
  flex-wrap: wrap;
}

nav.site a {
  color: var(--text-muted);
  position: relative;
  padding: var(--space-1) 0;
  transition: color var(--transition-fast);
}

/* The language pill is also an <a> inside nav.site, so it needs higher
   specificity than the rule above or its horizontal padding is reset to 0. */
nav.site a.lang {
  padding: 0 16px;
}

nav.site a:hover {
  color: var(--text-high);
  text-decoration: none;
}

nav.site a[aria-current="page"] {
  color: var(--text-high);
  font-weight: 600;
}

nav.site a[aria-current="page"]::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--beacon-gold), var(--vector-cyan));
  border-radius: var(--radius-pill);
}

/* Language Switcher Capsule */
.lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: max-content;
  width: auto;
  min-height: 30px;
  box-sizing: border-box;
  padding: 0 16px;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-align: center;
  color: var(--text-muted);
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
}

.lang:hover {
  color: var(--text-high);
  border-color: var(--line-beacon);
  background: var(--bg-surface-elevated);
  box-shadow: 0 0 12px var(--beacon-gold-glow);
  text-decoration: none;
}

/* ==========================================================================
   HEADINGS & CORE TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4 {
  color: var(--text-high);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

h1 {
  font-size: var(--fs-display);
  line-height: var(--lh-tight);
  margin: 0 0 var(--space-4);
  font-weight: 800;
}

h2 {
  font-size: var(--fs-xl);
  line-height: var(--lh-snug);
  margin: 0 0 var(--space-2);
  font-weight: 700;
}

h3 {
  font-size: var(--fs-lg);
  line-height: var(--lh-snug);
  margin: 0 0 var(--space-2);
  font-weight: 600;
}

p {
  margin: 0 0 var(--space-4);
}

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

strong {
  color: var(--text-high);
  font-weight: 600;
}

/* Signature Eyebrow: Instrumental Measurement Tag */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--beacon-gold);
  font-weight: 700;
  margin: 0 0 var(--space-3);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.lead {
  font-size: var(--fs-md);
  color: var(--text-base);
  line-height: var(--lh-base);
  max-width: 64ch;
}

.section-head {
  max-width: 64ch;
  margin-bottom: var(--space-6);
}

.section-head p {
  color: var(--text-muted);
}

/* ==========================================================================
   SECTIONS & SPACING
   ========================================================================== */
main {
  padding-bottom: var(--space-8);
}

section {
  padding: var(--space-8) 0;
  position: relative;
}

/* Horizon Line Divider with Star Meridian */
section + section {
  border-top: 1px solid var(--line);
}

section + section::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--beacon-gold), transparent);
}

/* ==========================================================================
   SIGNATURE ELEMENT 1: HERO (深空视界与信标脉冲矩阵)
   ========================================================================== */
.hero {
  padding: clamp(72px, 8vw, 120px) 0 clamp(64px, 7vw, 96px);
  position: relative;
  background:
    /* Deep star-map coordinate grid lines */
    linear-gradient(to right, var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(to bottom, var(--line) 1px, transparent 1px) 0 0 / 64px 64px,
    /* Beacon pulse flare (Amber gold beacon at top-left) */
    radial-gradient(ellipse 900px 480px at 15% -10%, var(--beacon-gold-glow) 0%, transparent 65%),
    /* Vector ray flare (Vector cyan pulse at bottom-right) */
    radial-gradient(ellipse 700px 420px at 90% 20%, var(--vector-cyan-glow) 0%, transparent 60%);
  overflow: hidden;
}

/* Vignette edge mask to blend seamlessly into background */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 1100px 100% at 50% 50%, transparent 40%, var(--bg-space) 95%);
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 2;
}

.hero h1 {
  max-width: 22ch;
  color: var(--text-high);
}

.hero .lead {
  margin-bottom: var(--space-6);
  max-width: 60ch;
}

/* Action Group */
.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: var(--fs-sm);
  letter-spacing: 0.01em;
  border: 1px solid var(--line-strong);
  background: var(--bg-surface);
  color: var(--text-high);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  user-select: none;
}

.btn:hover {
  text-decoration: none;
  background: var(--bg-surface-elevated);
  border-color: var(--text-muted);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: translateY(0);
}

/* Primary Beacon Flare Button */
.btn.primary {
  background: linear-gradient(135deg, #ffc442 0%, #ff9e1b 100%);
  color: var(--beacon-gold-ink);
  border-color: #ffa826;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--beacon-gold-glow), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
}

.btn.primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn.primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 24px var(--beacon-gold-glow), 0 0 0 2px var(--beacon-gold);
  transform: translateY(-2px);
}

.btn.primary:hover::before {
  transform: translateX(100%);
}

@media (prefers-color-scheme: light) {
  .btn.primary {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: #ffffff;
    border-color: #b45309;
    box-shadow: 0 4px 14px var(--beacon-gold-glow);
  }
}

/* ==========================================================================
   SIGNATURE ELEMENT 2: GAME DECK CARDS (信标雷达游戏卡片)
   ========================================================================== */
.games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.game {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition:
    transform var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal);
  position: relative;
}

.game:hover {
  transform: translateY(-6px);
  border-color: var(--line-beacon);
  box-shadow: var(--shadow-card-hover);
}

.game .cover {
  display: block;
  position: relative;
  background: var(--bg-surface-elevated);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-bottom: 1px solid var(--line);
}

.game .cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: transform var(--transition-smooth), filter var(--transition-smooth);
}

.game:hover .cover img {
  transform: scale(1.04);
}

/* Cover top gradient vignette for readability */
.game .cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8, 10, 16, 0.45) 0%,
    transparent 40%,
    rgba(8, 10, 16, 0.6) 100%
  );
  pointer-events: none;
}

/* Live Pulse Beacon Badge */
.status {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 5px 12px 5px 24px;
  border-radius: var(--radius-pill);
  background: rgba(8, 10, 16, 0.82);
  color: var(--text-high);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.status.live {
  color: var(--text-high);
  border-color: rgba(34, 197, 94, 0.45);
}

/* Beacon live indicator dot with breathing animation */
.status.live::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pulse-live);
  box-shadow: 0 0 0 0 var(--pulse-live-glow);
  animation: beacon-pulse 2.2s infinite ease-out;
}

@keyframes beacon-pulse {
  0% {
    box-shadow: 0 0 0 0 var(--pulse-live-glow);
  }
  65% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.game .body {
  padding: var(--space-5) var(--space-5) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1;
}

.game .body h3 {
  font-size: 1.18rem;
  margin: 0;
  color: var(--text-high);
}

.game .tagline {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
}

.game .links {
  display: flex;
  gap: var(--space-4);
  font-size: var(--fs-sm);
  font-weight: 600;
  flex-wrap: wrap;
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line);
}

.game .links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.game .links a::after {
  content: "→";
  font-family: var(--font-sans);
  font-size: 0.9em;
  transition: transform var(--transition-fast);
}

.game .links a:hover::after {
  transform: translateX(3px);
}

/* ==========================================================================
   SIGNATURE ELEMENT 3: PRECISION PILLARS (精密测绘刻度网格)
   ========================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: var(--space-7);
  align-items: start;
}

@media (max-width: 820px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* Narrow screens: keep the language pill from wrapping into a squashed oval. */
@media (max-width: 640px) {
  header.site .wrap {
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  nav.site {
    gap: var(--space-3);
    row-gap: var(--space-2);
  }
  .lang {
    min-height: 28px;
    padding: 0 12px;
  }
}

.about-grid p {
  color: var(--text-base);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
}

.pillars {
  display: grid;
  gap: var(--space-4);
}

.pillar {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5) var(--space-4) 48px;
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.pillar:hover {
  transform: translateX(4px);
  border-color: var(--line-beacon);
  box-shadow: var(--shadow-card);
}

/* Coordinate datum diamond locator (测绘刻度菱形基准点) */
.pillar::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 24px;
  width: 9px;
  height: 9px;
  background: var(--line-strong);
  transform: rotate(45deg);
  transition: all var(--transition-fast);
}

.pillar:hover::before {
  background: var(--beacon-gold);
  box-shadow: 0 0 10px var(--beacon-gold);
  transform: rotate(45deg) scale(1.2);
}

.pillar h3 {
  font-size: 1.02rem;
  color: var(--text-high);
  margin-bottom: var(--space-1);
}

.pillar p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
  line-height: 1.6;
}

/* ==========================================================================
   CONTACT CARDS (航行日志联络网格)
   ========================================================================== */
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-5);
}

.contact-card {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition:
    transform var(--transition-fast),
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.contact-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-beacon);
  box-shadow: var(--shadow-card);
}

.contact-card h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-1);
}

.contact-card p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
}

.contact-card a {
  font-size: var(--fs-sm);
  font-weight: 600;
  word-break: break-all;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   FOOTER (星轨底线与法律栏)
   ========================================================================== */
footer.site {
  border-top: 1px solid var(--line);
  padding: var(--space-7) 0 var(--space-6);
  font-size: var(--fs-sm);
  color: var(--text-muted);
  background: var(--bg-surface);
  position: relative;
}

footer.site::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-beacon), transparent);
}

footer.site .cols {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6) clamp(40px, 6vw, 80px);
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

footer.site h4 {
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--beacon-gold);
  margin: 0 0 var(--space-3);
  font-family: var(--font-mono);
  font-weight: 700;
}

footer.site ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

footer.site a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

footer.site a:hover {
  color: var(--text-high);
  text-decoration: none;
}

footer.site .legal-line {
  border-top: 1px solid var(--line);
  padding-top: var(--space-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  justify-content: space-between;
  align-items: center;
  font-size: var(--fs-xs);
  color: var(--text-dim);
}

/* ==========================================================================
   LEGAL / PRIVACY & SUPPORT DOCUMENTATION
   ========================================================================== */
.legal {
  max-width: 820px;
  margin: 0 auto;
  padding-top: var(--space-6);
}

.legal h1 {
  margin-bottom: var(--space-2);
}

.legal .meta {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-family: var(--font-mono);
  margin: 0 0 var(--space-2);
}

/* Draft Badge (信标认证/待定徽章) */
.legal .draft {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--beacon-gold-soft);
  color: var(--beacon-gold);
  border: 1px solid var(--line-beacon);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  margin: var(--space-2) 0 var(--space-5);
}

.legal h2 {
  border-top: 1px solid var(--line);
  padding-top: var(--space-6);
  margin-top: var(--space-7);
}

.legal h3 {
  margin-top: var(--space-5);
  font-size: 1.15rem;
}

.legal ul, .legal ol {
  padding-left: var(--space-5);
  color: var(--text-base);
}

.legal li {
  margin: var(--space-2) 0;
}

/* Callout Box (官方信标备忘录) */
.legal .callout {
  background: var(--bg-surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--beacon-gold);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0;
  box-shadow: var(--shadow-sm);
}

.legal .callout p {
  margin-bottom: var(--space-2);
}

.legal .callout p:last-child {
  margin-bottom: 0;
}

/* Table Design for Privacy Rules */
.legal table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-4) 0;
  font-size: var(--fs-sm);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
}

.legal th, .legal td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: var(--space-3) var(--space-4);
  vertical-align: top;
}

.legal th {
  background: var(--bg-surface-elevated);
  color: var(--text-high);
  font-weight: 700;
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.legal td {
  color: var(--text-base);
}

.legal tr:last-child td {
  border-bottom: none;
}

/* Code Snippet Pill */
code {
  background: var(--bg-surface-elevated);
  color: var(--text-high);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 2px 7px;
  font-size: 0.88em;
  font-family: var(--font-mono);
}

/* ==========================================================================
   ACCESSIBILITY & MOTION COMPLIANCE
   ========================================================================== */
@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;
  }

  .status.live::before {
    animation: none;
    box-shadow: 0 0 0 2px var(--pulse-live-glow);
  }

  .btn.primary::before {
    display: none;
  }
}
