/* ============================================================
   haoyumew.xyz 全站设计系统
   苹果式高级感：白/黑双主题、胶囊按钮、毛玻璃导航、克制动效
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  --bg: #FFFFFF;
  --bg-soft: #F5F5F7;
  --surface: #FFFFFF;
  --ink-1: #1D1D1F;
  --ink-2: #424245;
  --ink-3: #6E6E73;
  --hairline: rgba(0, 0, 0, 0.09);
  --link: #0071E3;
  --link-hover: #0060C9;
  --cta-bg: #1D1D1F;
  --cta-ink: #FFFFFF;
  --cta-bg-hover: #000000;
  --nav-bg: rgba(251, 251, 253, 0.8);
  --shadow-card: 0 6px 24px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 12px 32px rgba(0, 0, 0, 0.10);

  /* 图表色（浅色） */
  --c-blue: #0071E3;
  --c-green: #34C759;
  --c-orange: #FF9500;
  --c-red: #FF3B30;
  --c-gray: #8E8E93;
  --c-blue-soft: rgba(0, 113, 227, 0.12);
  --c-green-soft: rgba(52, 199, 89, 0.14);
  --c-orange-soft: rgba(255, 149, 0, 0.14);

  --nav-height: 52px;
  --radius-card: 20px;
  --radius-pill: 980px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
          "PingFang SC", "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --bg-soft: #161617;
    --surface: #1D1D1F;
    --ink-1: #F5F5F7;
    --ink-2: #A1A1A6;
    --ink-3: #86868B;
    --hairline: rgba(255, 255, 255, 0.14);
    --link: #2997FF;
    --link-hover: #5AA9FF;
    --cta-bg: #FFFFFF;
    --cta-ink: #1D1D1F;
    --cta-bg-hover: #E8E8ED;
    --nav-bg: rgba(22, 22, 23, 0.8);
    --shadow-card: none;
    --shadow-card-hover: none;

    --c-blue: #0A84FF;
    --c-green: #30D158;
    --c-orange: #FF9F0A;
    --c-red: #FF453A;
    --c-gray: #98989D;
    --c-blue-soft: rgba(10, 132, 255, 0.20);
    --c-green-soft: rgba(48, 209, 88, 0.22);
    --c-orange-soft: rgba(255, 159, 10, 0.22);
  }
}

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  color-scheme: light dark;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink-1);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.65;
}

::selection { background: var(--c-blue-soft); }

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

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

main { flex: 1; }

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); }

a, button { touch-action: manipulation; }

/* 粘性导航下的锚点定位（移动端目录条更高，需要更大偏移） */
section[id] { scroll-margin-top: calc(var(--nav-height) + 24px); }
@media (max-width: 1023px) {
  section[id] { scroll-margin-top: calc(var(--nav-height) + 64px); }
}

/* 键盘跳转链接：仅聚焦时可见 */
.skip-link {
  position: absolute;
  left: 16px;
  top: -56px;
  z-index: 200;
  background: var(--cta-bg);
  color: var(--cta-ink);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus-visible { top: 12px; color: var(--cta-ink); }

/* ---------- 导航（常驻毛玻璃 + 发丝线） ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, 4vw);
  background: var(--nav-bg);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.nav-logo {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-1);
}
.nav-logo:hover { color: var(--ink-1); }
.nav-menu {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-link {
  font-size: 13.5px;
  color: var(--ink-2);
  transition: color 0.2s var(--ease);
}
.nav-link:hover { color: var(--ink-1); }
.nav-link.active { color: var(--link); font-weight: 500; }

/* ---------- 按钮（胶囊） ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  padding: 0 26px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.25s var(--ease), color 0.25s var(--ease),
              border-color 0.25s var(--ease), transform 0.15s var(--ease);
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--cta-bg);
  color: var(--cta-ink);
  border: none;
}
.btn-primary:hover { background: var(--cta-bg-hover); color: var(--cta-ink); }

.btn-ghost {
  background: transparent;
  color: var(--ink-1);
  border: 1px solid var(--hairline);
}
.btn-ghost:hover { border-color: var(--ink-3); color: var(--ink-1); }

.btn-sm { height: 40px; padding: 0 20px; font-size: 14px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
a.card { display: block; color: inherit; }
a.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  color: inherit;
}

/* ---------- 排版 ---------- */
.kicker {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--link);
}
.hero-title {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.12;
}
.section-title {
  font-size: clamp(26px, 3.4vw, 32px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.text-secondary { color: var(--ink-2); }
.text-tertiary { color: var(--ink-3); }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--hairline);
  padding: 28px 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ---------- 滚动入场（无 JS / 减少动效时直接可见） ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .rv {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
    transition-delay: var(--rv-delay, 0ms);
  }
  html.js .rv.in { opacity: 1; transform: none; }
  html.js .hero-rise {
    opacity: 0;
    transform: translateY(16px);
    animation: hero-rise 0.7s var(--ease) forwards;
  }
  @keyframes hero-rise {
    to { opacity: 1; transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .nav-menu { gap: 18px; }
  .container { padding: 0 20px; }
}
