/* ══════════════════════════════════════════════════════════════════
   牛蛙落地页

   所有颜色 / 间距 / 圆角 / 缓动都从 App 的 lib/design/tokens.dart 搬过来，
   一个值都不另造——网站跟 App 得是同一套东西，不然点开下载会落差。

   对照表（左边 App，右边这里）：
     kAccent            0xFF298643  --accent
     kAccentInkLight    0xFF0F6D2F  --accent-ink
     kAccentWashLight   0xFFE8F4EA  --accent-wash
     kNeutral50/100     纸底 / 卡片
     kNeutral900        正文（暖近黑，不是 #000）
     S.x1..x11          2,4,8,12,16,20,24,32,40,56,72
     R.sm/md/lg         10 / 16 / 22
     M.out              cubic-bezier(.16,1,.3,1)
     M.spring           cubic-bezier(.34,1.56,.64,1)

   暗色模式用 App 那套暗色令牌（kDarkBg/kDarkCard/…），跟着系统走。
   ══════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Space Grotesk';
  src: url('assets/fonts/SpaceGrotesk.ttf') format('truetype-variations');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent:      #298643;
  --accent-ink:  #0F6D2F;
  --accent-wash: #E8F4EA;
  --accent-lift: #35A052;
  --accent-deep: #1F7237;

  --paper:       #FBF7F2;
  --card:        #FFFEF9;
  --raised:      #FFFFFF;
  --ink:         #1B1814;
  --dim:         #5D5A56;
  --faint:       #7B7773;
  --trace:       #8A8580;
  --line:        #DBD7D2;
  --line-strong: #CAC5C1;
  --danger:      #BD4238;

  --sh1: 0 1px 2px rgba(27,24,20,.039), 0 2px 4px rgba(27,24,20,.059);
  --sh2: 0 1px 2px rgba(27,24,20,.031), 0 6px 16px -4px rgba(27,24,20,.059);
  --sh3: 0 2px 4px rgba(27,24,20,.039), 0 16px 40px -8px rgba(27,24,20,.102);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;

  --out:    cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --inout:  cubic-bezier(.2, 0, 0, 1);

  --wrap: 1120px;
  --nav-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent:      #298643;
    --accent-ink:  #4AA55F;
    --accent-wash: #1D3527;
    --paper:       #1B1814;
    --card:        #262320;
    --raised:      #302C29;
    --ink:         #EDE9E4;
    --dim:         #A9A49E;
    --faint:       #928E89;
    --trace:       #7D766F;
    --line:        #3A3633;
    --line-strong: #4A4541;
    --danger:      #E66E68;

    /* 暗底上阴影看不见，层级改用描边表达——跟 App 一个思路 */
    --sh1: 0 0 0 1px rgba(255,255,255,.04);
    --sh2: 0 0 0 1px rgba(255,255,255,.055);
    --sh3: 0 0 0 1px rgba(255,255,255,.07), 0 16px 40px -8px rgba(0,0,0,.5);
  }
}

/* ── 底 ────────────────────────────────────────────────────────── */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Space Grotesk', 'PingFang SC', 'Noto Sans CJK SC',
               'Source Han Sans SC', 'Microsoft YaHei UI', 'Microsoft YaHei',
               sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 纸的颗粒。平涂的暖底会显得像没上完色，一层极淡的噪点就"是纸"了。
   幅度必须小——看得见噪点就成脏了。 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .028;
  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='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { body::after { opacity: .05; } }

h1, h2, h3, p, figure, blockquote, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

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

code {
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-size: .88em;
}

::selection { background: var(--accent-wash); color: var(--accent-ink); }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
}
.skip:focus { left: 12px; top: 12px; border-radius: var(--r-sm); }

/* ── 容器 ──────────────────────────────────────────────────────── */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}
.wrap--narrow { max-width: 780px; }

.section { padding-block: clamp(60px, 8vw, 104px); position: relative; }

/* ── 排字零件 ──────────────────────────────────────────────────── */

.eyebrow, .label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

.label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.label::before {
  content: '';
  width: 18px;
  height: 1.5px;
  background: var(--accent);
  flex: none;
}

.sec-head { margin-bottom: clamp(36px, 5vw, 56px); }
.sec-head--center { text-align: center; }
.sec-head--center .label { justify-content: center; }
.sec-head--center .label::before { display: none; }

.sec-h2 {
  font-size: clamp(26px, 4.2vw, 40px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.022em;
  text-wrap: balance;
}

.sep { color: var(--line-strong); margin-inline: 2px; }
.dot { color: var(--accent); margin-inline: 2px; }

/* ── 顶栏 ──────────────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .24s var(--out);
}
.nav.is-stuck { border-bottom-color: var(--line); }

.nav__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: baseline; gap: 8px; }
.brand__mark {
  width: 26px;
  height: 26px;
  color: var(--accent);
  align-self: center;
  flex: none;
}
.brand__name { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.brand__ver {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--accent-ink);
  background: var(--accent-wash);
  padding: 2px 7px;
  border-radius: 999px;
  align-self: center;
}

.nav__links { display: flex; align-items: center; gap: clamp(4px, 2vw, 26px); }
.nav__links a {
  font-size: 14px;
  color: var(--dim);
  padding: 6px 2px;
  transition: color .18s var(--out);
}
.nav__links a:hover { color: var(--ink); }

.nav__cta {
  color: var(--ink) !important;
  font-weight: 500;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 16px !important;
  transition: border-color .18s var(--out), background .18s var(--out);
}
.nav__cta:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
}
@media (max-width: 620px) {
  .nav__links a:not(.nav__cta) { display: none; }
}

/* ── 按钮 ──────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  padding: 15px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  /* 「Windows 便携版」在窄屏会折成两行，按钮跟着变胖，很难看 */
  white-space: nowrap;
  transition: transform .18s var(--out), box-shadow .24s var(--out),
              background .18s var(--out), border-color .18s var(--out);
}
.btn__sub { font-weight: 400; opacity: .8; font-size: 14px; }

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--sh2);
}
.btn--primary:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
  box-shadow: var(--sh3);
}
.btn--primary:active { transform: translateY(0) scale(.985); }

.btn--ghost {
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn--ghost:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
  transform: translateY(-1px);
}
.btn--ghost:active { transform: translateY(0) scale(.985); }

.btn--quiet {
  border-color: var(--line);
  color: var(--dim);
  font-size: 14px;
  padding: 10px 18px;
  background: transparent;
}
.btn--quiet:hover { color: var(--ink); border-color: var(--line-strong); }

.btn--wide { width: 100%; }

/* ── 青蛙 ──────────────────────────────────────────────────────── */

.frog { width: min(56vw, 296px); height: auto; color: var(--accent); }

/* ── 首屏 ──────────────────────────────────────────────────────── */

.hero {
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: clamp(56px, 7vw, 92px);
}
.hero__in {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero__h1 {
  font-size: clamp(38px, 6.4vw, 66px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.035em;
  margin: 20px 0 26px;
}
.hero__h1 em {
  font-style: normal;
  color: var(--accent);
  /* 手写体那一点"落款"感，靠一条绿下划线点出来，不用斜体 */
  background-image: linear-gradient(var(--accent-wash), var(--accent-wash));
  background-repeat: no-repeat;
  background-size: 100% .22em;
  background-position: 0 84%;
}

.hero__lede {
  font-size: clamp(15.5px, 1.6vw, 17.5px);
  line-height: 1.78;
  color: var(--dim);
  max-width: 34em;
  text-wrap: pretty;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.hero__meta {
  margin-top: 22px;
  font-size: 13px;
  color: var(--faint);
  letter-spacing: .005em;
}

.hero__art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 260px;
  /* 光晕要待在青蛙后面，但**不能**掉到页面底色后面去。
     z-index:-1 在没有层叠上下文时会一路退到根，被 body 的底色盖掉，
     看着就像这层压根没写。isolate 把它关在这一格里面。 */
  isolation: isolate;
}
.hero__glow {
  position: absolute;
  inset: -16%;
  z-index: -1;
  background: radial-gradient(
    closest-side,
    color-mix(in srgb, var(--accent) 16%, transparent),
    transparent 70%
  );
  pointer-events: none;
}

/* 窄屏收成单列。青蛙排在文字**后面**——先给标题和下载按钮，
   它是收尾的一笔，不是开场。 */
@media (max-width: 900px) {
  .hero__in { grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 6vw, 40px); }
  .hero__art { min-height: 0; }
  .frog { width: min(50vw, 190px); }
  .hero__lede, .hero__meta { max-width: none; }
}

/* ── 它是什么 ──────────────────────────────────────────────────── */

.what { background: var(--card); border-block: 1px solid var(--line); }

.pull {
  margin: 0 0 32px;
  padding-left: clamp(18px, 3vw, 30px);
  border-left: 2px solid var(--accent);
}
.pull p {
  font-size: clamp(21px, 3.5vw, 33px);
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: -.022em;
  text-wrap: balance;
}
.pull footer {
  margin-top: 18px;
  font-size: 13px;
  color: var(--faint);
}
.pull footer code { color: var(--trace); }

.what__body {
  font-size: 16px;
  line-height: 1.85;
  color: var(--dim);
  max-width: 40em;
}
.what__body strong { color: var(--ink); font-weight: 600; }

/* ── 三件事 ────────────────────────────────────────────────────── */

.three__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 268px), 1fr));
  gap: clamp(24px, 3.5vw, 44px);
}

.feat { position: relative; padding-top: 26px; border-top: 1px solid var(--line); }

.feat__h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: clamp(19px, 2.2vw, 22px);
  font-weight: 600;
  letter-spacing: -.015em;
  margin-bottom: 14px;
}
.feat__num {
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-size: 12px;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: .06em;
}

.feat__p {
  font-size: 15px;
  line-height: 1.82;
  color: var(--dim);
  text-wrap: pretty;
}
.feat__x {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--faint);
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
  text-wrap: pretty;
}

/* ── 技能 ──────────────────────────────────────────────────────── */

.skills { background: var(--card); border-block: 1px solid var(--line); }

.skl { border-top: 1px solid var(--line); }
.skl__row {
  display: grid;
  grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  gap: clamp(14px, 3vw, 40px);
  padding-block: clamp(20px, 2.6vw, 26px);
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.skl__id {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: .02em;
  margin-bottom: 4px;
}
.skl__name {
  display: block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--ink);
}
.skl__desc {
  font-size: 15px;
  line-height: 1.8;
  color: var(--dim);
  text-wrap: pretty;
}
.skl__desc strong { color: var(--accent-ink); font-weight: 600; }

@media (max-width: 640px) {
  .skl__row { grid-template-columns: 1fr; gap: 10px; }
}

/* ── 演示 ──────────────────────────────────────────────────────── */

.demo__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(36px, 6vw, 76px);
  align-items: center;
}
@media (max-width: 840px) {
  .demo__grid { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .demo__side { max-width: 560px; }
}

.demo__side .sec-h2 { margin-bottom: 20px; }

.demo__note {
  font-size: 15.5px;
  line-height: 1.82;
  color: var(--dim);
  max-width: 30em;
  text-wrap: pretty;
}

.demo__disclaimer {
  margin-top: 22px;
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--faint);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  max-width: 34em;
  text-wrap: pretty;
}
.demo__disclaimer strong { color: var(--ink); font-weight: 600; }

#replay { margin-top: 22px; }

/* 手机壳 */
.phone-wrap { position: relative; }
.phone {
  width: min(84vw, 320px);
  height: min(174vw, 664px);
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 34px;
  box-shadow: var(--sh3);
  overflow: hidden;
}

.phone__bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--line);
}
.phone__mark { width: 22px; height: 22px; color: var(--accent); flex: none; }
.phone__mark svg { width: 100%; height: 100%; }
.phone__who { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.phone__chip {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .09em;
  color: var(--faint);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 8px;
}

.phone__log {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 14px;
  overflow: hidden;
}

.bub {
  max-width: 84%;
  padding: 9px 13px;
  font-size: 13.5px;
  line-height: 1.62;
  border-radius: 18px;
  text-wrap: pretty;
  opacity: 0;
  transform: translateY(8px) scale(.97);
  transition: opacity .34s var(--out), transform .42s var(--spring);
}
.bub.is-in { opacity: 1; transform: none; }

.bub--me {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-end-end-radius: 6px;
}
.bub--frog {
  align-self: flex-start;
  background: var(--raised);
  color: var(--ink);
  border: 1px solid var(--line);
  border-end-start-radius: 6px;
}

/* 记忆落库的痕迹。App 里这类"机器在干什么"用 trace 色，比正文淡一档。 */
.bub__trace {
  align-self: flex-end;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--trace);
  padding-right: 4px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .3s var(--out), transform .34s var(--out);
}
.bub__trace.is-in { opacity: 1; transform: none; }
.bub__trace::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

.typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; }
.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
  animation: blink 1.15s var(--inout) infinite;
}
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes blink {
  0%, 62%, 100% { opacity: .28; transform: translateY(0); }
  32%           { opacity: 1;   transform: translateY(-2.5px); }
}

.phone__input {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 12px 14px;
  padding: 11px 12px 11px 16px;
  font-size: 13.5px;
  color: var(--faint);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.phone__send {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--line);
  flex: none;
}

/* ── 下载 ──────────────────────────────────────────────────────── */

.dl__lede {
  margin-top: 16px;
  font-size: 16px;
  color: var(--dim);
  max-width: 32em;
  margin-inline: auto;
  text-wrap: pretty;
}

.dl__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(18px, 2.6vw, 26px);
  max-width: 800px;
  margin-inline: auto;
}

.dl__card {
  display: flex;
  flex-direction: column;
  padding: 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh1);
  transition: transform .28s var(--out), box-shadow .28s var(--out),
              border-color .28s var(--out);
}
.dl__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh3);
  border-color: var(--line-strong);
}

.dl__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.dl__os { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.dl__ver {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--accent-ink);
  background: var(--accent-wash);
  padding: 3px 9px;
  border-radius: 999px;
}

.dl__file {
  font-family: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  color: var(--faint);
  margin-bottom: 4px;
  word-break: break-all;
}
.dl__facts { font-size: 13.5px; color: var(--dim); margin-bottom: 22px; }

.dl__card .btn { margin-top: auto; }

.dl__fine {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--faint);
  text-wrap: pretty;
}

/* 兜底那条（老设备 / 首次运行会拦）。比上面那行再淡半档——
   它是补救，不是主路径，别跟主按钮抢注意力。 */
.dl__alt {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--trace);
  text-wrap: pretty;
}
.dl__alt a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.dl__alt a:hover { color: var(--accent); }
.dl__alt strong { color: var(--dim); font-weight: 600; }

.dl__foot {
  margin-top: clamp(32px, 4vw, 44px);
  text-align: center;
  font-size: 13px;
  color: var(--faint);
}

/* ── 页脚 ──────────────────────────────────────────────────────── */

.foot {
  padding-block: clamp(44px, 6vw, 64px);
  border-top: 1px solid var(--line);
}
.foot__in { text-align: center; }
.foot__brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
}
.foot__mark { width: 24px; height: 24px; color: var(--accent); }
.foot__name { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.foot__author { font-size: 13.5px; color: var(--dim); }
.foot__fine { margin-top: 10px; font-size: 12.5px; color: var(--faint); }

/* ── 滚动出现 ──────────────────────────────────────────────────── */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .62s var(--out) var(--d, 0ms),
              transform .62s var(--out) var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

/* 没 JS 就别藏东西——藏了就永远看不见了 */
html:not(.js) .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .bub, .bub__trace { opacity: 1; transform: none; transition: none; }
  .typing { display: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
