/* 官网样式。
 *
 * ## 视觉：Linear 的骨架 + 毛毛回家的暖色
 *
 * 取值出处：`~/.dsh/skills/design-md/docs/linear.app/DESIGN.md`
 * —— 近黑底 `#010102`、面板 `#0f1011`、hairline 边框 `#23252a`、
 * 三级字色、显示字 600 字重 + 负字距、圆角 8/12/16/24、强调色绝不装饰。
 *
 * 差异只有一处：强调色用品牌 `#cc785c`（赭橙），并用它的**光晕**替代
 * Linear 的冷紫氛围 —— 因为这是宝贝找回应用，冷色会显得像开发者工具。
 *
 * ## 动画原则
 *
 * 全部 CSS + 40 行原生 JS，**没有动画库**。四条自律：
 * 1. 只动 `transform` / `opacity`（不触发布局，滚动不掉帧）
 * 2. 进入视口才播（`IntersectionObserver`），不浪费首屏外的算力
 * 3. 单次播放（`animation-fill-mode: both` + 观察后加 class），不循环刷屏
 * 4. **`prefers-reduced-motion` 下全部静止** —— 前庭敏感的人不该被动画打
 */

:root {
  --canvas: #010102;
  --surface-1: #0f1011;
  --surface-2: #141516;
  --surface-3: #18191a;
  --hairline: #23252a;
  --hairline-strong: #34343a;

  --ink: #f7f8f8;
  --ink-muted: #d0d6e0;
  --ink-subtle: #8a8f98;
  --ink-tertiary: #62666d;

  --primary: #cc785c;
  --primary-hover: #dd8b70;
  --primary-press: #b4664c;
  --on-primary: #17100d;
  --glow: rgba(204, 120, 92, 0.35);

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-xxl: 24px;

  --s-xxs: 4px;
  --s-xs: 8px;
  --s-sm: 12px;
  --s-md: 16px;
  --s-lg: 24px;
  --s-xl: 32px;
  --s-xxl: 48px;

  --max: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink-muted);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC",
    "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.06px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--s-lg); }

/* ——————————————————— 氛围光 ———————————————————
   三团极淡的赭橙光斑，用 `filter: blur` 做柔边而不是拿图片 ——
   纯 CSS、无极光图片、不额外请求。它们缓慢呼吸（24s 一轮）。 */
.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.aurora span {
  position: absolute;
  display: block;
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.20;
  will-change: transform;
}
.aurora span:nth-child(1) {
  top: -12vw; left: -6vw;
  background: radial-gradient(circle, #cc785c 0%, transparent 70%);
  animation: drift-a 26s var(--ease) infinite alternate;
}
.aurora span:nth-child(2) {
  top: 22vh; right: -14vw;
  background: radial-gradient(circle, #a8624b 0%, transparent 70%);
  opacity: 0.14;
  animation: drift-b 32s var(--ease) infinite alternate;
}
.aurora span:nth-child(3) {
  bottom: -16vw; left: 24vw;
  background: radial-gradient(circle, #e8a55a 0%, transparent 70%);
  opacity: 0.10;
  animation: drift-c 38s var(--ease) infinite alternate;
}
@keyframes drift-a { to { transform: translate3d(6vw, 4vh, 0) scale(1.12); } }
@keyframes drift-b { to { transform: translate3d(-5vw, 6vh, 0) scale(1.08); } }
@keyframes drift-c { to { transform: translate3d(4vw, -5vh, 0) scale(1.15); } }

/* 细颗粒噪点：暗色大色块最容易"塑料感"，一层极淡噪点立刻有质感。
   用 SVG feTurbulence 内联成 data URI —— 不额外请求，也不需要图片文件。 */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page { position: relative; z-index: 2; }

/* ——————————————————— 导航 ——————————————————— */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(1, 1, 2, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.nav.is-stuck {
  background: rgba(1, 1, 2, 0.86);
  border-bottom-color: var(--hairline);
}
.nav-inner { display: flex; align-items: center; gap: var(--s-sm); height: 62px; }

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img {
  width: 26px; height: 26px;
  border-radius: 7px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: transform 0.4s var(--ease);
}
.brand:hover img { transform: rotate(-6deg) scale(1.06); }
.brand span { color: var(--ink); font-size: 15px; font-weight: 600; letter-spacing: -0.2px; }

.nav-links { margin-left: auto; display: none; gap: var(--s-lg); }
.nav-links a {
  position: relative;
  color: var(--ink-subtle);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
@media (min-width: 760px) { .nav-links { display: flex; } }

.nav .btn-sm { margin-left: var(--s-sm); }
@media (min-width: 760px) { .nav .btn-sm { margin-left: var(--s-lg); } }

/* ——————————————————— 按钮 ———————————————————
   两个动效：hover 抬 1px + 光晕扩散；按下压回并缩小。
   `will-change` 只给按钮：数量少，不会被滥用成内存负担。 */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  background: linear-gradient(180deg, #d8836a 0%, var(--primary) 55%, #c06f54 100%);
  color: var(--on-primary);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.1px;
  text-decoration: none;
  border-radius: var(--r-md);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.16) inset, 0 8px 24px -12px var(--glow);
  transition: transform 0.18s var(--ease), box-shadow 0.3s var(--ease),
    background 0.3s var(--ease);
  will-change: transform;
}
.btn::after {
  /* 扫光：一条斜向高光，hover 时从左划到右 */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
  opacity: 0;
  transform: translateX(-40%);
  transition: opacity 0.25s var(--ease), transform 0.55s var(--ease);
  pointer-events: none;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 14px 34px -12px var(--glow);
}
.btn:hover::after { opacity: 0.55; transform: translateX(40%); }
.btn:active { transform: translateY(0) scale(0.985); }

.btn-sm { padding: 8px 15px; font-size: 14px; }

.btn-ghost {
  background: var(--surface-1);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--surface-2); border-color: #43434a; }
.btn-ghost::after { display: none; }

/* ——————————————————— Hero ——————————————————— */
.hero { padding: 72px 0 24px; }
@media (min-width: 900px) { .hero { padding: 104px 0 32px; } }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--ink-subtle);
  background: rgba(15, 16, 17, 0.7);
  backdrop-filter: blur(6px);
}
.eyebrow i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 0 var(--glow);
  animation: pulse 2.6s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(204, 120, 92, 0.55); }
  50% { box-shadow: 0 0 0 6px rgba(204, 120, 92, 0); }
}

h1 {
  margin: 22px 0 0;
  color: var(--ink);
  font-size: 42px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -1.6px;
  max-width: 18em;
  text-wrap: balance;
}
@media (min-width: 760px) {
  h1 { font-size: 62px; line-height: 1.04; letter-spacing: -2.6px; }
}
/* 标题里的强调词用渐变色 + 轻微光晕，不换字号 —— 换字号会破坏节奏 */
h1 em {
  font-style: normal;
  background: linear-gradient(96deg, #f0b39c 0%, var(--primary) 45%, #b4664c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(204, 120, 92, 0.25));
}

.lede {
  margin: 22px 0 0;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink-subtle);
  max-width: 32em;
}

.cta-row { display: flex; flex-wrap: wrap; gap: var(--s-sm); margin-top: 30px; }

.meta-line { margin: 16px 0 0; font-size: 13px; color: var(--ink-tertiary); }
.meta-line a { color: var(--ink-subtle); text-decoration: none; border-bottom: 1px solid var(--hairline-strong); }
.meta-line a:hover { color: var(--ink); }

details.sha { margin-top: 12px; font-size: 13px; color: var(--ink-tertiary); }
details.sha summary { cursor: pointer; color: var(--ink-subtle); list-style: none; }
details.sha summary::-webkit-details-marker { display: none; }
details.sha summary::before { content: "▸ "; }
details.sha[open] summary::before { content: "▾ "; }
details.sha code {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-sm);
  font-size: 12px;
  line-height: 1.6;
  word-break: break-all;
  color: var(--ink-muted);
  animation: fade-in 0.35s var(--ease) both;
}

/* ——————————————————— 产品示意 ——————————————————— */
.showcase {
  position: relative;
  margin: 56px 0 0;
  padding: 40px var(--s-lg) 28px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xxl);
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(204, 120, 92, 0.16), transparent 62%),
    linear-gradient(180deg, #101112 0%, #0b0c0d 100%);
  overflow: hidden;
}
/* 卡片顶部一道高光线：暗色面板最容易缺"体积感"的地方 */
.showcase::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(204, 120, 92, 0.6), transparent);
}

.phones {
  display: flex;
  gap: var(--s-lg);
  justify-content: center;
  align-items: flex-end;
  perspective: 1200px;
}

.phone {
  flex: 0 0 208px;
  padding: 7px;
  border-radius: 26px;
  background: linear-gradient(160deg, #2a2b2e 0%, #121314 45%, #1d1e20 100%);
  border: 1px solid #3a3b3f;
  box-shadow:
    0 30px 70px -20px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  will-change: transform;
  animation: float 9s ease-in-out infinite;
}
.phone:nth-child(2) { animation-delay: -4.5s; }
.phone + .phone { display: none; }
@media (min-width: 680px) { .phone + .phone { display: block; } }
@media (max-width: 560px) { .phone { flex-basis: 176px; } }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

/* 屏幕：暖白底 + 顶部一层极淡的赭橙雾，模仿 App 的 canvas 色 */
.screen {
  position: relative;
  border-radius: 20px;
  padding: 13px 12px;
  background:
    radial-gradient(90% 40% at 50% 0%, rgba(204, 120, 92, 0.10), transparent 70%),
    #fdfbf8;
  color: #1f1b18;
  font-size: 9px;
  line-height: 1.5;
  min-height: 320px;
  overflow: hidden;
}
/* 灵动岛：让"这是手机"一眼成立，成本只有一个圆角黑条 */
.screen::before {
  content: "";
  position: absolute;
  top: 7px; left: 50%;
  transform: translateX(-50%);
  width: 52px; height: 12px;
  border-radius: 999px;
  background: #0a0a0b;
}

.screen .bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 600;
  color: #1f1b18;
  margin: 14px 0 9px;
}
.screen .bar b { flex: 1; }
.search {
  border: 1px solid #e6ddd2;
  border-radius: 9px;
  padding: 6px 8px;
  color: #8b8078;
  margin-bottom: 9px;
  background: #fff;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.tile {
  background: #fff;
  border: 1px solid #efe7dd;
  border-radius: 11px;
  padding: 7px;
  box-shadow: 0 1px 2px rgba(31, 27, 24, 0.04);
}
.tile .paw {
  height: 36px;
  border-radius: 7px;
  background: linear-gradient(180deg, #f6f1ea, #ece3d8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c9bcae;
  font-size: 15px;
  margin-bottom: 6px;
}
.tile .chips { display: flex; gap: 4px; margin-bottom: 5px; }
.chip {
  border-radius: 999px;
  padding: 1px 6px;
  background: #cc785c;
  color: #fff;
  font-size: 7px;
  font-weight: 600;
}
.chip.dark { background: #1f1b18; }
.tile .t { font-weight: 600; font-size: 9px; letter-spacing: -0.1px; }
.tile .m { color: #8b8078; font-size: 8px; margin-top: 2px; }

.caption { margin-top: var(--s-md); text-align: center; font-size: 12px; color: var(--ink-tertiary); }

/* ——————————————————— 区块 ——————————————————— */
.section { padding: 64px 0; }
@media (min-width: 760px) { .section { padding: 84px 0; } }

.section-head { max-width: 36em; }
h2 {
  margin: 0;
  color: var(--ink);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.9px;
  text-wrap: balance;
}
@media (min-width: 760px) { h2 { font-size: 34px; letter-spacing: -1.3px; } }
.section-head p { margin: 14px 0 0; color: var(--ink-subtle); font-size: 15px; line-height: 1.7; }

.features { display: grid; gap: var(--s-sm); margin-top: var(--s-xl); grid-template-columns: 1fr; }
@media (min-width: 760px) { .features { grid-template-columns: 1fr 1fr; } }

.feature {
  position: relative;
  padding: 22px;
  background: linear-gradient(180deg, rgba(20, 21, 22, 0.9), rgba(15, 16, 17, 0.9));
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease),
    box-shadow 0.35s var(--ease);
}
.feature:hover {
  transform: translateY(-3px);
  border-color: #3b3c40;
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(204, 120, 92, 0.10);
}
.feature .ico {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  background: rgba(204, 120, 92, 0.10);
  border: 1px solid rgba(204, 120, 92, 0.22);
  color: var(--primary);
  margin-bottom: 15px;
  transition: transform 0.4s var(--ease), background 0.4s var(--ease);
}
.feature:hover .ico { transform: translateY(-2px) rotate(-4deg); background: rgba(204, 120, 92, 0.16); }
.feature h3 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 600; letter-spacing: -0.25px; }
.feature p { margin: 9px 0 0; font-size: 14px; color: var(--ink-subtle); line-height: 1.7; }

/* 步骤 */
.steps { margin-top: var(--s-xl); display: grid; gap: var(--s-sm); }
@media (min-width: 760px) { .steps { grid-template-columns: 1fr 1fr 1fr; } }
.step {
  padding: 22px;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  transition: border-color 0.3s var(--ease);
}
.step:hover { border-color: var(--hairline-strong); }
.step .n {
  display: inline-grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--surface-3);
  border: 1px solid var(--hairline-strong);
  color: var(--ink-muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 13px;
}
.step h3 { margin: 0 0 7px; color: var(--ink); font-size: 15px; font-weight: 600; }
.step p { margin: 0; font-size: 14px; color: var(--ink-subtle); line-height: 1.7; }

.notice {
  margin-top: var(--s-md);
  padding: 15px 17px;
  border-left: 2px solid var(--primary);
  background: rgba(204, 120, 92, 0.07);
  border-radius: var(--r-md);
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-muted);
}
.notice strong { color: var(--ink); }

/* FAQ：用 grid-template-rows 做高度过渡（比 max-height 猜数字干净） */
.faq { margin-top: var(--s-xl); border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-md);
  cursor: pointer;
  padding: 17px 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  list-style: none;
  transition: color 0.2s var(--ease);
}
.faq summary:hover { color: var(--primary-hover); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--ink-subtle); transition: transform 0.3s var(--ease); }
.faq details[open] summary::after { content: "–"; }
.faq p {
  margin: 0 0 17px;
  font-size: 14px;
  color: var(--ink-subtle);
  line-height: 1.8;
  animation: fade-in 0.3s var(--ease) both;
}

/* ——————————————————— 页脚 ——————————————————— */
footer {
  margin-top: var(--s-xxl);
  padding: var(--s-lg) 0 120px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--ink-tertiary);
}
footer .rows { display: flex; flex-wrap: wrap; gap: var(--s-md); justify-content: space-between; }
footer a { color: var(--ink-subtle); text-decoration: none; transition: color 0.2s var(--ease); }
footer a:hover { color: var(--ink); }

/* ——————————————————— 移动端吸底下载条 ——————————————————— */
.sticky-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  padding: 10px var(--s-md) calc(10px + env(safe-area-inset-bottom));
  background: rgba(1, 1, 2, 0.9);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  transform: translateY(110%);
  transition: transform 0.4s var(--ease);
}
.sticky-bar.is-visible { transform: translateY(0); }
.sticky-bar .ver { font-size: 12px; color: var(--ink-tertiary); flex: 1; }
@media (min-width: 760px) { .sticky-bar { display: none; } }

/* ——————————————————— 进入视口动画 ———————————————————
   `.reveal` 默认透明并下移 16px；JS 加 `.in` 后回到位。
   单次、交错（`--d` 由 HTML 给），滚动回来不重播。 */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  transition-delay: var(--d, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ——————————————————— 隐私政策页 ——————————————————— */
.doc { padding-bottom: 120px; }
.doc h1 { margin: 40px 0 10px; font-size: 30px; letter-spacing: -0.9px; }
.doc h2 { margin: 38px 0 12px; font-size: 21px; }
.doc h3 { margin: 26px 0 8px; font-size: 15px; color: var(--ink); }
.doc p, .doc li { font-size: 15px; color: var(--ink-subtle); line-height: 1.8; }
.doc ul, .doc ol { padding-left: 22px; }
.doc strong { color: var(--ink); }
.doc hr { border: 0; border-top: 1px solid var(--hairline); margin: 34px 0; }
.doc table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 13px; }
.doc th, .doc td {
  border: 1px solid var(--hairline);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  color: var(--ink-subtle);
  line-height: 1.7;
}
.doc th { background: var(--surface-1); color: var(--ink-muted); font-weight: 600; }
.doc code { background: var(--surface-1); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.doc tr { transition: background 0.2s var(--ease); }
.doc tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.back { display: inline-block; margin-top: 32px; color: var(--primary); text-decoration: none; }
.back:hover { color: var(--primary-hover); }

/* ——————————————————— 尊重"减少动态效果" ———————————————————
   系统开了这个设置的人（前庭功能敏感、容易晕动）不该被任何动画打扰。
   这不是可选项：动画是增强，不是内容。 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .sticky-bar { transform: none; }
}
