/* Vista 互動展示版：顏色、字體照 App（Vista/Design/Theme.swift） */
:root {
  --bg: #000;
  --s1: #141414;
  --s2: #1c1c1c;
  --s3: #262626;
  --gold: #ffc93c;
  --red: #ff453a;
  --green: #34c759;
  --paper: #f4f1ea;
  --ink: #161616;
  --t2: rgba(255, 255, 255, .6);
  --t3: rgba(255, 255, 255, .45);
  --t4: rgba(255, 255, 255, .35);
  --font: "Helvetica Neue", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  --serif: "Songti TC", "Noto Serif TC", Georgia, serif;
  --logo: "Snell Roundhand", "Great Vibes", "Apple Chancery", cursive;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at 50% 0%, #2a2a2e 0%, #121214 55%, #0b0b0c 100%);
  color: #fff; font-family: var(--font);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: #fff; }

/* ---------- 手機外框（桌機） ---------- */
.stage { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px 16px; }
.phone {
  position: relative; width: 393px; height: 852px; border-radius: 58px;
  background: #000; padding: 0; overflow: hidden;
  box-shadow: 0 0 0 11px #1d1d1f, 0 0 0 12.5px #3a3a3c, 0 40px 90px rgba(0, 0, 0, .55);
  transform-origin: top center;
}
.island { position: absolute; top: 11px; left: 50%; width: 124px; height: 36px; margin-left: -62px; border-radius: 20px; background: #000; z-index: 60; }
.status { position: absolute; top: 0; left: 0; right: 0; height: 54px; z-index: 55; display: flex; align-items: center; justify-content: space-between; padding: 16px 34px 0 46px; font-size: 16px; font-weight: 600; pointer-events: none; }
.status .r { display: flex; gap: 6px; align-items: center; }
.home-ind { position: absolute; bottom: 8px; left: 50%; width: 136px; height: 5px; margin-left: -68px; border-radius: 3px; background: rgba(255, 255, 255, .85); z-index: 70; pointer-events: none; }
.caption { font-size: 13px; color: rgba(255, 255, 255, .55); text-align: center; line-height: 1.6; }
.caption a { color: rgba(255, 255, 255, .85); }

/* 手機上直接全螢幕 */
@media (max-width: 500px) {
  body { background: #000; justify-content: flex-start; }
  .stage { padding: 0; gap: 0; width: 100%; height: 100dvh; }
  .phone { width: 100vw; height: 100dvh; border-radius: 0; box-shadow: none; }
  .island, .status, .home-ind { display: none; }
  .caption { display: none; }
}

/* ---------- App 版面 ---------- */
.app { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; }
.screen { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 54px 16px 24px; scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }
@media (max-width: 500px) { .screen { padding-top: max(14px, env(safe-area-inset-top)); } }

.tabbar { height: 84px; display: flex; justify-content: space-around; align-items: flex-start; padding-top: 10px; background: #000; flex-shrink: 0; }
.tabbar button { width: 56px; height: 44px; display: flex; align-items: center; justify-content: center; position: relative; color: rgba(255, 255, 255, .55); }
.tabbar button.on { color: #fff; }
.tabbar svg { width: 27px; height: 27px; }
.dot-badge { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.tabbar .dot-badge { bottom: -6px; left: 50%; margin-left: -3.5px; }

.ic { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.toast {
  position: absolute; left: 50%; bottom: 120px; transform: translate(-50%, 20px); opacity: 0;
  background: #fff; color: #000; font-size: 15px; font-weight: 500; padding: 12px 20px; border-radius: 22px;
  transition: opacity .2s, transform .2s; z-index: 90; white-space: nowrap; pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 標題列 */
.hdr { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.hdr h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: .5px; }
.logo { font-family: var(--logo); font-weight: 700; font-size: 34px; letter-spacing: 0; }
.iconbtn { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: #fff; position: relative; }
.iconbtn .dot-badge { top: 8px; right: 6px; }

/* 好友分頁 */
.year { font-size: 30px; font-weight: 700; }
.weekdate { font-size: 20px; font-weight: 500; margin: 18px 0 10px; }
.person { margin: 14px 0 20px; }
.person-h { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; cursor: pointer; }
.person-h .uid { font-size: 18px; font-weight: 400; }
.avatar { border-radius: 50%; flex-shrink: 0; background: var(--s3); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; font-weight: 600; color: rgba(255, 255, 255, .85); overflow: hidden; }
.rowp { display: flex; gap: 3.5px; margin-bottom: 6px; }
.tile { position: relative; flex: 0 0 auto; border-radius: 8px; overflow: hidden; background: var(--s2); background-size: cover; background-position: center; cursor: pointer; }
.tile .tag { position: absolute; left: 4px; bottom: 4px; font-size: 8px; font-weight: 600; padding: 3px 6px; border-radius: 10px; background: rgba(0, 0, 0, .62); color: #fff; }
.tile .newdot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.tile .lbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 10px; color: rgba(255, 255, 255, .9); text-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.tile.add { background: var(--s1); display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .6); font-size: 26px; font-weight: 200; }

/* 主頁 */
.prof-quote { font-size: 15px; line-height: 1.6; flex: 1; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.goal-row { display: flex; align-items: center; min-height: 44px; cursor: pointer; }
.goal-row .n { flex: 1; font-size: 15px; font-weight: 600; }
.goal-row .w { font-size: 12px; color: var(--t2); margin-right: 8px; }
.subs { padding: 0 0 10px 2px; }
.sub { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 32px; color: rgba(255, 255, 255, .6); }
.sub.done { color: rgba(255, 255, 255, .9); }
.pill-week { font-size: 12px; font-weight: 500; color: var(--gold); background: var(--s2); padding: 5px 10px; border-radius: 13px; margin-left: auto; }
.btn2 { flex: 1; height: 34px; border-radius: 10px; background: var(--s2); font-size: 14px; font-weight: 500; }
.wk-title { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 10px; }
.wk-title b { font-size: 17px; }
.wk-title span { font-size: 13px; color: var(--t2); }
.hscroll { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
.hscroll::-webkit-scrollbar { display: none; }

/* 收藏 */
.pills { display: flex; gap: 6px; margin: 10px 0 14px; overflow-x: auto; scrollbar-width: none; }
.pill { height: 34px; padding: 0 16px; border-radius: 17px; background: var(--s2); font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .7); white-space: nowrap; flex-shrink: 0; }
.pill.on { background: #fff; color: #000; }
.inbox-item { background: var(--s1); border-radius: 16px; padding: 14px 16px; margin-bottom: 8px; cursor: pointer; }
.inbox-item .k { font-size: 12px; color: var(--t2); display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.inbox-item .k .chip { font-size: 11px; padding: 2px 8px; border-radius: 8px; background: var(--s3); color: rgba(255, 255, 255, .8); }
.inbox-item .k .chip.q { background: rgba(255, 201, 60, .16); color: var(--gold); }
.inbox-item .k .chip.ok { background: rgba(52, 199, 89, .16); color: var(--green); }
.inbox-item .t { font-size: 15px; line-height: 1.5; }
.inbox-item .a { font-size: 13px; color: var(--t2); margin-top: 6px; }

/* 里程碑牆 */
.wall { display: flex; gap: 8px; align-items: flex-start; }
.wall .col { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.ms { position: relative; border-radius: 14px; overflow: hidden; background: var(--s2) center / cover; cursor: pointer; opacity: 0; transform: translateY(26px); filter: brightness(.3); }
.ms.in { animation: rise .7s cubic-bezier(.2, 1.3, .4, 1) forwards; }
@keyframes rise { to { opacity: 1; transform: translateY(0); filter: brightness(1); } }
.ms .lbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: rgba(255, 255, 255, .85); }
.ms .top { position: absolute; left: 0; right: 0; top: 0; padding: 8px; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; background: linear-gradient(rgba(0, 0, 0, .28), transparent); }
.ms .bot { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 8px; display: flex; align-items: flex-end; gap: 6px; background: linear-gradient(transparent, rgba(0, 0, 0, .4)); }
.ms .bot .g { flex: 1; font-size: 12px; font-weight: 600; color: var(--gold); line-height: 1.3; }
.heart { width: 18px; height: 18px; }
.bigheart { position: absolute; left: 50%; top: 50%; width: 70px; height: 70px; margin: -35px 0 0 -35px; color: var(--red); animation: pop .7s ease forwards; pointer-events: none; }
@keyframes pop { 0% { transform: scale(.3); opacity: 0; } 25% { transform: scale(1.15); opacity: 1; } 60% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.05); opacity: 0; } }

/* 信箱 */
.mail-row { display: flex; align-items: center; gap: 12px; min-height: 64px; cursor: pointer; }
.mail-row .mid { flex: 1; min-width: 0; }
.mail-row .who { font-size: 16px; font-weight: 600; }
.mail-row .sub { font-size: 14px; color: var(--t2); min-height: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.mail-row .r { text-align: right; font-size: 13px; color: var(--t2); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.udot { width: 9px; height: 9px; border-radius: 50%; background: #fff; }

/* ---------- 由下往上的頁面 ---------- */
.sheet {
  position: absolute; inset: 0; background: #000; z-index: 40; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .38s cubic-bezier(.2, .9, .25, 1);
}
.sheet.open { transform: translateY(0); }
.sheet.right { transform: translateX(100%); }
.sheet.right.open { transform: translateX(0); }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .3); margin: 60px auto 0; flex-shrink: 0; }
@media (max-width: 500px) { .sheet .grab { margin-top: max(10px, env(safe-area-inset-top)); } }
.sheet .bar { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 8px; flex-shrink: 0; }
.sheet .bar .t { font-size: 17px; font-weight: 600; }
.sheet .bar .txt { font-size: 17px; padding: 0 10px; height: 44px; }
.sheet .bar .txt.b { font-weight: 600; }
.sheet .bar .txt[disabled] { color: var(--t4); }
.sheet .body { flex: 1; overflow-y: auto; padding: 4px 16px 28px; scrollbar-width: none; }
.sheet .body::-webkit-scrollbar { display: none; }

/* 照片單則頁 */
.big { position: relative; width: 100%; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--s2) center / cover; margin-top: 70px; cursor: pointer; }
.big .wk { position: absolute; left: 10px; top: 10px; font-size: 13px; font-weight: 600; padding: 6px 11px; border-radius: 14px; background: rgba(0, 0, 0, .55); }
.big .nw { position: absolute; right: 10px; top: 10px; font-size: 13px; font-weight: 700; padding: 6px 11px; border-radius: 14px; background: var(--red); }
.big .lbl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; color: rgba(255, 255, 255, .9); }
.pdots { display: flex; justify-content: center; align-items: center; gap: 6px; height: 30px; margin-top: 10px; }
.pdots i { display: block; border-radius: 50%; background: rgba(255, 255, 255, .35); transition: all .22s; }
.pdots i.on { background: #fff; }
.meta { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; font-size: 14px; color: var(--t2); }

/* 上傳頁 */
.up-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 8px 8px 0 1px; }
.up-row::-webkit-scrollbar { display: none; }
.up-cell { width: 76px; height: 76px; border-radius: 12px; flex-shrink: 0; background: var(--s2) center / cover; position: relative; animation: popin .25s ease; }
.up-cell.slot { animation: none; }
@keyframes popin { from { transform: scale(.85); opacity: .3; } }
.up-h { display: flex; gap: 6px; align-items: baseline; margin-top: 16px; font-size: 13px; font-weight: 600; }
.up-h span { font-weight: 400; font-size: 12px; color: var(--t3); }
.seg { display: flex; background: var(--s1); border-radius: 22px; padding: 3px; margin: 18px 0 14px; }
.seg button { flex: 1; height: 38px; border-radius: 19px; font-size: 15px; font-weight: 500; color: rgba(255, 255, 255, .7); }
.seg button.on { background: #fff; color: #000; }
.lib { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin-top: 10px; }
.lib .c { aspect-ratio: 1; background: var(--s2) center / cover; position: relative; cursor: pointer; }
.lib .c.sel::after { content: ""; position: absolute; inset: 0; border: 3px solid #fff; }
.lib .c .n { position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%; background: #fff; color: #000; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.lib .c .tm { position: absolute; left: 6px; bottom: 5px; font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5); }

/* 信箋卡片 */
.card { position: relative; width: 100%; aspect-ratio: 3 / 2; border-radius: 6px; overflow: hidden; color: var(--ink); background: var(--paper); cursor: pointer; perspective: 1000px; }
.card .vista { position: absolute; left: 4.2%; top: 5.3%; font-size: max(5px, 2.4cqw); font-weight: 800; letter-spacing: .3em; color: rgba(0, 0, 0, .5); }
.cardwrap { container-type: inline-size; }
.card .word { position: absolute; font-family: var(--serif); font-weight: 800; line-height: 1.15; }
.card .w0 { inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 6% 8%; font-size: 13.6cqw; }
.card .w1 { top: 0; bottom: 0; right: 7.7%; display: flex; flex-direction: row-reverse; align-items: center; gap: 1.8cqw; font-size: 11.8cqw; line-height: 1.05; }
.card .w1 .col { display: flex; flex-direction: column; align-items: center; }
.card .w1.h { flex-direction: row; text-align: right; }
.card .w2 { left: 7.7%; bottom: 9.8%; right: 8%; font-size: 16cqw; }
.card .faint { color: rgba(22, 22, 22, .22); }
.card .back { position: absolute; inset: 0; background: var(--paper); display: flex; padding: 6% 4.5%; }
.card .back .msg { flex: 1.3; font-size: 3.9cqw; line-height: 1.75; padding-right: 4%; border-right: 1px solid rgba(0, 0, 0, .2); white-space: pre-wrap; }
.card .back .addr { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding-left: 5%; }
.card .stamp { align-self: flex-end; width: 11cqw; height: 13cqw; border: 1.5px dashed rgba(0, 0, 0, .35); background: #e8e2d6; display: flex; align-items: center; justify-content: center; font-size: 2.6cqw; font-weight: 800; letter-spacing: .15em; }
.card .to { font-size: 3.8cqw; padding-bottom: 1.5cqw; border-bottom: 1px solid rgba(0, 0, 0, .3); }
.card .from { font-size: 3.6cqw; color: rgba(0, 0, 0, .6); margin-top: 3cqw; }
.card .photo { position: absolute; inset: 0; background: center / cover; filter: sepia(.25) saturate(.9) contrast(.95); }
.card .frontline { position: absolute; left: 4%; bottom: 5.5%; font-family: var(--serif); font-size: 3.9cqw; font-weight: 700; padding: 1cqw 2.4cqw; background: rgba(244, 241, 234, .92); border-radius: 3px; }
.thumbs3 { display: flex; gap: 8px; }
.thumbs3 .cardwrap { flex: 1; border-radius: 8px; outline: 2px solid transparent; outline-offset: 3px; cursor: pointer; }
.thumbs3 .cardwrap.on { outline-color: #fff; }

.field { background: var(--s1); border-radius: 14px; padding: 0 14px; height: 52px; display: flex; align-items: center; }
.field input { flex: 1; background: none; border: 0; outline: 0; font-size: 16px; }
.area { width: 100%; min-height: 150px; background: var(--s1); border-radius: 14px; border: 0; outline: 0; padding: 14px; font-size: 16px; line-height: 1.6; resize: none; }
.lab { display: flex; justify-content: space-between; font-size: 13px; color: var(--t2); margin: 18px 4px 8px; }
.primary { width: 100%; height: 50px; border-radius: 25px; background: #fff; color: #000; font-size: 17px; font-weight: 600; }
.primary[disabled] { background: #555; color: #222; }
.footer-btn { padding: 10px 16px 30px; flex-shrink: 0; }
.radio { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-size: 15px; cursor: pointer; }
.radio i { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .4); }
.radio.on i { border: 6px solid #fff; }
.box { background: var(--s1); border-radius: 14px; padding: 0 14px; }
.box .radio + .radio { border-top: 1px solid rgba(255, 255, 255, .06); }

/* 歡迎頁與註冊 */
.welcome { position: absolute; inset: 0; background: #000; z-index: 50; display: flex; flex-direction: column; padding: 60px 24px 40px; transition: opacity .3s; }
.welcome.hide { opacity: 0; pointer-events: none; }
.welcome .mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.welcome .bigl { font-family: var(--logo); font-weight: 700; font-size: 84px; line-height: 1; }
.welcome .tag { font-size: 16px; color: rgba(255, 255, 255, .75); line-height: 1.6; }
.sso { width: 100%; height: 52px; border-radius: 26px; font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; }
.sso.apple { background: #fff; color: #000; }
.sso.google { background: var(--s2); }
.terms { font-size: 12px; color: rgba(255, 255, 255, .5); text-align: center; margin-top: 14px; }
.ob h2 { font-size: 26px; margin: 8px 0 6px; }
.ob .p { font-size: 14px; color: var(--t2); margin-bottom: 20px; }
.ob .step { font-size: 13px; color: var(--t3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chips button { height: 34px; padding: 0 14px; border-radius: 17px; background: var(--s2); font-size: 14px; }
.chips button.on { background: #fff; color: #000; }

/* 加好友、熱氣球 */
.search { display: flex; align-items: center; gap: 10px; height: 44px; border-radius: 14px; background: var(--s1); padding: 0 14px; color: var(--t3); font-size: 16px; flex: 1; }
.inv { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.inv .mid { flex: 1; }
.inv .mid b { display: block; font-size: 16px; font-weight: 600; }
.inv .mid span { font-size: 13px; color: var(--t2); }
.sbtn { height: 34px; padding: 0 14px; border-radius: 17px; background: var(--s2); font-size: 14px; font-weight: 500; }
.sbtn.w { background: #fff; color: #000; }
.fgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 8px; margin-top: 12px; }
.fgrid .f { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; position: relative; }
.balloon-badge { position: absolute; top: 30px; left: 50%; margin-left: 14px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }

/* 分享主頁 */
.qrcard { background: #fff; color: #000; border-radius: 24px; padding: 24px; width: 290px; margin: 30px auto 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.qrcard .qr { width: 220px; height: 220px; }
.qrcard .qr svg, .qrcard .qr img { width: 100%; height: 100%; }
.circles { display: flex; justify-content: center; gap: 28px; margin-top: 36px; }
.circles button { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; }
.circles button span:first-child { width: 56px; height: 56px; border-radius: 50%; background: var(--s2); display: flex; align-items: center; justify-content: center; }
.note { font-size: 12px; color: var(--t3); text-align: center; line-height: 1.6; margin-top: 18px; }
