:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --radius: 16px;
  --header-h: 72px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

main,
#page-root {
  flex: 1 0 auto;
  width: 100%;
}

.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(37, 99, 235, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(124, 58, 237, 0.08), transparent),
    var(--bg);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}

/* Header */
.header {
  position: sticky; top: 0; z-index: 100;
  min-height: var(--header-h);
  padding-top: var(--safe-top);
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: var(--header-h);
}
.header-nav-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.125rem; color: var(--text); text-decoration: none;
  flex-shrink: 0;
}
.logo-icon {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; border-radius: 10px; font-size: 16px;
}
.nav { display: flex; gap: 4px; flex-wrap: nowrap; }
.nav-link {
  padding: 8px 16px; border-radius: 999px; font-size: 0.9375rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none; transition: all 0.2s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--primary); background: var(--primary-soft); }
.nav-link.active { color: var(--primary); background: var(--primary-soft); font-weight: 600; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-backdrop {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: 12px; font-weight: 600; font-size: 0.9375rem;
  border: none; cursor: pointer; text-decoration: none; transition: all 0.2s; white-space: nowrap;
}
.btn-sm { padding: 8px 16px; font-size: 0.875rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,0.35); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline { border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--primary); background: var(--primary-soft); }
.btn-white { background: #fff; color: var(--primary); }
.btn-white:hover { background: #f1f5f9; }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem;
  background: #f1f5f9; color: var(--text-muted); font-weight: 600;
}
.pill-blue { background: var(--primary-soft); color: var(--primary); }

/* Hero Home */
.hero-home { padding: 56px 0 32px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center;
}
.badge {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-size: 0.8125rem; font-weight: 700;
  margin-bottom: 20px; border: 1px solid #bfdbfe;
}
.hero-copy h1 {
  font-size: clamp(2.25rem, 4vw, 3.25rem); line-height: 1.12; letter-spacing: -0.03em;
  margin-bottom: 12px; font-weight: 800;
}
.hero-sub { color: var(--primary); font-weight: 600; font-size: 1.0625rem; margin-bottom: 12px; }
.hero-desc { color: var(--text-muted); font-size: 1.125rem; margin-bottom: 20px; max-width: 540px; }
.hero-highlights {
  list-style: none; margin-bottom: 28px; display: grid; gap: 10px;
}
.hero-highlights li {
  display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 0.9375rem;
}
.hero-highlights .check {
  width: 22px; height: 22px; border-radius: 50%; background: #dcfce7; color: #16a34a;
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.install-preview {
  background: #0f172a; color: #e2e8f0; padding: 16px 20px; border-radius: 14px;
  font-size: 0.875rem; overflow-x: auto; border: 1px solid #1e293b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.install-preview code { font-family: Consolas, Monaco, monospace; }

.hero-visual { position: relative; }
.hero-glow {
  position: absolute; inset: 10% 5% -5%; background: radial-gradient(circle, rgba(37,99,235,0.2), transparent 70%);
  filter: blur(24px); z-index: 0;
}
.panel-mock {
  position: relative; z-index: 1;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden; border: 1px solid var(--border);
}
.panel-mock-lg {
  /* 不用 3D 透视，避免截图文字发糊 */
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
}
.panel-bar {
  display: flex; gap: 8px; padding: 14px 16px; background: #f8fafc; border-bottom: 1px solid var(--border);
}
.panel-bar span { width: 12px; height: 12px; border-radius: 50%; background: #cbd5e1; }
.panel-bar span:first-child { background: #f87171; }
.panel-bar span:nth-child(2) { background: #fbbf24; }
.panel-bar span:nth-child(3) { background: #4ade80; }
.panel-body {
  line-height: 0;
  background: #f8fafc;
}
.panel-body .hero-img,
.panel-body img {
  width: 100%;
  height: auto;
  max-height: 520px;
  display: block;
  object-fit: contain;
  object-position: center top;
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
}

.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
  margin-top: 48px; padding-bottom: 16px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 20px 24px; text-align: center; box-shadow: var(--shadow);
}
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.stat-card-highlight { border-color: #bfdbfe; background: linear-gradient(180deg, #eff6ff, var(--surface)); }
.stat-card-highlight .stat-value { color: #1d4ed8; }
.stat-label { color: var(--text-muted); font-size: 0.875rem; margin-top: 4px; }

/* Install counter (homepage) */
.install-counter-wrap {
  margin-top: 44px;
}
.install-counter {
  display: flex;
  align-items: center;
  gap: 20px 28px;
  padding: 22px 28px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.95) 0%, #fff 45%, rgba(248, 250, 252, 0.9) 100%);
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(37, 99, 235, 0.1);
  position: relative;
  overflow: hidden;
}
.install-counter::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--primary), #4f46e5);
  border-radius: 20px 0 0 20px;
}
.install-counter-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}
.install-counter-body { min-width: 0; }
.install-counter-num {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #1e40af;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.count-up {
  display: inline-block;
  min-width: 1.5ch;
  transition: transform 0.15s ease;
}
.count-up.is-animating {
  animation: countPulse 0.6s ease-out;
}
@keyframes countPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.install-counter-suffix {
  font-size: 0.55em;
  color: #3b82f6;
  margin-left: 2px;
  font-weight: 700;
}
.install-counter-label {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-top: 6px;
  font-weight: 500;
}
.install-counter-meta {
  margin-left: auto;
  text-align: right;
  flex-shrink: 0;
}
.install-counter-meta span {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.install-counter-meta strong {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Sections */
.section { padding: 72px 0; }
.section-soft { background: rgba(241, 245, 249, 0.6); }
.section-head-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 36px;
}
.section-head-row h2 { font-size: 2rem; letter-spacing: -0.02em; font-weight: 800; }
.section-sub-left { color: var(--text-muted); margin-top: 8px; font-size: 1.0625rem; }
.link-more { color: var(--primary); font-weight: 600; text-decoration: none; white-space: nowrap; }
.link-more:hover { text-decoration: underline; }

.page-hero {
  padding: 48px 0 32px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), transparent);
}
.page-hero h1 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; }
.page-hero p { color: var(--text-muted); margin-top: 12px; font-size: 1.125rem; max-width: 640px; }
.breadcrumb { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb span { margin: 0 8px; opacity: 0.5; }

/* Feature cards */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px;
}
.card-grid-lg { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow); transition: transform 0.25s, box-shadow 0.25s;
}
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--primary-soft); font-size: 1.375rem; margin-bottom: 16px;
}
.feature-card h3 { font-size: 1.125rem; margin-bottom: 8px; font-weight: 700; }
.feature-card p { color: var(--text-muted); font-size: 0.9375rem; }

/* Screenshot cards */
.screenshot-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px;
}
.screenshot-grid-page { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.shot-card {
  background: var(--surface); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s;
}
.shot-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.shot-frame { background: #f1f5f9; }
.shot-bar {
  display: flex; gap: 6px; padding: 10px 14px; background: #e2e8f0;
}
.shot-bar span { width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; }
.shot-bar span:first-child { background: #f87171; }
.shot-bar span:nth-child(2) { background: #fbbf24; }
.shot-bar span:nth-child(3) { background: #4ade80; }
.shot-img-wrap { aspect-ratio: 16/10; overflow: hidden; background: #e2e8f0; }
.shot-img-wrap img {
  width: 100%; height: 100%; object-fit: contain; object-position: center top;
  display: block; background: #f8fafc; transition: transform 0.4s;
}
.shot-card:hover .shot-img-wrap img { transform: scale(1.03); }
.shot-card figcaption { padding: 18px 20px; }
.shot-card strong { display: block; font-size: 1rem; margin-bottom: 4px; }
.shot-card span { color: var(--text-muted); font-size: 0.875rem; }
.shot-card-lg .shot-img-wrap { aspect-ratio: 16/9; }

/* Install */
.install-cards { display: flex; flex-direction: column; gap: 16px; max-width: 860px; margin: 0 auto; }
.install-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow);
}
.install-card-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px;
}
.install-card-header h3 { font-size: 0.9375rem; font-weight: 600; }
.install-card pre {
  background: #0f172a; color: #e2e8f0; padding: 16px 18px; border-radius: 12px;
  font-size: 0.8125rem; overflow-x: auto;
}
.copy-btn {
  padding: 6px 14px; font-size: 0.8125rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600;
}
.copy-btn:hover { border-color: var(--primary); color: var(--primary); }

.tip-card {
  max-width: 860px; margin: 0 auto; padding: 28px 32px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.tip-card h3 { margin-bottom: 16px; font-size: 1.125rem; }
.tip-card ul { padding-left: 20px; color: var(--text-muted); }
.tip-card li { margin-bottom: 8px; }
.tip-doc-link { margin-top: 16px; }
.tip-doc-link a { color: var(--primary); font-weight: 600; text-decoration: none; }
.tip-card code { background: #f1f5f9; padding: 2px 6px; border-radius: 4px; font-size: 0.875rem; }

/* Versions */
.version-list { display: flex; flex-direction: column; gap: 14px; max-width: 920px; margin: 0 auto; }
.version-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 26px; display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start;
  box-shadow: var(--shadow); transition: border-color 0.2s;
}
.version-card.stable { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.version-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.version-meta { color: var(--text-muted); font-size: 0.875rem; margin-top: 6px; }
.version-notes { margin-top: 10px; font-size: 0.9375rem; color: var(--text-muted); }
.version-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.version-actions button, .version-actions a {
  font-size: 0.8125rem; padding: 7px 14px; border-radius: 8px; text-decoration: none;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.version-actions button:hover, .version-actions a:hover { border-color: var(--primary); color: var(--primary); }

/* CTA */
.cta-band {
  padding: 0 0 80px;
}
.cta-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  padding: 48px 56px; border-radius: 24px;
  background: linear-gradient(135deg, var(--primary), #4f46e5);
  color: #fff; box-shadow: 0 20px 40px rgba(37,99,235,0.3);
}
.cta-inner h2 { font-size: 1.75rem; font-weight: 800; margin-bottom: 8px; }
.cta-inner p { opacity: 0.9; font-size: 1.0625rem; }

.empty-tip { text-align: center; color: var(--text-muted); padding: 48px 0; }

/* Footer */
.footer {
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid var(--border); padding: 32px 0; background: var(--surface);
}
.footer-inner {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px;
}
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.875rem; }
.footer-links a:hover { color: var(--primary); }

.toast {
  position: fixed;
  top: calc(var(--header-h) + 20px + var(--safe-top));
  bottom: auto;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: #0f172a; color: #fff; padding: 12px 24px; border-radius: 12px;
  font-size: 0.875rem; opacity: 0; transition: opacity 0.3s, transform 0.3s;
  pointer-events: none; z-index: 1100;
  max-width: min(420px, calc(100vw - 32px));
  text-align: center;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(15,23,42,0.88);
  display: grid; place-items: center; padding: 40px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1100px, 92vw); max-height: 75vh; border-radius: 12px; box-shadow: var(--shadow-lg); }
.lightbox p { color: #e2e8f0; margin-top: 16px; text-align: center; }
.lightbox-close {
  position: absolute; top: 24px; right: 32px; width: 44px; height: 44px;
  border: none; border-radius: 50%; background: rgba(255,255,255,0.15); color: #fff;
  font-size: 28px; cursor: pointer; line-height: 1;
}

/* ========== Desktop header ========== */
@media (min-width: 961px) {
  .header-inner {
    display: grid;
    grid-template-columns: minmax(140px, auto) 1fr minmax(120px, auto);
    align-items: center;
    gap: 32px;
  }
  .header-nav-wrap {
    justify-content: center;
  }
  .header-actions .btn-sm {
    padding: 9px 18px;
  }
}

/* ========== Tablet & mobile ========== */
@media (max-width: 960px) {
  :root { --header-h: 56px; }

  .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .header {
    height: auto;
    min-height: var(--header-h);
  }

  .header-inner {
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    min-height: var(--header-h);
    padding: 8px 0;
    display: flex;
    grid-template-columns: unset;
  }

  .header-nav-wrap {
    flex: 0 0 100%;
    order: 3;
    width: 100%;
  }

  .header-actions {
    order: 2;
    margin-left: auto;
  }

  .logo {
    font-size: 1rem;
    min-width: 0;
    flex: 1;
  }
  .logo #site-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .logo-icon { width: 32px; height: 32px; font-size: 14px; flex-shrink: 0; }
  #demo-link { display: none !important; }

  .nav-toggle {
    display: flex;
  }

  .nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin-top: 4px;
    padding: 8px 0 12px;
    border-top: 1px solid var(--border);
    max-height: min(60vh, 360px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  body.nav-open .nav { display: flex; }

  .nav-link {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.9375rem;
  }

  .hero-home { padding: 28px 0 20px; }
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .hero-visual {
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
    order: 2;
  }
  .hero-copy {
    text-align: center;
    order: 1;
  }
  .hero-desc {
    margin-left: auto;
    margin-right: auto;
    font-size: 1rem;
    line-height: 1.65;
  }
  .hero-highlights {
    text-align: left;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 24px;
  }
  .hero-actions {
    justify-content: stretch;
    flex-direction: column;
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 20px;
  }
  .hero-actions .btn { width: 100%; }
  .install-preview {
    text-align: left;
    font-size: 0.75rem;
    padding: 14px 16px;
    word-break: break-all;
    white-space: pre-wrap;
    max-width: 100%;
  }

  .install-counter-wrap { margin-top: 28px; }
  .install-counter {
    flex-wrap: wrap;
    gap: 16px;
    padding: 18px 20px 18px 24px;
  }
  .install-counter-meta {
    margin-left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid #dbeafe;
    text-align: left;
  }
  .install-counter-meta span { margin-bottom: 0; }
  .panel-body .hero-img,
  .panel-body img { max-height: 280px; }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 28px;
    padding-bottom: 8px;
  }
  .stat-card { padding: 14px 12px; }

  .section { padding: 40px 0; }
  .section-head-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 24px;
  }
  .section-head-row h2 { font-size: 1.5rem; line-height: 1.25; }
  .section-sub-left { font-size: 0.9375rem; }
  .link-more {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 8px 0;
    min-height: 44px;
  }

  .page-hero { padding: 28px 0 20px; }
  .page-hero h1 { font-size: 1.75rem; }
  .page-hero p { font-size: 0.9375rem; }

  .card-grid,
  .card-grid-lg {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .screenshot-grid,
  .screenshot-grid-page { grid-template-columns: 1fr; gap: 18px; }
  .shot-img-wrap { aspect-ratio: 16 / 11; }

  .cta-band { padding: 0 0 48px; }
  .cta-inner {
    flex-direction: column;
    text-align: center;
    padding: 32px 22px;
    gap: 20px;
    border-radius: 20px;
  }
  .cta-inner h2 { font-size: 1.375rem; }
  .cta-inner p { font-size: 0.9375rem; }
  .cta-inner .btn { width: 100%; max-width: none; }

  .footer {
    padding: 24px 0 calc(24px + var(--safe-bottom));
  }
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  .footer-links { justify-content: center; flex-wrap: wrap; gap: 16px; }
  .footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 4px;
  }

  .lightbox { padding: 16px; padding-top: calc(16px + var(--safe-top)); }
  .lightbox-close { top: calc(12px + var(--safe-top)); right: 16px; }
}

@media (max-width: 640px) {
  .container {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  .hero-copy h1 {
    font-size: 1.625rem;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
  }
  .badge { margin-bottom: 14px; font-size: 0.75rem; }
  .hero-sub { font-size: 0.875rem; margin-bottom: 10px; }
  .hero-desc { font-size: 0.9375rem; margin-bottom: 16px; }
  .hero-highlights li { font-size: 0.875rem; }

  .stats-row { gap: 8px; }
  .stat-value { font-size: 1.125rem; }
  .stat-label { font-size: 0.75rem; }

  .section { padding: 36px 0; }
  .section-head-row h2 { font-size: 1.3125rem; }
  .page-hero h1 { font-size: 1.5rem; }

  .feature-card { padding: 20px 16px; }
  .feature-card:hover { transform: none; box-shadow: var(--shadow); }
  .feature-icon { width: 44px; height: 44px; font-size: 1.25rem; margin-bottom: 12px; }
  .feature-card h3 { font-size: 1.0625rem; }
  .feature-card p { font-size: 0.875rem; line-height: 1.55; }

  .shot-card:hover { transform: none; box-shadow: var(--shadow); }
  .shot-card figcaption { padding: 14px 16px; }

  .install-card { padding: 16px 14px; }
  .install-card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .install-card-header .copy-btn {
    align-self: stretch;
    text-align: center;
    padding: 11px;
    min-height: 44px;
  }
  .install-card pre {
    font-size: 0.6875rem;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
    word-break: break-all;
    white-space: pre-wrap;
  }

  .tip-card { padding: 20px 16px; width: 100%; max-width: none; }

  .version-card {
    grid-template-columns: 1fr;
    padding: 16px 14px;
    gap: 12px;
  }
  .version-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
  }
  .version-actions button,
  .version-actions a {
    flex: 1 1 calc(50% - 4px);
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .btn-lg { padding: 13px 18px; font-size: 0.9375rem; min-height: 48px; }
  .btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

  .toast {
    top: calc(var(--header-h) + 12px + var(--safe-top));
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    transform: translateY(-10px);
    max-width: none;
  }
  .toast.show { transform: translateY(0); }
}

@media (max-width: 380px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .hero-copy h1 { font-size: 1.5rem; }
}
