:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #5c5c5c;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 2px 12px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --header-h: 64px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .pulse-soft,
  .hero-orbit {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "DM Sans", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  padding-top: var(--header-h);
}

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

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

.wrap {
  width: min(1120px, 100% - 40px);
  margin-inline: auto;
}

.narrow {
  width: min(720px, 100% - 40px);
  margin-inline: auto;
}

/* Language visibility */
html.lang-en [data-lang="zh"],
html.lang-zh [data-lang="en"] {
  display: none !important;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  animation: header-in 0.6s var(--ease-out) both;
}

@keyframes header-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
}

.brand-icon {
  border-radius: 11px;
  box-shadow: var(--shadow-sm);
}

.nav {
  display: none;
  align-items: center;
  gap: 1.25rem;
}

.nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  opacity: 0.85;
  transition: opacity 0.2s, color 0.2s;
}

.nav a:hover {
  opacity: 1;
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-toggle {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  color: var(--text);
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.lang-toggle:hover {
  background: #f8fafc;
  border-color: rgba(37, 99, 235, 0.25);
}

.lang-toggle:active {
  transform: scale(0.97);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff !important;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text) !important;
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.12);
}

.btn-lg {
  padding: 14px 22px;
  font-size: 1rem;
  border-radius: 12px;
}

.header-cta {
  display: none;
  font-size: 0.88rem;
  padding: 8px 14px;
}

.hero {
  padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(3rem, 8vw, 6rem);
  background: var(--bg);
}

.hero-grid {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
  .nav {
    display: flex;
    gap: 0.9rem;
  }
  .nav a {
    font-size: 0.88rem;
  }
  .header-cta {
    display: inline-flex;
  }
}

.eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero-title {
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.hero-lead {
  margin: 0 0 1.75rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 34em;
}

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

.hero-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 280px;
  isolation: isolate;
}

.intro-device-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.device-switch {
  display: inline-flex;
  margin-bottom: 1rem;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 999px;
  border: 1px solid var(--border);
  gap: 2px;
}

.device-switch--intro {
  margin-bottom: 0;
}

.hero-visual .device-switch {
  margin-bottom: 1.1rem;
}

.device-btn {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 18px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.device-btn:hover {
  color: var(--text);
}

.device-btn.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.hero-orbit {
  position: absolute;
  width: min(340px, 85vw);
  height: min(340px, 85vw);
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(37, 99, 235, 0.12), transparent 55%),
    radial-gradient(circle at 70% 60%, rgba(99, 102, 241, 0.1), transparent 50%);
  animation: orbit-pulse 8s ease-in-out infinite;
  z-index: 0;
}

.hero-visual.is-ipad .hero-orbit {
  width: min(420px, 92vw);
  height: min(420px, 92vw);
}

@keyframes orbit-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.85;
  }
}

.device-frame {
  position: relative;
  z-index: 1;
  width: min(260px, 72vw);
  border-radius: 36px;
  padding: 10px;
  background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
  box-shadow: var(--shadow), 0 24px 48px rgba(15, 23, 42, 0.12);
}

.hero-visual.is-ipad .device-frame {
  width: min(380px, 92vw);
  border-radius: 26px;
  padding: 11px;
}

.device-screen {
  border-radius: 28px;
  width: 100%;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  background: #fff;
}

.hero-visual.is-ipad .device-screen {
  border-radius: 18px;
  aspect-ratio: 3 / 4;
}

.pulse-soft {
  animation: pulse-glow 3.5s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  }
  50% {
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.5);
  }
}

.section {
  padding: clamp(3rem, 7vw, 5rem) 0;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.section-tight {
  padding-top: clamp(2.5rem, 5vw, 4rem);
}

.section-title {
  font-size: clamp(1.65rem, 3.5vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  text-align: center;
}

.section-lead {
  text-align: center;
  color: var(--text-muted);
  max-width: 52ch;
  margin: 0 auto 2.5rem;
  font-size: 1.02rem;
}

.shots-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 2vw, 20px);
}

@media (max-width: 700px) {
  .shots-row {
    grid-template-columns: 1fr;
    max-width: 280px;
    margin-inline: auto;
  }
}

.shot-card {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.shot-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--shadow);
}

.shot-img {
  width: 100%;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
}

.shots-row.is-ipad .shot-img {
  aspect-ratio: 3 / 4;
}

.highlight-grid {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 600px) {
  .highlight-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .highlight-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.highlight-card {
  margin: 0;
  padding: 1.35rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  transition: border-color 0.25s, box-shadow 0.35s, transform 0.35s var(--ease-out);
}

.highlight-card:hover {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: var(--shadow-sm);
  transform: translateY(-4px);
}

.hi-icon {
  display: block;
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 0.6rem;
}

.highlight-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.highlight-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-delay="120"] {
  transition-delay: 0.12s;
}

/* FAQ */
.faq-list {
  margin-top: 2rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow 0.3s;
}

.faq-item[open] {
  box-shadow: var(--shadow-sm);
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.15rem;
  padding-right: 2.75rem;
  font-weight: 600;
  font-size: 1rem;
  position: relative;
  user-select: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-chevron {
  position: absolute;
  right: 1.15rem;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-60%) rotate(45deg);
  transition: transform 0.3s var(--ease-out);
}

.faq-item[open] .faq-chevron {
  transform: translateY(-20%) rotate(-135deg);
}

.faq-body {
  padding: 0 1.15rem 1.15rem;
  color: var(--text-muted);
  font-size: 0.97rem;
  line-height: 1.65;
  animation: faq-open 0.35s var(--ease-out);
}

@keyframes faq-open {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-cta {
  text-align: center;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.cta-inner h2 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  margin: 0 0 0.75rem;
  font-weight: 700;
}

.cta-note {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.app-store-badge svg {
  flex-shrink: 0;
}

.section-footer-contact {
  text-align: center;
  padding-bottom: 2rem;
}

.mailto {
  font-size: 1.15rem;
  font-weight: 600;
}

.site-footer {
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--border);
  background: #fff;
  text-align: center;
}

.footer-brand {
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0.35rem 0;
}

/* Documentation */
.doc-page .nav a.nav-current {
  color: var(--accent);
  opacity: 1;
  font-weight: 600;
}

.doc-main {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
  min-height: 60vh;
}

.doc-back {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.doc-back a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}

.doc-back a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.doc-wrap {
  width: min(800px, 100% - 40px);
}

.doc-wrap-wide {
  width: min(1120px, 100% - 40px);
}

.doc-layout-inner {
  display: grid;
  gap: 1.75rem 2.25rem;
  grid-template-columns: 1fr;
  align-items: start;
}

.doc-article-wrap {
  min-width: 0;
}

@media (min-width: 900px) {
  .doc-layout-inner {
    grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  }
}

.doc-toc {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  z-index: 20;
  max-height: calc(100vh - var(--header-h) - 1.25rem);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.doc-toc {
  padding: 1rem 1.1rem 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #f8fafc;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.doc-toc-title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.doc-toc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-toc-item {
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.doc-toc-item--h2 + .doc-toc-item--h2 {
  margin-top: 0.65rem;
}

.doc-toc-item--h2 > a {
  color: var(--text);
  font-weight: 600;
}

.doc-toc-sub {
  margin: 0.35rem 0 0.5rem;
  padding: 0 0 0 0.75rem;
  list-style: none;
  border-left: 2px solid rgba(37, 99, 235, 0.18);
}

.doc-toc-item--h3 {
  margin-top: 0.3rem;
  font-size: 0.86rem;
  line-height: 1.4;
}

.doc-toc-item a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  display: block;
  border-radius: 6px;
  padding: 0.15rem 0.2rem;
  margin: 0 -0.2rem;
  transition: color 0.15s, background 0.15s;
}

.doc-toc-item a:hover {
  color: var(--accent);
}

.doc-toc-item a.is-active {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.08);
  font-weight: 600;
}

.doc-loading {
  color: var(--text-muted);
  padding: 2rem 0;
}

.doc-error {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  line-height: 1.55;
}

.doc-error code {
  font-size: 0.88em;
  background: rgba(0, 0, 0, 0.06);
  padding: 0.15em 0.4em;
  border-radius: 6px;
}

.doc-prose {
  color: var(--text);
}

.doc-prose h1 {
  font-size: clamp(1.85rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  line-height: 1.2;
}

.doc-prose h2 {
  font-size: clamp(1.35rem, 2.8vw, 1.55rem);
  font-weight: 700;
  margin: 2.25rem 0 0.85rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  line-height: 1.3;
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

.doc-prose h2:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.doc-prose h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.75rem 0 0.65rem;
  line-height: 1.35;
  scroll-margin-top: calc(var(--header-h) + 0.75rem);
}

.doc-prose p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  max-width: 65ch;
}

.doc-prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.75rem 0;
}

.doc-prose strong {
  color: var(--text);
  font-weight: 600;
}

.doc-global-device {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #f8fafc;
}

.doc-global-device-label {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.doc-global-device .device-switch {
  margin-bottom: 0;
}

.doc-screenshot {
  margin: 1.25rem 0 2rem;
}

.doc-screenshot-frame {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: #f8fafc;
}

.doc-screenshot-frame .doc-shot {
  width: 100%;
  height: auto;
  display: block;
}

.doc-screenshot-frame.is-ipad .doc-shot--iphone {
  display: none !important;
}

.doc-screenshot-frame.is-iphone .doc-shot--ipad {
  display: none !important;
}

.doc-screenshot-frame.is-iphone {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 0.5rem 0 0.35rem;
}

.doc-screenshot-frame.is-iphone .doc-shot--iphone {
  width: 68%;
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

html.lang-en .doc-page {
  font-family: "DM Sans", "Noto Sans SC", system-ui, -apple-system, sans-serif;
}
