/* ===== 官網首頁「一天的帳」 =====
   白天色票對齊 App 預設主題「晨霧」（FitLogTheme mist）；往下捲到夜晚時，
   landing-motion.js 在 <html> 設 data-night="true" 切換成夜晚色票。
   沒有 JS 或偏好減少動態時，頁面停在清晨天色，今日帳直接顯示整天合計。
   天色只由「這一天的時間」決定，不跟系統深色／淺色模式切換，手機與電腦看到的一樣。 */
:root {
  --ink: #1E1B16;
  --mute: #5F5950;
  --line: rgba(30, 27, 22, .14);
  --hair: rgba(30, 27, 22, .1);
  --brand: #8C7350;
  --brand-deep: #6F5A3E;
  --accent: #A5532A;
  --good: #52704F;
  --water: #4B7194;
  --glass: rgba(255, 255, 255, .55);
  --glass-text: rgba(255, 255, 255, .64);
  --glass-strong: rgba(255, 255, 255, .74);
  --glass-edge: rgba(255, 255, 255, .7);
  --on-brand: #FCFBF7;
  --shadow: 0 18px 44px rgba(62, 51, 36, .14);
  --shadow-soft: 0 8px 24px rgba(62, 51, 36, .1);
  --sky-base: #F3EADD;
  --sky-0: linear-gradient(180deg, #F7C9A9 0%, #F6E3CF 55%, #F3EADD 100%);
  --sky-1: linear-gradient(180deg, #BFDDF1 0%, #EAF0EE 60%, #F6F1E7 100%);
  --sky-2: linear-gradient(180deg, #9CC6E8 0%, #DCE9EE 55%, #F4EFE4 100%);
  --sky-3: linear-gradient(180deg, #6B5689 0%, #C77A63 42%, #EDB27C 78%, #F3D7B0 100%);
  --sky-4: linear-gradient(180deg, #0B1020 0%, #151C33 60%, #1E2742 100%);
  --sun: radial-gradient(circle at 35% 35%, #FFF3D6, #FFC46B 55%, #F59B4C);
  --sun-glow: 0 0 80px 30px rgba(255, 190, 110, .45);
  --nav-h: 4.1rem;
  color-scheme: light;
}
/* 夜晚（由捲動時間切換） */
:root[data-night="true"] {
  color-scheme: dark;
  --ink: #F4EFE6;
  --mute: #C2BCB1;
  --line: rgba(244, 239, 230, .18);
  --hair: rgba(244, 239, 230, .14);
  --brand: #D9BE93;
  --brand-deep: #E6CDA3;
  --accent: #F0A06E;
  --good: #9CC29A;
  --water: #9FC0DC;
  --glass: rgba(20, 24, 40, .55);
  --glass-text: rgba(20, 24, 40, .6);
  --glass-strong: rgba(20, 24, 40, .76);
  --glass-edge: rgba(255, 255, 255, .14);
  --on-brand: #17140F;
  --shadow: 0 18px 44px rgba(0, 0, 0, .42);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--sky-base);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro TC", "SF Pro Text", "PingFang TC", "Noto Sans TC", "Segoe UI", Roboto, sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: color .8s ease;
}
img { max-width: 100%; }
figure { margin: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap { max-width: 78rem; margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--brand-deep); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

/* ===== 天空：五層漸層交叉淡入，太陽沿弧線移動，日落後換月亮與星星 ===== */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sky i { position: absolute; inset: 0; opacity: 0; }
.sky .s0 { background: var(--sky-0); opacity: 1; }
.sky .s1 { background: var(--sky-1); }
.sky .s2 { background: var(--sky-2); }
.sky .s3 { background: var(--sky-3); }
.sky .s4 { background: var(--sky-4); }
.ledger-live .sky i { transition: opacity .2s linear; }
.sun {
  position: absolute; width: 9vmax; height: 9vmax; border-radius: 50%;
  left: var(--sx, 13%); top: var(--sy, 88%); transform: translate(-50%, -50%);
  background: var(--sun); box-shadow: var(--sun-glow);
  transition: opacity .8s ease;
}
/* 太陽由左下升起、正午在上方、傍晚從右下沉到畫面外；
   太陽落下時月亮從對面（左下）升起，夜深到最高點，收尾時往右偏低。
   沒有 JS 時月亮留在地平線下（--my 預設 112%）。 */
.moon {
  position: absolute; width: 6vmax; height: 6vmax; border-radius: 50%;
  left: var(--mx, 8%); top: var(--my, 112%); transform: translate(-50%, -50%);
  background: radial-gradient(circle at 40% 40%, #FFFBF0, #E3DCCB 65%, #BDB5A4);
  box-shadow: 0 0 50px 14px rgba(230, 225, 210, .2);
}
.stars {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 40%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 12%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 72% 30%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 88% 20%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 70%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 80% 62%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 20% 80%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 64% 84%, #fff 50%, transparent 51%);
}
:root[data-night="true"] .sun { opacity: 0; }
:root[data-night="true"] .stars { opacity: .8; }

/* ===== 導覽列：玻璃膠囊（呼應 App 底部 tab bar） ===== */
.nav-shell { position: sticky; top: 0; z-index: 10; padding-top: .5rem; }
nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  max-width: 78rem; margin: 0 auto;
  padding: .55rem .65rem .55rem 1.1rem;
  border-radius: 999px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--shadow-soft);
  transition: background .8s ease;
}
.nav-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; letter-spacing: .02em; text-decoration: none; color: var(--ink); }
.nav-brand .mark {
  width: 1.7rem; height: 1.7rem; border-radius: 8px; flex: none;
  display: block; overflow: hidden;
}
.nav-brand .mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nav-links { display: flex; gap: 1.4rem; font-size: .92rem; }
.nav-links a { color: var(--mute); text-decoration: none; }
.nav-links a:hover { color: var(--ink); }
/* 導覽列下載：Apple 官方黑色 App Store 徽章（與開場／尾聲同一份素材） */
.nav-cta { display: inline-flex; align-items: center; line-height: 0; border-radius: 7px; flex: none; padding: 5px 3px; margin: -5px -3px; }
.nav-cta img { display: block; width: auto; height: 36px; }
.language-switch {
  font-size: .82rem; font-weight: 600; white-space: nowrap;
  color: var(--brand-deep); border: 1px solid var(--line);
  padding: .4rem .75rem; border-radius: 999px; text-decoration: none;
}
.nav-actions { display: flex; align-items: center; gap: .55rem; }
@media (max-width: 760px) { .nav-links { display: none; } }
/* 手機：右上角只留下載，語言切換改由頁尾連結提供 */
@media (max-width: 560px) { .language-switch { display: none; } .nav-cta img { height: 34px; } }
@media (max-width: 360px) { .nav-brand { gap: .35rem; font-size: .85rem; } }

#top, section { scroll-margin-top: 5.5rem; }

/* ===== 手機外框：深色邊框＋動態島＋側鍵（圓角隨寬度等比） ===== */
/* 邊框厚度跟著手機自己的寬度（--dw）：百分比 padding 會以父層寬度計算，
   整排手機的格子父層很寬，邊框就會變得過厚。 */
.device {
  --dw: min(19rem, 78vw);
  position: relative; width: var(--dw);
  border-radius: 16% / 7.4%;
  padding: calc(var(--dw) * .028);
  background: linear-gradient(150deg, #46413a, #171512 42%, #26221e 82%, #3a352f);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: var(--shadow), inset 0 0 0 3px rgba(0, 0, 0, .6);
  container-type: inline-size;
}
.device::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  top: 2.4%; width: 25%; aspect-ratio: 3.7 / 1;
  background: #0c0b0a; border-radius: 999px; z-index: 2;
}
/* 截圖本身已有動態島時，不再畫第二個 */
.device.has-island::after { display: none; }
.device > img, .device .screen {
  display: block; width: 100%; height: auto; aspect-ratio: 720 / 1558;
  object-fit: cover; border-radius: 13.6% / 6.3%; background: #111;
}
.device .screen { position: relative; overflow: hidden; }
.pbtn { position: absolute; width: 3px; border-radius: 3px; background: #2b2721; box-shadow: -1px 0 1px rgba(0,0,0,.4); }
.pbtn-pwr { right: -2px; top: 30%; height: 10%; }
.pbtn-vol { left: -2px; top: 24%; height: 4%; box-shadow: 0 calc(var(--dw) * .1) 0 #2b2721, 0 calc(var(--dw) * .18) 0 #2b2721; }

/* ===== 開場 ===== */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 3rem; align-items: center;
  min-height: min(88vh, 50rem); padding: 3rem 0 4rem;
}
.kicker { font-size: .8rem; font-weight: 600; letter-spacing: .18em; color: var(--mute); margin: 0 0 1rem; }
h1 {
  font-size: clamp(2.5rem, 6.4vw, 5.2rem);
  line-height: 1.06; letter-spacing: -.03em;
  margin: 0 0 1.3rem; font-weight: 800; text-wrap: balance;
}
.h1-sub {
  display: block; margin-top: .9rem;
  font-size: max(1.05rem, .36em); font-weight: 700; line-height: 1.35; letter-spacing: -.005em;
  color: var(--mute);
}
.lede { font-size: 1.1rem; color: var(--mute); max-width: 32rem; margin: 0 0 1.8rem; }
.cta-row { display: flex; align-items: center; gap: 1.3rem; flex-wrap: wrap; }
.app-store-badge { display: inline-flex; align-items: center; line-height: 0; border-radius: 8px; }
.app-store-badge img { display: block; width: auto; height: 48px; }
.scroll-hint {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .9rem; color: var(--mute); text-decoration: none;
}
.scroll-hint:hover { color: var(--ink); }
.scroll-hint i { display: inline-block; width: 1px; height: 2.2rem; background: currentColor; animation: dropline 1.6s ease-in-out infinite; }
@keyframes dropline {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
.hero-note { font-size: .8rem; line-height: 1.6; color: var(--mute); margin: 1.6rem 0 0; max-width: 32rem; }
.hero-visual { display: flex; justify-content: center; }
.hero .device { animation: float 7s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 2.6rem; min-height: 0; padding: 2.4rem 0 3rem; text-align: center; }
  .lede, .hero-note { margin-inline: auto; }
  .cta-row { justify-content: center; }
  .hero .device { --dw: min(17rem, 70vw); }
}

@media (max-width: 360px) {
  .hero { padding: .9rem 0 2rem; gap: 2rem; }
  .kicker { margin-bottom: .5rem; }
  h1 { font-size: 2.15rem; margin-bottom: .75rem; }
  .h1-sub { margin-top: .55rem; }
  .lede { font-size: 1rem; line-height: 1.55; margin-bottom: 1rem; }
}

/* ===== 一天：左側釘著今日帳，右側逐格時刻 ===== */
.day {
  display: grid; grid-template-columns: minmax(0, 19rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem); align-items: start;
  padding: 1rem 0 2rem;
}
.book {
  position: sticky; top: calc(var(--nav-h) + .75rem);
  max-height: calc(100vh - var(--nav-h) - 1.5rem);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  background: var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  border-radius: 24px; padding: 1.25rem 1.3rem 1.1rem;
  box-shadow: var(--shadow-soft);
  transition: background .8s ease;
}
.book::-webkit-scrollbar { display: none; }
.book p { margin: 0; }
.book-date { font-size: .78rem; font-weight: 600; letter-spacing: .12em; color: var(--mute); }
.clock {
  font-size: 3.1rem; font-weight: 800; line-height: 1.05; letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.total { margin-top: .8rem; display: flex; align-items: baseline; gap: .5rem; font-variant-numeric: tabular-nums; }
.total b { font-size: 2.1rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--accent); }
.total span { font-size: .82rem; color: var(--mute); white-space: nowrap; }
.bar { margin-top: .6rem; height: .5rem; border-radius: 999px; background: var(--hair); overflow: hidden; }
.bar i { display: block; height: 100%; width: var(--w, 100%); background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 999px; transition: width .6s ease, background .6s ease; }
/* 攝取超過目標：進度條轉成 App 的超標紅 */
.book.over .bar i { background: #B5503A; }
:root[data-night="true"] .book.over .bar i { background: #E07A60; }
.book-sub {
  display: flex; justify-content: space-between; gap: .6rem; margin-top: .55rem;
  font-size: .82rem; color: var(--mute); font-variant-numeric: tabular-nums;
}
.book-sub b { color: var(--ink); font-weight: 800; }
.entries { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--hair); font-size: .84rem; line-height: 1.45; font-variant-numeric: tabular-nums; }
.entries li { display: grid; grid-template-columns: 3em minmax(0, 1fr) auto; gap: .6em; align-items: start; padding: .45rem 0; border-bottom: 1px solid var(--hair); }
.ledger-live .entries li { opacity: .28; transition: opacity .5s ease; }
.ledger-live .entries li.on { opacity: 1; }
.e-time { color: var(--mute); }
.e-name small { display: block; font-size: .72rem; color: var(--mute); line-height: 1.35; }
.e-kcal { font-weight: 800; }
.e-kcal.neg { color: var(--good); }
.book-water { display: flex; justify-content: space-between; margin-top: .8rem; font-size: .84rem; color: var(--mute); font-variant-numeric: tabular-nums; }
.book-water b { color: var(--ink); font-weight: 800; }

.moments { list-style: none; margin: 0; padding: 2rem 0 5rem; display: grid; gap: clamp(4.5rem, 13vh, 9rem); }
.m { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2.2rem; align-items: center; }
.m.flip { grid-template-columns: auto minmax(0, 1fr); }
.m.flip .m-text { order: 2; }
/* 文字底下墊一層玻璃：黃昏天色是中間調，直接壓在天空上會看不清楚 */
.m-text {
  padding: 1.4rem 1.6rem 1.5rem; border-radius: 24px;
  background: var(--glass-text); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  transition: background .8s ease;
}
.m-text p { margin: 0; }
.m-time {
  display: flex; align-items: center; gap: .7rem;
  font-size: .98rem; font-weight: 800; letter-spacing: .06em; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.m-time::after { content: ""; flex: 1; max-width: 6rem; height: 1px; background: var(--line); }
.m h2 { font-size: clamp(1.6rem, 3.2vw, 2.5rem); line-height: 1.2; letter-spacing: -.02em; font-weight: 800; margin: .5rem 0 .7rem; text-wrap: balance; }
.m-body { color: var(--mute); font-size: 1.02rem; max-width: 27rem; text-wrap: pretty; }
.deltas { display: flex; flex-direction: column; gap: .1rem; margin-top: .7rem !important; font-variant-numeric: tabular-nums; }
.delta { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.delta.pos { color: var(--accent); }
.delta.neg { color: var(--good); }
.delta.wtr { font-size: 1.1rem; color: var(--water); }
.delta small { display: inline-block; white-space: nowrap; font-size: .85rem; font-weight: 600; letter-spacing: 0; color: var(--mute); margin-left: .6rem; }
.tag {
  display: inline-block; margin-top: .9rem !important;
  font-size: .8rem; font-weight: 600; letter-spacing: .04em; line-height: 1.5;
  padding: .3rem .85rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--mute); background: var(--glass);
}

.phones { display: flex; gap: 1rem; align-items: flex-end; }
.phones .device { --dw: min(13.5rem, 38vw); }
.phones.two .device, .phones.two .photo-slot { --dw: min(11.5rem, 30vw); }
.phones.four .device { --dw: min(10.5rem, 22vw); }
.phones > :nth-child(even) { transform: translateY(1.5rem); }
/* 電腦版：點截圖或標籤照片就在原位放大，看得清楚畫面細節；再點一次、點旁邊或按 Esc 縮回。
   .zoomable 由 landing-motion.js 只在滑鼠裝置加上；手機寬度改成左右滑動，不放大。 */
.phones .device { --zoom: 1.5; }
.phones.two .device, .phones.two .photo-slot { --zoom: 1.75; }
.phones.four .device { --zoom: 1.9; }
@media (min-width: 901px) {
  .zoomable {
    position: relative; cursor: zoom-in;
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease, translate .3s cubic-bezier(.2, .8, .2, 1);
  }
  .zoomable:hover { translate: 0 -6px; }
  /* 放大後仍在導覽列（z-index 10）底下 */
  .zoomable.zoomed { z-index: 9; cursor: zoom-out; translate: none; transform: scale(var(--zoom)); box-shadow: 0 30px 70px rgba(20, 15, 10, .45); }
  .phones > .zoomable.zoomed:nth-child(even) { transform: translateY(1.5rem) scale(var(--zoom)); }
  /* 一排兩支以上時，最左、最右那支從外側放大，避免超出畫面 */
  .phones.two > :first-child, .phones.four > :first-child { transform-origin: left center; }
  .phones.two > :last-child, .phones.four > :last-child { transform-origin: right center; }
}
.m.wide { grid-template-columns: minmax(0, 1fr); }
.m.wide .m-text { text-align: center; max-width: 38rem; margin-inline: auto; }
.m.wide .m-body { margin-inline: auto; }
.m.wide .m-time { justify-content: center; }
.m.wide .m-time::after { display: none; }
.m.wide .phones { justify-content: center; flex-wrap: wrap; }

/* 真實營養標示照片：獨立一格，之後換圖只動這個 figure */
.photo-slot {
  position: relative; width: var(--dw, 11.5rem);
  flex: none; align-self: center;
  border-radius: 18px; overflow: hidden; line-height: 0;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  background: #6E7F3A;
}
.photo-slot img { display: block; width: 100%; height: auto; }
/* 掃描框：四角括號＋來回掃動的線，壓在真實標籤照片上 */
.label-scan { position: absolute; inset: 9% 7%; pointer-events: none; }
.label-scan i { position: absolute; width: 1.2rem; height: 1.2rem; border: 3px solid #C26A3D; }
.label-scan i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.label-scan i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.label-scan i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.label-scan i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.label-scan b {
  position: absolute; left: 6%; right: 6%; top: 4%; height: 3px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #C26A3D 28%, #C26A3D 72%, transparent);
  box-shadow: 0 0 14px rgba(194, 106, 61, .75);
  animation: labelscan 2.6s ease-in-out infinite alternate;
}
@keyframes labelscan { to { top: 94%; } }

/* 常用食物示意卡 */
.fav, .sync {
  width: min(16rem, 42vw); padding: 1rem; font-size: .88rem;
  background: var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-radius: 22px; box-shadow: var(--shadow-soft);
}
.fav p, .sync p { margin: 0; }
/* Apple 健康同步示意卡（07:32） */
.sync-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; padding: 0 .3rem; margin-bottom: .6rem !important; }
.sync-ok { font-size: .75rem; font-weight: 700; color: var(--good); border: 1px solid currentColor; border-radius: 999px; padding: .05rem .55rem; }
.sync-row { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .7rem .7rem; border-radius: 14px; background: color-mix(in srgb, var(--good) 14%, transparent); }
.sync-row span { display: grid; gap: .1rem; }
.sync-row small { color: var(--mute); font-size: .78rem; }
.sync-kcal { color: var(--good); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sync-foot { margin-top: .6rem !important; padding: 0 .3rem; color: var(--mute); font-size: .8rem; }
.fav-head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: .5rem !important; padding: 0 .3rem; }
.fav-head span:last-child { color: var(--accent); }
.fav-list { list-style: none; margin: 0; padding: 0; }
.fav-item { display: flex; justify-content: space-between; gap: .6rem; padding: .5rem .6rem; border-radius: 12px; color: var(--mute); }
.fav-item b { color: var(--ink); font-variant-numeric: tabular-nums; }
.fav-item.on { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--ink); font-weight: 600; }
.fav-btn { margin-top: .6rem !important; text-align: center; background: var(--brand); color: var(--on-brand); border-radius: 12px; padding: .55rem; font-weight: 700; font-size: .86rem; }

/* 白開水杯 */
.cup {
  position: relative; overflow: hidden;
  width: min(12rem, 36vw); aspect-ratio: 1 / 1.15;
  border-radius: 14% 14% 40% 40% / 8% 8% 34% 34%;
  background: var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
}
.cup i {
  position: absolute; left: -40%; width: 180%; height: 200%; top: var(--lvl, 42%);
  border-radius: 40%; background: rgba(120, 170, 210, .55);
  animation: spin 8s linear infinite; transition: top .8s ease;
}
.cup i + i { background: rgba(120, 170, 210, .35); animation-duration: 12s; top: calc(var(--lvl, 42%) + 3%); }
@keyframes spin { to { transform: rotate(360deg); } }
.cup b { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }

/* 相機取景示意（非 App 截圖） */
.cam img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.cam-scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.42), rgba(0,0,0,0) 24%, rgba(0,0,0,0) 64%, rgba(0,0,0,.52)); }
.cam-top {
  position: absolute; top: 7.5%; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 90%; text-align: center; line-height: 1.4;
  font-size: max(.62rem, 5cqw); font-weight: 600; color: #fff; background: rgba(0,0,0,.42);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: .3em 1em; border-radius: 999px;
}
.cam-focus { position: absolute; top: 40%; left: 26%; width: 48%; aspect-ratio: 1; border: 1.5px solid rgba(255, 214, 10, .95); border-radius: 4px; }
.cam-mode { position: absolute; bottom: 14.5%; left: 50%; transform: translateX(-50%); font-size: max(.6rem, 4.4cqw); font-weight: 600; letter-spacing: .14em; color: #FFD60A; }
.cam-shutter { position: absolute; bottom: 4.6%; left: 50%; transform: translateX(-50%); width: 15%; aspect-ratio: 1; border-radius: 50%; background: #fff; }
.cam-shutter::before { content: ""; position: absolute; inset: -.35rem; border: 3px solid rgba(255,255,255,.95); border-radius: 50%; }

@media (max-width: 1180px) {
  .m, .m.flip { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .m.flip .m-text { order: 0; }
  .phones .device { --dw: min(13rem, 34vw); }
  .phones.two .device, .phones.two .photo-slot { --dw: min(12rem, 32vw); }
  .phones.four .device { --dw: min(10.5rem, 20vw); }
}

/* ===== 手機：今日帳改成置頂精簡列，每格單欄 ===== */
@media (max-width: 900px) {
  .day { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-top: 0; }
  /* 精簡帳本：壓成兩行，少佔一點螢幕 */
  .book {
    top: calc(var(--nav-h) + .3rem); z-index: 5; max-height: none; overflow: visible;
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .1rem .8rem;
    padding: .5rem .9rem .55rem; border-radius: 16px;
    background: var(--glass-strong);
  }
  .book-date, .entries, .book-water { display: none; }
  .book-live { display: contents; }
  .clock { font-size: 1.35rem; white-space: nowrap; }
  .total { margin-top: 0; justify-self: end; min-width: 0; flex-wrap: wrap; justify-content: flex-end; column-gap: .4rem; text-align: right; }
  .total b { font-size: 1.2rem; }
  .total span { font-size: .7rem; }
  .bar { grid-column: 1 / -1; margin-top: .25rem; height: .35rem; }
  .book-sub { grid-column: 1 / -1; margin-top: .15rem; font-size: .72rem; }
  .moments { padding-top: 1.5rem; }
  /* 內文靠左、標題縮小到一行排得下，讀起來比多行置中輕鬆 */
  .m-text { text-align: left; padding: 1.2rem 1.25rem 1.3rem; }
  .m h2 { font-size: clamp(1.35rem, 6vw, 1.65rem); }
  .m-body { font-size: 1rem; line-height: 1.75; }
  .m.wide .m-text { text-align: left; }
  .m.wide .m-time { justify-content: flex-start; }
  .phones { justify-content: center; }
  .phones .device { --dw: min(17rem, 72vw); }
  /* 兩支以上改成左右滑動，每支放大到約螢幕寬的 72%，露出下一支的邊緣提示可以滑 */
  .phones.two, .phones.four {
    justify-content: flex-start; align-items: center; flex-wrap: nowrap; gap: 1rem;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: -1.25rem; padding: .4rem 1.25rem 1rem; scroll-padding-inline: 1.25rem;
  }
  .phones.two::-webkit-scrollbar, .phones.four::-webkit-scrollbar { display: none; }
  .phones.two > *, .phones.four > * { flex: none; scroll-snap-align: center; }
  .m.wide .phones.two, .m.wide .phones.four { flex-wrap: nowrap; justify-content: flex-start; }
  .phones.two .device, .phones.two .photo-slot, .phones.four .device { --dw: min(17rem, 72vw); }
  .phones > :nth-child(even), .phones.four > :nth-child(even) { transform: none; }
  .fav, .sync, .cup { margin-inline: auto; }
  .fav, .sync { width: min(18rem, 84vw); }
  .cup { width: min(11rem, 48vw); }
}
/* ===== 手機版收據：取代置頂精簡帳本，每經過一個時刻從底部印出一行，合計為淨熱量 ===== */
.tape { display: none; }
@media (max-width: 900px) {
  /* 視覺上交給底部收據；帳本仍留在無障礙樹中，螢幕閱讀器讀得到摘要與明細 */
  .ledger-live .book {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
  }
  .ledger-live .moments { padding-top: 3.2rem; gap: 5.5rem; padding-bottom: 7rem; }
  /* 每格背後的空心超大時間 */
  .m { position: relative; }
  .m::before {
    content: attr(data-stamp); position: absolute; z-index: 0; top: -3.1rem; left: -.2rem;
    font-size: 5.4rem; font-weight: 900; letter-spacing: -.05em; line-height: 1; white-space: nowrap;
    /* 英文「Month-end」這類長字會比手機還寬，撐寬整頁版面；超出卡片的部分直接裁掉 */
    max-width: 100%; overflow: hidden;
    color: transparent; -webkit-text-stroke: 1.5px rgba(30, 27, 22, .22); font-variant-numeric: tabular-nums;
    pointer-events: none;
  }
  :root[data-night="true"] .m::before { -webkit-text-stroke-color: rgba(244, 239, 230, .28); }
  .m > * { position: relative; z-index: 1; }
  .tape {
    display: block; position: fixed; left: 50%; bottom: calc(.7rem + env(safe-area-inset-bottom)); z-index: 8;
    width: min(22rem, calc(100vw - 1.6rem)); transform: translate(-50%, 130%);
    background: #FBF7EE; color: #1E1B16; border-radius: 3px 3px 12px 12px;
    box-shadow: 0 20px 44px rgba(30, 20, 10, .32); padding: .7rem 1rem .6rem;
    font-size: .82rem; font-variant-numeric: tabular-nums; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .5s cubic-bezier(.2, .8, .2, 1);
  }
  .tape.on { transform: translate(-50%, 0); }
  /* 平常只留最新兩筆＋淨熱量，少擋內容；點一下展開整天明細，再點收起 */
  .tape:not(.open) .tape-head, .tape:not(.open) .tape-sub { display: none; }
  .tape.open { padding-top: 1rem; }
  /* 收據上緣的鋸齒 */
  .tape::before {
    content: ""; position: absolute; left: 0; right: 0; top: -9px; height: 10px;
    background: linear-gradient(135deg, transparent 50%, #FBF7EE 50%) 0 0 / 12px 10px repeat-x,
                linear-gradient(225deg, transparent 50%, #FBF7EE 50%) 0 0 / 12px 10px repeat-x;
  }
  .tape p { margin: 0; }
  .tape-head { display: flex; justify-content: space-between; font-size: .7rem; font-weight: 700; letter-spacing: .12em; color: #6B6257; padding-bottom: .45rem; border-bottom: 1px dashed #CFC4B0; }
  .tape-lines { max-height: 3.4em; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; transition: max-height .35s cubic-bezier(.2, .8, .2, 1); }
  .tape.open .tape-lines { max-height: 12em; margin-top: .3rem; }
  .tape-line { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto; gap: .5em; line-height: 1.7; white-space: nowrap; }
  .tape-line span:nth-child(1) { color: #6B6257; }
  .tape-line span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
  .tape-line .neg { color: #52704F; }
  .tape-line.new { animation: tape-print .55s cubic-bezier(.2, .8, .2, 1); }
  @keyframes tape-print { from { transform: translateY(100%); opacity: 0; } }
  .tape-empty { color: #6B6257; text-align: center; line-height: 1.7; }
  .tape-sub { display: flex; justify-content: space-between; margin-top: .35rem !important; padding-top: .35rem; border-top: 1px dashed #CFC4B0; font-size: .74rem; color: #6B6257; }
  .tape-sub b { color: #1E1B16; }
  .tape-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1.5px solid #1E1B16; margin-top: .35rem !important; padding-top: .4rem; font-weight: 800; }
  .tape-total b { font-size: 1.25rem; color: #A5532A; letter-spacing: -.02em; }
  .tape-more { margin-left: .6em; font-size: .7rem; font-weight: 600; color: #6B6257; }
  .tape-more::before { content: attr(data-more); }
  .tape.open .tape-more::before { content: attr(data-less); }
  /* 往上的箭頭＝可以展開；展開後轉成往下＝收起 */
  .tape-more::after {
    content: ""; display: inline-block; width: .42em; height: .42em; margin-left: .4em; vertical-align: .05em;
    border-left: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg);
    transition: transform .3s ease;
  }
  .tape.open .tape-more::after { transform: translateY(-.2em) rotate(225deg); }
}
@media (max-width: 380px) {
  .book { column-gap: .6rem; padding-inline: .85rem; }
  .clock { font-size: 1.45rem; }
  .total b { font-size: 1.25rem; }
}

/* ===== 收尾：隱私、點數、常見問題、尾聲（夜晚） ===== */
section { padding: 4.2rem 0 1rem; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.15rem); line-height: 1.3; letter-spacing: -.01em; margin: 0 0 .7rem; text-wrap: balance; }
.pnl {
  background: var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  border-radius: 24px; padding: 1.6rem clamp(1.2rem, 3vw, 1.8rem);
  box-shadow: var(--shadow-soft);
  transition: background .8s ease;
}
.pnl h3 { font-size: 1.15rem; line-height: 1.35; margin: 0 0 1rem; }
.pnl-kicker { font-size: .78rem; font-weight: 600; letter-spacing: .14em; color: var(--mute); margin: 0 0 .3rem; }

#privacy {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; padding-top: 5rem;
}
.close-lead h2 { font-size: clamp(2rem, 4.4vw, 3.3rem); line-height: 1.18; letter-spacing: -.02em; font-weight: 800; margin-bottom: 1rem; }
.close-lead p { color: var(--mute); font-size: 1.05rem; margin: 0; max-width: 34rem; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .95rem; }
.checks li { display: flex; gap: .8rem; align-items: flex-start; font-size: .95rem; color: var(--mute); }
.checks li b { color: var(--ink); font-weight: 600; }
.checks .tick {
  flex: none; width: 1.45rem; height: 1.45rem; margin-top: .2rem; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--good) 20%, transparent); color: var(--good);
}
.checks .tick svg { width: .8rem; height: .8rem; }

.credits-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.receipt h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; margin-bottom: 1rem; }
.recpt { margin: 0; font-variant-numeric: tabular-nums; font-size: .95rem; }
.recpt div { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--hair); }
.recpt dt { color: var(--mute); }
.recpt dd { margin: 0; font-weight: 700; white-space: nowrap; }
.recpt dd.free { color: var(--good); }
.recpt div.tot { border-bottom: 0; font-size: 1.1rem; }
.recpt div.tot dt { color: var(--ink); font-weight: 800; }
.recpt div.tot dd { font-weight: 800; }
.recpt-note { color: var(--mute); font-size: .9rem; margin: .8rem 0 0; }
.credits-steps { display: grid; gap: 1rem; }
.step {
  padding: 1.3rem 1.3rem 1.2rem; border-radius: 20px;
  background: var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: background .8s ease;
}
.step h3 { display: flex; align-items: baseline; gap: .6rem; font-size: 1.02rem; margin: 0 0 .45rem; }
.step p { font-size: .9rem; color: var(--mute); margin: 0; }
.step .n { font-variant-numeric: tabular-nums; font-size: .78rem; font-weight: 700; color: var(--brand-deep); letter-spacing: .1em; }
/* 方案比較：三種方案並排，數字是每天補的點數 */
.plans {
  padding: 1.1rem 1.2rem 1rem; border-radius: 20px;
  background: var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.plans h3 { font-size: 1.02rem; margin: 0 0 .6rem; }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
/* 每格：方案名／每天補點（數字＋單位同一行）／價格，三行緊湊排列 */
.plan-list li {
  display: grid; grid-template-columns: auto auto; justify-content: center; align-items: baseline;
  column-gap: .25rem; row-gap: .05rem; text-align: center;
  padding: .45rem .35rem .5rem; border-radius: 12px; border: 1px solid var(--line);
}
.plan-list b { grid-column: 1 / -1; font-size: .82rem; }
.plan-n { font-size: 1.35rem; font-weight: 800; line-height: 1.1; color: var(--accent); font-variant-numeric: tabular-nums; }
.plan-u { font-size: .72rem; color: var(--mute); }
.plan-list small { grid-column: 1 / -1; font-size: .74rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.plans-note { font-size: .78rem; color: var(--mute); margin: .6rem 0 0; }

/* 下載前常見問題：左標題＋右單欄手風琴 */
.faq-layout {
  display: grid; grid-template-columns: minmax(0, 19rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem); align-items: start;
}
.faq-intro { position: sticky; top: 6rem; }
.faq-intro h2 { margin: 0 0 .7rem; }
.faq-intro p { color: var(--mute); margin: 0; }
.faq-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; }
.faq-item {
  background: var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-radius: 20px; padding: 0 clamp(1.1rem, 3vw, 1.6rem);
  transition: background .8s ease;
}
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.15rem 0; color: var(--ink); font-weight: 600; line-height: 1.45;
  cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; flex: none; color: var(--accent); font-size: 1.35rem; font-weight: 400;
  line-height: 1; transition: transform .2s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item[open] summary { padding-bottom: .85rem; }
.faq-item p {
  margin: 0 0 1.25rem; padding-top: .95rem;
  border-top: 1px solid var(--hair);
  color: var(--mute); font-size: .95rem; line-height: 1.7; max-width: 40rem;
}
.faq-item p a { font-weight: 600; }

@media (max-width: 820px) {
  #privacy, .credits-grid { grid-template-columns: minmax(0, 1fr); }
  .faq-layout { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
  .faq-intro { position: static; }
}

.finale { text-align: center; padding: 5rem 0 4rem; }
.finale h2 { font-size: clamp(1.9rem, 4.6vw, 3.3rem); line-height: 1.2; letter-spacing: -.02em; font-weight: 800; margin-bottom: 1rem; }
.finale p { color: var(--mute); margin: 0 0 1.9rem; }
.finale-actions { display: flex; align-items: center; justify-content: center; gap: 1.2rem; flex-wrap: wrap; }
.cta-secondary { font-size: .95rem; color: var(--mute); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: .1rem; }
.cta-secondary:hover { color: var(--ink); }
footer {
  border-top: 1px solid var(--hair);
  margin-top: 2rem; padding: 2.4rem 1.25rem 3rem;
  text-align: center; font-size: .88rem; color: var(--mute);
}
footer .links { margin-bottom: .8rem; }
footer .links a { color: var(--brand-deep); text-decoration: none; margin: 0 .6rem; }
footer .links a:hover { text-decoration: underline; }
footer .trademark { max-width: 44rem; margin: .8rem auto 0; font-size: .72rem; line-height: 1.5; }

/* 淡入：只在 JS 成功執行後才先藏起來。 */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s ease, background .8s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .reveal { opacity: 1; transform: none; }
  .label-scan b { top: 48%; }
}
