/* Landing page shell. The diary itself is styled by diary.css. Mobile first: ads land on phones. */
@font-face {
  font-family: "XY Display";
  src: url(/static/fonts/xy-display.woff2) format("woff2");
  font-weight: 700 900; font-display: swap;
}
:root {
  --paper: #FBF6EC; --card: #FFFDF8; --ink: #3B332B; --muted: #8C8173; --line: #EBE1CF;
  --green: #5FA36A; --green-d: #3E7D4B; --coral: #EE8566; --mustard: #EDBE55; --sky: #9CCBEA;
  --lineg: #06C755;
  --serif: "XY Display", "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #F1E9D8; color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--green-d); }
button { font: inherit; color: inherit; }
.wrap { max-width: 480px; margin: 0 auto; background: var(--paper); min-height: 100vh; box-shadow: 0 0 40px rgba(60, 40, 20, .08); }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px 4px; }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--green-d); text-decoration: none; letter-spacing: .06em; }
.brand svg { width: 26px; height: 26px; display: block; }
.aud { font-size: 12px; color: var(--muted); }

.view { padding: 8px 20px 36px; }
/* Headings break at punctuation, not in the middle of a word like 寶寶; if a phrase is
   wider than the screen it may still break anywhere. */
h1, h2 { word-break: keep-all; overflow-wrap: anywhere; }
h1 { font-family: var(--serif); font-weight: 900; font-size: clamp(25px, 7.6vw, 30px); line-height: 1.34; margin: 14px 0 10px; letter-spacing: .01em; }
h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(20px, 5.9vw, 23px); line-height: 1.4; margin: 0 0 12px; }
h3 { font-family: var(--serif); font-weight: 700; font-size: 19px; margin: 0 0 12px; }
.lead { margin: 0 0 16px; color: #5A5046; }

/* hero visuals, one per ad message */
.strip { display: flex; gap: 8px; align-items: flex-start; }
.strip figure { margin: 0; min-width: 0; }
.strip .tall { flex: .5625 1 0; }
.strip .wide { flex: .8 1 0; }
.strip img, .strip video { width: 100%; height: auto; display: block; border-radius: 14px; background: #EFE6D3; border: 1px solid var(--line); object-fit: cover; }
.strip .tall img, .strip .tall video { aspect-ratio: 9 / 16; }
.strip .wide img { aspect-ratio: 4 / 5; }
.strip figcaption { text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
.vcap { font-size: 12px; color: var(--muted); margin: 8px 0 0; text-align: center; }
.also { margin: 14px 0 0; font-size: 15px; color: var(--green-d); font-weight: 700; text-align: center; }

.mock { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.mock .tag { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: var(--green); border-radius: 999px; padding: 1px 10px; }
.mock.ai .ask { font-family: var(--serif); font-weight: 700; font-size: 18px; margin: 8px 0 10px; }
.mock.ai .part { display: grid; grid-template-columns: 6.2em 1fr; gap: 8px; font-size: 14px; padding: 7px 0; border-top: 1px dashed var(--line); }
.mock.ai .part b { color: var(--green-d); }
.mock.ai .mfoot { font-size: 12px; color: var(--muted); margin: 8px 0 0; padding-top: 8px; border-top: 1px dashed var(--line); }
.mock.chat { background: #E9F0E4; padding: 12px; }
.msg { margin-bottom: 8px; max-width: 86%; }
.msg .who { font-size: 11px; color: var(--muted); margin: 0 4px 2px; }
.msg .bubble { display: inline-block; background: #fff; border-radius: 16px; padding: 7px 12px; font-size: 14px; line-height: 1.55; white-space: pre-line; }
.msg.me { margin-left: auto; text-align: right; }
.msg.me .bubble { background: #A9E5A0; text-align: left; }
.msg.bot .bubble { background: var(--card); border: 1px solid var(--line); }

/* quiz */
.q1 { margin-top: 22px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px 16px 18px; }
.qintro { font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.q1 h2 { margin-bottom: 10px; }
.opts { display: grid; gap: 10px; }
.opt { width: 100%; min-height: 54px; padding: 10px 16px; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; font-size: 17px; cursor: pointer; transition: background .12s, border-color .12s; }
.q1 .opt { background: var(--paper); }
.opt:hover { border-color: var(--green); }
.opt.on { background: #E6F2E4; border-color: var(--green); font-weight: 700; }
.opts.full .opt:not(.on) { opacity: .45; }
.opt:focus-visible, .btn:focus-visible, .tab:focus-visible, .link:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 14px 0 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 999px; transition: width .2s; }
.qprog { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.qhint { font-size: 14px; color: var(--muted); margin: -6px 0 12px; min-height: 1px; }
.qnav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }

.btn { display: inline-block; min-height: 50px; padding: 10px 26px; border: 0; border-radius: 999px; background: var(--green-d); color: #fff; font-weight: 700; font-size: 16px; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.ghost { background: transparent; color: var(--green-d); border: 1.5px solid var(--green); width: 100%; margin-top: 10px; }
.link { background: none; border: 0; padding: 10px 4px; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 15px; }
.btn-line { display: block; width: 100%; text-align: center; min-height: 56px; line-height: 56px; border-radius: 999px; background: var(--lineg); color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; box-shadow: 0 8px 20px rgba(6, 199, 85, .28); }

/* result */
.rtitle { margin-top: 12px; }
.note { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.tabs { display: flex; gap: 6px; margin: 16px 0 12px; background: #F1E9D8; border-radius: 999px; padding: 4px; }
.tab { flex: 1; min-height: 40px; border: 0; background: transparent; border-radius: 999px; font-size: 15px; cursor: pointer; color: var(--muted); }
.tab.on { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 2px 8px rgba(60, 40, 20, .1); }
.diary-wrap { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; position: relative; min-height: 200px; background: var(--paper); }
.diary-wrap.collapsed { max-height: 820px; }
.diary-wrap.collapsed::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 140px; background: linear-gradient(180deg, rgba(251, 246, 236, 0), var(--paper)); pointer-events: none; }
.phone { width: 74%; max-width: 300px; margin: 0 auto; border-radius: 30px; padding: 7px; background: #2F2A25; box-shadow: 0 18px 40px rgba(60, 40, 20, .25); }
.phone video { width: 100%; display: block; border-radius: 24px; aspect-ratio: 9 / 16; background: var(--paper); }
.cardimg { width: 100%; height: auto; display: block; border-radius: 20px; border: 1px solid var(--line); }
.pnote { font-size: 13px; color: var(--muted); text-align: center; margin: 10px 0 0; }

.reasons { margin-top: 26px; }
.reasons ul { margin: 0; padding: 0; list-style: none; }
.reasons li { position: relative; padding: 10px 12px 10px 38px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; font-size: 15px; }
.reasons li::before { content: ""; position: absolute; left: 14px; top: 17px; width: 12px; height: 12px; border-radius: 50%; background: var(--green); }

.cta { margin-top: 24px; text-align: center; }
.cta .sub { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.cta .code { font-size: 13px; color: var(--muted); margin: 4px 0 0; }

.plan { margin-top: 38px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.p { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px 12px 14px; }
.p.pro { border-color: var(--mustard); background: #FFF9EA; }
.p h4 { margin: 0; font-size: 14px; color: var(--muted); font-weight: 500; }
.p .price { font-family: var(--serif); font-weight: 900; font-size: 26px; margin: 2px 0 8px; white-space: nowrap; }
.p .price small { font-family: var(--sans); font-weight: 500; font-size: 13px; color: var(--muted); }
.p ul { margin: 0 0 12px; padding: 0 0 0 1.1em; font-size: 14px; }
.p li { margin-bottom: 3px; }
.p .btn { width: 100%; padding: 8px 6px; min-height: 44px; font-size: 15px; background: var(--ink); }
.p .pnote { margin-top: 6px; font-size: 12px; }

.faq { margin-top: 38px; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 12px 0; font-weight: 700; list-style: none; position: relative; padding-right: 24px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 2px; top: 10px; font-size: 20px; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0 0 14px; font-size: 15px; color: #5A5046; }

.foot { padding: 20px 20px 110px; text-align: center; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.foot p { margin: 0 0 4px; }

.sticky { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(251, 246, 236, 0), var(--paper) 35%); }
.sticky .btn-line { max-width: 448px; margin: 0 auto; }
.sticky { transition: opacity .15s; }
.sticky.off { opacity: 0; pointer-events: none; }

.modal { position: fixed; inset: 0; z-index: 40; background: rgba(48, 36, 24, .5); display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; background: var(--paper); border-radius: 24px 24px 0 0; padding: 24px 20px calc(18px + env(safe-area-inset-bottom)); text-align: center; }
.sheet h3 { font-size: 21px; }
.sheet p { margin: 0 0 18px; color: #5A5046; }

/* standalone pages: sample diary, privacy, LINE preview */
.page { padding: 8px 20px 40px; }
.page h1 { font-size: 24px; }
.page h2 { font-size: 18px; margin: 22px 0 6px; }
.page li { margin-bottom: 6px; }
.page .updated { font-size: 13px; color: var(--muted); }
.backbar { padding: 16px 20px 30px; text-align: center; }
.issue-img { display: block; width: 100%; height: auto; }
.issue-video { display: block; width: 100%; aspect-ratio: 9 / 16; background: #2B241D; }
.qrpage { text-align: center; }
.qrbox { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 10px; margin: 6px 0 12px; }
.qrbox svg { display: block; width: 240px; height: 240px; }
.linebox { background: #E9F0E4; border-radius: 18px; padding: 14px; margin: 14px 0; }
.linebox .bubble { display: inline-block; background: #fff; border-radius: 16px; padding: 8px 12px; white-space: pre-line; font-size: 15px; }
.linebox .mine { text-align: right; margin-bottom: 10px; }
.linebox .mine .bubble { background: #A9E5A0; }

@media (min-width: 520px) {
  body { padding: 24px 0; }
  .wrap { border-radius: 28px; overflow: hidden; min-height: 0; }
}
