/* 玩梗单词 · play.iyunci.cn
 *
 * 零外部资源：不引 Google Fonts、不引 CDN、不引任何 JS 库。
 * 域名在境内，字体和 CDN 走境外一律不可靠，而且 App 本身就是「离线也能用」的定位，
 * 官网跟着这个原则走：整页只有 HTML + CSS + 一段 20 行的 IntersectionObserver。
 *
 * 配色直接沿用 App 的设计令牌（specs/tokens.json），不另起一套。
 * 官网和 App 长得不像是最廉价的失误。
 */

:root {
  --paper: #faf7f0;          /* bg.canvas，与 App 一致 */
  --surface: #fffdf9;
  --surface-2: #f4efe4;
  --ink: #1f2b38;            /* fg.ink */
  --ink-60: rgba(31, 43, 56, 0.62);
  --ink-40: rgba(31, 43, 56, 0.42);
  --hairline: rgba(31, 43, 56, 0.11);
  --accent: #2e8af0;         /* accent.blue，全站唯一强调色 */
  --accent-ink: #ffffff;
  --accent-wash: rgba(46, 138, 240, 0.09);
  --right: #61c4a6;          /* swipe.right，只在讲滑动语义时出现 */
  --left: #f55745;           /* swipe.left，同上 */
  --shadow: rgba(31, 43, 56, 0.10);

  --radius: 16px;            /* 全站统一圆角，交互元素用 999px 胶囊 */
  --radius-lg: 24px;
  --max: 1160px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14181d;
    --surface: #1b2027;
    --surface-2: #232932;
    --ink: #eef2f6;
    --ink-60: rgba(238, 242, 246, 0.66);
    --ink-40: rgba(238, 242, 246, 0.44);
    --hairline: rgba(238, 242, 246, 0.13);
    --accent: #5aa4f6;
    --accent-ink: #0d1116;
    --accent-wash: rgba(90, 164, 246, 0.13);
    --shadow: rgba(0, 0, 0, 0.42);
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  /* 中文字体只能靠系统栈：一份思源黑体子集也有几 MB，
     为了一个落地页让用户等字体下载不值得。鸿蒙机器命中 HarmonyOS Sans。 */
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Noto Sans CJK SC",
               "Source Han Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* height:auto 是必须的：HTML 上的 width/height 属性会被 UA 样式表映射成
   CSS 呈现提示，height 提示会盖掉 aspect-ratio，图直接被拉成 1200px 原始高。
   属性又不能删——它给浏览器预留了正确的占位比例，是 CLS 的保障。 */
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

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

/* ---------------------------------------------------------------- 导航 */

.nav {
  position: sticky; top: 0; z-index: 40;
  height: 68px;
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.nav.scrolled { border-bottom-color: var(--hairline); }
.nav .wrap { display: flex; align-items: center; gap: 28px; }

.brand {
  font-weight: 800; font-size: 19px; letter-spacing: -.01em;
  text-decoration: none; margin-right: auto; white-space: nowrap;
}
.brand span { color: var(--accent); }

.nav-links { display: flex; gap: 26px; }
.nav-links a {
  font-size: 15px; color: var(--ink-60); text-decoration: none;
  white-space: nowrap; transition: color .2s ease;
}
.nav-links a:hover { color: var(--ink); }

/* ---------------------------------------------------------------- 按钮 */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; white-space: nowrap;
  padding: 13px 26px; border-radius: 999px;
  font-size: 16px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .16s cubic-bezier(.16,1,.3,1), box-shadow .16s ease, background .16s ease;
}
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -8px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:active { transform: translateY(0) scale(.985); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--hairline); }
.btn-ghost:hover { background: var(--surface-2); transform: translateY(-2px); }
.btn-ghost:active { transform: translateY(0) scale(.985); }
.btn-sm { padding: 9px 20px; font-size: 15px; }

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

/* ---------------------------------------------------------------- 首屏 */

.hero {
  display: grid;
  /* 非对称，不做 50/50。
     右列必须是**确定宽度**：写成 auto 的话，配上里面 width:min(100%,…) 会形成
     「轨道按内容定宽、内容按轨道取 100%」的循环依赖，浏览器解出来的结果是
     文字列被压到 200px、图被拉成 375×1209。clamp 给了确定值就没有这个问题。 */
  grid-template-columns: minmax(0, 1fr) clamp(220px, 26vw, 340px);
  gap: 56px; align-items: center;
  /* 首屏必须一屏装得下：CTA 不能要滚动才看得见 */
  min-height: calc(100dvh - 68px);
  align-content: center;
  padding: 48px 0 64px;
}
.hero h1 {
  margin: 0 0 20px;
  font-size: clamp(38px, 5.2vw, 62px);
  line-height: 1.14; letter-spacing: -.03em; font-weight: 800;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p {
  margin: 0 0 30px; max-width: 30em;
  font-size: 18px; color: var(--ink-60);
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-art { position: relative; width: 100%; }
/* 卡是 3:4 的。max-height 是矮屏的那道保险：屏不够高就裁高度而不是顶穿首屏。 */
.hero-art img {
  width: 100%; aspect-ratio: 3 / 4; max-height: 54vh; object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px -28px var(--shadow), 0 2px 0 var(--hairline);
  transform: rotate(1.6deg);
}
/* 卡面下方的词条说明，不压在图上 */
.hero-cap {
  margin-top: 18px; padding-left: 4px;
  font-size: 15px; color: var(--ink-60);
}
.hero-cap b { display: block; font-size: 21px; color: var(--ink); letter-spacing: -.01em; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding: 28px 0 56px; min-height: 0; }
  .hero-art { order: -1; max-width: 264px; }
  .hero-art img { transform: none; max-height: 40vh; }
}

/* ---------------------------------------------------------------- 区块骨架 */

section { padding: 92px 0; }
.section-head { max-width: 34em; margin-bottom: 44px; }
.section-head h2 {
  margin: 0 0 12px;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.22; letter-spacing: -.025em; font-weight: 800;
}
.section-head p { margin: 0; font-size: 17px; color: var(--ink-60); }

@media (max-width: 700px) { section { padding: 64px 0; } }

/* ---------------------------------------------------------------- 梗卡横向画廊 */

.gallery-band { background: var(--surface-2); }
.rail {
  display: flex; gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 24px 24px;
  margin: 0 -24px;
  scrollbar-width: thin;
}
.rail::-webkit-scrollbar { height: 6px; }
.rail::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 999px; }

.card {
  flex: 0 0 258px; scroll-snap-align: start;
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--hairline);
  overflow: hidden;
  transition: transform .22s cubic-bezier(.16,1,.3,1), box-shadow .22s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 34px -18px var(--shadow); }
.card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.card-body { padding: 15px 17px 19px; }
.card-word {
  font-size: 21px; font-weight: 700; letter-spacing: -.01em;
  font-family: ui-sans-serif, system-ui, "Helvetica Neue", sans-serif;
}
.card-phon { font-size: 13px; color: var(--ink-40); margin-top: 1px; }
.card-hook { font-size: 15px; color: var(--ink-60); margin-top: 9px; }
.card-hook b { color: var(--accent); font-weight: 600; }

/* ---------------------------------------------------------------- 交错步骤 */

.steps { display: grid; gap: 8px; }
.step {
  display: grid; grid-template-columns: 200px 1fr;
  gap: 32px; align-items: start;
  padding: 30px 0; border-top: 1px solid var(--hairline);
}
.step:last-child { border-bottom: 1px solid var(--hairline); }
.step h3 { margin: 0; font-size: 23px; letter-spacing: -.02em; font-weight: 750; }
.step p { margin: 6px 0 0; color: var(--ink-60); max-width: 40em; }
/* 交错：第二条整体右移，打破三行等距的呆板 */
.step:nth-child(2) { padding-left: 6%; }
.step:nth-child(3) { padding-left: 12%; }

.swipe-key { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 14px; font-size: 15px; }
.swipe-key span { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-60); }
.swipe-key i {
  width: 22px; height: 3px; border-radius: 2px; display: inline-block; font-style: normal;
}
.swipe-key .k-right i { background: var(--right); }
.swipe-key .k-left i { background: var(--left); }

@media (max-width: 760px) {
  .step { grid-template-columns: 1fr; gap: 6px; padding: 24px 0; }
  .step:nth-child(2), .step:nth-child(3) { padding-left: 0; }
}

/* ---------------------------------------------------------------- 算法整幅陈述 */

.statement { background: var(--ink); color: var(--paper); }
.statement .wrap { max-width: 900px; }
.statement h2 {
  margin: 0 0 22px;
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.22; letter-spacing: -.03em; font-weight: 800;
}
.statement p { margin: 0 0 16px; font-size: 18px; color: rgba(250, 247, 240, .72); max-width: 40em; }
.statement strong { color: var(--paper); font-weight: 650; }
@media (prefers-color-scheme: dark) {
  .statement { background: var(--surface-2); color: var(--ink); }
  .statement p { color: var(--ink-60); }
  .statement strong { color: var(--ink); }
}

/* ---------------------------------------------------------------- 价格 */

.plans { display: grid; grid-template-columns: 1fr 1.15fr; gap: 20px; align-items: stretch; }
.plan {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius-lg); padding: 32px;
  display: flex; flex-direction: column;
}
.plan-pro { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-wash); }
.plan h3 { margin: 0 0 4px; font-size: 22px; font-weight: 750; letter-spacing: -.02em; }
.plan .tag { font-size: 15px; color: var(--ink-60); margin: 0 0 22px; }
.plan ul { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 11px; }
.plan li { display: flex; gap: 10px; font-size: 16px; color: var(--ink-60); align-items: baseline; }
.plan li::before {
  content: ""; flex: 0 0 7px; height: 7px; border-radius: 2px;
  background: var(--accent); transform: translateY(-1px);
}
.plan-free li::before { background: var(--ink-40); }
.plan .foot { margin-top: auto; }
.price-note { margin: 34px 0 0; font-size: 14px; color: var(--ink-40); }

@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- 下载 */

.download { text-align: center; }
.download h2 {
  margin: 0 0 14px; font-size: clamp(28px, 3.6vw, 42px);
  letter-spacing: -.03em; font-weight: 800;
}
.download p { margin: 0 auto 30px; max-width: 30em; color: var(--ink-60); }
.stores { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- 页脚 */

footer {
  border-top: 1px solid var(--hairline);
  padding: 52px 0 44px; font-size: 15px; color: var(--ink-60);
}
.foot-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px;
  margin-bottom: 36px;
}
.foot-grid h4 { margin: 0 0 12px; font-size: 15px; font-weight: 650; color: var(--ink); }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.foot-grid a { color: var(--ink-60); text-decoration: none; transition: color .2s ease; }
.foot-grid a:hover { color: var(--accent); }
.foot-note { font-size: 14px; color: var(--ink-40); max-width: 30em; }

.legal {
  border-top: 1px solid var(--hairline); padding-top: 22px;
  display: flex; gap: 8px 20px; flex-wrap: wrap; align-items: center;
  font-size: 14px; color: var(--ink-40);
}
.legal a { color: var(--ink-40); text-decoration: none; }
.legal a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------------------------------------------------------------- 进场动效
 * MOTION_INTENSITY 5：只做一次性的入场，不做无限循环。
 * 动的目的是让阅读有先后次序，不是为了动。 */

.reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity .62s cubic-bezier(.16,1,.3,1), transform .62s cubic-bezier(.16,1,.3,1);
}
.reveal.in { opacity: 1; transform: none; }
.reveal[data-d="1"] { transition-delay: .07s; }
.reveal[data-d="2"] { transition-delay: .14s; }
.reveal[data-d="3"] { transition-delay: .21s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card { transition: none; }
  .btn:hover, .card:hover { transform: none; }
}
