/* ============================================================
   Balana Web · ThemeV2 Design System (Web port)
   Source: HRV/DesignSystem — Color+ThemeV2.swift / ThemeV2Typography.swift
   色值来源: HRV/Assets.xcassets/Theme/{AI,Neutral,Semantic}
   ============================================================ */

:root {
  /* --- Neutral (dark mode value, 深空沉浸) --- */
  --bg-app: #0A0A0C;
  --bg-card: #151518;
  --bg-elevated: #1D1E24;
  --text-title: #F5F6FA;
  --text-body: #CCCFD8;
  --text-caption: #8B90A0;
  --border-subtle: rgba(245, 246, 250, 0.10);

  /* --- AI 品牌渐变 (Theme/AI) --- */
  --ai-purple: #8C4DFF;
  --ai-blue: #4080F0;
  --grad-ai: linear-gradient(135deg, #8C4DFF 0%, #4080F0 100%);
  --grad-ai-h: linear-gradient(90deg, #8C4DFF 0%, #4080F0 100%);
  --gtext: linear-gradient(135deg, #C39BFF, #7FB0FF); /* 夜航紫焰渐变文字 */

  /* --- Semantic (dark mode value) --- */
  --recovery: #66D0B0;          /* 恢复绿 */
  --recovery-deep: #31B489;
  --stress: #FFA64D;            /* 损耗橙 */
  --cognitive: #4FC3F7;         /* 认知蓝 */
  --intervention: #BB90FF;      /* 干预紫 */
  --sleep: #8E70FA;             /* 睡眠紫 */
  --nap-gold: #FFC752;          /* 小憩金 */
  --warning-red: #EF5350;       /* 警告红 */

  /* --- PowerZone (dark) --- */
  --z1: #64B5F6; --z2: #4FC3F7; --z3: #66D0B0;
  --z4: #FFD54F; --z5: #FFA64D; --z6: #EF5350; --z7: #E53935;

  /* --- Typography (ThemeV2Typography 映射) --- */
  /* displayHero 34/800 · sectionTitle 20/600 · bodyMain 17/400
     captionMetrics 12/500 · statusLabel 11/700 · badgeChip 11/600   */

  /* --- Spacing / Radius (CardBackgroundV2: 24pt 连续圆角, 14pt 子磁贴) --- */
  --r-card: 24px;
  --r-tile: 14px;
  --r-chip: 999px;
}

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

html { scroll-behavior: smooth; }

body {
  background-color: var(--bg-app);
  color: var(--text-title);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
  min-height: 100vh;
}

/* 弥散光斑背景 (夜航紫焰 · 引导页 theme-b) */
.bg-aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(58% 38% at 86% 0%, rgba(64, 128, 240, 0.13), transparent 70%),
    radial-gradient(48% 34% at 8% 4%, rgba(140, 77, 255, 0.16), transparent 70%),
    radial-gradient(40% 30% at 50% 110%, rgba(49, 180, 137, 0.07), transparent 70%);
}

a { color: inherit; text-decoration: none; }

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

/* ============ Navigation ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  background: rgba(10, 10, 12, 0.72);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.nav-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(140, 77, 255, 0.35);
}
.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-link {
  padding: 7px 14px;
  border-radius: var(--r-chip);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-caption);
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text-title); background: rgba(255, 255, 255, 0.06); }
.nav-link.active { color: var(--text-title); background: rgba(140, 77, 255, 0.16); }

/* ============ Hero ============ */
.hero { padding: 96px 0 72px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--r-chip);
  background: rgba(140, 77, 255, 0.12);
  border: 1px solid rgba(140, 77, 255, 0.25);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;      /* 引导页徽章字距规范 */
  color: #C39BFF;
  margin-bottom: 28px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 56px);
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1.22;
  margin-bottom: 22px;
}
.grad-text {
  background: var(--gtext);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero .sub {
  font-size: 18px;
  color: var(--text-body);
  max-width: 620px;
  line-height: 1.75;
  margin-bottom: 36px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 16px;
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s, background 0.2s;
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn-grad {
  background: var(--grad-ai);
  color: #fff;
  box-shadow: 0 8px 28px rgba(140, 77, 255, 0.4);
}
.btn-grad:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(140, 77, 255, 0.5); }
.btn-recovery {
  background: var(--recovery-deep);
  color: #06251B;             /* 深绿底深字，对比度更佳 */
  box-shadow: 0 8px 28px rgba(49, 180, 137, 0.35);
}
.btn-recovery:hover { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(49, 180, 137, 0.45); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-title);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-2px); }

/* ============ Section 框架 ============ */
section { padding: 72px 0; }
.kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--text-caption);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.section-title {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.3;
  margin-bottom: 14px;
}
.section-sub {
  font-size: 16px;
  color: var(--text-caption);
  max-width: 640px;
  margin-bottom: 44px;
  line-height: 1.7;
}

/* ============ Cards (CardBackgroundV2 · 晶体质感) ============ */
.card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-card);
  transition: border-color 0.25s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
}
.card:hover { border-color: rgba(255, 255, 255, 0.18); }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

/* 语义 icon tile */
.tile-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--r-tile);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 18px;
}
.ti-ai { background: var(--grad-ai); box-shadow: 0 6px 18px rgba(140, 77, 255, 0.35); }
.ti-recovery { background: rgba(102, 208, 176, 0.16); border: 1px solid rgba(102, 208, 176, 0.3); }
.ti-sleep { background: rgba(142, 112, 250, 0.16); border: 1px solid rgba(142, 112, 250, 0.3); }
.ti-stress { background: rgba(255, 166, 77, 0.14); border: 1px solid rgba(255, 166, 77, 0.3); }
.ti-cognitive { background: rgba(79, 195, 247, 0.14); border: 1px solid rgba(79, 195, 247, 0.3); }
.ti-nap { background: rgba(255, 199, 82, 0.14); border: 1px solid rgba(255, 199, 82, 0.3); }
.ti-cycle { background: rgba(187, 144, 255, 0.14); border: 1px solid rgba(187, 144, 255, 0.3); }
.ti-warning { background: rgba(239, 83, 80, 0.14); border: 1px solid rgba(239, 83, 80, 0.3); }

.card h3 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  margin-bottom: 8px;
}
.card p { font-size: 13.5px; color: var(--text-body); line-height: 1.7; }

/* ============ 静态数据图卡（拟 App 实景） ============ */
.mock-card {
  padding: 24px;
}
.mock-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.mock-label { font-size: 12px; font-weight: 500; color: var(--text-caption); }
.mock-value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;   /* displayValue 规范 */
  line-height: 1.1;
}
.mock-unit { font-size: 14px; font-weight: 500; color: var(--text-caption); margin-left: 4px; }
.mock-sub { font-size: 11px; font-weight: 700; letter-spacing: 0.2px; }

.v-recovery { color: var(--recovery); }
.v-stress { color: var(--stress); }
.v-cognitive { color: var(--cognitive); }
.v-sleep { color: var(--sleep); }
.v-gold { color: var(--nap-gold); }
.v-grad {
  background: var(--gtext);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* SVG 折线基础 */
.spark-wrap { margin-top: 14px; }
.spark-line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ============ 条纹带 / 状态徽章 ============ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-chip);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1px;
}
.chip-recovery { background: rgba(102, 208, 176, 0.14); color: var(--recovery); }
.chip-stress { background: rgba(255, 166, 77, 0.13); color: var(--stress); }
.chip-sleep { background: rgba(142, 112, 250, 0.14); color: var(--sleep); }
.chip-ai {
  background: rgba(140, 77, 255, 0.14);
  color: #C39BFF;
  letter-spacing: 1px;
  font-weight: 700;
}

/* ============ 隐私保证条 (onboard_v3_privacy_note) ============ */
.privacy-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px 22px;
  border-radius: var(--r-chip);
  background: rgba(49, 180, 137, 0.09);
  border: 1px solid rgba(49, 180, 137, 0.25);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--recovery);
}
.privacy-strip.lock { font-size: 15px; }

/* ============ Footer ============ */
footer {
  border-top: 1px solid var(--border-subtle);
  padding: 44px 0 56px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.footer-brand .nav-logo { width: 26px; height: 26px; border-radius: 8px; }
.footer-tag { font-size: 12.5px; color: var(--text-caption); margin-top: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col-title { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; color: var(--text-caption); text-transform: uppercase; margin-bottom: 2px; }
.footer-link { font-size: 13.5px; color: var(--text-body); transition: color 0.2s; }
.footer-link:hover { color: var(--text-title); }
.footer-copy {
  max-width: 1080px;
  margin: 36px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-caption);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.footer-copy a { color: var(--text-caption); }
.footer-copy a:hover { color: var(--text-title); }

/* ============ Document pages (privacy / support) ============ */
.doc-hero { padding: 72px 0 40px; }
.doc-hero h1 { font-size: clamp(30px, 5vw, 42px); font-weight: 800; letter-spacing: -0.6px; margin-bottom: 12px; }
.doc-updated { font-size: 13px; color: var(--text-caption); }

.doc-body { max-width: 820px; padding-bottom: 40px; }
.doc-body h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 44px 0 16px;
  padding-top: 12px;
}
.doc-body h3 { font-size: 16.5px; font-weight: 600; margin: 26px 0 10px; }
.doc-body p, .doc-body li { font-size: 14.5px; color: var(--text-body); line-height: 1.85; }
.doc-body ul { padding-left: 22px; margin: 12px 0; display: grid; gap: 7px; }
.doc-body li::marker { color: var(--recovery-deep); }
.doc-body strong { color: var(--text-title); font-weight: 600; }
.doc-body a { color: #A98BFF; text-decoration: underline; text-underline-offset: 3px; }
.doc-body a:hover { color: #C39BFF; }
.doc-body code {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 7px;
  border-radius: 6px;
}

.doc-note {
  border-radius: var(--r-card);
  padding: 22px 26px;
  margin-bottom: 36px;
  background: rgba(49, 180, 137, 0.08);
  border: 1px solid rgba(49, 180, 137, 0.25);
}
.doc-note h4 { font-size: 15px; font-weight: 700; color: var(--recovery); margin-bottom: 8px; }
.doc-note p { font-size: 14px; color: var(--text-body); line-height: 1.75; }
.doc-note.ai {
  background: rgba(140, 77, 255, 0.09);
  border-color: rgba(140, 77, 255, 0.28);
}
.doc-note.ai h4 { color: #C39BFF; }

.doc-block { /* 双语分隔 */
  border-top: 1px solid var(--border-subtle);
}
.doc-lang-divider {
  margin: 48px 0 8px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--text-caption);
}

/* ============ FAQ (support) ============ */
details.faq {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-tile);
  background: var(--bg-card);
  margin-bottom: 12px;
  overflow: hidden;
}
details.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 17px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-title);
  display: flex;
  align-items: center;
  gap: 12px;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after {
  content: "+";
  margin-left: auto;
  font-size: 19px;
  font-weight: 500;
  color: var(--text-caption);
  transition: transform 0.25s;
}
details.faq[open] summary::after { transform: rotate(45deg); color: #C39BFF; }
details.faq .faq-body { padding: 0 20px 18px; font-size: 14px; color: var(--text-body); line-height: 1.8; }
details.faq .faq-body a { color: #A98BFF; }

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 64px 0 56px; }
  section { padding: 56px 0; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .nav-link { padding: 7px 10px; font-size: 12.5px; }
  .nav-links { gap: 0; }
  .hero-cta .btn { padding: 12px 20px; font-size: 14px; }
}
