﻿/* ── 设计变量 ───────────────────────────────────────── */
:root {
  /* 米白纸底。卡片、命令条一类的元素仍用纯白，靠这点色差浮起来 */
  --paper: #f7f3ea;
  --paper-tint: #f1ebde;
  --ink: #1a1a1a;
  --ink-soft: #56514d;
  --ink-mute: #857e72;
  --line: #e3dbcc;
  /* 庄重的中国红：深、正、不偏橙 */
  --red: #c8161d;
  --red-deep: #9e1016;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --pad: clamp(20px, 5vw, 64px);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB",
    system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
ol, ul { margin: 0; padding: 0; list-style: none; }

/* ── 按钮 ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.btn--solid { background: var(--red); color: #fff; }
.btn--solid:hover { background: var(--red-deep); }
.btn--ghost { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn--ghost:hover { border-color: #cdc2ad; }

/* ── 顶栏 ───────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 68px;
  padding: 0 var(--pad);
  background: rgba(247, 243, 234, 0.78);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.nav.is-stuck { border-bottom-color: var(--line); }
.nav__brand { display: flex; align-items: center; }

/* 字标：xiaoya 取中国红，claw 取墨色 */
.wordmark {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  white-space: nowrap;
}
.wordmark em { font-style: normal; color: var(--red); }

.nav__links { display: flex; gap: 28px; margin-left: auto; font-size: 14.5px; color: var(--ink-soft); }
.nav__links a { transition: color 0.2s; }
.nav__links a:hover { color: var(--red-deep); }
.nav__cta { height: 38px; padding: 0 18px; font-size: 14px; }

/* ── 首屏 ───────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  /* 顶栏固定定位会盖住上方 68px，所以上下内边距本该差出这一段才算视觉居中；
     这里刻意少差一些，让内容整体再抬高约 28px，视觉重心偏上一点。 */
  padding: 108px var(--pad) 98px;
  overflow: hidden;
  background: var(--paper);
}

/* 常驻底纹：以左下角为源向外渐隐，只让那一带的底图透出来，
   右上留白给标题。鼠标激起的水波会叠在它上面，交界处不会有断层。 */
.hero__base {
  position: absolute;
  inset: 0;
  background: url("assets/hero-bg.png") center / cover no-repeat;
  opacity: 0.9;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(108% 82% at 0% 100%,
    #000 0%, rgba(0, 0, 0, 0.78) 30%, rgba(0, 0, 0, 0.36) 54%,
    rgba(0, 0, 0, 0.1) 74%, transparent 88%);
  mask-image: radial-gradient(108% 82% at 0% 100%,
    #000 0%, rgba(0, 0, 0, 0.78) 30%, rgba(0, 0, 0, 0.36) 54%,
    rgba(0, 0, 0, 0.1) 74%, transparent 88%);
}

/* 水波层：底图只在 canvas 画出的波面下显影，其余保持纸白 */
.hero__ripple {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.hero__ripple.is-ready { opacity: 1; }

.hero__inner { position: relative; z-index: 2; max-width: 860px; text-align: center; }

.hero__eyebrow {
  display: inline-block;
  margin-bottom: 26px;
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink-mute);
  font-size: 13px;
  letter-spacing: 0.02em;
}
.hero__title { font-size: clamp(34px, 6.2vw, 62px); letter-spacing: -0.035em; }
.hero__title em { font-style: normal; color: var(--red); }
.hero__sub {
  margin: 24px auto 0;
  max-width: 640px;
  color: var(--ink-soft);
  font-size: clamp(15px, 1.8vw, 18px);
}

/* ── 安装命令：胶囊分段 Tab 与命令行是两个独立元素，没有外层卡片 ── */
.cmd { margin: 36px auto 0; max-width: 520px; }

.cmd__tabs {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 14px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(26, 20, 12, 0.055);
}
.cmd__tab {
  padding: 6px 20px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-mute);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}
.cmd__tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(26, 20, 12, 0.08);
}

.cmd__line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px 13px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
}
.cmd__prompt { color: var(--red); font-family: var(--mono); font-size: 14px; }
.cmd__text { flex: 1; overflow-x: auto; color: var(--ink); font-family: var(--mono); font-size: 14px; white-space: nowrap; }
.cmd__copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-mute);
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}
.cmd__copy:hover { color: var(--ink); background: rgba(26, 20, 12, 0.05); }
.cmd__copy svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cmd__copy .cmd__done { display: none; }
.cmd__copy.is-done { color: var(--red); }
.cmd__copy.is-done .cmd__done { display: block; }
.cmd__copy.is-done .cmd__clip { display: none; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 30px; }

/* ── 信任条 ─────────────────────────────────────────── */
.strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin: 0 var(--pad);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--line);
}
.strip__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 30px 12px;
  background: var(--paper);
}
.strip__item strong { color: var(--red); font-size: 26px; font-weight: 650; letter-spacing: -0.02em; }
.strip__item span { color: var(--ink-mute); font-size: 13.5px; }

/* ── 通用区块 ───────────────────────────────────────── */
.section { padding: clamp(72px, 11vw, 132px) var(--pad); }
.section--tint { background: var(--paper-tint); }
.section__head { max-width: 720px; margin: 0 auto clamp(44px, 6vw, 72px); text-align: center; }
.section__eyebrow { color: var(--red); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; }
.section__title { margin-top: 12px; font-size: clamp(26px, 3.8vw, 40px); }

/* ── 能力卡片 ───────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
  max-width: 1180px;
  margin: 0 auto;
}
.card {
  padding: 32px 30px 34px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  transition: border-color 0.25s, transform 0.25s;
}
.card:hover { border-color: #cdc2ad; transform: translateY(-3px); }
.card__icon { width: 26px; height: 26px; fill: none; stroke: var(--red); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.card h3 { margin: 18px 0 10px; font-size: 19px; }
.card p { color: var(--ink-soft); font-size: 15px; }

/* ── 三步 ───────────────────────────────────────────── */
.flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  max-width: 1080px;
  margin: 0 auto;
}
/* 这个区块是米色底，只靠一条细线分隔会看不出边界，改用白卡片 */
.flow__step {
  position: relative;
  padding: 28px 28px 30px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
  transition: border-color 0.25s, transform 0.25s;
}
.flow__step:hover { border-color: #cdc2ad; transform: translateY(-3px); }
.flow__no { color: var(--red); font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; }
.flow__step h3 { margin: 8px 0 10px; font-size: 20px; }
.flow__step p { color: var(--ink-soft); font-size: 15px; }

/* ── 安全 ───────────────────────────────────────────── */
.safe {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.05fr);
  gap: clamp(36px, 6vw, 80px);
  align-items: start;
  max-width: 1080px;
  margin: 0 auto;
}
.safe .section__head { margin: 0; text-align: left; }
.safe .section__title { max-width: 12em; }
.safe__lead { margin-top: 18px; color: var(--ink-soft); font-size: 15.5px; }
.safe__list { display: grid; gap: 1px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--line); overflow: hidden; }
.safe__list li { padding: 22px 26px; background: #fff; color: var(--ink-soft); font-size: 15px; }
.safe__list strong { display: block; margin-bottom: 4px; color: var(--ink); font-weight: 600; }

/* ── 收尾 CTA ───────────────────────────────────────── */
.cta {
  padding: clamp(80px, 12vw, 140px) var(--pad);
  border-top: 1px solid var(--line);
  text-align: center;
}
.cta h2 { font-size: clamp(28px, 4.4vw, 44px); }
.cta p { margin-top: 16px; color: var(--ink-soft); }

/* ── 页脚 ───────────────────────────────────────────── */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px 36px;
  padding: 32px var(--pad);
  border-top: 1px solid var(--line);
  background: var(--paper-tint);
  color: var(--ink-mute);
  font-size: 13.5px;
}
.foot__brand { display: flex; align-items: center; }
.foot__brand .wordmark { font-size: 17px; }
.foot__links { display: flex; gap: 24px; margin-left: auto; }
.foot__links a:hover { color: var(--red-deep); }
.foot__copy { width: 100%; padding-top: 8px; border-top: 1px solid var(--line); }

/* ── 滚动进场 ───────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.is-in { opacity: 1; transform: none; }
.grid .reveal:nth-child(2), .flow .reveal:nth-child(2) { transition-delay: 0.08s; }
.grid .reveal:nth-child(3), .flow .reveal:nth-child(3) { transition-delay: 0.16s; }
.grid .reveal:nth-child(5) { transition-delay: 0.08s; }
.grid .reveal:nth-child(6) { transition-delay: 0.16s; }

/* ── 响应式 ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .safe { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .nav__links { display: none; }
  .nav__cta { margin-left: auto; }
  .only-wide { display: none; }
  .strip { grid-template-columns: repeat(2, 1fr); }
  .hero { min-height: auto; padding-top: 132px; }
}

/* 减弱动效：只关掉装饰性过渡，墨迹揭示本身是核心功能，由 main.js 决定如何降级。
   降级判断不写在 CSS 里，避免与 JS 形成两套互相打架的条件。 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card { transition: none; }
}
