/* ============================================================
   MarkFlow 主页 · 原生 Web UI
   设计系统：ui-ux-pro-max (Minimalism & Swiss) → design-system/markflow/
   主题：呼应应用本身的克制中性色 + 单一青绿强调色 + 下载橙色 CTA
   ============================================================ */

:root {
  color-scheme: light dark;

  /* 色彩令牌 */
  --bg: #f5f7f6;
  --bg-soft: #eef3f1;
  --surface: #ffffff;
  --surface-2: #f0f5f3;
  --ink: #17232b;
  --ink-2: #33454c;
  --muted: #4f5d63;
  --faint: #5f6e74;
  --line: #dde6e3;
  --line-strong: #c2d2cd;

  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #e3f1ee;
  --accent-line: #b7dbd4;

  --action: #c2410c;
  --action-strong: #9a3412;
  --action-soft: #fdeae0;

  --on-dark: #ffffff;

  /* 字体 */
  --font-sans: "Plus Jakarta Sans", "Segoe UI", -apple-system, BlinkMacSystemFont,
    "Inter", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas,
    "SF Mono", monospace;

  /* 布局 */
  --container: 1200px;
  --nav-h: 64px;
  --radius: 10px;
  --radius-sm: 6px;

  /* 阴影（克制：浅色轻微、深色更浅） */
  --shadow-xs: 0 1px 2px rgba(23, 35, 43, 0.05);
  --shadow-sm: 0 2px 6px rgba(23, 35, 43, 0.06);
  --shadow-md: 0 10px 24px rgba(23, 35, 43, 0.09);
  --shadow-lg: 0 24px 56px rgba(23, 35, 43, 0.13);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1719;
    --bg-soft: #132024;
    --surface: #182428;
    --surface-2: #1e2d31;
    --ink: #e6efec;
    --ink-2: #c3d2ce;
    --muted: #92a5a0;
    --faint: #6f827d;
    --line: #29393c;
    --line-strong: #3f5658;

    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: #123338;
    --accent-line: #1f5b58;

    --action: #fb923c;
    --action-strong: #fbbf77;
    --action-soft: #3d2518;

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.6);
  }
}

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

html {
  /* 注意：不使用 scroll-behavior: smooth —— 全局平滑滚动会与 GSAP ScrollTrigger
     的 scrub / pin 位置计算冲突，导致动画迟滞与卡顿；锚点平滑改由 JS 单独处理 */
  -webkit-text-size-adjust: 100%;
}

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

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

a {
  color: var(--accent-strong);
  text-decoration: none;
  transition: color 180ms ease;
}

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

button,
a {
  cursor: pointer;
}

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

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

.container {
  width: min(var(--container), 100% - 48px);
  margin-inline: auto;
}

section[id] {
  scroll-margin-top: calc(var(--nav-h) + 12px);
}

.skip-link {
  position: fixed;
  top: -48px;
  left: 16px;
  z-index: 120;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: top 180ms ease;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- 滚动进度条 ---------- */
.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 110;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- 顶部导航 ---------- */
.site-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease, background 200ms ease;
}

.site-nav.scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}

.nav-inner {
  width: min(var(--container), 100% - 48px);
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

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

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  box-shadow: var(--shadow-xs);
}

.brand-version {
  margin-left: 2px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 18px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-inline: auto;
}

.nav-links a {
  position: relative;
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 500;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
  transition: right 200ms ease;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  right: 0;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nav-github {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  transition: color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.nav-github svg {
  width: 19px;
  height: 19px;
}

.nav-github:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: nowrap;
  transition: transform 200ms ease, box-shadow 200ms ease,
    background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn-sm {
  height: 38px;
  padding: 0 18px;
  font-size: 14px;
}

.btn-lg {
  height: 52px;
  padding: 0 26px;
  font-size: 16px;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--ink-2);
  color: var(--bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-accent {
  background: var(--action);
  color: #fff;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--action) 32%, transparent);
}

.btn-accent:hover {
  background: var(--action-strong);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px color-mix(in srgb, var(--action) 38%, transparent);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  transform: translateY(-1px);
}

/* ---------- 通用章节头 ---------- */
.section {
  padding-block: clamp(72px, 9vw, 120px);
}

.section-alt {
  background: var(--bg-soft);
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 640px;
  margin-bottom: clamp(40px, 6vw, 64px);
}

.section-head.is-center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.section-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.section-sub {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16.5px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(48px, 8vw, 96px));
  padding-bottom: clamp(56px, 8vw, 96px);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(640px 420px at 88% -6%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 62%),
    radial-gradient(520px 360px at 12% 108%, color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
}

.hero-title {
  margin: 0;
  font-size: clamp(36px, 5.1vw, 58px);
  line-height: 1.13;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.hero-title-accent {
  color: var(--accent);
}

.hero-sub {
  margin: 22px 0 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 17.5px;
  line-height: 1.75;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
}

.hero-meta li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--faint);
  font-size: 13.5px;
}

.hero-meta svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

/* 截图舞台 */
.hero-stage {
  perspective: 1400px;
}

.shot-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.frame-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.frame-dots {
  display: inline-flex;
  gap: 6px;
}

.frame-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.frame-dots i:first-child {
  background: color-mix(in srgb, var(--action) 70%, var(--line-strong));
}

.frame-address {
  flex: 1;
  margin-right: auto;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.frame-body {
  background: var(--surface);
}

.frame-body img {
  width: 100%;
  height: auto;
}

/* ============================================================
   STAT STRIP
   ============================================================ */
.stat-strip {
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}

.stat {
  padding: 30px 28px;
  background: var(--surface);
}

.stat-num {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: clamp(30px, 3.4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}


/* ============================================================
   CONVERT FLOW
   ============================================================ */
.convert-flow {
  display: grid;
  grid-template-columns: 1fr auto 1.15fr auto 1fr;
  align-items: stretch;
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.convert-step {
  padding: 30px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.convert-step-main {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-sm);
}

.step-tag {
  display: inline-block;
  margin-bottom: 18px;
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.step-tag-accent {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.convert-step h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.convert-step p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.7;
}

.format-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.format-tags li {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12px;
}

.feature-check {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-check li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 14px;
}

.feature-check svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex: 0 0 auto;
}

.convert-arrow {
  display: grid;
  place-items: center;
  color: var(--faint);
}

.convert-arrow svg {
  width: 26px;
  height: 26px;
}

/* ============================================================
   DOWNLOAD
   ============================================================ */
.download-section {
  padding-block: clamp(72px, 9vw, 120px);
}

.download-card {
  max-width: 880px;
  margin-inline: auto;
  padding: clamp(32px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(480px 260px at 50% -12%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 65%),
    var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}

.download-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 22px;
  border-radius: 15px;
  box-shadow: var(--shadow-sm);
}

.download-head .section-title {
  font-size: clamp(26px, 3.6vw, 36px);
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 36px;
  text-align: left;
}

.platform-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  transition: transform 220ms ease, box-shadow 220ms ease,
    border-color 220ms ease;
}

.platform-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-md);
  color: var(--ink);
}

.platform-os {
  font-size: 16px;
  font-weight: 700;
}

.platform-arch {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 600;
}

.platform-version {
  margin-top: 8px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 12px;
}

.platform-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.platform-action svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  transition: transform 200ms ease;
}

.platform-card:hover .platform-action svg {
  transform: translateY(2px);
}

.download-notes {
  display: grid;
  gap: 10px;
  max-width: 620px;
  margin: 28px auto 0;
  text-align: left;
}

.download-notes p {
  display: flex;
  gap: 10px;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.download-notes p span {
  flex: 1 1 auto;
  min-width: 0;
}

.download-notes svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
  flex: 0 0 auto;
  margin-top: 2px;
}

.download-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 30px;
  margin-top: 28px;
}

.download-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
  font-weight: 600;
}

.download-links svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding-block: 56px 32px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-brand p {
  margin: 14px 0 0;
  max-width: 340px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.footer-col h4 {
  margin: 0 0 14px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-col a {
  color: var(--ink-2);
  font-size: 14.5px;
}

.footer-col a:hover {
  color: var(--accent-strong);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}

.footer-bottom p {
  margin: 0;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-sub {
    margin-inline: auto;
  }

  .hero-cta,
  .hero-meta {
    justify-content: center;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .convert-flow {
    grid-template-columns: 1fr;
  }

  .convert-arrow {
    transform: rotate(90deg);
    padding-block: 2px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .nav-links {
    display: none;
  }

  .nav-inner {
    gap: 12px;
  }

  .platform-grid {
    grid-template-columns: 1fr;
  }

  .stat {
    padding: 22px 18px;
  }

  .frame-bar {
    height: 34px;
  }
}

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

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .btn-lg {
    width: 100%;
  }

  .hero-cta .btn {
    flex: 1 1 200px;
  }
}

/* ---------- 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
