/* KeyPocket 网站的样式。方向和 App 一致：中性石墨灰加细线，
   不铺渐变、光晕和玻璃；唯一有颜色的是那张密钥卡。色值取自 DesignSystem/Colors.swift。 */

:root {
  --bg: #fafafa;
  --card: #ffffff;
  --group: #f4f4f5;
  --label: #171717;
  --secondary: #525252;
  --tertiary: #737373;
  --line: rgba(23, 23, 23, 0.08);
  --line-strong: rgba(23, 23, 23, 0.14);
  --accent: #0064d2;
  --ink: #171717;
  --on-ink: #ffffff;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141415;
    --card: #19191b;
    --group: #232325;
    --label: #ededed;
    --secondary: #a1a1a6;
    --tertiary: #85858b;
    --line: rgba(237, 237, 237, 0.08);
    --line-strong: rgba(237, 237, 237, 0.16);
    --accent: #4c9dff;
    --ink: #ededed;
    --on-ink: #141415;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-weight: 600; line-height: 1.25; margin: 0; text-wrap: balance; }
p { margin: 0; }
code, pre, kbd { font-family: var(--mono); }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* 顶栏 */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--label); font-weight: 600; font-size: 16px; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; border-radius: 6px; display: block; }
.nav { display: flex; gap: 24px; font-size: 14px; }
.nav a { color: var(--secondary); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--label); text-decoration: none; }

/* 首屏 */
.hero { padding: 80px 0 64px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero h1 { font-size: 44px; letter-spacing: -0.02em; }
.hero .lead { margin-top: 20px; font-size: 18px; color: var(--secondary); max-width: 30em; }
.cta { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 8px;
  font-size: 15px; font-weight: 500; border: 1px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-primary:hover { opacity: 0.88; }
.btn-plain { border-color: var(--line-strong); color: var(--label); background: var(--card); }
.btn-plain:hover { background: var(--group); }
.btn[aria-disabled="true"] { background: var(--group); color: var(--secondary); border-color: var(--line); cursor: default; }
.platforms { margin-top: 16px; font-size: 13px; color: var(--tertiary); }

/* 密钥卡：整站唯一有颜色的地方 */
.keycard {
  position: relative; overflow: hidden;
  border-radius: 20px; padding: 28px;
  color: #fff;
  background: linear-gradient(135deg, #1c4a3f 0%, #12332b 55%, #0a1a16 100%);
  aspect-ratio: 1.58;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset, 0 24px 48px -24px rgba(10, 26, 22, 0.5);
}
.keycard-top { display: flex; align-items: center; gap: 16px; }
.keycard-glyph { width: 48px; height: 48px; border-radius: 12px; background: rgba(255, 255, 255, 0.12); display: grid; place-items: center; }
.keycard-glyph svg { width: 24px; height: 24px; }
.keycard-name { font-size: 22px; font-weight: 600; line-height: 1.2; }
.keycard-sub { font-size: 13px; color: rgba(255, 255, 255, 0.64); }
.keycard-tag { margin-left: auto; align-self: flex-start; font-size: 12px; color: rgba(255, 255, 255, 0.56); }
.keycard-field { font-size: 12px; color: rgba(255, 255, 255, 0.56); }
.keycard-secret { margin-top: 4px; font-family: var(--mono); font-size: clamp(14px, 2.2vw, 19px); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.keycard-copy {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 8px;
  background: #fff; color: #171717; font-size: 14px; font-weight: 500;
}
.keycap {
  font-family: var(--sans); font-size: 12px; line-height: 1;
  padding: 3px 5px; border-radius: 4px;
  background: var(--group); color: var(--secondary); border: 1px solid var(--line);
}
.keycard .keycap { background: #f4f4f5; color: #525252; border-color: rgba(23, 23, 23, 0.08); }
.hero-note { margin-top: 16px; font-size: 13px; color: var(--tertiary); text-align: center; }

/* 分节 */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: 28px; letter-spacing: -0.01em; }
.section .intro { margin-top: 12px; color: var(--secondary); max-width: 40em; }

.columns { margin-top: 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.columns h3 { font-size: 17px; padding-bottom: 12px; border-bottom: 1px solid var(--line-strong); }
.columns ul { list-style: none; margin: 0; padding: 0; }
.columns li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--secondary); }
.columns li strong { color: var(--label); font-weight: 500; }

.split { margin-top: 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 20px 40px; font-size: 15px; color: var(--secondary); }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line-strong);
  display: grid; place-items: center; font-size: 13px; color: var(--label);
}
.steps strong { display: block; color: var(--label); font-weight: 500; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.panel-title { padding: 12px 16px; font-size: 13px; color: var(--tertiary); border-bottom: 1px solid var(--line); }
pre { margin: 0; padding: 16px; font-size: 13px; line-height: 1.7; overflow-x: auto; color: var(--label); }
.panel p { padding: 12px 16px; font-size: 13px; color: var(--tertiary); border-top: 1px solid var(--line); }

.facts { margin-top: 40px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.facts div { padding: 24px; border-left: 1px solid var(--line); }
.facts div:first-child { border-left: 0; }
.facts dt { font-size: 17px; font-weight: 500; }
.facts dd { margin: 4px 0 0; font-size: 14px; color: var(--secondary); }
.more { margin-top: 24px; font-size: 15px; }

/* 页脚 */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; font-size: 13px; color: var(--tertiary); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--secondary); }
.site-footer .fine { flex-basis: 100%; max-width: 56em; }

/* 文档页：隐私政策、使用条款、支持 */
.doc { max-width: 720px; margin: 0 auto; padding: 56px 24px 80px; }
.doc h1 { font-size: 32px; letter-spacing: -0.01em; }
.doc .meta { margin-top: 8px; font-size: 14px; color: var(--tertiary); }
.doc .summary { margin-top: 32px; padding: 20px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.doc .summary p + p { margin-top: 8px; }
.doc h2 { margin-top: 48px; font-size: 20px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.doc h3 { margin-top: 24px; font-size: 16px; }
.doc p, .doc ul, .doc ol, .doc dl { margin-top: 12px; color: var(--secondary); }
.doc .summary p { margin-top: 0; color: var(--label); }
.doc ul, .doc ol { padding-left: 20px; }
.doc li { margin-top: 6px; }
.doc strong { color: var(--label); font-weight: 500; }
.doc code { font-size: 0.9em; padding: 1px 5px; border-radius: 4px; background: var(--group); color: var(--label); }
.doc pre { margin-top: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.doc pre code { padding: 0; background: none; }
.doc dt { margin-top: 24px; color: var(--label); font-weight: 500; }
.doc dd { margin: 6px 0 0; }
.doc table { margin-top: 16px; width: 100%; border-collapse: collapse; font-size: 14px; }
.doc th, .doc td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--secondary); }
.doc th { color: var(--label); font-weight: 500; }
.table-scroll { overflow-x: auto; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding: 48px 0; gap: 40px; }
  .hero h1 { font-size: 34px; }
  .columns { grid-template-columns: 1fr; gap: 32px; }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .facts div:nth-child(odd) { border-left: 0; }
  .facts div:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .section { padding: 48px 0; }
}

@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .doc { padding: 40px 16px 64px; }
  .nav { gap: 16px; }
  .keycard { padding: 20px; border-radius: 16px; }
  .keycard-name { font-size: 18px; }
  .facts { grid-template-columns: 1fr; }
  .facts div { border-left: 0; }
  .facts div + div { border-top: 1px solid var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
