/* Family Sleep League — 手機版樣式（/m/zh/、/m/en/ 共用）
   和電腦版同一套視覺（夜空、彩色字母卡、金色標題），改成手機 App 的操作方式：
   底部分頁列、左右滑動卡片、加入入口分頁切換 */
:root {
  --sky-1: #161a52; --sky-2: #24236f; --sky-3: #3a2a8c;
  --gold: #ffd23f; --gold-2: #ffb31a;
  --blue: #3b5bdb; --pink: #e0426b; --purple: #7b4fd6; --orange: #f08c1a; --green: #2fa84f; --teal: #1597a6;
  --ink: #1d2150; --ink-soft: #565b80; --panel: #fbfaff; --line: #e6e3f3; --check: #2fb24f;
  --bar-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
       background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 40%, var(--sky-3) 100%); background-attachment: fixed;
       padding-bottom: calc(var(--bar-h) + var(--safe-b) + 12px); }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0 0 .7em; }
.hidden { display: none !important; }
.gold { background: linear-gradient(180deg, #fff2b0, var(--gold) 45%, var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pad { padding-inline: 16px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- 頂部 App bar ---------- */
.appbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; padding-top: env(safe-area-inset-top, 0px);
          background: rgba(22,26,82,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.appbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 17px; text-decoration: none; }
.appbar .moon { font-size: 24px; filter: drop-shadow(0 0 8px rgba(255,210,63,.6)); }
.appbar .lang { margin-left: auto; min-width: 44px; height: 34px; display: grid; place-items: center; padding: 0 12px; border-radius: 999px;
                border: 1.5px solid rgba(255,255,255,.45); font-size: 13px; font-weight: 800; text-decoration: none; }

/* ---------- 按鈕 ---------- */
.btn { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 12px 20px; border-radius: 16px; border: 0;
       font: 800 17px/1.25 var(--font); text-decoration: none; text-align: center; cursor: pointer; }
.btn small { font-weight: 600; font-size: 12.5px; opacity: .85; }
.btn:active { transform: scale(.98); }
.btn-gold { background: linear-gradient(180deg, #ffe066, var(--gold-2)); color: #2a1f5c; box-shadow: 0 4px 0 #c98a00; }
.btn-glass { background: rgba(255,255,255,.12); color: #fff; border: 1.5px solid rgba(255,255,255,.4); }
.btn-ink { background: linear-gradient(180deg, #4a3fc0, #2c2a8a); color: #fff; }
.btn-line { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn[aria-disabled="true"] { opacity: .6; }

/* ---------- 主視覺 ---------- */
.hero { color: #fff; padding: 22px 0 8px; }
.hero h1 { font-size: 29px; font-weight: 900; text-align: center; letter-spacing: -.01em; }
.hero h1 .gold { display: block; font-size: 31px; margin-top: 2px; }
.hero-pill { margin: 12px auto 0; width: fit-content; max-width: 100%; padding: 7px 14px; border-radius: 999px; background: linear-gradient(90deg, #5b3fd0, #7c4fe0);
             font-size: 13px; font-weight: 700; text-align: center; }
.hero-photo { margin: 18px 16px 0; border-radius: 20px; overflow: hidden; border: 2px solid rgba(255,255,255,.15); box-shadow: 0 16px 36px rgba(0,0,0,.4); }
.hero-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 38% 50%; }
.today { margin: -38px 28px 0; position: relative; background: linear-gradient(180deg, #262c7a, #322b8c); border: 1.5px solid rgba(140,160,255,.45); border-radius: 20px; padding: 14px;
         box-shadow: 0 14px 30px rgba(0,0,0,.4); }
.today-top { display: flex; align-items: center; gap: 10px; }
.today-top .m { font-size: 30px; }
.today-top b { font-size: 22px; display: block; line-height: 1.1; }
.today-top small { font-size: 12.5px; opacity: .85; }
.today-top .who { margin-left: auto; text-align: right; font-size: 12.5px; font-weight: 700; opacity: .9; }
.today-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; text-align: center; }
.today-stats div { background: rgba(255,255,255,.08); border-radius: 12px; padding: 8px 4px; font-size: 11.5px; }
.today-stats b { display: block; font-size: 17px; color: var(--gold); }
.hero-sub { padding: 18px 20px 0; font-size: 16px; opacity: .92; text-align: center; }
.hero-ctas { display: grid; gap: 10px; padding: 8px 16px 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 18px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; font-weight: 800; font-size: 14px; color: #2a1f5c;
        background: linear-gradient(180deg, #fff1a8, var(--gold)); }
.chip.alt { background: linear-gradient(180deg, #efe4ff, #cdb6ff); }

/* ---------- 卡片 Cards ---------- */
.card { --c: var(--blue); margin: 18px 12px 0; background: var(--panel); border-radius: 20px; overflow: hidden;
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 55%, transparent), 0 10px 26px rgba(0,0,0,.25); }
.card-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; color: #fff; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 65%, #fff)); }
.card-head h2 { font-size: 19px; font-weight: 900; font-style: italic; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.card-head h2 small { display: block; font-size: 12.5px; font-weight: 700; font-style: normal; opacity: .92; }
.letter { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--c); display: grid; place-items: center; font-weight: 900; font-size: 18px; }
.card-tag { margin-left: auto; font-size: 11.5px; font-weight: 700; opacity: .95; text-align: right; max-width: 40%; line-height: 1.3; }
.card-body { padding: 16px; }
.card.blue { --c: var(--blue); } .card.pink { --c: var(--pink); } .card.purple { --c: var(--purple); }
.card.orange { --c: var(--orange); } .card.green { --c: var(--green); } .card.teal { --c: var(--teal); }

/* 清單 Lists */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.checks li { position: relative; padding-left: 32px; font-size: 15px; }
.checks li::before { content: "✓"; position: absolute; left: 0; top: 1px; width: 23px; height: 23px; border-radius: 50%; background: var(--check); color: #fff;
                     display: grid; place-items: center; font-weight: 900; font-size: 13px; }
.checks b { display: block; }
.checks small { color: var(--ink-soft); font-size: 13.5px; }
.boxes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.boxes li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 15px; }
.boxes li::before { content: ""; flex: none; width: 20px; height: 20px; border: 2.5px solid #4a4f7a; border-radius: 5px; margin-top: 2px; background: #fff; }
.familiar { display: grid; grid-template-columns: 1fr 92px; gap: 12px; align-items: end; }
.familiar img { border-radius: 14px; }
.row-item { display: flex; gap: 12px; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 11px 12px; }
.row-item + .row-item { margin-top: 8px; }
.row-item .ic { font-size: 28px; flex: none; width: 36px; text-align: center; }
.row-item b { display: block; font-size: 15.5px; }
.row-item span { font-size: 13.5px; color: var(--ink-soft); }
.stats { display: grid; gap: 8px; margin-top: 12px; }
.stat { display: flex; align-items: center; gap: 12px; background: linear-gradient(180deg, #232a72, #34298a); color: #fff; border-radius: 14px; padding: 12px 14px; }
.stat b { flex: none; min-width: 76px; font-size: 28px; line-height: 1; color: var(--gold); font-weight: 900; }
.stat span { font-size: 13.5px; }
.src { font-size: 12px; color: var(--ink-soft); margin: 10px 0 0; }

/* ---------- 左右滑動 Swipe ---------- */
.swipe { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; overscroll-behavior-x: contain; }
.swipe::-webkit-scrollbar { display: none; }
.swipe > * { flex: 0 0 80%; scroll-snap-align: center; }
.swipe.narrow > * { flex-basis: 62%; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dots i { width: 7px; height: 7px; border-radius: 999px; background: #cfcae6; transition: width .2s, background .2s; }
.dots i.on { width: 20px; background: var(--c); }
.swipe-hint { text-align: center; font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

.step { background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; }
.step-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.step-n { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(180deg, #8a66f0, #5b3fd0); color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 18px; }
.step-top .ic { font-size: 32px; }
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { font-size: 14px; color: var(--ink-soft); margin: 0; }

.flow-item { text-align: center; }
.flow-time { display: inline-block; background: #24236f; color: #fff; font-weight: 900; border-radius: 999px; padding: 4px 12px; font-size: 13px; margin-bottom: 8px; }
.flow-pic { aspect-ratio: 1 / .9; border-radius: 16px; overflow: hidden; background: linear-gradient(180deg, #ffd88a, #ffb347); display: grid; place-items: center; font-size: 64px; }
.flow-pic img { width: 100%; height: 100%; object-fit: cover; }
.flow-item h3 { font-size: 16px; margin: 10px 0 2px; }
.flow-item p { font-size: 13.5px; color: var(--ink-soft); margin: 0; }
.note { font-size: 12.5px; color: var(--ink-soft); margin: 12px 0 0; text-align: center; }

.pic { border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.pic img { width: 100%; height: 130px; object-fit: cover; }
.faces { display: block; font-size: 24px; letter-spacing: 2px; }
.timer { display: flex; gap: 10px; align-items: center; margin-top: 14px; background: #ffe9ee; border-radius: 14px; padding: 10px 12px; }
.timer .ic { font-size: 32px; }
.timer b { color: var(--pink); font-size: 17px; display: block; font-style: italic; }
.timer span { font-size: 13px; }

/* 報告 Reports */
.mini { background: #10143d; border-radius: 26px; padding: 8px; }
.mini-screen { background: linear-gradient(180deg, #262c7a, #322b8c); border-radius: 20px; padding: 14px 12px; color: #fff; min-height: 300px; }
.mini-title { text-align: center; font-weight: 900; font-size: 17px; padding-bottom: 8px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.15); }
.mini-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; padding: 6px 2px; border-bottom: 1px dashed rgba(255,255,255,.12); }
.mini-row .y { color: #7ef09a; }
.mini-row b { white-space: nowrap; }
.mini-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; align-items: end; height: 80px; margin: 4px 0; }
.mini-bars i { display: block; background: linear-gradient(180deg, #ffe45c, #ffb21a); border-radius: 4px 4px 2px 2px; }
.mini-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; font-size: 10.5px; text-align: center; opacity: .8; margin-bottom: 4px; }
.trophy { text-align: center; font-size: 40px; line-height: 1; }
.mini-score { text-align: center; margin-bottom: 6px; }
.mini-score b { font-size: 28px; color: var(--gold); display: block; }
.mini-score span { font-size: 12px; opacity: .85; }
.mini-team { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; font-size: 13px; padding: 5px 4px; border-radius: 8px; }
.mini-team.me { background: rgba(255,210,63,.18); font-weight: 800; }
.mini-cap { margin-top: 8px; text-align: center; font-size: 13px; color: var(--ink-soft); }
.mini-cap b { color: var(--ink); }

/* 計分 Score */
.score-top { display: flex; align-items: center; gap: 14px; background: linear-gradient(180deg, #fff1b8, var(--gold)); border-radius: 16px; padding: 12px 16px; margin-bottom: 12px; }
.score-top b { font-size: 54px; font-weight: 900; line-height: 1; color: #2a1f5c; }
.score-top span { font-weight: 800; color: #5a4300; }
.srow { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font-weight: 600; font-size: 14.5px; }
.srow + .srow { margin-top: 8px; }
.pts { background: #fff1c7; color: #6b4b00; border-radius: 999px; padding: 2px 11px; font-weight: 900; white-space: nowrap; }

/* 獎章、聯盟、承諾 */
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 4px; text-align: center; font-weight: 700; font-size: 12.5px; line-height: 1.3; }
.badge span { display: block; font-size: 28px; line-height: 1.3; }
.board { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 4px 12px; margin-bottom: 14px; }
.board-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; }
.board-row:last-child { border-bottom: 0; }
.board-row .r { font-size: 20px; }
.board-row.me { color: var(--green); font-weight: 900; }
.nos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.no { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 8px; text-align: center; }
.no span { display: block; font-size: 28px; }
.no b { display: block; font-size: 16px; }
.no small { color: var(--ink-soft); font-size: 12.5px; }

.week { background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; text-align: center; }
.week .ic { font-size: 36px; }
.week b { display: block; color: var(--orange); font-size: 13px; letter-spacing: .04em; }
.week h3 { font-size: 17px; margin: 2px 0 6px; }
.week p { font-size: 14px; color: var(--ink-soft); margin: 0; }

/* 價格 Pricing */
.price { position: relative; background: #fff; border: 1.5px solid var(--line); border-radius: 18px; padding: 16px; }
.price + .price { margin-top: 12px; }
.price.featured { background: linear-gradient(180deg, #262c7a, #3a2a8c); color: #fff; border: 0; box-shadow: 0 0 0 3px var(--gold); margin-top: 10px; }
.price.featured .checks small { color: rgba(255,255,255,.7); }
.ribbon { position: absolute; top: -11px; left: 16px; background: var(--gold); color: #2a1f5c; font-weight: 900; font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.price-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.price h3 { font-size: 18px; }
.amount { font-size: 34px; font-weight: 900; line-height: 1.1; white-space: nowrap; }
.amount small { font-size: 13px; font-weight: 700; opacity: .75; }
.price.featured .amount { color: var(--gold); }
.price .checks { margin: 12px 0 14px; }
.price.compact .checks { margin-bottom: 0; }

/* 加入 Join（分頁切換三個入口） */
.join { margin: 26px 12px 0; }
.join-title { text-align: center; color: #fff; }
.join-title h2 { font-size: 30px; font-weight: 900; }
.join-title p { font-size: 14.5px; opacity: .9; margin: 6px 0 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 16px; padding: 4px; background: rgba(255,255,255,.12); border-radius: 16px; }
.seg button { min-height: 48px; border: 0; border-radius: 12px; background: transparent; color: #fff; font: 800 13.5px/1.2 var(--font); cursor: pointer; padding: 6px 4px; }
.seg button span { display: block; font-size: 20px; }
.seg button[aria-selected="true"] { background: #fff; color: var(--ink); }
.door { margin-top: 12px; background: var(--panel); border-radius: 20px; padding: 18px 16px; }
.door h3 { font-size: 19px; margin-bottom: 6px; }
.door > p { font-size: 14.5px; }
.door form { display: grid; gap: 10px; margin-top: 6px; }
.field label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 4px; }
input[type=text], input[type=email], select { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; color: var(--ink); font: 16px var(--font); }
input.code { text-transform: uppercase; letter-spacing: .28em; text-align: center; font-size: 22px; font-weight: 900; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; min-height: 44px; padding-top: 4px; }
.check input { width: 22px; height: 22px; flex: none; margin: 0; }
.msg { font-size: 14px; min-height: 1.2em; }
.msg.err { color: #c0392b; font-weight: 600; }
.msg.ok { color: #1c7a3d; font-weight: 700; }
.or { text-align: center; font-size: 13px; color: var(--ink-soft); margin: 8px 0 2px; }
.door-links { display: grid; gap: 10px; margin-top: 12px; }

/* FAQ */
.faq details { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; }
.faq details + details { margin-top: 8px; }
.faq summary { cursor: pointer; list-style: none; min-height: 50px; padding: 13px 44px 13px 14px; font-weight: 800; font-size: 15px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--purple); }
.faq details[open] summary::after { content: "–"; }
.faq .ans { padding: 0 14px 14px; font-size: 14.5px; color: var(--ink-soft); }

/* 經文 Verse */
.verse { margin: 18px 12px 0; border-radius: 20px; overflow: hidden; color: #fff; background: linear-gradient(180deg, #3b2f8f, #8a4fb0 60%, #f0a35e); }
.verse-text { padding: 20px 18px 16px; }
.verse .tag { display: inline-block; font-weight: 800; font-size: 12.5px; background: rgba(255,255,255,.16); border-radius: 999px; padding: 4px 12px; margin-bottom: 10px; }
.verse blockquote { margin: 0; font-size: 20px; font-weight: 800; font-style: italic; line-height: 1.45; }
.verse cite { display: block; margin-top: 8px; font-style: normal; opacity: .9; font-size: 14px; }
.verse small { display: block; margin-top: 8px; opacity: .85; font-size: 12.5px; }
.verse img { width: 100%; height: 110px; object-fit: cover; }

/* 結尾、頁尾 */
.final { text-align: center; color: #fff; padding: 36px 16px 8px; }
.final h2 { font-size: 26px; font-weight: 900; font-style: italic; }
.final p { opacity: .9; margin: 8px 0 16px; }
footer { color: rgba(255,255,255,.75); padding: 26px 20px 10px; font-size: 13.5px; text-align: center; }
footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-bottom: 14px; }
footer nav a { color: #fff; min-height: 36px; display: inline-flex; align-items: center; }
footer .legal { font-size: 12px; color: rgba(255,255,255,.6); }

/* ---------- 底部分頁列 Tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
          height: calc(var(--bar-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: rgba(16,19,62,.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
          border-top: 1px solid rgba(255,255,255,.1); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--bar-h); color: rgba(255,255,255,.65);
            text-decoration: none; font-size: 11px; font-weight: 700; }
.tabbar a span { font-size: 21px; line-height: 1; filter: grayscale(.4); }
.tabbar a.on { color: var(--gold); }
.tabbar a.on span { filter: none; }
.tabbar a.cta { position: relative; }
.tabbar a.cta span { width: 50px; height: 50px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; filter: none;
                     background: linear-gradient(180deg, #ffe066, var(--gold-2)); box-shadow: 0 4px 0 #c98a00, 0 6px 16px rgba(0,0,0,.35); }
.tabbar a.cta { color: var(--gold); }

@media (min-width: 600px) { body { max-width: 560px; margin-inline: auto; } .tabbar { max-width: 560px; margin-inline: auto; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto; } }
