/* ==========================================================================
   心愈派 · 深夜极光  —— 基础层：设计令牌 / 排版 / 通用组件 / 天空背景
   ========================================================================== */

:root {
  color-scheme: dark;

  /* 夜空 */
  --night-0: #05050f;
  --night-1: #07071a;
  --night-2: #0d0c26;
  --indigo: #16143a;

  /* 光 */
  --violet: #8b7cff;
  --violet-2: #b3a8ff;
  --blue: #5b8cff;
  --rose: #ff8fb1;
  --dawn: #ffc98b;
  --green: #55d69e;           /* 品牌绿 = logo 绿点 = “AI 在场”指示灯 */

  --aurora: linear-gradient(100deg, #a293ff 0%, #ff8fb1 55%, #ffc98b 100%);

  /* 文字（深底上的三级灰） */
  --text: #f4f2fb;
  --text-2: rgba(232, 229, 246, 0.74);
  --text-3: rgba(232, 229, 246, 0.5);

  /* 线与面 */
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.15);
  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));

  --radius-lg: 28px;
  --radius: 20px;
  --radius-sm: 14px;

  /* 字体：标题为钉钉进步体自托管子集（见 fonts.css）；正文拉丁字形优先系统无衬线 */
  --font-display: "Heal Display", "DingTalk JinBuTi", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC",
    "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei",
    "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", "Roboto Mono", Menlo,
    Consolas, monospace;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1200px;
  --header-h: 72px;
}

/* ---------- reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night-1);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

::selection { background: rgba(139, 124, 255, 0.38); color: #fff; }

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

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; left: 16px; top: 12px; z-index: 100;
  padding: 10px 16px; border-radius: 999px;
  background: var(--text); color: var(--night-1);
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease-out);
}
.skip-link:focus { transform: none; }

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

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

.section-head { max-width: 900px; margin-bottom: clamp(40px, 5vw, 64px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }

/* 中文标题：优先在标点和 <wbr> 处换行、行宽均衡，避免单字落行；实在放不下才任意断行 */
.display, .display-2 {
  text-wrap: balance;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.display-2 + .body-lg { margin-top: 24px; }

/* 装饰性光晕不许撑出横向滚动（不支持 clip 的浏览器沿用 body 上的 hidden） */
html,
body { overflow-x: clip; }

/* ---------- 排版 ---------- */
/* 标题：钉钉进步体。只有一个字重且自带粗壮感，禁止浏览器再合成粗体/斜体 */
.display,
.display-2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-synthesis: none;
  color: var(--text);
}

.display {
  font-size: clamp(40px, 5.4vw, 78px);
  line-height: 1.18;
  letter-spacing: 0.01em;
}
.display .line { display: block; }

.display-2 {
  font-size: clamp(30px, 3.6vw, 50px);
  line-height: 1.3;
  letter-spacing: 0.01em;
}

/* 大段引语：无衬线细体，和粗壮的标题拉开层次 */
.statement {
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--text);
}

.text-aurora {
  font-style: normal;
  background: var(--aurora);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.85;
  color: var(--text-2);
}

.body-lg {
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-2);
}

.section-intro {
  margin-top: 22px;
  font-size: 17px;
  line-height: 1.9;
  color: var(--text-2);
}

/* 正文段落尽量不留单字尾行 */
.lead, .body-lg, .section-intro, .about-lead { text-wrap: pretty; }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--text-3);
}
.eyebrow .idx {
  font-size: 12px;
  color: var(--violet-2);
  padding: 2px 8px;
  border: 1px solid rgba(179, 168, 255, 0.3);
  border-radius: 999px;
  letter-spacing: 0.08em;
}

.kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--violet-2);
  margin-bottom: 14px;
}

/* ---------- AI 在场指示灯 ---------- */
.presence-dot {
  display: inline-block;
  width: 8px; height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(85, 214, 158, 0.9);
  animation: presence 2.8s ease-in-out infinite;
}
@keyframes presence {
  0%, 100% { box-shadow: 0 0 0 0 rgba(85, 214, 158, 0.55), 0 0 10px rgba(85, 214, 158, 0.9); }
  50% { box-shadow: 0 0 0 7px rgba(85, 214, 158, 0), 0 0 14px rgba(85, 214, 158, 1); }
}

/* ---------- 品牌 ---------- */
.brand { display: inline-flex; align-items: center; gap: 12px; }
.logo { width: 32px; height: 32px; color: var(--text); overflow: visible; }
.logo-dot {
  fill: var(--green);
  filter: drop-shadow(0 0 5px rgba(85, 214, 158, 0.85));
  transform-box: fill-box;
  transform-origin: center;
  animation: breathe 5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { transform: scale(0.88); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
}
.brand-text { display: grid; line-height: 1.25; }
.brand-text strong { font-size: 17px; font-weight: 600; letter-spacing: 0.04em; }
.brand-text small { font-size: 11px; color: var(--text-3); letter-spacing: 0.06em; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  padding: 14px 0;
  transition: padding 0.5s var(--ease-out);
}
.header-inner {
  width: min(100% - 32px, 1240px);
  margin-inline: auto;
  height: 58px;
  padding: 0 10px 0 18px;
  display: flex;
  align-items: center;
  gap: 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 0.5s var(--ease-out), border-color 0.5s var(--ease-out),
    backdrop-filter 0.5s var(--ease-out);
}
.site-header.is-scrolled { padding: 10px 0; }
.site-header.is-scrolled .header-inner {
  background: rgba(10, 10, 30, 0.58);
  border-color: var(--line);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 20px 60px -30px rgba(0, 0, 0, 0.8);
}

.nav { display: flex; gap: 6px; margin-left: auto; }
.nav a {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-2);
  border-radius: 999px;
  transition: color 0.3s, background 0.3s;
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav a.is-active { color: var(--text); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: 2px;
  width: 4px; height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  margin-left: 4px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: transparent;
  place-items: center;
  align-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 16px; height: 1.5px;
  background: var(--text);
  transition: transform 0.35s var(--ease-out);
}
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* ---------- 按钮 ---------- */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: transform 0.4s var(--ease-out), background 0.3s, border-color 0.3s, color 0.3s;
}
.btn:active { transform: scale(0.98); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-lg { height: 58px; padding: 0 34px; font-size: 16px; }

/* 主按钮：月白实体 + 身后的极光晕 */
.btn-glow { background: var(--text); color: var(--night-1); }
.btn-glow::before {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: -1;
  border-radius: inherit;
  background: var(--aurora);
  filter: blur(14px);
  opacity: 0.45;
  transition: opacity 0.4s var(--ease-out), filter 0.4s var(--ease-out);
}
.btn-glow:hover { transform: translateY(-1px); }
.btn-glow:hover::before { opacity: 0.85; filter: blur(20px); }

.btn-ghost {
  border-color: var(--line-2);
  color: var(--text);
  background: rgba(255, 255, 255, 0.02);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.28); }

.chip {
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-2);
  font-size: 13px;
  transition: color 0.3s, background 0.3s, border-color 0.3s;
}
.chip:hover { color: var(--text); border-color: rgba(179, 168, 255, 0.45); }
.chip.is-active {
  color: var(--text);
  border-color: rgba(179, 168, 255, 0.6);
  background: rgba(139, 124, 255, 0.16);
}

/* ---------- 玻璃面板（带跟随光标的微光） ---------- */
.glass {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 40px 100px -50px rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}
.glass::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, -30%),
      rgba(179, 168, 255, 0.1), transparent 60%);
  opacity: var(--spot, 0);
  transition: opacity 0.5s var(--ease-out);
}

/* ---------- 天空：深夜 → 黎明 ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--night-0);
  --twilight: 0;
  --dawn: 0;
}
.sky-layer { position: absolute; inset: 0; }
.sky-night {
  background:
    radial-gradient(1100px 760px at 78% -12%, rgba(98, 80, 255, 0.24), transparent 62%),
    radial-gradient(900px 700px at 4% 18%, rgba(46, 72, 190, 0.16), transparent 60%),
    linear-gradient(180deg, #05050f 0%, #080822 100%);
}
.sky-twilight {
  opacity: var(--twilight);
  background:
    radial-gradient(1200px 800px at 50% 115%, rgba(139, 124, 255, 0.34), transparent 62%),
    linear-gradient(180deg, #0a0924 0%, #1a1340 100%);
}
.sky-dawn {
  opacity: var(--dawn);
  background:
    radial-gradient(1300px 620px at 50% 118%, rgba(255, 201, 139, 0.55), transparent 62%),
    radial-gradient(1000px 560px at 50% 104%, rgba(255, 143, 177, 0.34), transparent 66%),
    linear-gradient(180deg, #110e2c 0%, #2a1a48 58%, #3c2446 100%);
}
.sky-stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: calc(1 - var(--dawn) * 0.75);
}
.sky-grain {
  position: absolute;
  inset: -50%;
  opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .7 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ---------- 滚动浮现（仅在 JS 可用时隐藏初始态） ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  filter: blur(8px);
  transition: opacity 1.1s var(--ease-out), transform 1.1s var(--ease-out), filter 1.1s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].is-in { opacity: 1; transform: none; filter: none; }

/* ---------- 响应式：顶栏 ---------- */
@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .nav-toggle { display: grid; }
  .header-cta { margin-left: auto; }
  .nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 16px;
    right: 16px;
    margin: 0;
    padding: 10px;
    flex-direction: column;
    gap: 2px;
    border-radius: 22px;
    background: rgba(10, 10, 30, 0.88);
    border: 1px solid var(--line);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out), visibility 0.35s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a { padding: 12px 16px; font-size: 15px; }
  .nav a.is-active::after { left: auto; right: 16px; top: 50%; bottom: auto; margin: -2px 0 0; }
}

@media (max-width: 560px) {
  .container { width: min(100% - 36px, var(--container)); }
  .brand-text small { display: none; }
  .header-inner { padding: 0 8px 0 14px; gap: 10px; }
}

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; filter: none; }
}
