:root {
  --bg: #0D1117;
  --surface: #171F33;
  --surface-2: #1F2842;
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #E6EDF3;
  --text-secondary: #888D96;
  --accent: #FF7528;
  --link: #818CF8;
  --max-width: 720px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Top bar ───────────────────────────────────────────── */

.topbar {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.brand {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

.brand a {
  color: inherit;
}

.brand a:hover {
  text-decoration: none;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  user-select: none;
}

.lang-toggle button {
  appearance: none;
  background: none;
  border: 0;
  padding: 4px 6px;
  font: inherit;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
  min-height: 32px;
}

.lang-toggle button:hover {
  color: var(--text-primary);
}

body[data-lang="zh"] .lang-toggle button[data-lang="zh"],
body[data-lang="en"] .lang-toggle button[data-lang="en"] {
  color: var(--accent);
  font-weight: 600;
}

.lang-toggle .sep {
  color: var(--border);
}

/* ── Main column ──────────────────────────────────────── */

main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 8px 20px 48px;
}

h1 {
  font-size: 32px;
  line-height: 1.25;
  font-weight: 700;
  margin: 24px 0 8px;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 20px;
  line-height: 1.35;
  font-weight: 600;
  margin: 36px 0 12px;
  color: var(--text-primary);
}

p {
  margin: 0 0 16px;
  color: var(--text-primary);
}

ul {
  margin: 0 0 16px;
  padding-left: 22px;
}

ul li {
  margin: 6px 0;
}

.last-updated {
  display: inline-block;
  margin: 0 0 24px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ── Landing page ─────────────────────────────────────── */

.hero {
  margin-top: 24px;
}

.hero h1 {
  font-size: 40px;
  margin-bottom: 12px;
}

.hero .tagline {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.about {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin: 28px 0;
}

.about h2 {
  margin-top: 0;
  font-size: 18px;
}

.about p:last-child {
  margin-bottom: 0;
}

.cta-list {
  list-style: none;
  padding: 0;
  margin: 28px 0;
  display: grid;
  gap: 10px;
}

.cta-list li {
  margin: 0;
}

.cta-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-weight: 500;
  transition: background 0.15s ease, border-color 0.15s ease;
  min-height: 52px;
}

.cta-list a:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  text-decoration: none;
}

.cta-list a::after {
  content: "→";
  color: var(--text-secondary);
  font-size: 18px;
  margin-left: 12px;
}

.cta-list .email {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
}

/* ── Trademark / disclaimer block ─────────────────────── */

.trademark {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Footer ───────────────────────────────────────────── */

footer {
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px calc(32px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  justify-content: space-between;
}

footer .footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

footer .footer-links a {
  color: var(--text-secondary);
}

footer .footer-links a:hover {
  color: var(--text-primary);
}

/* ── Language visibility ──────────────────────────────── */

body[data-lang="zh"] .lang-en {
  display: none;
}

body[data-lang="en"] .lang-zh {
  display: none;
}

/* ── Responsive ───────────────────────────────────────── */

@media (max-width: 480px) {
  .hero h1 {
    font-size: 32px;
  }
  h1 {
    font-size: 28px;
  }
  h2 {
    font-size: 18px;
  }
  body {
    font-size: 15px;
  }
}

/* ── Marketing v3 ─────────────────────────────────────── */
/* New classes for hero.html and features.html. Scoped via */
/* .container-wide and .hero-v3 so they never affect       */
/* index.html / privacy.html / terms.html.                  */

.container-wide {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 8px 24px 64px;
}

.topbar.container-wide {
  padding: max(20px, env(safe-area-inset-top)) 24px 12px;
}

.brand a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
}

.brand .app-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: block;
  box-shadow:
    0 0 0 1px rgba(255, 117, 40, 0.18),
    0 4px 10px -2px rgba(0, 0, 0, 0.5),
    0 0 18px -4px rgba(255, 117, 40, 0.45);
}

.brand .wordmark {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.brand .subwordmark {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-left: 2px;
}

.hero-v3 {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 48px;
  padding: 40px 0 72px;
}

.hero-v3 .copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 760px;
  width: 100%;
}

.hero-v3 .brand-mark {
  display: flex;
  justify-content: center;
  margin: 0 0 8px;
}

.hero-v3 .brand-mark img {
  width: 128px;
  height: 128px;
  border-radius: 28px;
  display: block;
  box-shadow:
    0 0 0 1px rgba(255, 117, 40, 0.22),
    0 18px 40px -10px rgba(0, 0, 0, 0.6),
    0 0 60px -6px rgba(255, 117, 40, 0.45),
    0 0 140px -10px rgba(255, 117, 40, 0.3);
  animation: icon-glow 4.5s ease-in-out infinite;
}

@keyframes icon-glow {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 117, 40, 0.22),
      0 18px 40px -10px rgba(0, 0, 0, 0.6),
      0 0 60px -6px rgba(255, 117, 40, 0.45),
      0 0 140px -10px rgba(255, 117, 40, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 117, 40, 0.32),
      0 18px 40px -10px rgba(0, 0, 0, 0.6),
      0 0 80px -4px rgba(255, 117, 40, 0.6),
      0 0 180px -8px rgba(255, 117, 40, 0.42);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-v3 .brand-mark img {
    animation: none;
  }
}

.hero-v3 .tagline {
  font-size: 64px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text-primary);
}

.hero-v3 .subtagline {
  font-size: 20px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  max-width: 520px;
}

.hero-v3 .cta-row {
  margin-top: 12px;
}

.hero-v3 .phone {
  position: relative;
  display: flex;
  justify-content: center;
  isolation: isolate;
}

.hero-v3 .phone::before {
  content: "";
  position: absolute;
  inset: -12% -18% -6% -18%;
  background: radial-gradient(
    ellipse 55% 45% at 50% 50%,
    rgba(255, 117, 40, 0.22),
    rgba(255, 117, 40, 0.08) 45%,
    transparent 72%
  );
  filter: blur(48px);
  z-index: -1;
  pointer-events: none;
}

.hero-v3 .phone::after {
  content: "";
  position: absolute;
  inset: 18% 8% -4% 8%;
  background: radial-gradient(
    ellipse 70% 35% at 50% 100%,
    rgba(129, 140, 248, 0.12),
    transparent 70%
  );
  filter: blur(40px);
  z-index: -1;
  pointer-events: none;
}

.hero-v3 .phone img {
  width: 100%;
  max-width: 380px;
  height: auto;
  display: block;
  border-radius: 40px;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.05) inset,
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 20px 30px -10px rgba(0, 0, 0, 0.6),
    0 40px 80px -20px rgba(0, 0, 0, 0.7);
}

.app-store-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 10px;
  transition: transform 0.15s ease, opacity 0.15s ease;
  text-decoration: none;
}

.app-store-badge:hover {
  transform: translateY(-1px);
  opacity: 0.92;
  text-decoration: none;
}

.app-store-badge svg {
  display: block;
  width: 168px;
  height: auto;
}

/* ── Features grid ────────────────────────────────────── */

.features-section {
  padding: 32px 0 80px;
  border-top: 1px solid var(--border);
}

.features-section .section-eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 40px 0 8px;
  text-align: center;
}

.features-section .section-heading {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  text-align: center;
  margin: 0 0 56px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 32px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.feature-card .phone-sm {
  position: relative;
  width: 100%;
  max-width: 240px;
  isolation: isolate;
}

.feature-card .phone-sm::before {
  content: "";
  position: absolute;
  inset: -8% -14% -4% -14%;
  background: radial-gradient(
    ellipse 60% 40% at 50% 55%,
    rgba(255, 117, 40, 0.10),
    transparent 70%
  );
  filter: blur(32px);
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.feature-card:hover .phone-sm::before {
  opacity: 1;
}

.feature-card .phone-sm img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 28px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 14px 24px -8px rgba(0, 0, 0, 0.5),
    0 28px 50px -16px rgba(0, 0, 0, 0.55);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.35s ease;
}

.feature-card:hover .phone-sm img {
  transform: translateY(-6px);
  box-shadow:
    0 0 0 1px rgba(255, 117, 40, 0.18),
    0 20px 30px -8px rgba(0, 0, 0, 0.55),
    0 40px 60px -16px rgba(0, 0, 0, 0.6);
}

.feature-card h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  margin: 8px 0 0;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}

.feature-card p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
  max-width: 280px;
}

/* ── Marketing v3 responsive ──────────────────────────── */

@media (max-width: 880px) {
  .hero-v3 .tagline {
    font-size: 52px;
  }
  .hero-v3 .subtagline {
    font-size: 18px;
  }
  .hero-v3 .brand-mark img {
    width: 112px;
    height: 112px;
    border-radius: 24px;
  }
}

@media (max-width: 760px) {
  .hero-v3 {
    gap: 36px;
    padding: 24px 0 56px;
  }
  .hero-v3 .tagline {
    font-size: 40px;
  }
  .hero-v3 .subtagline {
    max-width: none;
  }
  .hero-v3 .brand-mark img {
    width: 96px;
    height: 96px;
    border-radius: 22px;
  }
  .hero-v3 .phone img {
    max-width: 300px;
  }
  .features-grid {
    grid-template-columns: 1fr;
    gap: 56px;
  }
  .features-section .section-heading {
    font-size: 26px;
    margin-bottom: 40px;
  }
}

@media (max-width: 420px) {
  .hero-v3 .tagline {
    font-size: 32px;
  }
  .hero-v3 .subtagline {
    font-size: 16px;
  }
  .hero-v3 .brand-mark img {
    width: 84px;
    height: 84px;
    border-radius: 19px;
  }
}

/* ── Footer trademark (marketing pages) ───────────────── */
/* Sits as a body-level sibling between <main> and <footer>.*/
/* Owns the single divider line; the immediately-following  */
/* <footer> gets its own border-top zeroed out so there's   */
/* only ONE hr between content and footer. Privacy/terms    */
/* pages don't emit .footer-trademark, so untouched.        */

.footer-trademark {
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  padding: 18px 24px 4px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  text-align: center;
}

.footer-trademark + footer {
  border-top: 0;
  padding-top: 12px;
}
