/* Tokens follow landing-page-design-kit/DESIGN_GUIDE.md */
:root {
  --brand-orange: #f77116;
  --action-orange: #f97316;
  --apricot: #f4a261;
  --ink: #000000;
  --ink-soft: #111827;
  --text: #374151;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;
  --border: #e5e7eb;
  --surface-chip: #f3f4f6;
  --surface-page: #f9fafb;
  --surface-card: #ffffff;
  --success: #16a34a;
  --danger: #ef4444;
  --medal: #f59e0b;
  --protein: #e05c2e;
  --carbs: #92400e;
  --fat-icon: #eab308;
  --fat-text: #a16207;
  --max: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", system-ui,
          "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 600;
  color: var(--text);
  background: var(--surface-card);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.1; letter-spacing: -0.025em; margin: 0; font-weight: 800; }
html[data-lang="zh"] h1, html[data-lang="zh"] h2, html[data-lang="zh"] h3 { letter-spacing: 0; line-height: 1.28; }
p { margin: 0; }

/* Language switching: elements marked .en / .zh are shown for the active language only */
html[data-lang="en"] .zh, html[data-lang="zh"] .en { display: none !important; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 40px; width: auto; }
.nav-links { display: flex; gap: 26px; margin-left: 8px; }
.nav-links a { text-decoration: none; font-size: 15px; font-weight: 700; color: var(--text); }
.nav-links a:hover { color: var(--ink); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* Segmented control (app: Week / Month / Year) */
.seg {
  display: inline-flex; padding: 3px; border-radius: 999px;
  background: var(--surface-card); border: 1px solid var(--border);
}
.seg button {
  font: inherit; font-size: 13px; font-weight: 700; border: 0; cursor: pointer;
  padding: 6px 13px; border-radius: 999px; background: transparent; color: var(--text);
}
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

/* ---------- Buttons ---------- */
/* Official Apple badge artwork, unmodified. Min 40px tall on screen; clear space = 1/4 badge height */
.badge { display: inline-flex; flex: none; margin: 0; line-height: 0; }
.badge img { height: 100%; width: auto; }
.badge-sm { height: 40px; }
.badge-lg { height: 54px; margin: 0 14px 0 0; }
.badge[aria-disabled="true"] { cursor: default; }
.soon-note {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--surface-chip); color: var(--ink-soft); font-size: 13px; font-weight: 700;
}

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--action-orange); color: #fff; text-decoration: none;
  font-size: 17px; font-weight: 800; padding: 15px 26px; border-radius: 16px;
}
.btn-primary:hover { background: #ea670c; }
.btn-text { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 700; color: var(--ink); padding: 14px 16px; }
.btn-text:hover { color: var(--action-orange); }

/* ---------- Icons ---------- */
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.tile {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-chip); color: var(--ink);
}

/* ---------- Hero ---------- */
.hero { padding: 56px 0 48px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted);
}
.hero h1 { font-size: clamp(40px, 5.6vw, 68px); margin: 18px 0 20px; }
.hero h1 em { font-style: normal; color: var(--brand-orange); }
.hero .lede { font-size: 19px; color: var(--text); max-width: 520px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 4px; margin-top: 30px; }
.hero-note { margin-top: 14px; font-size: 14px; color: var(--text-muted); }

.facts { display: flex; gap: 10px; margin-top: 36px; flex-wrap: wrap; }
.fact {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 14px; color: var(--ink-soft); font-weight: 700;
}
.fact .ico { width: 18px; height: 18px; color: var(--brand-orange); }

.hero-phone { display: flex; justify-content: center; }
.hero-phone .phone { width: 300px; }

/* ---------- Phone frame (plain iPhone frame) ---------- */
.phone {
  border-radius: 46px; padding: 10px; background: #0b0b0c;
  box-shadow: 0 0 0 1px #d1d5db, 0 18px 40px -24px rgba(17,24,39,.35);
}
.phone img { border-radius: 37px; width: 100%; height: auto; aspect-ratio: 1320 / 2868; object-fit: cover; background: var(--surface-chip); }

/* ---------- Sections ---------- */
section { padding: 96px 0; }
section.gray { background: var(--surface-page); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(30px, 4vw, 46px); margin-top: 12px; }
.section-head p { color: var(--text); font-size: 18px; margin-top: 14px; }

/* Card (flat: white, 1px border, no shadow) */
.card { background: var(--surface-card); border: 1px solid var(--border); border-radius: 24px; }

/* ---------- One budget ---------- */
.budget { display: grid; grid-template-columns: 1fr 1.1fr; gap: 16px; align-items: stretch; }
.budget-main { padding: 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring { position: relative; width: 210px; height: 210px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 46px; font-weight: 800; color: var(--ink); letter-spacing: -0.03em; }
.ring-cap { margin-top: 10px; font-size: 17px; color: var(--text); }
.budget-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin-top: 26px; }
.num-card { background: var(--surface-page); border: 1px solid var(--border); border-radius: 18px; padding: 16px 12px; }
.num-card .big { font-size: 28px; font-weight: 800; color: var(--brand-orange); letter-spacing: -0.02em; }
.num-card .big.green { color: var(--success); }
.num-card .big small { font-size: 15px; color: var(--text-subtle); font-weight: 700; }
.num-card .lbl { font-size: 13px; color: var(--text-muted); }

.budget-steps { display: grid; gap: 16px; }
.bstep { padding: 24px; display: flex; gap: 18px; align-items: flex-start; }
.bstep h3 { font-size: 19px; margin-bottom: 6px; letter-spacing: -0.01em; }
.bstep p { color: var(--text); font-size: 15.5px; }
.bstep .tag { display: inline-block; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 10px; margin-left: 6px; vertical-align: 2px; letter-spacing: 0; }
.tag-use { background: #fff1e7; color: #c2410c; }
.tag-add { background: #dcfce7; color: #15803d; }

/* ---------- Feature rows ---------- */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.feature + .feature { margin-top: 112px; }
.feature.flip .feature-media { order: -1; }
.feature h2 { font-size: clamp(28px, 3.6vw, 42px); margin: 12px 0 16px; }
.feature .intro { color: var(--text); font-size: 18px; margin-bottom: 24px; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 13px; }
.checks li { position: relative; padding-left: 32px; color: var(--text); font-weight: 600; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.checks strong { color: var(--ink); font-weight: 800; }

.feature-media {
  display: flex; justify-content: center; align-items: center;
  background: var(--surface-page); border: 1px solid var(--border);
  border-radius: 28px; padding: 48px 24px; min-height: 600px;
}
.feature-media .phone { width: 260px; }
.duo, .trio { display: flex; align-items: center; justify-content: center; }
.duo .phone { width: 240px; }
.duo .phone:first-child { transform: translateX(16px) translateY(-18px); z-index: 1; }
.duo .phone:last-child { transform: translateX(-16px) translateY(18px); z-index: 2; }
.trio .phone { width: 200px; }
.trio .phone:nth-child(1) { transform: translateX(28px) scale(.9); z-index: 1; }
.trio .phone:nth-child(2) { z-index: 3; }
.trio .phone:nth-child(3) { transform: translateX(-28px) scale(.9); z-index: 2; }

/* Log-method chips (app: Camera / Gallery / Barcode / Text) */
.methods { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.method {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px 8px 11px; border-radius: 999px;
  background: var(--surface-chip); color: var(--ink); font-size: 14px; font-weight: 700;
}
.method .ico { width: 18px; height: 18px; }

/* Macro row */
.macros { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.macro { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); font-size: 14px; font-weight: 700; }
.macro i { width: 10px; height: 10px; border-radius: 50%; }
.macro.p { color: var(--protein); } .macro.p i { background: var(--protein); }
.macro.c { color: var(--carbs); } .macro.c i { background: var(--carbs); }
.macro.f { color: var(--fat-text); } .macro.f i { background: var(--fat-icon); }

/* Weekly row with medals */
.week { display: flex; gap: 10px; margin-top: 22px; }
.week div { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: var(--text-subtle); font-weight: 700; }
.week svg { width: 34px; height: 34px; }

/* Activity chips + burn card */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.chip { background: var(--surface-chip); border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.burn-card { padding: 28px; width: 100%; max-width: 420px; }
.burn-card .head { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.burn-card h4 { font-size: 18px; letter-spacing: -0.01em; }
.burn-card .sub { color: var(--text-muted); font-size: 14px; }
.bar-row { margin-bottom: 16px; }
.bar-row .lbl { font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
.bar { height: 12px; border-radius: 999px; background: var(--surface-chip); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--apricot); }
.burn-card .foot {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--success); font-weight: 800;
}

/* ---------- FAQ ---------- */
.faq { max-width: 780px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq summary {
  cursor: pointer; list-style: none; font-weight: 700; font-size: 17.5px; color: var(--ink);
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 26px; font-weight: 400; color: var(--text-muted); line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--text); margin-top: 10px; font-weight: 500; }

/* ---------- Final CTA ---------- */
.cta { text-align: center; padding: 64px 24px; background: var(--surface-page); }
.cta img.icon { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto 22px; border: 1px solid var(--border); }
.cta h2 { font-size: clamp(30px, 4.4vw, 46px); }
.cta p { margin: 12px auto 28px; font-size: 18px; max-width: 560px; }
.cta .badge-lg { margin: 0 14px; }
.cta .soon-note { margin-top: 14px; }
.cta-actions { display: flex; flex-direction: column; align-items: center; }

/* ---------- Footer ---------- */
footer { padding: 48px 0 40px; border-top: 1px solid var(--border); margin-top: 96px; font-size: 14.5px; }
.foot-grid { display: flex; flex-wrap: wrap; gap: 28px; justify-content: space-between; align-items: center; }
.foot-grid .brand img { height: 34px; }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; }
.foot-links a { text-decoration: none; color: var(--text); font-weight: 700; }
.foot-links a:hover { color: var(--ink); }
.disclaimer { color: var(--text-subtle); font-size: 13px; margin-top: 28px; max-width: 820px; font-weight: 500; }
.copy { color: var(--text-subtle); font-size: 13px; margin-top: 10px; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* ---------- Simple content pages (privacy / support) ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 64px 24px 0; }
.doc h1 { font-size: clamp(32px, 5vw, 46px); margin-bottom: 12px; }
.doc h2 { font-size: 22px; margin: 40px 0 12px; letter-spacing: -0.01em; }
.doc p, .doc li { color: var(--text); margin-bottom: 12px; font-weight: 500; }
.doc strong { font-weight: 700; color: var(--ink); }
.doc .muted { color: var(--text-muted); }
.doc .card { background: var(--surface-page); padding: 26px; margin-top: 28px; }
.doc .card a { color: var(--brand-orange); font-weight: 800; font-size: 19px; }

/* Privacy policy */
.policy ul { padding-left: 22px; margin: 0 0 14px; }
.policy li { margin-bottom: 6px; }
.policy a { color: var(--brand-orange); font-weight: 700; }
.policy .summary { margin: 28px 0 8px; }
.policy .summary p { margin-bottom: 8px; }
.policy .summary ul { margin-bottom: 0; }
.policy .note { background: var(--surface-chip); border-radius: 14px; padding: 12px 16px; font-size: 14px; }
.table-wrap { overflow-x: auto; margin: 4px 0 16px; border: 1px solid var(--border); border-radius: 16px; }
.policy table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
.policy th, .policy td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text); font-weight: 500; }
.policy th { background: var(--surface-page); color: var(--ink); font-weight: 700; }
.policy tr:last-child td { border-bottom: 0; }
.policy td:first-child { font-weight: 700; color: var(--ink); width: 34%; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav-links { display: none; }
  .hero { padding-top: 36px; }
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero .lede { margin: 0 auto; }
  .hero-cta, .facts { justify-content: center; }
  .hero-phone .phone { width: 250px; }
  .budget { grid-template-columns: 1fr; }
  .feature, .feature.flip { grid-template-columns: 1fr; gap: 32px; }
  .feature.flip .feature-media { order: 0; }
  .feature + .feature { margin-top: 80px; }
  .feature-media { min-height: 0; }
  section { padding: 72px 0; }
}
@media (max-width: 600px) {
  .nav-inner { gap: 10px; height: 60px; }
  .brand img { height: 34px; }
  .nav .badge { display: none; }
  .seg button { padding: 5px 11px; }
  .hero-phone .phone { width: 230px; padding: 8px; border-radius: 38px; }
  .hero-phone .phone img { border-radius: 31px; }
  .feature-media { padding: 32px 10px; border-radius: 22px; }
  .feature-media .phone { width: 220px; }
  .duo .phone { width: 158px; padding: 7px; border-radius: 30px; }
  .trio .phone { width: 128px; padding: 6px; border-radius: 26px; }
  .duo .phone img { border-radius: 24px; }
  .trio .phone img { border-radius: 21px; }
  .hero .lede, .feature .intro, .section-head p { font-size: 17px; }
  .budget-main { padding: 28px 18px; }
  .ring { width: 180px; height: 180px; }
  .btn-primary { width: 100%; }
}
