/* ============================================================================
   余白 / Yohaku — 官网样式
   设计令牌取自 App 的 DesignSystem/Theme.swift（暖白纸面 · 黛绿主色 · 陶土点睛），
   与文档页 yubai-doc.css 同源。单一字族策略：展示字 Serif，正文 SF Pro。
   浅 / 深色自适应，离线自包含，无任何外部请求。
   ============================================================================ */

:root {
  --bg:            #F6F3EC;
  --bg-grad-top:   #F8F5EE;
  --bg-grad-bot:   #EFEAE0;
  --surface:       #FFFFFF;
  --surface-sunk:  #EFEAE0;

  --ink:           #26241F;
  --ink-2:         #6F695F;
  --ink-3:         #A39C8F;

  --brand:         #2E6F5E;
  --brand-soft:    #DCEAE3;
  --accent:        #E0915C;   /* 陶土橙：唯一点睛色 */
  --calm:          #4FA383;
  --stop:          #C2685A;
  --divider:       #E7E1D6;

  --jar-sage:      #3F8E78;
  --jar-terra:     #D99A63;
  --jar-mist:      #6E94A6;
  --jar-plum:      #9A7FA6;
  --jar-celadon:   #4DA39A;

  --r-chip: 8px;
  --r-control: 14px;
  --r-card: 16px;
  --r-panel: 24px;

  --shadow-card: 0 4px 18px rgba(38, 36, 31, 0.06);
  --shadow-soft: 0 1px 3px rgba(38, 36, 31, 0.05);
  --shadow-pop:  0 10px 34px rgba(38, 36, 31, 0.10);

  --font-serif: "New York", "Songti SC", "Noto Serif CJK SC", "Noto Serif JP",
                "Hiragino Mincho ProN", "Yu Mincho", Georgia, "Times New Roman", serif;
  --font-sans:  -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
                "Hiragino Sans", "Noto Sans CJK SC", "Segoe UI", system-ui, sans-serif;

  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #15140F;
    --bg-grad-top:   #1A1812;
    --bg-grad-bot:   #100F0B;
    --surface:       #201E18;
    --surface-sunk:  #2A271F;

    --ink:           #F2EFE7;
    --ink-2:         #B7B0A2;
    --ink-3:         #8B8473;

    --brand:         #5FB89A;
    --brand-soft:    #233A33;
    --accent:        #E8A877;
    --calm:          #74C7A8;
    --stop:          #D98A7E;
    --divider:       #38342B;

    --jar-sage:      #6BC0A6;
    --jar-terra:     #E6B07F;
    --jar-mist:      #8FB2C2;
    --jar-plum:      #B89CC2;
    --jar-celadon:   #79C4BB;

    --shadow-card: 0 1px 0 rgba(255,255,255,0.04), 0 8px 26px rgba(0,0,0,0.34);
    --shadow-soft: 0 1px 0 rgba(255,255,255,0.04);
    --shadow-pop:  0 1px 0 rgba(255,255,255,0.05), 0 16px 40px rgba(0,0,0,0.45);
  }
}

/* ----------------------------------------------------------------- 基础 */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(130% 80% at 50% -10%, var(--bg-grad-top) 0%, var(--bg-grad-bot) 72%),
    var(--bg);
  background-attachment: fixed;
  line-height: 1.62;
  font-size: 17px;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
::selection { background: var(--brand-soft); color: var(--ink); }
a { color: var(--brand); text-decoration: none; }

/* —— 双语显隐：默认中文；data-lang=en 时切换 —— */
[data-i18n="en"], .i.en { display: none; }
[data-lang="en"] [data-i18n="en"] { display: block; }
[data-lang="en"] [data-i18n="zh-Hans"] { display: none; }
[data-lang="en"] .i.en { display: inline; }
[data-lang="en"] .i.zh { display: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ----------------------------------------------------------- 顶部导航 */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px max(20px, env(safe-area-inset-left)) 11px max(20px, env(safe-area-inset-right));
  padding-top: max(11px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  backdrop-filter: saturate(1.4) blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--divider) 70%, transparent);
}
.brandmark {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-family: var(--font-serif); font-weight: 700; font-size: 20px;
  letter-spacing: 0.04em; color: var(--ink); white-space: nowrap;
}
.brandmark .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent); align-self: center;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.brandmark .latin { font-weight: 600; color: var(--ink-2); font-size: 14px; letter-spacing: 0; }
.nav-right { display: flex; align-items: center; gap: 18px; }
.nav-links { display: flex; gap: 20px; }
.nav-links a {
  font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  transition: color .18s ease;
}
.nav-links a:hover { color: var(--ink); }

/* —— 语言切换（仅官网；文档页另有处理） —— */
.lang-switch {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-sunk); border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--divider) 60%, transparent);
}
.lang-switch button {
  appearance: none; border: 0; cursor: pointer; font-family: var(--font-sans);
  font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-2);
  background: transparent; padding: 6px 12px; border-radius: 999px;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.lang-switch button:hover { color: var(--ink); }
.lang-switch button[aria-pressed="true"] { color: var(--brand); background: var(--surface); box-shadow: var(--shadow-soft); }

/* —— 按钮 —— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600; letter-spacing: 0.01em;
  padding: 12px 22px; border-radius: 999px; cursor: pointer; border: 1px solid transparent;
  transition: transform .12s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-soft); }
.btn-primary:hover { box-shadow: var(--shadow-card); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--divider); }
.btn-ghost:hover { background: var(--surface); box-shadow: var(--shadow-soft); }
.nav .btn { padding: 9px 18px; font-size: 14px; }

/* —— 通用 section —— */
section { padding: 72px 0; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--brand); margin-bottom: 16px;
}
.eyebrow.terra { color: var(--accent); }
h1, h2, h3 { font-family: var(--font-serif); color: var(--ink); letter-spacing: 0.005em; }
.sec-head { max-width: 40rem; margin: 0 auto 44px; text-align: center; }
.sec-head h2 { font-size: clamp(26px, 4.4vw, 36px); line-height: 1.18; margin: 0 0 14px; }
.sec-head p { font-size: 17px; color: var(--ink-2); margin: 0; }

/* --------------------------------------------------------------- 英雄 */
.hero { padding: clamp(48px, 8vw, 92px) 0 56px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.hero h1 { font-size: clamp(34px, 6.2vw, 58px); line-height: 1.1; margin: 0 0 20px; }
.hero .lede { font-size: clamp(17px, 2.1vw, 19px); color: var(--ink-2); margin: 0 0 28px; max-width: 32rem; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-note { margin-top: 16px; font-size: 13px; color: var(--ink-3); }

/* 方形视频卡（1080² 源，显示 ≤ 460px，retina 清晰） */
.video-card {
  position: relative; aspect-ratio: 1 / 1; width: 100%; max-width: 460px; margin-inline: auto;
  border-radius: var(--r-panel); overflow: hidden;
  background: var(--surface-sunk); box-shadow: var(--shadow-pop);
  border: 1px solid color-mix(in srgb, var(--divider) 80%, transparent);
}
.video-card video, .video-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-card .frame-ring { position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.14); pointer-events: none; }

/* ---------------------------------------- 罐子动画（hero）：App 落进黛绿罐 → 盖木盖 */
.jar-anim {
  position: relative; width: 100%; max-width: 348px; margin-inline: auto;
  aspect-ratio: 1024 / 1536;
}
.jar-halo {
  position: absolute; left: 50%; top: 52%; width: 116%; height: 84%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--jar-sage) 32%, transparent) 0%, transparent 60%);
  filter: blur(6px); z-index: 0;
  animation: jarBreathe 6s ease-in-out infinite;
}
@keyframes jarBreathe {
  0%, 100% { opacity: .72; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%, -50%) scale(1.045); }
}
.jar-stage { position: absolute; inset: 0; }
.jar-body {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  z-index: 2; pointer-events: none; user-select: none; -webkit-user-select: none;
}
.jar-lid {
  position: absolute; left: 50%; top: 0.5%; width: 80%;
  transform-origin: 50% 50%;
  z-index: 3; pointer-events: none; user-select: none; -webkit-user-select: none;
  filter: drop-shadow(0 7px 12px rgba(38, 36, 31, 0.18));
  /* 循环：App 落入 → 木盖落下盖好 → 静置密封 → 抬起 → 重来。 */
  animation: lidClose 7s cubic-bezier(.5,.06,.22,1) infinite;
}
@keyframes lidClose {
  0%, 30%   { transform: translateX(-50%) translateY(-128%) rotate(-5deg); }  /* 悬停等待 App 落入 */
  38%       { transform: translateX(-50%) translateY(5%) rotate(.5deg); }      /* 落下微弹 */
  42%, 74%  { transform: translateX(-50%) translateY(0) rotate(0deg); }        /* 盖好密封 */
  86%, 100% { transform: translateX(-50%) translateY(-128%) rotate(-5deg); }   /* 抬起，循环 */
}

.app-icon {
  position: absolute; z-index: 1; width: 16%; aspect-ratio: 1; border-radius: 27%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(38, 36, 31, 0.22), inset 0 1px 0 rgba(255,255,255,0.32);
  opacity: 0; will-change: transform, opacity;
  /* 逐个从罐口上方落入、轻微回弹后 settle，盖着时静置，循环前淡出。 */
  animation: iconDrop 7s cubic-bezier(.28,.7,.3,1) infinite;
}
.app-icon svg { width: 54%; height: 54%; }
@keyframes iconDrop {
  0%   { transform: translateY(-470%) scale(.5) rotate(var(--r0)); opacity: 0; }
  4%   { opacity: 1; }
  22%  { transform: translateY(7%) scale(1.03) rotate(var(--r1)); opacity: 1; }  /* 落到位微弹 */
  28%  { transform: translateY(0) scale(1) rotate(var(--r1)); opacity: 1; }       /* settle */
  72%  { transform: translateY(0) scale(1) rotate(var(--r1)); opacity: 1; }       /* 静置（盖着） */
  80%  { transform: translateY(0) scale(.92) rotate(var(--r1)); opacity: 0; }     /* 淡出（已收好） */
  100% { transform: translateY(-470%) scale(.5) rotate(var(--r0)); opacity: 0; }  /* 复位 */
}
/* 落点上移到罐身清透区（避免落到不透明罐底被裁切）+ 颜色 + 入场错峰 */
.ai1 { left: 28%; bottom: 28%; background: linear-gradient(160deg, #FF7A7A, #E64A4A); animation-delay: 0s;   }
.ai2 { left: 50%; bottom: 26%; background: linear-gradient(160deg, #62ADE8, #3B82C4); animation-delay: .13s; }
.ai3 { left: 39%; bottom: 39%; background: linear-gradient(160deg, #B197D6, #8366B8); animation-delay: .26s; }
.ai4 { left: 24%; bottom: 44%; background: linear-gradient(160deg, #F59AB8, #E26D98); animation-delay: .39s; }
.ai5 { left: 56%; bottom: 43%; background: linear-gradient(160deg, #F2BC63, #E0915C); animation-delay: .52s; }
@media (prefers-reduced-motion: reduce) {
  .jar-lid, .app-icon, .jar-halo { animation: none; }
  .jar-lid { transform: translateX(-50%) translateY(0); }
  .app-icon { opacity: 1; transform: translateY(0) rotate(var(--r1)); }
}

/* --------------------------------------------------------- 场景三联 */
.scenes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.scene { text-align: left; }
.scene .video-card { max-width: none; border-radius: var(--r-card); }
.scene h3 { font-size: 19px; margin: 16px 0 6px; }
.scene p { font-size: 15px; color: var(--ink-2); margin: 0; }
.scene .tag { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--accent); margin-bottom: 0; }

/* ------------------------------------------------------ 核心概念 */
.concept { background: var(--surface); border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider); }
.concept-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
.concept-step {
  padding: 26px; border-radius: var(--r-panel); background: var(--bg);
  border: 1px solid var(--divider);
}
.concept-step .num {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 11px; background: var(--brand-soft); color: var(--brand);
  font-weight: 700; font-size: 15px; margin-bottom: 14px;
}
.concept-step h3 { font-size: 19px; margin: 0 0 8px; }
.concept-step p { font-size: 15px; color: var(--ink-2); margin: 0; }

/* --------------------------------------------------------- 规则卡 */
.rules-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.rule-card {
  padding: 26px; border-radius: var(--r-panel); background: var(--surface);
  border: 1px solid var(--divider); box-shadow: var(--shadow-card);
  position: relative; overflow: hidden;
}
.rule-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tint, var(--brand)); }
.rule-card .ico {
  width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--tint, var(--brand)) 14%, transparent); margin-bottom: 16px;
}
.rule-card .ico svg { width: 22px; height: 22px; stroke: var(--tint, var(--brand)); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rule-card h3 { font-size: 18px; margin: 0 0 8px; }
.rule-card p { font-size: 14.5px; color: var(--ink-2); margin: 0; }

/* ------------------------------------------------------- 双栏图文 */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.feature.flip .feature-text { order: 2; }
.feature-text h2 { font-size: clamp(24px, 3.6vw, 32px); line-height: 1.2; margin: 0 0 16px; }
.feature-text p { font-size: 16.5px; color: var(--ink-2); margin: 0 0 14px; }
.feature-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 12px; }
.feature-list li { display: flex; gap: 11px; font-size: 15.5px; color: var(--ink); }
.feature-list li .tick {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; margin-top: 1px;
}
.panel {
  border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--divider);
  box-shadow: var(--shadow-card); padding: 30px;
}
.panel.tint-warm { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface)); }

/* —— 隐私要点 —— */
.privacy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 4px; }
.privacy-item { display: flex; gap: 12px; align-items: flex-start; }
.privacy-item .dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--calm); margin-top: 7px; }
.privacy-item b { display: block; font-size: 15.5px; }
.privacy-item span { font-size: 14px; color: var(--ink-2); }

/* --------------------------------------------------------- 价格对比 */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; max-width: 760px; margin: 0 auto; }
.plan {
  padding: 30px; border-radius: var(--r-panel); background: var(--surface);
  border: 1px solid var(--divider); box-shadow: var(--shadow-card);
}
.plan.pro { border-color: color-mix(in srgb, var(--brand) 40%, var(--divider)); box-shadow: var(--shadow-pop); }
.plan h3 { font-size: 22px; margin: 0 0 4px; }
.plan .price { font-size: 14px; color: var(--ink-3); margin: 0 0 18px; }
.plan ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.plan li { display: flex; gap: 10px; font-size: 15px; color: var(--ink); }
.plan li .tick { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; margin-top: 1px; }
.plan .badge { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); padding: 3px 10px; border-radius: 999px; margin-bottom: 12px; }

/* ----------------------------------------------------------- 收尾 CTA */
.closing { text-align: center; }
.closing h2 { font-size: clamp(28px, 5vw, 44px); line-height: 1.14; margin: 0 auto 18px; max-width: 22ch; }
.closing p { font-size: 17px; color: var(--ink-2); margin: 0 auto 28px; max-width: 34rem; }

/* ------------------------------------------------------------ 页脚 */
.footer { border-top: 1px solid var(--divider); padding: 48px 0 60px; }
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; }
.footer .brandmark { font-size: 18px; }
.footer-cols { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-sans); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.footer-col a { display: block; font-size: 14.5px; color: var(--ink-2); margin-bottom: 9px; }
.footer-col a:hover { color: var(--ink); }
.footer-fine { margin-top: 36px; font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }

/* ------------------------------------------------------- 进入动画 */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* --------------------------------------------------------- 响应式 */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero .video-card { max-width: 380px; }
  .scenes-grid, .concept-grid, .rules-grid { grid-template-columns: 1fr; }
  .feature, .feature.flip .feature-text { grid-template-columns: 1fr; }
  .feature.flip .feature-text { order: 0; }
  .feature.flip .feature-media { order: 2; }
  .plans, .privacy-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  section { padding: 56px 0; }
}
@media (min-width: 560px) {
  .scenes-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .scenes-grid { grid-template-columns: 1fr; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1; }
}
