/* ============================================================
   LinkX 官网 · 设计系统
   设计 token 与 LinkX 应用同源：
   Platforms/Windows/src/theme.rs + LinkXTheme.kt
   动效纪律沿用产品：克制、无 bounce、尊重 reduced-motion
   ============================================================ */

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

:root {
  --nav-h: 64px;
  --glow-1: rgba(74, 168, 255, 0.16);
  --glow-2: rgba(26, 115, 217, 0.12);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --font-ui: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "Consolas", "Cascadia Mono", ui-monospace, monospace;
  --max-w: 1120px;
  --hero-grid: rgba(122, 167, 214, 0.10);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1B1F25;
  --bg-soft: #161A20;
  --surface: #232830;
  --surface-2: #2A303A;
  --surface-glass: rgba(27, 31, 37, 0.72);
  --text: #E9EDF3;
  --text-2: #9BA4B1;
  --text-3: #6B7382;
  --accent: #4AA8FF;
  --accent-strong: #6CBCFF;
  --accent-soft: #1E3A5C;
  --accent-ink: #CFE4FF;
  --on-accent: #06243F;
  --divider: #323844;
  --ok: #4CD07E;
  --ok-soft: #17301F;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24), 0 2px 8px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.28), 0 12px 32px rgba(0, 0, 0, 0.36);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.32), 0 24px 64px rgba(0, 0, 0, 0.44);
  --shadow-accent: 0 8px 24px rgba(74, 168, 255, 0.22);
  --nav-border: rgba(50, 56, 68, 0.9);
}

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

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { list-style: none; }

::selection { background: var(--accent); color: var(--on-accent); }

/* ---------- 排版 ---------- */

h1, h2, h3 { line-height: 1.22; font-weight: 700; letter-spacing: -0.015em; }

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

.section { padding: clamp(96px, 11vw, 150px) 0; position: relative; }

.section-head { max-width: 720px; margin-bottom: clamp(44px, 6vw, 72px); }
.section-head.center { margin-inline: auto; text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.08em;
  color: var(--accent-strong);
  background: var(--accent-soft);
  padding: 6px 14px; border-radius: 999px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

.section-title {
  font-size: clamp(32px, 4.4vw, 52px);
  margin-bottom: 16px;
  text-wrap: balance;
}
.section-desc { color: var(--text-2); font-size: 18px;  text-wrap: balance; }

.num { font-variant-numeric: tabular-nums; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 46px; padding: 0 26px;
  border-radius: 999px;
  font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease),
              background-color 0.22s var(--ease), border-color 0.22s var(--ease);
  will-change: transform;
}
.btn svg { width: 18px; height: 18px; flex: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #FFFFFF;
  box-shadow: var(--shadow-accent);
}
html[data-theme="dark"] .btn-primary { color: #FFFFFF; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 32px rgba(51, 153, 245, 0.42); }
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  border: 1px solid var(--divider);
  background: var(--surface);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-strong); transform: translateY(-2px); }

/* 深色底上的按钮（黑金 Hero 用） */
.btn-invert {
  background: #FFFFFF; color: #0B0D12;
  box-shadow: 0 8px 28px rgba(96, 165, 250, 0.20);
}
.btn-invert:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(96, 165, 250, 0.32); }
.btn-invert:active { transform: translateY(0); }
.btn-outline-light {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: #F2F5F9;
}
.btn-outline-light:hover { border-color: rgba(255, 255, 255, 0.85); transform: translateY(-2px); background: rgba(255, 255, 255, 0.08); }

.btn-sm { height: 38px; padding: 0 18px; font-size: 14px; }

/* ---------- 导航 ---------- */

.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--nav-h);
  background: transparent;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), backdrop-filter 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border-bottom-color: var(--nav-border);
}
/* 深色 Hero 上方的反色态：透明底 + 白字（覆盖 scrolled 的玻璃底） */
.nav.inverted {
  background: transparent;
  border-bottom-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: #F2F5F9;
}
.nav.inverted .nav-links a { color: rgba(242, 245, 249, 0.72); }
.nav.inverted .nav-links a:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.10); }
.nav.inverted .icon-btn { color: rgba(242, 245, 249, 0.8); border-color: rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.06); }
.nav.inverted .icon-btn:hover { color: #FFFFFF; border-color: rgba(255, 255, 255, 0.5); }
.nav-inner {
  height: 100%;
  display: flex; align-items: center; gap: 28px;
  width: min(1200px, calc(100% - 48px));
  margin-inline: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.brand img { width: 30px; height: 30px; }
.nav-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; color: var(--text-2);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); border: 1px solid var(--divider);
  background: var(--surface);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.22s var(--ease);
}
.icon-btn:hover { color: var(--accent-strong); border-color: var(--accent); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }

.nav-burger { display: none; }

/* 移动端菜单 */
@media (max-width: 860px) {
  .nav-burger { display: inline-flex; }
  .nav-links {
    position: fixed; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    margin: 0; padding: 12px 20px 20px;
    background: var(--surface-glass);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    backdrop-filter: blur(20px) saturate(1.5);
    border-bottom: 1px solid var(--nav-border);
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
  }
  .nav-links a { padding: 13px 16px; border-radius: var(--r-md); font-size: 16px; }
  .nav.open .nav-links { transform: none; opacity: 1; pointer-events: auto; }
}

/* ---------- 滚动进度条 ---------- */

.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%;
  z-index: 101; pointer-events: none;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- 卡片 / chips ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-lg);
}

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--divider);
  background: var(--surface);
  font-size: 14px; font-weight: 500; color: var(--text-2);
  transition: border-color 0.22s var(--ease), color 0.22s var(--ease), transform 0.22s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--accent-strong); transform: translateY(-2px); }
.chip svg { width: 15px; height: 15px; color: var(--accent); }

/* ---------- reveal 动画 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.reveal-l { opacity: 0; transform: translateX(-32px); transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out); transition-delay: var(--d, 0s); }
.reveal-r { opacity: 0; transform: translateX(32px); transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out); transition-delay: var(--d, 0s); }
.reveal-scale { opacity: 0; transform: scale(0.94); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); transition-delay: var(--d, 0s); }
.in.reveal, .in.reveal-l, .in.reveal-r, .in.reveal-scale { opacity: 1; transform: none; }

/* ---------- toast ---------- */

.toast {
  position: fixed; left: 50%; bottom: 36px; z-index: 300;
  transform: translate(-50%, 16px);
  background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 500;
  padding: 11px 22px; border-radius: 999px;
  box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
html[data-theme="dark"] .toast { background: var(--accent); color: #06243F; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 模态 ---------- */

.modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(12, 16, 22, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s var(--ease);
}
.modal.open { opacity: 1; pointer-events: auto; }
.modal-panel {
  background: var(--surface);
  border: 1px solid var(--divider);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: min(400px, 100%);
  padding: 36px 32px 30px;
  text-align: center;
  transform: translateY(22px) scale(0.97);
  transition: transform 0.32s var(--ease-out);
  position: relative;
}
.modal.open .modal-panel { transform: none; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-close svg { width: 16px; height: 16px; }

/* ---------- 回到顶部 ---------- */

.back-top {
  position: fixed; right: 26px; bottom: 26px; z-index: 90;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--divider);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease),
              color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.back-top.show { opacity: 1; transform: none; pointer-events: auto; }
.back-top:hover { color: var(--accent-strong); border-color: var(--accent); }
.back-top svg { width: 18px; height: 18px; }

/* ---------- 页脚 ---------- */

.footer {
  border-top: 1px solid var(--divider);
  background: var(--bg-soft);
  padding: 56px 0 36px;
  margin-top: 40px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px; margin-bottom: 44px;
}
.footer-brand p { color: var(--text-2); font-size: 14.5px; margin-top: 12px; max-width: 320px; }
.footer h4 { font-size: 13px; font-weight: 600; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 14px; }
.footer-col a, .footer-col span {
  display: block; padding: 5px 0; font-size: 14.5px; color: var(--text-2);
  transition: color 0.2s var(--ease);
}
.footer-col a:hover { color: var(--accent-strong); }
.footer-bottom {
  border-top: 1px solid var(--divider);
  padding-top: 22px;
  display: flex; flex-wrap: wrap; gap: 12px 24px;
  align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-3);
}
.visit-stat {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-2);
}
.visit-stat .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
  animation: pulse-dot 2.2s var(--ease) infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30, 158, 85, 0.45); }
  55% { box-shadow: 0 0 0 5px rgba(30, 158, 85, 0); }
}
.visit-stat b { color: var(--text); font-weight: 600; }

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .container { width: calc(100% - 40px); }
}

/* ---------- 焦点可访问性 ---------- */

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

/* 锚点定位避开固定导航 */
[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* ---------- reduced motion ---------- */

@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, .reveal-l, .reveal-r, .reveal-scale { opacity: 1; transform: none; }
}

/* ---------- 全幅 CTA 大版面（蓝渐变） ---------- */

.end-cta {
  text-align: center;
  min-height: max(640px, 92svh);
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(96px, 12vw, 150px) 24px;
  background: linear-gradient(118deg, #0B4E8F 0%, #1A73D9 48%, #3399F5 100%);
  color: #FFFFFF;
  overflow: hidden;
  position: relative;
}
.end-cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent 100%);
  mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent 100%);
}
.end-cta h2 {
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.2;
  margin-bottom: 16px;
  position: relative;
}
.end-cta p { color: rgba(255,255,255,0.92); font-size: clamp(16px, 1.8vw, 20px); margin-bottom: 40px; position: relative;  text-wrap: balance; }
.end-cta .hero-cta { justify-content: center; margin-bottom: 0; position: relative; }
