/* The marketing site stylesheet - the only hand-written one.
   Brand colour and logo come from the generated /assets/brand.css (package: i18n-brand).
   No brand name, host or address belongs in this file either: it ships to every white-label
   channel, and a comment naming our brand would travel with it. No CJK characters either -
   the copy lives in locales/*.json. */

:root {
  /* text */
  --ink: #14181f;
  --ink-soft: #5a6573;
  --ink-faint: #8a93a1;
  --line: #e4e8ee;
  --line-soft: #eef1f5;

  /* surfaces */
  --surface: #ffffff;
  --surface-soft: #f5f7fa;
  --surface-raised: #ffffff;

  /* accent derives from the brand pack (--brand-primary), never hardcoded as a brand value.
     Tints fall back to a neutral surface so a non-blue brand still looks right on old browsers. */
  --accent: var(--brand-primary, #1f6feb);
  --accent-soft: color-mix(in srgb, var(--accent) 38%, transparent);
  --accent-tint: var(--surface-soft);
  --accent-tint: color-mix(in srgb, var(--accent) 9%, var(--surface));
  --accent-tint-strong: var(--surface-soft);
  --accent-tint-strong: color-mix(in srgb, var(--accent) 16%, var(--surface));

  /* radii + spacing */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --gap: 24px;
  --wrap: 1080px;
  --container-pad: 24px;

  /* soft, layered shadows */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 6px 16px rgba(16, 24, 40, 0.07), 0 2px 6px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 18px 40px rgba(16, 24, 40, 0.10), 0 6px 14px rgba(16, 24, 40, 0.05);
  --shadow-accent: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9edf2;
    --ink-soft: #aab3c0;
    --ink-faint: #7c8593;
    --line: #272d38;
    --line-soft: #1f2530;
    --surface: #14181f;
    --surface-soft: #1b212a;
    --surface-raised: #1c2330;
    --accent-tint: color-mix(in srgb, var(--accent) 14%, var(--surface));
    --accent-tint-strong: color-mix(in srgb, var(--accent) 24%, var(--surface));
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.6), 0 6px 14px rgba(0, 0, 0, 0.45);
    --shadow-accent: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 14px; }
h1 { font-size: clamp(2.05rem, 4.6vw, 3.05rem); font-weight: 800; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.4rem, 2.8vw, 1.9rem); font-weight: 700; letter-spacing: -0.018em; }
h3 { font-size: 1.12rem; font-weight: 650; letter-spacing: -0.01em; }

p { margin: 0 0 14px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--surface);
  padding: 10px 14px;
  z-index: 10;
  border-radius: var(--radius-sm);
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- shared container ---------- */

.container {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ---------- navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
}
/* Non-blur fallback: a slightly stronger solid surface. */
@supports not ((backdrop-filter: blur(2px)) or (-webkit-backdrop-filter: blur(2px))) {
  .nav { background: var(--surface); }
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 14px var(--container-pad);
}

.nav-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.nav-brand:hover { text-decoration: none; }

.logo { display: block; width: auto; height: 28px; }
/* <picture> is just a source-switching wrapper for the logo; let the <img> be the flex child. */
.nav-brand picture { display: contents; }

.wordmark { font-size: 1.1rem; font-weight: 750; letter-spacing: -0.022em; }

.nav-links { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }

.nav-link {
  color: var(--ink-soft);
  font-size: 0.95rem;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: background .16s ease, color .16s ease;
}
.nav-link:hover { background: var(--accent-tint); color: var(--ink); text-decoration: none; }

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

/* ---------- language dropdown: zero JS, <details>/<summary> + :focus-within ---------- */

.lang-switch-details {
  position: relative;
  z-index: 60;
}
.lang-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: background .15s ease, border-color .15s ease;
}
.lang-summary:hover { background: var(--accent-tint); border-color: var(--accent); }
.lang-summary::-webkit-details-marker { display: none; }
.lang-summary::after {
  content: "";
  border: 4px solid transparent;
  border-top-color: currentColor;
  margin-left: 4px;
  transition: transform .15s ease;
}
.lang-switch-details[open] .lang-summary::after { transform: rotate(180deg); }
.lang-summary .flag { width: 20px; height: 12px; border-radius: 2px; }

.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.lang-switch-details[open] .lang-menu,
.lang-switch-details:focus-within .lang-menu {
  display: block;
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.86rem;
  color: var(--ink);
  text-decoration: none;
  transition: background .15s ease;
}
.lang-option:hover { background: var(--accent-tint); text-decoration: none; color: var(--ink); }
.lang-option.is-current {
  background: var(--accent-tint);
  color: var(--ink);
  font-weight: 600;
  cursor: default;
}
.lang-option .flag { width: 20px; height: 12px; border-radius: 2px; }
.lang-option .code { min-width: 26px; font-weight: 600; }
.lang-option .name { flex: 1; color: var(--ink-soft); }

/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease, background .16s ease;
}
.button:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-accent), var(--shadow-md); filter: brightness(1.06); }
.button:active { transform: translateY(0); box-shadow: var(--shadow-sm); }

.button-secondary {
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}
.button-secondary:hover { background: var(--accent-tint); box-shadow: none; filter: none; }

.button-small { padding: 9px 16px; font-size: 0.9rem; }

/* ---------- hero ---------- */

.hero {
  position: relative;
  padding: clamp(52px, 8vw, 92px) 0 clamp(44px, 6vw, 72px);
  overflow: hidden;
  background:
    radial-gradient(900px 300px at 18% -10%, var(--accent-tint-strong), transparent 65%),
    radial-gradient(700px 280px at 85% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    var(--surface);
  border-bottom: 1px solid var(--line);
}
.hero-small { padding-top: clamp(40px, 6vw, 64px); padding-bottom: clamp(28px, 4vw, 40px); }

.hero .lead,
.prose .lead,
.hero-small .lead {
  font-size: 1.14rem;
  color: var(--ink-soft);
  max-width: 62ch;
  margin-bottom: 4px;
}

/* a subtle grid pattern behind the hero for depth, visible in light tint */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--accent-tint) 1px, transparent 1px),
    linear-gradient(90deg, var(--accent-tint) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 40%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 40%, transparent 75%);
  opacity: 0.6;
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }

.hero h1 + .lead { margin-top: 14px; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 12px; }

.note { color: var(--ink-soft); font-size: 0.94rem; }

.note { color: var(--ink-soft); font-size: 0.94rem; }

.note-banner {
  background: var(--accent-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 16px;
}

/* 正文里的图：整幅宽度、圆角、细边，图注在下方小字。docs 页的界面截图走这里，
   图片按原始比例缩放，不裁切、不加装饰（截图本身是证据，别修饰）。 */
figure { margin: 28px 0; }
figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
figure figcaption { margin-top: 10px; color: var(--ink-soft); font-size: 0.9rem; }

.section { padding: clamp(52px, 7vw, 84px) 0; }
.section-tint { background: var(--accent-tint); }
.section-soft { background: var(--surface-soft); }

/* a closing call-to-action band */
.section-cta {
  background:
    radial-gradient(900px 320px at 50% 120%, var(--accent-tint-strong), transparent 70%),
    var(--surface);
  border-top: 1px solid var(--line);
}

.section h2 { position: relative; }
/* a short accent bar above section headings gives rhythm without extra copy */
.section > .container > h2::before,
.section-cta > .container > h2::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
  margin-bottom: 16px;
}
.section h2 + p,
.section h2 + .lead { color: var(--ink-soft); }

.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
/* Feature blocks: a 300px min lets six blocks settle into 3 columns on the wrap. */
.grid-features { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  display: block;
  height: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { border-color: var(--accent-soft); transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; }
.card h3 { margin-bottom: 8px; }
.card p { color: var(--ink-soft); margin: 0; }

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

.steps { color: var(--ink-soft); padding-left: 22px; margin: 8px 0 0; counter-reset: step; list-style: decimal; }
.steps li { margin-bottom: 12px; }
.steps li::marker { color: var(--accent); font-weight: 700; }

.list { color: var(--ink-soft); padding-left: 22px; }
.list li { margin-bottom: 8px; }
.list li::marker { color: var(--accent); }

/* ---------- demo media ---------- */

.demo-media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  color: var(--ink-faint);
  object-fit: cover;
  box-shadow: var(--shadow-md);
}

.demo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  border-style: dashed;
  box-shadow: none;
}

/* ---------- pricing tiers ---------- */

.tier {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.tier:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--accent-soft); }
.tier h3 { margin: 0; font-size: 1.2rem; }
.tier .button { margin-top: auto; width: 100%; }

.tier-featured {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--accent-soft);
  transform: translateY(-2px);
}
.tier-featured:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.tier-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 14px;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.price { margin: 0; font-weight: 700; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.price-value { font-size: 2rem; letter-spacing: -0.02em; line-height: 1.1; }
.price-period { color: var(--ink-soft); font-size: 0.9rem; font-weight: 400; }
.price-was { color: var(--ink-faint); font-size: 1rem; text-decoration: line-through; font-weight: 500; }
.price-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 650;
  border-radius: 999px;
}
.price-pending .price-value { font-size: 1.15rem; color: var(--ink-soft); font-weight: 500; }

.tier-devices { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

.tier-features {
  list-style: none;
  margin: 8px 0 4px;
  padding: 0;
  font-size: 0.93rem;
  color: var(--ink-soft);
}
.tier-features li {
  position: relative;
  padding: 6px 0 6px 26px;
  border-bottom: 1px solid var(--line-soft);
}
.tier-features li:last-child { border-bottom: 0; }
.tier-features li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 11px;
  width: 16px;
  height: 16px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 50%;
}
.tier-features li::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  width: 8px;
  height: 5px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------- billing toggle (CSS-only segmented control) ---------- */

.billing-toggle {
  position: relative;
  display: inline-flex;
  padding: 4px;
  margin: 0 auto 32px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
}
.billing-toggle input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.billing-toggle label {
  position: relative;
  z-index: 1;
  padding: 8px 22px;
  cursor: pointer;
  color: var(--ink-soft);
  border-radius: 999px;
  transition: color .2s ease;
}
.billing-toggle input[type="radio"]:checked + label {
  color: var(--ink);
}
.billing-toggle-track {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  background: var(--surface);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}
#billing-three:checked ~ .billing-toggle-track {
  transform: translateX(100%);
}

/* hide / show pricing grids based on selected radio (uses :has() on the container) */
.pricing-grid[data-billing="three"] {
  display: none;
}
.section:has(#billing-three:checked) .pricing-grid[data-billing="year"] {
  display: none;
}
.section:has(#billing-three:checked) .pricing-grid[data-billing="three"] {
  display: grid;
}

/* ---------- contact facts ---------- */

.facts {
  margin: 0;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.facts dt { font-weight: 650; color: var(--ink); }
.facts dd { margin: 4px 0 0; color: var(--ink-soft); }

/* ---------- prose (docs and legal) ---------- */

.prose { max-width: 760px; margin: 0 auto; padding: clamp(40px, 6vw, 64px) var(--container-pad) 64px; }
.prose h2 { margin-top: 36px; }
.prose h2:first-child, .prose .note + h1 + p, .prose h1 { margin-top: 0; }
.prose ul, .prose ol { color: var(--ink-soft); }
.prose blockquote {
  margin: 0 0 16px;
  padding: 2px 16px;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
  background: var(--accent-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.prose pre {
  overflow-x: auto;
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.prose code { font-size: 0.92em; }
.prose pre code { font-size: 0.9rem; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.prose a { font-weight: 500; }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  max-width: none;
  margin-top: 40px;
  padding: clamp(40px, 6vw, 60px) 0 clamp(32px, 4vw, 44px);
}

.footer-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

.footer-column h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: 14px; }
.footer-column ul { list-style: none; margin: 0; padding: 0; }
.footer-column li { margin-bottom: 10px; font-size: 0.95rem; }
.footer-column a { color: var(--ink-soft); }
.footer-column a:hover { color: var(--ink); }

.footer-note, .footer-rights {
  max-width: var(--wrap);
  margin: 28px auto 0;
  padding: 0 var(--container-pad);
  color: var(--ink-faint);
  font-size: 0.88rem;
}
.footer-rights { margin-top: 12px; }
.footer-note { border-top: 1px solid var(--line); padding-top: 22px; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .button:hover, .card:hover, .tier:hover { transform: none; }
}

/* ---------- product feature blocks ---------- */

.feature h3 { margin-bottom: 6px; }

/* ---------- docs index ---------- */

.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-item { padding: 20px 0; border-bottom: 1px solid var(--line); }
.doc-item:first-child { padding-top: 0; }
.doc-item:last-child { border-bottom: 0; padding-bottom: 0; }
.doc-item a { font-weight: 650; font-size: 1.08rem; }
.doc-item a:hover { color: var(--accent); }
.doc-item p { margin: 6px 0 0; color: var(--ink-soft); font-size: 0.97rem; max-width: 70ch; }

/* ---------- centered heroes (sign in / sign up / 404) ---------- */

.hero-center .container { max-width: 620px; }
.hero-center { text-align: center; }
.hero-center .lead { margin-left: auto; margin-right: auto; }
.hero-center .cta-row { justify-content: center; }

/* ---------- narrow screens ----------
   The layout is fluid (flex wrap + auto-fit grids). Here we only tune spacing and
   font size: 19px body is large on a phone, and a nav that wraps to two rows reads
   better left-aligned. Panels get a little side margin so they float above the page. */

@media (max-width: 760px) {
  body { font-size: 16px; }
  :root { --container-pad: 18px; }
  .hero { padding: clamp(40px, 12vw, 56px) 0 clamp(32px, 8vw, 44px); }
  .section { padding: 44px 0; }
  .nav-inner { padding: 12px var(--container-pad); gap: 10px 16px; }
  .nav-links { margin-left: 0; gap: 2px; }
  .nav-actions { gap: 10px; }
  .grid { gap: 16px; }
  .tier { padding: 22px 18px; }
  .card { padding: 20px; }
  .doc-item { padding: 16px 0; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta-row .button { width: 100%; }
}
