/* 记忆同步官网样式
   冷中性色板加单一钴蓝强调色，系统浅色深色模式，
   响应式单列布局，支持减弱动态偏好。 */

:root {
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-muted: #eef1f5;
  --text: #1b222b;
  --text-secondary: #46515d;
  --border: #d7dee5;
  --accent: #1d4fd8;
  --accent-hover: #173fb0;
  --accent-soft: #e8edfb;
  --on-accent: #ffffff;
  --focus: #1d4fd8;
  --radius: 14px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.06);
  --content-max: 1080px;
  --font-sans: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --surface: #151b22;
    --surface-muted: #1b222b;
    --text: #e7ebef;
    --text-secondary: #a9b3bd;
    --border: #2a333d;
    --accent: #7d9dff;
    --accent-hover: #9ab3ff;
    --accent-soft: #1b2745;
    --on-accent: #0d1420;
    --focus: #7d9dff;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

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

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 跳过链接 */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  left: 16px;
  top: 12px;
  color: var(--on-accent);
}

/* 头部与导航 */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 14px 24px;
}

.brand {
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  color: var(--accent);
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.site-nav a {
  display: inline-block;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.site-nav .nav-cta {
  color: var(--accent);
}

.site-nav .nav-cta:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

.site-nav .nav-github {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.site-nav .nav-github svg {
  flex: none;
}

/* 首屏 */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 72px 24px 64px;
}

.hero h1 {
  font-size: clamp(30px, 4.4vw, 44px);
  line-height: 1.25;
  margin: 0 0 16px;
  letter-spacing: 0.01em;
}

.hero-sub {
  color: var(--text-secondary);
  font-size: 17px;
  margin: 0 0 28px;
  max-width: 34em;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-visual {
  margin: 0;
}

.hero-visual img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent);
}

.btn-secondary {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* 通用区块 */

.section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 56px 24px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 112px;
}

.section h2 {
  font-size: 28px;
  line-height: 1.3;
  margin: 0 0 8px;
}

.section-lead {
  color: var(--text-secondary);
  margin: 0 0 28px;
  max-width: 40em;
}

/* 步骤列表 */

.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 24px;
  min-width: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 52px;
  min-width: 0;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 2px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.steps h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.steps p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 46em;
}

@media (min-width: 768px) {
  .process-flow {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }

  .process-flow li:first-child {
    grid-row: 1 / span 2;
    padding-top: 14px;
    padding-right: 48px;
  }
}

/* 提示块 */

.note {
  margin-top: 32px;
  padding: 18px 22px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.note h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.note p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 46em;
}

/* 事实列表 */

.facts {
  display: grid;
  gap: 24px;
  margin: 0;
}

.security-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 56px;
  align-items: center;
}

.security-visual {
  margin: 0;
}

.security-visual img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.fact dt {
  font-weight: 700;
  margin-bottom: 4px;
}

.fact dd {
  margin: 0;
  color: var(--text-secondary);
  max-width: 46em;
}

/* 代码块 */

pre {
  margin: 14px 0 0;
  padding: 16px 18px;
  max-width: 100%;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.6;
}

code {
  font-family: var(--font-mono);
}

/* 下载区块 */

.download-card {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-card);
}

.download-info h3 {
  margin: 0 0 6px;
  font-size: 17px;
}

.download-info p {
  margin: 0 0 8px;
  color: var(--text-secondary);
}

.download-info .mono {
  font-family: var(--font-mono);
  font-size: 13px;
  word-break: break-all;
}

.download-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* 页脚 */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 24px 40px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.site-footer p {
  margin: 4px 0;
}

/* 入场动画 */

html.js [data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html.js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* 移动端单列 */

@media (max-width: 767px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 20px;
  }

  .site-nav ul {
    gap: 2px;
  }

  .site-nav a {
    padding: 6px 10px;
    font-size: 14px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 48px 20px 40px;
    gap: 32px;
  }

  .hero h1 {
    font-size: 30px;
  }

  .section {
    padding: 44px 20px;
  }

  .security-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .steps li {
    padding-left: 0;
    padding-top: 44px;
  }

  .steps li::before {
    top: 0;
  }

  .download-card {
    flex-direction: column;
    align-items: stretch;
  }
}
