/* ============================================
   星河官网 — 共享设计 tokens & 基础样式
   ============================================ */

:root {
  /* Color tokens */
  --xh-bg: #ffffff;
  --xh-bg-warm: #faf9f6;
  --xh-bg-mute: #f5f5f2;
  --xh-bg-panel: #fafafa;

  --xh-fg: #0a0a0a;
  --xh-fg-1: #2a2a2a;
  --xh-fg-2: #525252;
  --xh-fg-3: #8a8a8a;
  --xh-fg-4: #b8b8b8;
  --xh-border: rgba(10, 10, 10, 0.08);
  --xh-border-strong: rgba(10, 10, 10, 0.14);

  /* Brand — v2.0 锁定 (2026-05-25 · N3 渐变 + N1 单色)
     详见 星河/memory/strategy_brand_visual_palette.md
     废止: #3b5bff / #2842d9 / #7c3aed / #6d3aff 老色已替换 */
  --xh-brand-grad: linear-gradient(135deg, #8377FF 0%, #4A3DDB 100%);
  --xh-brand-solid: #6559F4;       /* N1 单色 fallback */
  --xh-brand-light: #8377FF;       /* N3 渐变亮端 */
  --xh-brand-dark: #4A3DDB;        /* N3 渐变暗端 */

  /* 向后兼容: 沿用旧变量名, 底层指向新色 */
  --xh-blue: var(--xh-brand-solid);
  --xh-blue-deep: var(--xh-brand-dark);
  --xh-purple: var(--xh-brand-dark);
  --xh-violet: var(--xh-brand-solid);
  --xh-grad: var(--xh-brand-grad);
  --xh-grad-soft: linear-gradient(135deg, rgba(131, 119, 255, 0.10) 0%, rgba(74, 61, 219, 0.10) 100%);

  /* Type */
  --xh-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Source Han Sans CN', sans-serif;
  --xh-mono: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

/* Reset minimal */
.xh-root, .xh-root * {
  box-sizing: border-box;
}
.xh-root {
  font-family: var(--xh-sans);
  color: var(--xh-fg);
  background: var(--xh-bg);
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  font-size: 16px;
}
.xh-root h1, .xh-root h2, .xh-root h3, .xh-root h4, .xh-root p {
  margin: 0;
}
.xh-root a:not(.xh-btn):not(.xh-login) { color: inherit; text-decoration: none; }
.xh-root a { text-decoration: none; }
.xh-root button { font-family: inherit; cursor: pointer; }

/* Layout helpers */
.xh-container { width: 100%; max-width: 1340px; margin: 0 auto; padding: 0 48px; }
.xh-narrow { max-width: 980px; }

/* ============================================
   Top nav (sticky)
   ============================================ */
/* SEO-only: 给爬虫 + screen reader 读 · 视觉不可见 · 跟实际内容一致 (不算 cloaking) */
.xh-seo-only {
  position: absolute !important;
  width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0,0,0,0) !important;
  white-space: nowrap !important; border: 0 !important;
}

.xh-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--xh-border);
}
.xh-nav-inner {
  display: flex; align-items: center; height: 72px;
}
.xh-logo {
  display: flex; align-items: center; gap: 9px;
  font-weight: 600; font-size: 17px; letter-spacing: -0.015em;
}
.xh-logo-mark {
  /* v2.0 (2026-05-25) · 两笔 logo · N3 渐变底 + 白色 mask */
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--xh-grad);
  position: relative; flex-shrink: 0;
}
.xh-logo-mark::after {
  content: ''; position: absolute; inset: 4px;
  background: #fff;
  -webkit-mask: url('/assets/logo-glyph.svg') center / contain no-repeat;
          mask: url('/assets/logo-glyph.svg') center / contain no-repeat;
}
.xh-nav-links {
  display: flex; gap: 32px; margin-left: 52px;
  font-size: 14.5px; color: var(--xh-fg-1); font-weight: 500;
}
.xh-nav-links a {
  position: relative;
  padding: 6px 0;
  transition: color 0.12s;
}
.xh-nav-links a:hover { color: var(--xh-fg); }
.xh-nav-links a.is-active {
  color: var(--xh-fg);
  font-weight: 600;
}
.xh-nav-links a.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -26px; /* 对齐 nav 底部 border (72px height - link cluster center) */
  height: 2px;
  background: var(--xh-grad);
  border-radius: 2px 2px 0 0;
}
.xh-nav-cta { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.xh-nav-cta .xh-login { font-size: 14px; color: var(--xh-fg-1); padding: 8px 4px; }

/* ============================================
   Buttons
   ============================================ */
.xh-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500; letter-spacing: -0.005em;
  padding: 9px 16px; border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.14s;
  white-space: nowrap;
}
.xh-btn-primary {
  background: var(--xh-fg);
  color: #fff;
  border-color: var(--xh-fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);  /* v1.5.8 极轻阴影 · 微微浮起感 · 不像 v1.5 的 0.45 重黑 */
}
.xh-btn-primary:hover { background: #1a1a1a; }
.xh-btn-primary.xh-btn-grad {
  background: var(--xh-grad);
  border: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 8px 20px -8px rgba(101, 89, 244, 0.5);
}
.xh-btn-ghost {
  background: transparent;
  color: var(--xh-fg-1);
  border-color: var(--xh-border-strong);
}
.xh-btn-ghost:hover { border-color: var(--xh-fg); color: var(--xh-fg); }
.xh-btn-lg { padding: 13px 22px; font-size: 15px; border-radius: 10px; }

/* ============================================
   Section primitives
   ============================================ */
.xh-section { padding: 96px 0; }
.xh-section-sm { padding: 64px 0; }

.xh-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--xh-blue);
}
.xh-eyebrow::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: var(--xh-grad);
}

.xh-h1 { font-size: 64px; font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; text-wrap: balance; }
.xh-h2 { font-size: 44px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; text-wrap: balance; }
.xh-h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.25; }
.xh-h4 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.xh-lead { font-size: 19px; color: var(--xh-fg-2); line-height: 1.55; font-weight: 400; }
.xh-body { font-size: 15px; color: var(--xh-fg-2); line-height: 1.6; }
.xh-meta { font-size: 13px; color: var(--xh-fg-3); }

.xh-gradient-text {
  background: var(--xh-grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

/* ============================================
   Cards
   ============================================ */
.xh-card {
  background: #fff;
  border: 1px solid var(--xh-border);
  border-radius: 14px;
  padding: 28px;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.xh-card:hover {
  border-color: var(--xh-border-strong);
  box-shadow: 0 1px 0 rgba(0,0,0,0.02), 0 8px 24px -12px rgba(0,0,0,0.08);
}
.xh-card-icon {
  width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(101, 89, 244,0.10), rgba(74, 61, 219,0.10));
  color: var(--xh-blue);
  margin-bottom: 18px;
}

/* ============================================
   Footer
   ============================================ */
.xh-footer {
  border-top: 1px solid var(--xh-border);
  padding: 64px 0 32px;
  background: var(--xh-bg);
}
.xh-footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1.1fr;
  gap: 48px; padding-bottom: 48px;
}
.xh-footer h5 {
  font-size: 13px; font-weight: 600; color: var(--xh-fg);
  margin: 0 0 16px;
}
.xh-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.xh-footer li, .xh-footer a { font-size: 13px; color: var(--xh-fg-2); transition: color 0.12s; }
.xh-footer a:hover { color: var(--xh-fg); }
.xh-footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 28px; border-top: 1px solid var(--xh-border);
  font-size: 12px; color: var(--xh-fg-3);
}
.xh-footer-bottom a { font-size: inherit; color: inherit; }
.xh-footer-bottom a:hover { color: var(--xh-fg-1); text-decoration: underline; text-underline-offset: 3px; }

/* 联系列 · 二维码 hover 放大 */
.xh-footer-qr-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.xh-footer-qr {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 6px;
  border: 1px solid var(--xh-border);
  background: #fff;
  cursor: zoom-in;
  flex-shrink: 0;
}
.xh-footer-qr > img { width: 28px; height: 28px; display: block; }
.xh-footer-qr-pop {
  position: absolute; bottom: calc(100% + 10px); right: -8px;
  width: 168px; height: 168px; padding: 10px;
  background: #fff; border: 1px solid var(--xh-border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(10,10,10,0.12), 0 2px 6px rgba(10,10,10,0.06);
  opacity: 0; pointer-events: none;
  transform: translateY(6px) scale(0.96);
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 10;
}
.xh-footer-qr-pop::after {
  content: ''; position: absolute; top: 100%; right: 16px;
  width: 12px; height: 12px;
  background: #fff;
  border-right: 1px solid var(--xh-border);
  border-bottom: 1px solid var(--xh-border);
  transform: translateY(-7px) rotate(45deg);
}
.xh-footer-qr-pop > img { width: 100%; height: 100%; display: block; border-radius: 4px; }
.xh-footer-qr:hover .xh-footer-qr-pop,
.xh-footer-qr:focus-within .xh-footer-qr-pop {
  opacity: 1; pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* ============================================
   Decorative gradient orbs (versioned intensity)
   ============================================ */
.xh-glow-soft {
  position: absolute; pointer-events: none; z-index: 0;
  filter: blur(60px); opacity: 0.55;
  background: radial-gradient(circle, rgba(74, 61, 219,0.5), transparent 70%);
  border-radius: 50%;
}
.xh-glow-blue {
  background: radial-gradient(circle, rgba(101, 89, 244,0.5), transparent 70%);
}

/* ============================================
   Mac window chrome
   ============================================ */
.xh-mac {
  background: #fff;
  border: 1px solid var(--xh-border);
  border-radius: 12px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.6) inset,
    0 24px 56px -24px rgba(15, 23, 42, 0.18),
    0 8px 16px -12px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}
.xh-mac-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--xh-border);
  background: linear-gradient(180deg, #fbfbfb, #f5f5f5);
}
.xh-mac-dots { display: flex; gap: 6px; }
.xh-mac-dots span {
  width: 11px; height: 11px; border-radius: 50%;
  display: block;
  background: rgba(10, 10, 10, 0.12);
  border: 1px solid rgba(10, 10, 10, 0.04);
}
.xh-mac-dots span:nth-child(1) { background: rgba(10, 10, 10, 0.12); }
.xh-mac-dots span:nth-child(2) { background: rgba(10, 10, 10, 0.12); }
.xh-mac-dots span:nth-child(3) { background: rgba(10, 10, 10, 0.12); }
.xh-mac-title {
  flex: 1; text-align: center;
  font-size: 12px; color: var(--xh-fg-3); font-weight: 500;
  letter-spacing: -0.005em;
}

/* ============================================
   Animations
   ============================================ */
@keyframes xh-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes xh-pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(101, 89, 244, 0.4); }
  100% { box-shadow: 0 0 0 12px rgba(101, 89, 244, 0); }
}
@keyframes xh-sheen {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.xh-anim-pulse-ring { animation: xh-pulse-ring 1.8s ease-out infinite; }
