:root {
  --paper: #f7f8fa;
  --paper-raised: #ffffff;
  --paper-sunk: #eceff3;
  --ink: #14161a;
  --ink-soft: #4a5058;
  --ink-faint: #878e98;
  --scan: #00a8b5;
  --pupil: #1b2a4a;
  --rule: #dde2e8;

  --font-cn: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-tag: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --gap: 1.5rem;
  --page: 68rem;
}

* { box-sizing: border-box; }

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

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

a { color: inherit; }

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

/* ---------- 顶栏 ---------- */

.topbar {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 4rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  text-decoration: none;
}

.brand-cn {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: .12em;
}

.brand-en {
  font-family: var(--font-tag);
  font-size: .68rem;
  letter-spacing: .28em;
  color: var(--ink-faint);
  text-transform: lowercase;
}

.topbar-links {
  display: flex;
  gap: 1.5rem;
  font-size: .9rem;
  color: var(--ink-soft);
}

.topbar-links a { text-decoration: none; }
.topbar-links a:hover { color: var(--scan); }

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 3rem;
  align-items: center;
  padding-top: 3.25rem;
  padding-bottom: 3.75rem;
}

.hero-eyebrow {
  font-family: var(--font-tag);
  font-size: .72rem;
  letter-spacing: .22em;
  color: var(--scan);
  text-transform: uppercase;
  margin: 0 0 1.25rem;
}

.hero-title {
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  line-height: 1.22;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0 0 1.25rem;
}

.hero-title em {
  font-style: normal;
  color: var(--scan);
}

.hero-lede {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 2.5rem;
  max-width: 30rem;
}

/* ---------- 扫码卡片 ---------- */

.scan-card {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.5rem 1rem 1rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.scan-card img {
  display: block;
  width: 116px;
  height: 116px;
  border-radius: 2px;
}

.scan-card-text strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .35rem;
}

.scan-card-text span {
  display: block;
  font-size: .875rem;
  color: var(--ink-faint);
  line-height: 1.6;
}

/* ---------- 签名元素：矫正演示 ---------- */

.stage {
  position: relative;
  aspect-ratio: 4 / 5;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.stage::after {
  content: "";
  position: absolute;
  inset: auto 12% 8%;
  height: 40px;
  background: radial-gradient(ellipse at center, rgba(20, 22, 26, .16), transparent 72%);
  filter: blur(6px);
}

.sheet {
  position: relative;
  width: 66%;
  aspect-ratio: 1 / 1.414;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 2px;
  box-shadow: 0 18px 40px -18px rgba(20, 22, 26, .35);
  padding: 9% 10%;
  overflow: hidden;
  font-size: clamp(7px, .95vw, 12px);
  transform: rotateX(16deg) rotateY(-22deg) rotate(-6deg) scale(.94);
  animation: rectify 1.6s cubic-bezier(.2, .85, .25, 1) .45s both;
}

@keyframes rectify {
  to { transform: rotateX(0) rotateY(0) rotate(0) scale(1); }
}

/* 纸上的内容：用线条表示文字 */

.line {
  height: .5em;
  border-radius: 1px;
  background: var(--paper-sunk);
  margin-bottom: .62em;
}

.line.head {
  height: .85em;
  width: 58%;
  background: var(--pupil);
  margin-bottom: 1.5em;
}

.line.sub {
  height: .6em;
  width: 34%;
  background: #c3cad4;
  margin-top: 1.5em;
  margin-bottom: .9em;
}

.line.short { width: 46%; }
.line.mid { width: 74%; }
.line.long { width: 92%; }

/* 扫描光带 */

.scanline {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--scan);
  box-shadow: 0 0 18px 5px rgba(0, 168, 181, .45);
  opacity: 0;
  animation: sweep 1.9s ease-in-out 2.05s 1 both;
}

@keyframes sweep {
  0%   { top: -2%;  opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { top: 102%; opacity: 0; }
}

.stage-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-tag);
  font-size: .7rem;
  letter-spacing: .16em;
  color: var(--ink-faint);
}

/* ---------- 通用区块 ---------- */

.band {
  border-top: 1px solid var(--rule);
  padding: 4.5rem 0;
}

.band-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: .02em;
  margin: 0 0 2.5rem;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.25rem 2.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.features h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 .5rem;
  padding-top: .9rem;
  border-top: 2px solid var(--ink);
}

.features p {
  margin: 0;
  font-size: .92rem;
  color: var(--ink-soft);
}

/* ---------- iOS 预告 ---------- */

.next {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.next-tag {
  font-family: var(--font-tag);
  font-size: .7rem;
  letter-spacing: .18em;
  color: var(--scan);
  border: 1px solid var(--scan);
  border-radius: 2px;
  padding: .2rem .5rem;
  text-transform: uppercase;
}

.next p {
  margin: 0;
  color: var(--ink-soft);
}

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

.foot {
  border-top: 1px solid var(--rule);
  background: var(--paper-sunk);
  padding: 3rem 0 3.5rem;
  font-size: .875rem;
  color: var(--ink-soft);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}

.foot h4 {
  font-size: .72rem;
  font-family: var(--font-tag);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  margin: 0 0 1rem;
}

.foot ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.foot li { margin-bottom: .5rem; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--scan); }

.foot-legal {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--ink-faint);
}

/* ---------- 协议页 ---------- */

.doc {
  max-width: 46rem;
  padding-top: 3.5rem;
  padding-bottom: 4.5rem;
}

.doc-back {
  display: inline-block;
  font-size: .875rem;
  color: var(--ink-faint);
  text-decoration: none;
  margin-bottom: 2rem;
}

.doc-back:hover { color: var(--scan); }

.doc h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  line-height: 1.35;
  margin: 0 0 .75rem;
}

.doc-meta {
  font-family: var(--font-tag);
  font-size: .74rem;
  letter-spacing: .1em;
  color: var(--ink-faint);
  margin: 0 0 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--rule);
}

.doc-meta span + span::before {
  content: "·";
  margin: 0 .6rem;
}

.doc-intro {
  font-size: .96rem;
  color: var(--ink-soft);
  background: var(--paper-sunk);
  border-left: 2px solid var(--scan);
  padding: 1.25rem 1.5rem;
  margin: 0 0 3rem;
}

.doc h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2.75rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.doc p {
  margin: 0 0 .9rem;
  font-size: .95rem;
}

.doc p.indent { padding-left: 1.5rem; }
.doc p.bold { font-weight: 600; color: var(--ink); }

.doc-note {
  margin-top: 3rem;
  padding: 1.25rem 1.5rem;
  background: var(--paper-sunk);
  border-radius: 3px;
  font-size: .9rem;
  color: var(--ink-soft);
}

/* ---------- 可访问性与响应式 ---------- */

a:focus-visible,
.brand:focus-visible {
  outline: 2px solid var(--scan);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .sheet {
    animation: none;
    transform: none;
  }
  .scanline { display: none; }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
  .topbar-links { gap: 1.1rem; font-size: .85rem; }
  .stage {
    aspect-ratio: 5 / 4;
    order: -1;
  }
  .sheet { width: 46%; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .brand-en { display: none; }
  .topbar-links { gap: .9rem; font-size: .8rem; }
  .features { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: 2rem; }
  .scan-card {
    width: 100%;
    padding: 1rem;
    gap: 1rem;
  }
  .scan-card img { width: 96px; height: 96px; }
  .sheet { width: 58%; }
  .band { padding: 3.25rem 0; }
}
