/* 伴旅 WithU — tokens */
:root {
  --paper: #F2F1F6;
  --surface: #FFFFFF;
  --ink: #26223A;
  --muted: #77728C;
  --line: #E0DDEA;
  --me: #3B3561;          /* her bubbles: deep indigo */
  --me-ink: #FFFFFF;
  --him: #FFFFFF;         /* his bubbles: paper-white notes */
  --rose: #C2477F;        /* lover, practice-mode glow */
  --rose-soft: #F6E3EC;
  --amber: #E09A2E;       /* 報備 status: a streetlight on the way home */
  --sage: #5E8C6A;
  --danger: #B3403A;
  --sans: "Noto Sans TC", system-ui, -apple-system, "PingFang TC", sans-serif;
  --hand: "LXGW WenKai TC", "Noto Sans TC", serif;
  --r-bubble: 18px;
  --r-card: 14px;
  --tabs-h: 62px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #17151F; --surface: #211E2C; --ink: #ECE9F5; --muted: #9B96AE; --line: #322E40;
    --me: #5B4FB0; --him: #262233; --rose: #E07AA8; --rose-soft: #3A2431; --amber: #F0B04E; --sage: #7FB08B;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.hand { font-family: var(--hand); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }

/* ---------- page scaffolding ---------- */
.page { padding: calc(env(safe-area-inset-top) + 18px) 18px calc(var(--tabs-h) + env(safe-area-inset-bottom) + 24px); }
.page h1 { font: 700 26px/1.3 var(--hand); margin: 4px 0 18px; letter-spacing: .5px; }
.page h2 { font: 700 17px/1.4 var(--sans); margin: 28px 0 10px; }
.page p { margin: 0 0 12px; }
.section { background: var(--surface); border-radius: var(--r-card); padding: 4px 16px; margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row label { flex: 1; }

/* ---------- buttons & fields ---------- */
.btn { border: 0; border-radius: 999px; padding: 12px 20px; background: var(--me); color: var(--me-ink); font-weight: 500; }
.btn.block { display: block; width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.btn.rose { background: var(--rose); color: #fff; }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px currentColor; }
.btn.sm { padding: 7px 14px; font-size: 14px; }
.btn:disabled { opacity: .5; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 11px 13px; outline: none;
}
.input:focus { border-color: var(--me); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-size: 15px; }
.check input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--me); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 14px; font-size: 14px; }
.chip[aria-pressed="true"] { background: var(--me); color: var(--me-ink); border-color: var(--me); }
.seg { display: inline-flex; background: var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(38,34,58,.12); }

/* ---------- tabs ---------- */
.tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; }
.tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.tabs a[aria-current="page"] { color: var(--ink); }
.tabs a[aria-current="page"] svg { stroke-width: 2.1; }
.tabs .dot { position: absolute; margin: -22px 0 0 22px; width: 8px; height: 8px; border-radius: 50%; background: var(--rose); }

/* ---------- avatar ---------- */
.avatar { position: relative; flex: none; width: var(--s, 48px); height: var(--s, 48px); }
.avatar svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.avatar .season { position: absolute; right: -3px; bottom: -3px; font-size: calc(var(--s, 48px) * .34); line-height: 1; }
.avatar.lover::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--rose); }

/* ---------- chat list ---------- */
.lover-card {
  display: flex; gap: 16px; align-items: center; background: var(--surface); border-radius: 20px; padding: 18px;
  text-decoration: none; margin-bottom: 22px; position: relative;
}
.lover-card .grow { flex: 1; min-width: 0; }
.lover-card .name { font: 700 20px/1.3 var(--hand); }
.status-line { display: flex; align-items: baseline; gap: 8px; font: 16px/1.45 var(--hand); color: var(--ink); margin-top: 4px; }
.status-line::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); transform: translateY(-2px); }
.status-time { display: block; font: 12px var(--sans); color: var(--muted); margin: 2px 0 0 16px; }
.lover-card .badge, .conv .badge { min-width: 20px; height: 20px; border-radius: 10px; background: var(--rose); color: #fff; font-size: 12px; display: grid; place-items: center; padding: 0 6px; flex: none; }
.list-label { font-size: 13px; color: var(--muted); margin: 0 0 6px 4px; }
.conv { display: flex; gap: 13px; align-items: center; padding: 12px 6px; text-decoration: none; border-radius: 14px; }
.conv:active { background: var(--line); }
.conv .meta { flex: 1; min-width: 0; }
.conv .top { display: flex; align-items: baseline; gap: 8px; }
.conv .nm { font-weight: 700; }
.conv .star { color: var(--amber); font-size: 13px; }
.conv .when { margin-left: auto; font-size: 12px; color: var(--muted); }
.conv .last { display: block; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .badge { min-width: 20px; height: 20px; border-radius: 10px; background: var(--rose); color: #fff; font-size: 12px; display: grid; place-items: center; padding: 0 6px; }
.conv.glow .last { color: var(--rose); }
.empty { text-align: center; padding: 48px 16px; }
.empty .hand { font-size: 22px; margin-bottom: 8px; }

/* ---------- chat room ---------- */
.room { display: flex; flex-direction: column; height: 100dvh; }
.room-head {
  display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top) + 8px) 12px 10px;
  background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.icon-btn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.room-head .who { flex: 1; min-width: 0; background: none; border: 0; text-align: left; padding: 0; display: flex; gap: 10px; align-items: center; }
.room-head .nm { font: 700 17px/1.2 var(--hand); }
.room-head .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--rose-soft); color: var(--rose); margin-left: 6px; vertical-align: 2px; font-family: var(--sans); font-weight: 500; }
.stream { flex: 1; overflow-y: auto; padding: 14px 12px 8px; overscroll-behavior: contain; }
.day { text-align: center; font-size: 12px; color: var(--muted); margin: 14px 0 8px; }
.msg { display: flex; margin: 3px 0; }
.msg.me { justify-content: flex-end; }
.bubble {
  max-width: 78%; padding: 9px 14px; border-radius: var(--r-bubble); word-break: break-word; overflow-wrap: anywhere; white-space: pre-wrap;
  min-width: 0; flex: 0 1 auto;
}
/* 他的訊息左邊有大頭照：泡泡要扣掉大頭照和時間的寬度，長訊息才不會超出畫面 */
.msg.him .bubble { max-width: calc(100% - 96px); }
.msg .time { flex: none; }
.msg { min-width: 0; max-width: 100%; }
.msg.him .bubble { background: var(--him); font: 17px/1.55 var(--hand); border-bottom-left-radius: 6px; }
.msg.me .bubble { background: var(--me); color: var(--me-ink); border-bottom-right-radius: 6px; }
.msg.him.glow .bubble { box-shadow: 0 0 0 1px color-mix(in srgb, var(--rose) 22%, transparent), 0 4px 18px color-mix(in srgb, var(--rose) 22%, transparent); }
.msg.him + .msg.him .bubble { border-top-left-radius: 6px; }
.msg.me + .msg.me .bubble { border-top-right-radius: 6px; }
.msg .time { align-self: flex-end; font-size: 11px; color: var(--muted); margin: 0 6px 2px; }
.photo-bubble { max-width: 68%; border-radius: 16px; overflow: hidden; background: var(--line); }
.photo-bubble img { display: block; width: 100%; height: auto; }
.photo-bubble .cap { padding: 8px 12px; background: var(--me); color: var(--me-ink); font-size: 15px; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.voice .play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: color-mix(in srgb, currentColor 14%, transparent); display: grid; place-items: center; flex: none; }
.voice .play svg { width: 16px; height: 16px; fill: currentColor; }
.voice .wave { flex: 1; height: 22px; display: flex; gap: 2px; align-items: center; }
.voice .wave i { flex: 1; background: currentColor; opacity: .35; border-radius: 2px; }
.voice .wave i.on { opacity: .9; }
.voice-tx { margin-top: 6px; font-size: 15px; opacity: .9; }
.voice-toggle { background: none; border: 0; padding: 0; font: 12px var(--sans); color: inherit; opacity: .6; text-decoration: underline; margin-top: 4px; }
.scene { margin: 18px 8px; text-align: center; font: 15px/1.8 var(--hand); color: var(--muted); }
.scene::before, .scene::after { content: ""; display: block; width: 36px; height: 1px; background: var(--line); margin: 8px auto; }
.note { text-align: center; font-size: 13px; color: var(--muted); margin: 10px 24px; font-style: italic; }
.milestone { text-align: center; margin: 18px 0; }
.milestone span { display: inline-block; font: 16px/1.5 var(--hand); color: var(--rose); background: var(--rose-soft); padding: 8px 18px; border-radius: 999px; }
.typing .bubble { display: flex; gap: 4px; padding: 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.reveal { animation: rise .28s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .reveal, .typing i { animation: none; } }

/* cards inside the chat */
.card { background: var(--surface); border-radius: var(--r-card); padding: 14px; margin: 8px 0 8px 0; max-width: 86%; border: 1px solid var(--line); }
.card h4 { margin: 0 0 10px; font: 700 15px var(--sans); }
.meal-opt { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.meal-opt:first-of-type { border-top: 0; }
.meal-opt .grow { flex: 1; min-width: 0; }
.meal-opt .store { font-weight: 700; font-size: 15px; }
.meal-opt .item { font-size: 14px; color: var(--muted); }
.meal-opt .line { font: 15px/1.5 var(--hand); margin-top: 2px; }
.meal-opt.chosen { background: var(--rose-soft); margin: 0 -14px; padding: 10px 14px; }
.new-tag { font-size: 11px; color: var(--amber); border: 1px solid currentColor; border-radius: 6px; padding: 0 5px; margin-left: 6px; }
.card .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.help-card { border-color: var(--rose); }
.help-card a { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); text-decoration: none; }
.help-card a b { font-variant-numeric: tabular-nums; color: var(--rose); }
.outing-banner { margin: 0 12px; padding: 6px 12px; border-radius: 999px; background: var(--rose-soft); color: var(--rose); font-size: 13px; text-align: center; }

/* composer */
.composer {
  display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px calc(env(safe-area-inset-bottom) + 8px);
  background: var(--paper); border-top: 1px solid var(--line);
}
.composer textarea {
  flex: 1; resize: none; border: 1px solid var(--line); background: var(--surface); border-radius: 20px;
  padding: 9px 14px; max-height: 120px; line-height: 1.45; outline: none;
}
.composer .send { background: var(--me); color: var(--me-ink); }
.rec-bar { flex: 1; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 14px; border-radius: 21px; background: var(--rose-soft); color: var(--rose); }
.rec-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--rose); animation: blink 1s infinite; }

/* ---------- sheets ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(23, 21, 31, .42); z-index: 40; animation: fade .2s; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 480px; max-height: 88dvh; overflow-y: auto;
  background: var(--paper); border-radius: 22px 22px 0 0; z-index: 41; padding: 10px 18px calc(env(safe-area-inset-bottom) + 22px); animation: up .25s ease-out;
}
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { font: 700 20px var(--hand); margin: 0 0 12px; }
@keyframes up { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
@keyframes fade { from { opacity: 0; } }

/* ---------- onboarding / meeting ---------- */
.welcome { min-height: 100dvh; display: flex; flex-direction: column; justify-content: flex-end; padding: calc(env(safe-area-inset-top) + 32px) 24px calc(env(safe-area-inset-bottom) + 28px); }
.welcome .mark { font: 700 56px/1 var(--hand); letter-spacing: 4px; margin-bottom: 18px; }
.welcome .lede { font: 20px/1.7 var(--hand); margin-bottom: 26px; }
.welcome .fine { font-size: 13px; color: var(--muted); margin-top: 14px; }
.choice { display: block; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 12px; }
.choice b { display: block; font: 700 19px var(--hand); margin-bottom: 4px; }
.choice span { color: var(--muted); font-size: 14px; }
.people { display: grid; gap: 12px; }
.person { display: flex; gap: 14px; align-items: flex-start; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px; width: 100%; }
.person .nm { font: 700 18px var(--hand); }
.person .info { font-size: 13px; color: var(--muted); }
.person .intro { font-size: 14px; margin-top: 4px; }
.person[aria-pressed="true"] { border-color: var(--me); box-shadow: 0 0 0 1px var(--me); }
.going { min-height: 100dvh; display: grid; place-items: center; text-align: center; padding: 24px; }
.going .hand { font-size: 22px; }
.back { margin: calc(env(safe-area-inset-top) + 6px) 0 6px -8px; }
.code-box { font: 700 26px/1 ui-monospace, monospace; letter-spacing: 3px; text-align: center; padding: 18px; background: var(--surface); border-radius: 14px; margin: 12px 0; }

/* ---------- explore ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--surface); border-radius: 18px; padding: 14px; text-align: left; border: 0; display: flex; flex-direction: column; gap: 8px; }
.tile .nm { font: 700 18px var(--hand); }
.tile .info { font-size: 12px; color: var(--muted); }
.tile .intro { font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile .by { font-size: 11px; color: var(--muted); margin-top: auto; }

/* ---------- story ---------- */
.story-tabs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; margin: 0 -18px 8px; padding-left: 18px; scrollbar-width: none; }
.story-tabs button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; font-size: 13px; opacity: .55; }
.story-tabs button[aria-pressed="true"] { opacity: 1; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 4px 0 14px; }
.tl-item::before { content: ""; position: absolute; left: -20px; top: 11px; width: 9px; height: 9px; border-radius: 50%; background: var(--rose); }
.tl-item .t { font: 17px/1.5 var(--hand); }
.tl-item time { font-size: 12px; color: var(--muted); }
.album { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; border-radius: 14px; overflow: hidden; }
.album button { border: 0; padding: 0; aspect-ratio: 1; background: var(--line); }
.album img { width: 100%; height: 100%; object-fit: cover; display: block; }
.places { display: grid; gap: 0; }
.place { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.place .pin { width: 30px; height: 30px; flex: none; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--rose-soft); display: grid; place-items: center; }
.place .pin b { transform: rotate(45deg); font-size: 12px; color: var(--rose); }
.place .nm { font: 17px var(--hand); }
.trip { background: var(--surface); border-radius: 18px; overflow: hidden; margin-bottom: 12px; }
.trip img { width: 100%; height: 160px; object-fit: cover; display: block; }
.trip .body { padding: 14px; }
.trip .t { font: 700 18px var(--hand); }
.trip p { font: 16px/1.7 var(--hand); margin: 6px 0 10px; }
.letter { background: var(--surface); border-radius: 18px; padding: 22px; font: 17px/1.9 var(--hand); white-space: pre-wrap; }

/* ---------- toast & install ---------- */
#toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px); transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s; background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 60; pointer-events: none; max-width: 90vw; }
#toast.on { opacity: 1; transform: translateX(-50%); }
.install { background: var(--surface); border-radius: 16px; padding: 14px 16px; margin-bottom: 18px; display: flex; gap: 12px; align-items: center; font-size: 14px; }
.install .grow { flex: 1; }
.banner-test { font-size: 12px; text-align: center; color: var(--muted); margin-bottom: 10px; }

/* ---------- illustrations ---------- */
.hero-art { position: relative; margin: 0 -24px 26px; flex: 1; min-height: 200px; overflow: hidden; border-radius: 0 0 28px 28px; }
.hero-art { background: #B9A5D6; }
.hero-art svg { position: absolute; left: 0; right: 0; bottom: 0; height: auto !important; }
.hero-art svg, .scene-art svg, .empty-art svg, .scene-card .art svg { display: block; width: 100%; height: 100%; }
.welcome { justify-content: flex-start; padding-top: 0; }
.welcome .mark { margin-top: 0; }
.welcome .mark-en { display: block; font: 500 18px/1 var(--sans); letter-spacing: 6px; color: var(--muted); margin-top: 10px; }
.scene-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.scene-card { border: 0; padding: 0; background: var(--surface); border-radius: 16px; overflow: hidden; text-align: left; box-shadow: 0 0 0 1px var(--line); }
.scene-card .art { display: block; aspect-ratio: 2 / 1; }
.scene-card .lb { display: block; padding: 8px 10px 10px; font-size: 13px; line-height: 1.4; }
.scene-card[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--me); }
.scene-card[aria-pressed="true"] .lb { font-weight: 700; }
.scene-art { margin: 6px 0 0; border-radius: 18px; overflow: hidden; aspect-ratio: 2 / 1; }
.scene-art + .scene::before { display: none; }
.empty-art { max-width: 300px; margin: 0 auto 18px; border-radius: 20px; overflow: hidden; aspect-ratio: 2 / 1; }
.builder-face { display: flex; justify-content: center; margin: 0 0 18px; }
.builder-face svg { border-radius: 50%; }

/* ---------- 角色個人頁 ---------- */
.profile { min-height: 100dvh; }
.cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 0 0 24px 24px; }
.cover svg { display: block; width: 100%; height: 100%; }
.cover-back { position: absolute; top: calc(env(safe-area-inset-top) + 8px); left: 8px; background: color-mix(in srgb, var(--paper) 80%, transparent); }
.pf-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-top: -52px; padding: 0 24px; position: relative; }
.pf-head .avatar svg { box-shadow: 0 0 0 4px var(--paper); }
.pf-name { font: 700 26px/1.3 var(--hand); margin: 10px 0 4px; }
.signature { font: 16px/1.5 var(--hand); color: var(--ink); margin: 0 0 10px; max-width: 320px; }
.signature::before { content: "「"; color: var(--muted); } .signature::after { content: "」"; color: var(--muted); }
.signature.muted::before, .signature.muted::after { content: none; }
.pf-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.pf-chips span { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.pf-actions { display: flex; gap: 10px; }
.pf-actions .btn { min-width: 110px; text-align: center; }
.pf-body { padding-top: 22px; }
.posts { display: grid; gap: 10px; }
.post { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border-radius: 16px; padding: 12px 14px; }
.post-text { font-size: 16px; line-height: 1.6; }
.post time { font-size: 12px; color: var(--muted); }

/* ---------- 散步與明信片 ---------- */
.walk-banner .linkbtn { white-space: nowrap; flex: none; }
.walk-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 12px 0; padding: 8px 14px; border-radius: 14px; background: color-mix(in srgb, var(--sage) 16%, var(--surface)); color: var(--ink); font-size: 13px; }
.postcard { width: 260px; background: #FFFDF8; color: #26223A; border-radius: 6px; box-shadow: 0 1px 0 rgba(0,0,0,.04), 0 6px 18px rgba(38,34,58,.12); padding: 10px 10px 12px; transform: rotate(-1.2deg); }
.postcard.large { width: 100%; transform: none; }
.pc-pic { position: relative; aspect-ratio: 2 / 1; overflow: hidden; border-radius: 3px; background: #E7E5EE; }
.pc-pic img, .pc-pic svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.pc-stamp { position: absolute; top: 6px; right: 6px; font: 700 10px/1 var(--sans); letter-spacing: 1px; color: #C2477F; border: 1.5px dashed #C2477F; padding: 5px 6px; background: #FFFDF8; transform: rotate(6deg); }
.pc-body { padding: 10px 4px 0; }
.pc-msg { font: 16px/1.6 var(--hand); margin: 0 0 6px; }
.pc-meta { font-size: 11px; color: #77728C; margin: 0; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pc-thumb { border: 0; padding: 0; background: none; text-align: left; }
.pc-thumb .postcard { width: 100%; transform: none; padding: 6px 6px 8px; }
.pc-thumb .pc-msg { font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 回覆建議 ---------- */
.suggest { display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px 2px; background: var(--paper); scrollbar-width: none; }
.suggest .chip { flex: none; font-size: 14px; background: var(--surface); border-color: color-mix(in srgb, var(--me) 35%, var(--line)); color: var(--ink); }

/* ---- 上線狀態 ---- */
.pdot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:5px; vertical-align:1px; background:#b9b6c3; }
.pdot.online { background:#3fb67b; }
.pdot.busy { background:#e9a83a; }
.pdot.dnd { background:#7d76b8; }
.pdot.away { background:#b9b6c3; }
.av-wrap { position:relative; display:inline-flex; flex-shrink:0; }
.pdot.on-av { position:absolute; right:1px; top:1px; width:12px; height:12px; margin:0; border:2px solid var(--paper); }
.pres { display:block; color:var(--muted); margin-top:2px; }
.last1 { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.pf-pres { margin:4px 0 0; color:var(--muted); }
.pf-mood { margin:6px 0 0; font-size:14px; }
.msg .read { color:var(--muted); font-size:11px; display:block; text-align:right; line-height:1.1; }
.pending-note { opacity:.85; }
/* ---- 未讀數 ---- */
.tabs a { position:relative; }
.tab-badge { position:absolute; top:2px; left:calc(50% + 6px); min-width:18px; height:18px; padding:0 5px; border-radius:9px; background:#e0525f; color:#fff; font-size:11px; line-height:18px; text-align:center; font-weight:600; }
/* ---- 話題錦囊 ---- */
.tb-chips { display:flex; flex-wrap:wrap; gap:8px; }
.tb-chips .chip { white-space:normal; text-align:left; }
.tb-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.tb-item { text-align:left; border:1px solid var(--line); background:var(--surface); border-radius:14px; padding:10px 12px; font:inherit; color:inherit; cursor:pointer; }
.tb-item b { display:block; font-size:15px; }
.tb-item span { display:block; font-size:12px; color:var(--muted); margin-top:2px; }
.tb-item:disabled { opacity:.45; }
.steps { padding-left:20px; line-height:1.9; }
.kbd { display:inline-block; border:1px solid var(--line); border-radius:6px; padding:0 6px; font-size:13px; }
.sheet .list-label { margin-top:16px; }

/* ---- 分類 ---- */
.cat-row { display:flex; gap:8px; overflow-x:auto; padding:2px 0 14px; scrollbar-width:none; }
.cat-row::-webkit-scrollbar { display:none; }
.cat { flex:0 0 auto; border:1px solid var(--line); background:var(--surface); color:var(--ink); border-radius:999px; padding:7px 14px; font:inherit; font-size:14px; }
.cat.on { background:var(--ink); color:var(--paper); border-color:var(--ink); }
.mood-grid .choice[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--ink); }

/* ---- 寫實照片 ---- */
.pc-pic { position:relative; }
.credit { position:absolute; right:6px; bottom:6px; font-size:10px; color:#fff; background:rgba(0,0,0,.45); padding:2px 6px; border-radius:6px; text-decoration:none; line-height:1.4; }
.avatar.photo img { width:100%; height:100%; object-fit:cover; border-radius:50%; display:block; }

/* ---- 動態牆 ---- */
.tabs { grid-template-columns: repeat(5, 1fr); }
.tab-dot { position:absolute; top:6px; left:calc(50% + 8px); width:8px; height:8px; border-radius:50%; background:#e0525f; }
.fpost { background:var(--surface); border-radius:18px; padding:14px; margin-bottom:14px; box-shadow:0 1px 3px rgba(38,34,58,.06); }
.fp-who { display:flex; gap:10px; align-items:center; color:inherit; text-decoration:none; }
.fp-who time { display:block; font-size:12px; color:var(--muted); }
.fp-text { margin:10px 0; white-space:pre-wrap; line-height:1.6; }
.fp-photo { position:relative; border-radius:14px; overflow:hidden; margin:6px 0; }
.fp-photo img { width:100%; display:block; aspect-ratio:4/3; object-fit:cover; }
.fp-photo.sm img { aspect-ratio:16/9; }
.fp-actions { display:flex; gap:14px; align-items:center; margin-top:6px; }
.fp-like { border:0; background:none; font-size:22px; color:var(--muted); padding:0 4px; line-height:1; }
.fp-like.on { color:#e0525f; }
.fp-cbtn { border:0; background:none; color:var(--muted); font:inherit; font-size:14px; padding:0; }
.fp-comments { margin-top:8px; border-top:1px solid var(--line); padding-top:8px; font-size:14px; }
.fp-c { padding:3px 0; }

/* ---- 貼圖 ---- */
.msg.stk .stk-img { line-height:0; }
.stk-panel { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; padding:10px; background:var(--surface); border-top:1px solid var(--line); max-height:42vh; overflow-y:auto; }
.stk-panel button { border:0; background:none; padding:4px; border-radius:12px; }
.stk-panel button:active { background:var(--line); }
/* ---- 聊天室選單 ---- */
.rm-head { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.rm-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.rm-grid button { border:0; background:none; display:flex; flex-direction:column; align-items:center; gap:6px; font:inherit; font-size:13px; color:var(--ink); padding:8px 0; border-radius:14px; }
.rm-grid button span { width:48px; height:48px; border-radius:16px; background:var(--surface); display:grid; place-items:center; font-size:22px; box-shadow:0 1px 3px rgba(38,34,58,.08); }
.nrow { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); }
.nrow.done .grow { text-decoration:line-through; opacity:.55; }
.sres { padding:10px 0; border-bottom:1px solid var(--line); }
.sres.ep { display:block; width:100%; text-align:left; background:none; border:0; border-bottom:1px solid var(--line); font:inherit; color:inherit; }
.ep-msgs { padding:8px 12px; margin:0 0 8px; background:var(--surface); border-radius:12px; display:grid; gap:4px; }
.sres mark { background:#F6D28B; color:inherit; border-radius:3px; }
/* ---- 聊天室主題 ---- */
.theme-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.theme-grid button { border:0; background:none; font:inherit; font-size:13px; color:var(--ink); display:flex; flex-direction:column; align-items:center; gap:6px; }
.theme-grid button[aria-pressed="true"] .th-sw { box-shadow:0 0 0 3px var(--ink); }
.th-sw { width:100%; aspect-ratio:3/4; border-radius:14px; display:flex; flex-direction:column; justify-content:center; gap:8px; padding:10px; background:var(--room-bg, var(--paper)); border:1px solid var(--line); }
.th-sw i { display:block; height:12px; border-radius:6px; width:70%; background:var(--bub-him, var(--surface)); }
.th-sw i + i { align-self:flex-end; width:55%; background:var(--bub-me, var(--ink)); }
[data-theme="night"] { --room-bg: linear-gradient(180deg,#1E1B33,#2E2A4A); --bub-him:#3B3561; --bub-him-ink:#ECE9F5; --bub-me:#C2477F; --room-muted:#B7B2CC; }
[data-theme="cafe"] { --room-bg: linear-gradient(180deg,#F5ECE0,#EADBC8); --bub-him:#FFFDF9; --bub-me:#7A5236; --room-muted:#8A7564; }
[data-theme="sea"] { --room-bg: linear-gradient(180deg,#E3F2F7,#CBE5EE); --bub-him:#FFFFFF; --bub-me:#2F7A99; --room-muted:#5E8A99; }
[data-theme="sakura"] { --room-bg: linear-gradient(180deg,#FDF0F3,#F9DDE5); --bub-him:#FFFFFF; --bub-me:#D46A8C; --room-muted:#A07888; }
[data-theme="forest"] { --room-bg: linear-gradient(180deg,#EEF4EA,#DCE8D5); --bub-him:#FFFFFF; --bub-me:#4F7A55; --room-muted:#6F8A70; }
.room[data-theme]:not([data-theme="default"]) .stream { background: var(--room-bg); }
.room[data-theme]:not([data-theme="default"]) .msg.him .bubble { background: var(--bub-him); color: var(--bub-him-ink, var(--ink)); }
.room[data-theme]:not([data-theme="default"]) .msg.me .bubble { background: var(--bub-me); color:#fff; }
.room[data-theme]:not([data-theme="default"]) .msg .time, .room[data-theme]:not([data-theme="default"]) .note, .room[data-theme]:not([data-theme="default"]) .day, .room[data-theme]:not([data-theme="default"]) .scene { color: var(--room-muted); }

/* ---- 回憶錄 ---- */
.mm-ch { margin-bottom:16px; }
.mm-head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:8px; }
.mm-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.mm-card { aspect-ratio:3/4; border-radius:14px; padding:10px; display:flex; flex-direction:column; justify-content:space-between;
  background:linear-gradient(160deg, color-mix(in srgb, var(--rose, #C2477F) 18%, var(--surface)), var(--surface)); box-shadow:0 1px 3px rgba(38,34,58,.08); }
.mm-t { font-size:13px; line-height:1.4; font-weight:600; }
.mm-card time { font-size:11px; color:var(--muted); }
.mm-card.locked { background:color-mix(in srgb, var(--surface) 45%, transparent); border:1px dashed var(--line); box-shadow:none; backdrop-filter:blur(6px); justify-content:center; align-items:center; }
.mm-q { font-size:22px; color:var(--muted); opacity:.55; letter-spacing:2px; }

/* ---- 我的主頁 ---- */
.me-top { display:flex; justify-content:space-between; align-items:center; }
.me-top h1 { margin:0; }
.me-head { display:flex; align-items:center; gap:24px; margin:18px 0 10px; }
.me-avbtn { border:0; background:none; padding:0; }
.avatar.me-av img { width:100%; height:100%; object-fit:cover; border-radius:50%; display:block; }
.avatar.me-av.initial { display:grid; place-items:center; background:linear-gradient(135deg,#C2477F,#6E4C7E); border-radius:50%; color:#fff; }
.avatar.me-av.initial b { font-size:calc(var(--s) * .42); }
.me-stats { display:flex; gap:28px; }
.me-stats div { display:flex; flex-direction:column; align-items:center; }
.me-stats b { font-size:20px; }
.me-stats span { font-size:13px; color:var(--muted); }
.me-bio p { margin:4px 0 0; white-space:pre-wrap; }
.me-status { margin-top:12px; width:100%; display:flex; justify-content:space-between; align-items:center; border:1px solid var(--line); background:var(--surface); border-radius:14px; padding:10px 14px; font:inherit; color:var(--ink); }
.me-status time { font-size:12px; color:var(--muted); }
.me-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin:14px 0; }
.me-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:3px; }
.me-tile { position:relative; aspect-ratio:1; border:0; padding:0; background:var(--surface); overflow:hidden; border-radius:4px; }
.me-tile img { width:100%; height:100%; object-fit:cover; display:block; }
.me-tile span { display:block; padding:8px; font-size:12px; text-align:left; line-height:1.4; color:var(--ink); }
.me-tile i { position:absolute; right:4px; bottom:4px; font-style:normal; font-size:11px; color:#fff; background:rgba(0,0,0,.4); border-radius:6px; padding:1px 5px; }
.st-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.st-grid button { border:1px solid var(--line); background:var(--surface); border-radius:12px; padding:10px; font:inherit; text-align:left; color:var(--ink); }
.create-card { margin-bottom:14px; }
/* ---- 限時動態 ---- */
.st-row { display:flex; gap:14px; overflow-x:auto; padding:12px 2px 16px; scrollbar-width:none; }
.st-row::-webkit-scrollbar { display:none; }
.st-circle { border:0; background:none; display:flex; flex-direction:column; align-items:center; gap:6px; font:inherit; font-size:12px; color:var(--ink); flex:0 0 auto; width:68px; }
.st-circle > span:last-child { max-width:68px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.st-circle .ring { padding:3px; border-radius:50%; background:conic-gradient(#F6A04D,#E0525F,#C2477F,#7A5BD0,#F6A04D); display:inline-flex; position:relative; }
.st-circle .ring > .avatar { box-shadow:0 0 0 3px var(--paper); border-radius:50%; }
.st-circle .ring.seen { background:var(--line); }
.st-circle .ring.add { background:none; }
.st-circle .ring.add::after { content:'+'; position:absolute; right:0; bottom:0; width:22px; height:22px; border-radius:50%; background:#3F7BE0; color:#fff; font-weight:700; display:grid; place-items:center; box-shadow:0 0 0 3px var(--paper); }
.st-circle .ring .season { display:none; }
.story-view { position:fixed; inset:0; z-index:60; background:#111; color:#fff; display:flex; flex-direction:column; max-width:480px; margin:0 auto; }
.sv-bars { display:flex; gap:4px; padding:10px 10px 0; }
.sv-bars i { flex:1; height:3px; border-radius:2px; background:rgba(255,255,255,.35); }
.sv-bars i.done { background:#fff; }
.sv-bars i.now { background:linear-gradient(90deg,#fff 0,#fff 0) no-repeat, rgba(255,255,255,.35); animation:svbar 6s linear forwards; background-size:0 100%; }
@keyframes svbar { to { background-size:100% 100%; } }
.sv-head { display:flex; align-items:center; gap:8px; padding:10px 12px; position:relative; z-index:2; }
.sv-head time { color:rgba(255,255,255,.7); font-size:12px; }
.sv-x { margin-left:auto; border:0; background:none; color:#fff; font-size:20px; }
.sv-body { flex:1; position:relative; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.sv-body img { width:100%; max-height:100%; object-fit:contain; }
.sv-body.text-only { background:linear-gradient(160deg,#C2477F,#6E4C7E); }
.sv-text { position:absolute; left:16px; right:16px; bottom:24px; font-size:18px; line-height:1.5; text-shadow:0 1px 6px rgba(0,0,0,.6); margin:0; }
.sv-body.text-only .sv-text { position:static; font-size:22px; text-align:center; padding:0 24px; }
.sv-nav { position:absolute; top:80px; bottom:90px; width:35%; border:0; background:none; z-index:1; }
.sv-nav.prev { left:0; } .sv-nav.next { right:0; }
.sv-reply { display:flex; gap:8px; padding:12px 12px calc(env(safe-area-inset-bottom) + 12px); position:relative; z-index:2; }
.sv-reply input { flex:1; border:1px solid rgba(255,255,255,.5); background:transparent; color:#fff; border-radius:999px; padding:10px 14px; font:inherit; }
.sv-reply button { border:0; background:none; color:#fff; font:inherit; font-weight:600; }
.sv-foot { padding:14px; text-align:center; color:rgba(255,255,255,.8); padding-bottom:calc(env(safe-area-inset-bottom) + 14px); }
.sq { font-size:12px; opacity:.75; border-left:3px solid currentColor; padding-left:8px; margin-bottom:6px; }

/* ---- 心情按鈕 ---- */
.mood-fab { position:fixed; right:max(16px, calc(50% - 240px + 16px)); bottom:calc(var(--tabs-h) + env(safe-area-inset-bottom) + 16px); width:60px; height:60px; border-radius:50%; border:0; background:var(--surface); box-shadow:0 6px 18px rgba(38,34,58,.18); padding:6px; z-index:15; animation:fabwob 3.2s ease-in-out infinite; }
.mood-fab svg, .mood-head svg { width:100%; height:100%; }
.mood-head { padding:4px; }
@keyframes fabwob { 0%,100% { transform:rotate(0) } 45% { transform:rotate(-6deg) } 55% { transform:rotate(6deg) } }
.mood-to { display:flex; gap:12px; overflow-x:auto; padding:4px 0 12px; }
.mood-to button { border:0; background:none; display:flex; flex-direction:column; align-items:center; gap:4px; font:inherit; font-size:12px; color:var(--ink); opacity:.55; }
.mood-to button[aria-pressed="true"] { opacity:1; }
.mood-grid2 { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.mood-btn { border:0; background:var(--surface); border-radius:16px; padding:12px 4px; display:flex; flex-direction:column; align-items:center; gap:4px; font:inherit; font-size:13px; color:var(--ink); box-shadow:0 1px 3px rgba(38,34,58,.08); }
.mood-btn .em { font-size:28px; }
.mood-press { text-align:center; padding:12px 0 8px; }
.mood-big { width:140px; height:140px; border-radius:50%; border:0; background:radial-gradient(circle at 35% 30%, #fff, #FBE3EA); box-shadow:0 10px 30px rgba(194,71,127,.25); font-size:72px; line-height:1; user-select:none; -webkit-user-select:none; touch-action:manipulation; }
.mood-big.pop { animation:mpop .28s ease-out; }
@keyframes mpop { 0% { transform:scale(1) } 40% { transform:scale(1.18) rotate(-4deg) } 100% { transform:scale(1) } }
.mood-count { margin-top:14px; color:var(--muted); }
.mood-count b { font-size:28px; color:var(--ink); }
.mood-particle { position:fixed; z-index:80; font-size:26px; pointer-events:none; animation:mfly .9s ease-out forwards; }
@keyframes mfly { from { transform:translate(-50%,-50%) scale(.6); opacity:1 } to { transform:translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.3) rotate(var(--r)); opacity:0 } }
.poke-card { display:flex; align-items:center; gap:8px; background:linear-gradient(135deg,#FBE3EA,#EFE7FB); color:#3B3561; border-radius:18px; padding:10px 14px; font-weight:600; }
.poke-card .em { font-size:30px; }
.poke-card b { margin-left:6px; color:#C2477F; }

.choice-opts { display:flex; flex-wrap:wrap; gap:8px; }
.goal-row { display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); }
.goal-row .dots { display:flex; gap:4px; margin:6px 0 2px; flex-wrap:wrap; }
.goal-row .dots i { width:12px; height:12px; border-radius:50%; background:var(--line); }
.goal-row .dots i.on { background:#C2477F; }

/* ---- 紀念日 ---- */
.ann-list { display:flex; flex-direction:column; gap:8px; }
.ann { display:flex; align-items:center; gap:12px; background:var(--surface); border-radius:14px; padding:10px 14px; }
.ann.today { background:linear-gradient(135deg,#FBE3EA,#EFE7FB); color:#3B3561; }
.ann-ic { font-size:22px; }
.ann .grow { display:flex; flex-direction:column; }
.ann-left { font-size:13px; font-weight:600; color:#C2477F; white-space:nowrap; }
.ann-banner { display:block; margin:6px 0 12px; padding:10px 14px; border-radius:14px; background:linear-gradient(135deg,#FBE3EA,#EFE7FB); color:#3B3561; text-decoration:none; font-weight:600; }

.sug-toggle { opacity:.8; font-size:13px; }

/* ---- 使用說明導覽 ---- */
.tour { position:fixed; inset:0; z-index:95; }
.tour-dim { position:absolute; inset:0; background:rgba(16,12,28,.55); }
.tour-hole { position:absolute; border-radius:16px; box-shadow:0 0 0 9999px rgba(16,12,28,.55), 0 0 0 3px rgba(255,255,255,.9); transition:all .25s ease; pointer-events:none; }
.tour-card { position:absolute; left:50%; translate:-50% 0; width:min(92vw, 380px); background:var(--surface); color:var(--ink); border-radius:20px; padding:16px 16px 12px; box-shadow:0 16px 40px rgba(0,0,0,.3); }
:root[data-app="night"] .tour-card { background:#241F48; }
.tour-head { display:flex; align-items:center; gap:10px; font-size:17px; }
.tour-art { width:40px; height:40px; flex:none; } .tour-art svg { width:100%; height:100%; }
.tour-card p { margin:8px 0 12px; line-height:1.65; font-size:15px; }
.tour-foot { display:flex; align-items:center; gap:8px; justify-content:flex-end; }
.tour-dots { display:flex; gap:4px; margin-right:auto; } .tour-dots i { width:6px; height:6px; border-radius:50%; background:var(--line); } .tour-dots i.on { background:var(--rose); width:16px; border-radius:3px; }
@media (prefers-reduced-motion: no-preference) { .tour-card { animation: msgin .25s ease-out; } }

/* ---- 語音通話 ---- */
.call-screen { position:fixed; inset:0; z-index:80; display:flex; flex-direction:column; align-items:center; justify-content:space-between; padding:calc(env(safe-area-inset-top) + 48px) 24px calc(env(safe-area-inset-bottom) + 40px); background:radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--me) 55%, #000), #120F1E); color:#fff; text-align:center; }
.call-top h2 { margin:14px 0 4px; font:700 24px var(--hand); } .call-time { opacity:.75; font-size:14px; margin:0; }
.call-av { display:inline-block; border-radius:50%; box-shadow:0 0 0 6px rgba(255,255,255,.12); }
.call-sub { max-width:320px; min-height:3.2em; font-size:16px; line-height:1.6; opacity:.92; }
.call-bottom { display:flex; gap:48px; align-items:center; }
.call-mic, .call-end { width:76px; height:76px; border-radius:50%; border:0; display:grid; place-items:center; color:#fff; }
.call-mic { background:rgba(255,255,255,.16); } .call-mic svg, .call-end svg { width:32px; height:32px; fill:none; stroke:currentColor; stroke-width:1.8; }
.call-mic.on { background:#E0525F; animation:callpulse 1.2s ease-in-out infinite; } .call-mic.speaking { box-shadow:0 0 0 10px rgba(255,255,255,.08); }
.call-mic:disabled { opacity:.5; }
.call-end { background:#E0525F; } .call-end svg { transform:rotate(135deg); }
@keyframes callpulse { 50% { box-shadow:0 0 0 14px rgba(224,82,95,.25); } }
.call-note { text-align:center; }

/* ---- 心情按鈕：分組、自訂、說不出來 ---- */
.mood-group { margin-top:12px; } .mg-title { font-size:13px; color:var(--muted); margin:0 0 6px 2px; font-weight:600; }
.mood-special { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:6px; }
.mood-unsure, .mood-custom { display:flex; gap:10px; align-items:center; text-align:left; border:0; border-radius:16px; padding:12px; background:var(--rose-soft); color:var(--ink); font:inherit; }
.mood-custom { background:var(--surface); box-shadow:0 0 0 1px var(--line); }
.mood-unsure .em, .mood-custom .em { font-size:26px; } .mood-unsure small, .mood-custom small { display:block; font-size:11.5px; color:var(--muted); line-height:1.35; }
.emoji-row { display:grid; grid-template-columns:repeat(8,1fr); gap:6px; } .emoji-row button { border:0; background:var(--surface); border-radius:10px; font-size:22px; padding:6px 0; box-shadow:0 0 0 1px var(--line); }
.emoji-row button[aria-pressed="true"] { box-shadow:0 0 0 2px var(--ink); }
.chips.wrap { display:flex; flex-wrap:wrap; gap:8px; }
.chip[aria-pressed="true"] { background:var(--me); color:var(--me-ink); border-color:var(--me); }
.level-row { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; } .level-row button { border:0; border-radius:12px; padding:10px 0; background:var(--surface); box-shadow:0 0 0 1px var(--line); font:inherit; font-weight:700; color:var(--ink); }
.level-row button[aria-pressed="true"] { background:var(--me); color:var(--me-ink); }
.level-cap { display:flex; justify-content:space-between; margin-top:4px; }
.dir-list { display:grid; gap:8px; }

/* ---- 角色的 AI 人像 ---- */
.ai-tag { position:absolute; left:6px; bottom:6px; font-style:normal; font-size:10px; line-height:1; padding:3px 6px; border-radius:999px; background:rgba(0,0,0,.45); color:#fff; letter-spacing:.02em; }
.pt-tile { position:relative; display:block; margin:-14px -14px 4px; border-radius:18px 18px 0 0; overflow:hidden; aspect-ratio:4/5; background:var(--line); }
.pt-tile img { width:100%; height:100%; object-fit:cover; display:block; transform:scale(1.08); }
.pt-mini { position:relative; flex:none; width:64px; height:80px; border-radius:14px; overflow:hidden; background:var(--line); }
.pt-mini img { width:100%; height:100%; object-fit:cover; transform:scale(1.1); }
.pt-mini .ai-tag { left:4px; bottom:4px; font-size:9px; }
.page h2 .small { font: 400 12px var(--sans); letter-spacing: 0; }
.pf-face { width:96px; height:96px; border-radius:50%; overflow:hidden; box-shadow:0 0 0 4px var(--paper); background:var(--line); } .pf-face img { width:100%; height:100%; object-fit:cover; }
.msg-av { display:inline-flex; border:0; background:none; padding:0; margin:0 6px 0 0; align-self:flex-start; flex:none; cursor:pointer; }
.msg-av-sp { width:40px; flex:none; }
[data-prof-rel] { cursor:pointer; display:inline-flex; }
button.pf-face { border:0; padding:0; cursor:zoom-in; }
.pf-photos { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.pf-ph { position:relative; aspect-ratio:3/4; border:0; padding:0; border-radius:12px; overflow:hidden; background:var(--line); }
.pf-ph img { width:100%; height:100%; object-fit:cover; display:block; }
.pf-ph.locked img { transform:scale(1.15); }
.pf-lock { position:absolute; inset:auto 0 0 0; padding:18px 6px 6px; font-size:11px; color:#fff; background:linear-gradient(transparent, rgba(0,0,0,.55)); text-align:center; }
.pf-big { position:relative; border-radius:16px; overflow:hidden; } .pf-big img { width:100%; display:block; }

/* ---- 系統公告 ---- */
.sys-ann { display:flex; align-items:center; gap:10px; margin:6px 0 12px; padding:10px 6px 10px 12px; border-radius:16px; background:var(--surface); box-shadow:0 0 0 1px var(--line); font-size:14px; }
.sys-ann-art { width:36px; height:36px; flex:none; } .sys-ann-art svg { width:100%; height:100%; }
.sys-ann .grow { flex:1; min-width:0; }

/* ---- 新版本提示 ---- */
.update-bar { position:fixed; left:50%; transform:translateX(-50%); top:calc(env(safe-area-inset-top) + 10px); z-index:90; display:flex; align-items:center; gap:12px; background:var(--ink); color:var(--paper); padding:10px 10px 10px 16px; border-radius:999px; box-shadow:0 8px 24px rgba(0,0,0,.2); font-size:14px; animation:dropin .35s ease-out; }
.update-bar button { border:0; background:var(--rose); color:#fff; border-radius:999px; padding:6px 14px; font:inherit; font-weight:600; }
@keyframes dropin { from { transform:translate(-50%,-20px); opacity:0 } to { transform:translate(-50%,0); opacity:1 } }

/* ================= 系統主題 ================= */
/* 三種風格：換系統主題時，整個 App 的質感、字體、吉祥物一起換。
   每一種只有一個最明顯的記憶點：手帳＝方格紙和紙膠帶、電台＝夜空和柔光、日光＝大標題和留白。 */

/* ---------- 1. 溫暖手帳（小糰）：像跟他寫交換日記 ---------- */
:root[data-app="milk"] {
  --paper:#F7EEF0; --surface:#FFFCFB; --ink:#3A2D44; --muted:#8A7A8C; --line:#EADCE1;
  --me:#4A3558; --me-ink:#FFF; --him:#FFFCFB; --rose:#D14D7A; --rose-soft:#F8DDE6; --amber:#E39A3B; --sage:#6E9A7A;
  --tape:#F7C9A9; --tape2:#C9DAF0;
  --title-font: var(--hand);
  --deco: radial-gradient(circle, #E3CFD7 1px, transparent 1.3px) 0 0 / 18px 18px;
  --ring: conic-gradient(#D14D7A, #F7A58A, #F7C9A9, #C9DAF0, #D14D7A);
  --card-shadow: 0 1px 0 #EADCE1, 0 10px 18px -14px rgba(58,45,68,.45);
}
@media (prefers-color-scheme: dark) {
  :root[data-app="milk"]:not([data-theme="light"]) {
    --paper:#1F1820; --surface:#2A2129; --ink:#F3E8EE; --muted:#B19FAE; --line:#3B2F3A;
    --me:#B9849F; --me-ink:#1F1820; --him:#2E242D; --rose:#EE86AA; --rose-soft:#43293A; --tape:#8A5A47; --tape2:#3E4C66;
    --deco: radial-gradient(circle, #3A2E39 1px, transparent 1.3px) 0 0 / 18px 18px;
    --card-shadow: 0 1px 0 #3B2F3A;
    color-scheme: dark;
  }
}
:root[data-app="milk"] body { background: var(--deco), var(--paper); background-attachment: fixed; }
:root[data-app="milk"] .page h1 { font-size: 28px; display: inline-block; padding: 0 6px; margin-left: -6px;
  background: linear-gradient(transparent 58%, color-mix(in srgb, var(--tape) 75%, transparent) 58% 92%, transparent 92%); }
:root[data-app="milk"] .page h2 { font-family: var(--hand); font-size: 18px; display: inline-block; position: relative; padding: 0 8px; margin-left: -4px; z-index: 0; }
:root[data-app="milk"] .page h2::before { content: ""; position: absolute; inset: 3px -2px 2px; background: color-mix(in srgb, var(--tape2) 70%, transparent); transform: rotate(-1.2deg); z-index: -1; border-radius: 2px;
  -webkit-mask: linear-gradient(90deg, transparent 0 2px, #000 2px calc(100% - 2px), transparent calc(100% - 2px)); }
:root[data-app="milk"] .section, :root[data-app="milk"] .tile, :root[data-app="milk"] .person, :root[data-app="milk"] .lover-card, :root[data-app="milk"] .fpost, :root[data-app="milk"] .ann, :root[data-app="milk"] .mm-card:not(.locked) { box-shadow: var(--card-shadow); border-color: transparent; }
:root[data-app="milk"] .stream { background: var(--deco); }
:root[data-app="milk"] .msg.him .bubble { box-shadow: 0 0 0 1px var(--line); }
:root[data-app="milk"] .tabs { border-top: 1px dashed color-mix(in srgb, var(--ink) 25%, transparent); }
:root[data-app="milk"] .tabs a[aria-current="page"] { color: var(--rose); }

/* ---------- 2. 夜晚電台（小月）：凌晨兩點，有人陪你醒著 ---------- */
:root[data-app="night"] {
  --paper:#16142C; --surface:rgba(255,255,255,.06); --ink:#F1ECFF; --muted:#A9A2CC; --line:rgba(255,255,255,.10);
  --me:#8D78E8; --me-ink:#FFF; --him:rgba(255,255,255,.08); --rose:#F2A6C8; --rose-soft:rgba(242,166,200,.16); --amber:#F6D98B; --sage:#9BC7A6;
  --title-font: "Noto Serif TC", serif;
  --ring: conic-gradient(#F6D98B, #F2A6C8, #B7A6FF, #F6D98B);
  color-scheme: dark;
}
:root[data-app="night"] body {
  background:
    radial-gradient(1px 1px at 20% 12%, #fff9 50%, transparent), radial-gradient(1px 1px at 72% 6%, #fff7 50%, transparent),
    radial-gradient(1.4px 1.4px at 86% 22%, #F6D98Bcc 50%, transparent), radial-gradient(1px 1px at 40% 30%, #fff5 50%, transparent),
    radial-gradient(1px 1px at 8% 44%, #fff6 50%, transparent), radial-gradient(1px 1px at 60% 52%, #fff4 50%, transparent),
    radial-gradient(120% 60% at 50% -10%, #3A3078 0%, #211C48 45%, #16142C 80%) fixed;
  background-color: #16142C;
}
:root[data-app="night"] .page h1 { font: 600 28px/1.3 var(--title-font); letter-spacing: .06em; text-shadow: 0 0 22px rgba(183,166,255,.45); }
:root[data-app="night"] .page h2 { font-family: var(--title-font); font-weight: 600; letter-spacing: .04em; }
:root[data-app="night"] .section, :root[data-app="night"] .tile, :root[data-app="night"] .person, :root[data-app="night"] .lover-card, :root[data-app="night"] .fpost, :root[data-app="night"] .ann,
:root[data-app="night"] .chip, :root[data-app="night"] .cat, :root[data-app="night"] .choice, :root[data-app="night"] .tb-item, :root[data-app="night"] .mm-card {
  background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
:root[data-app="night"] .sheet { background: #211D42; }
:root[data-app="night"] .composer, :root[data-app="night"] .composer textarea { background: rgba(22,20,44,.85); }
:root[data-app="night"] .msg.me .bubble { background: linear-gradient(135deg, #8D78E8, #B07CD8); box-shadow: 0 6px 20px -8px rgba(160,124,224,.8); }
:root[data-app="night"] .msg.him .bubble { border: 1px solid var(--line); }
:root[data-app="night"] .btn:not(.ghost):not(.danger) { background: linear-gradient(135deg, #8D78E8, #B07CD8); box-shadow: 0 6px 18px -8px rgba(160,124,224,.9); }
:root[data-app="night"] .tabs { background: rgba(22,20,44,.72); }
:root[data-app="night"] .tabs a[aria-current="page"] { color: var(--amber); }
:root[data-app="night"] .tabs a[aria-current="page"] svg { filter: drop-shadow(0 0 6px rgba(246,217,139,.6)); }
:root[data-app="night"] .cat.on, :root[data-app="night"] .chip[aria-pressed="true"] { background: var(--ink); color: #16142C; }

/* ---------- 3. 清新日光（小芽）：週末早上，陽光照進來 ---------- */
:root[data-app="forest"] {
  --paper:#FFFFFF; --surface:#F3F7F2; --ink:#14261C; --muted:#6B7C70; --line:#E3ECE2;
  --me:#1F9B68; --me-ink:#FFF; --him:#F1F5F0; --rose:#FF6B5E; --rose-soft:#FFE7E3; --amber:#FFB938; --sage:#1F9B68;
  --title-font: var(--sans);
  --ring: conic-gradient(#FFC53D, #FF8A4C, #1F9B68, #2BB3A3, #FFC53D);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root[data-app="forest"]:not([data-theme="light"]) {
    --paper:#0F1813; --surface:#18241C; --ink:#E9F3EC; --muted:#93A79A; --line:#24342A; --him:#1B2920; --rose-soft:#3A2420;
    color-scheme: dark;
  }
}
:root[data-app="forest"] .page h1 { font: 900 32px/1.15 var(--sans); letter-spacing: -.02em; margin-bottom: 20px; }
:root[data-app="forest"] .page h2 { font-weight: 900; font-size: 19px; letter-spacing: -.01em; }
:root[data-app="forest"] .section, :root[data-app="forest"] .tile, :root[data-app="forest"] .person, :root[data-app="forest"] .lover-card, :root[data-app="forest"] .fpost, :root[data-app="forest"] .ann { box-shadow: none; border: 0; border-radius: 22px; }
:root[data-app="forest"] .tile .nm, :root[data-app="forest"] .person .nm, :root[data-app="forest"] .lover-card .name, :root[data-app="forest"] .room-head .nm { font-family: var(--sans); font-weight: 900; letter-spacing: -.01em; }
:root[data-app="forest"] .msg.him .bubble { font-family: var(--sans); font-size: 16px; }
:root[data-app="forest"] .bubble { border-radius: 22px; }
:root[data-app="forest"] .tabs { background: var(--paper); backdrop-filter: none; border-top-color: transparent; box-shadow: 0 -1px 0 var(--line); }
:root[data-app="forest"] .tabs a[aria-current="page"] { color: var(--me); }
:root[data-app="forest"] .tabs a[aria-current="page"]::after { content: ""; position: absolute; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--me); }
:root[data-app="forest"] .cat.on, :root[data-app="forest"] .chip[aria-pressed="true"] { background: var(--me); border-color: var(--me); color: #fff; }

/* 共用：限動圈圈跟著風格換色、頁面標題字體 */
:root[data-app] .st-circle .ring:not(.seen):not(.add) { background: var(--ring); }

.theme-pick { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:8px; }
.theme-pick button { border:1px solid var(--line); background:var(--surface); border-radius:16px; padding:12px 8px; display:flex; flex-direction:column; align-items:center; gap:4px; font:inherit; color:var(--ink); text-align:center; }
.theme-pick button[aria-pressed="true"] { box-shadow:0 0 0 2px var(--ink); }
.theme-pick .small { font-size:11px; line-height:1.4; }
.tp-art { width:58px; height:58px; border-radius:50%; display:grid; place-items:center; padding:6px; }
.tp-milk { background: radial-gradient(circle, #E3CFD7 1px, transparent 1.3px) 0 0/10px 10px, #F7EEF0; } .tp-night { background: radial-gradient(1px 1px at 30% 25%, #fff 50%, transparent), radial-gradient(1px 1px at 75% 60%, #F6D98B 50%, transparent), linear-gradient(160deg,#3A3078,#16142C); } .tp-forest { background: linear-gradient(160deg,#FFF6D6,#DDF2E6); }
.tp-art svg { width:100%; height:100%; }
.mood-head-art { width:64px; height:64px; margin:0 auto 4px; animation:bob 2.6s ease-in-out infinite; }
.mood-head-art svg { width:100%; height:100%; }
@keyframes bob { 0%,100% { transform:translateY(0) } 50% { transform:translateY(-5px) } }

/* ================= 互動動畫 ================= */
@media (prefers-reduced-motion: no-preference) {
  .btn, .chip, .choice, .tile, .person, .conv, .lover-card, .fpost, .tb-item, .mood-btn, .rm-grid button, .scene-card, .cat, .st-circle, .me-tile, .ann, .mm-card:not(.locked), .theme-pick button, .icon-btn {
    transition: transform .18s cubic-bezier(.2,.8,.3,1.2), box-shadow .18s ease, background-color .18s ease, opacity .18s ease;
  }
  @media (hover: hover) {
    .btn:hover, .chip:hover, .cat:hover { transform: translateY(-1px); }
    .choice:hover, .tile:hover, .person:hover, .lover-card:hover, .tb-item:hover, .mood-btn:hover, .scene-card:hover, .ann:hover, .mm-card:not(.locked):hover, .theme-pick button:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(38,34,58,.12); }
    .conv:hover { background: color-mix(in srgb, var(--surface) 70%, transparent); }
    .st-circle:hover .ring, .rm-grid button:hover span { transform: scale(1.06); }
    .icon-btn:hover { transform: scale(1.08); }
    .me-tile:hover img { transform: scale(1.05); }
    .mood-fab:hover { animation-play-state: paused; transform: scale(1.08) rotate(-4deg); }
  }
  .btn:active, .chip:active, .choice:active, .tile:active, .person:active, .conv:active, .tb-item:active, .mood-btn:active, .rm-grid button:active, .cat:active, .icon-btn:active, .st-circle:active, .theme-pick button:active { transform: scale(.96); }
  .me-tile img, .st-circle .ring, .rm-grid button span { transition: transform .25s ease; }
  /* 換頁淡入、訊息浮上來 */
  .page, .room, .profile { animation: pagein .28s ease-out; }
  @keyframes pagein { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform:none; } }
  .reveal { animation: msgin .3s cubic-bezier(.2,.8,.3,1.2); }
  @keyframes msgin { from { opacity:0; transform: translateY(8px) scale(.98); } to { opacity:1; transform:none; } }
  /* 分頁圖示：點到的那個跳一下 */
  .tabs a[aria-current="page"] svg { animation: tabpop .35s cubic-bezier(.2,.8,.3,1.4); }
  @keyframes tabpop { 0% { transform: scale(.85) } 60% { transform: scale(1.15) } 100% { transform: scale(1) } }
  /* 打字中的三個點 */
  .msg.typing .bubble i { animation: blink 1.2s infinite ease-in-out; }
  .msg.typing .bubble i:nth-child(2) { animation-delay: .15s; } .msg.typing .bubble i:nth-child(3) { animation-delay: .3s; }
  @keyframes blink { 0%,80%,100% { opacity:.25; transform: translateY(0) } 40% { opacity:1; transform: translateY(-3px) } }
  /* 底部面板 */
  .sheet-backdrop { animation: fadein .2s ease-out; }
  @keyframes fadein { from { opacity:0 } to { opacity:1 } }
  .badge, .tab-badge { animation: badgepop .4s cubic-bezier(.2,.8,.3,1.6); }
  @keyframes badgepop { from { transform: scale(0) } to { transform: scale(1) } }
}

.mm-more { text-align:center; color:var(--muted); font-size:14px; padding:14px 0 4px; }

/* 語感回饋 */
.quote-line { background: var(--paper-2, rgba(0,0,0,.04)); border-radius: 12px; padding: 10px 12px; margin: 0 0 8px; line-height: 1.6; }
.msg.him > .bubble { -webkit-touch-callout: none; }
.face-more { border: 1px dashed var(--line, rgba(0,0,0,.15)); border-radius: 14px; padding: 10px 12px; }
.face-more > summary { cursor: pointer; font-weight: 600; }
.face-more .field { margin-top: 10px; }

/* 相遇過場 */
.going-in { width: min(360px, 100%); }
.going-scene { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 2 / 1; box-shadow: 0 10px 30px rgba(0,0,0,.08); animation: goScene 6s ease-in-out infinite alternate; }
.going-scene svg { width: 100%; height: 100%; display: block; transform-origin: 50% 60%; animation: goZoom 9s ease-in-out infinite alternate; }
.going-av { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); animation: goWalk 1.6s ease-in-out infinite; filter: drop-shadow(0 4px 8px rgba(0,0,0,.15)); }
.going-line { margin: 22px 0 10px; min-height: 2.6em; font-size: 20px; }
.going-line.show { animation: goFade .9s ease both; }
.going-dots { display: flex; gap: 8px; justify-content: center; }
.going-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent, #6E4C7E); opacity: .25; animation: goDot 1.2s ease-in-out infinite; }
.going-dots i:nth-child(2) { animation-delay: .2s; } .going-dots i:nth-child(3) { animation-delay: .4s; }
.going-slow { margin-top: 14px; animation: goFade .9s ease both; }
@keyframes goZoom { from { transform: scale(1); } to { transform: scale(1.08); } }
@keyframes goScene { from { filter: saturate(.9) brightness(.97); } to { filter: saturate(1.05) brightness(1.02); } }
@keyframes goWalk { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }
@keyframes goFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes goDot { 0%, 100% { opacity: .25; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .going-scene, .going-scene svg, .going-av, .going-dots i { animation: none; } .going-dots i { opacity: .6; } }

/* 登入碼：讓瀏覽器的密碼管理認得 */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.keep-field input { letter-spacing: 3px; font-size: 14px; opacity: .7; }
.pw-wrap { display: flex; gap: 8px; align-items: center; }
.pw-wrap .input { flex: 1; letter-spacing: 2px; }

/* 歡迎頁：新使用者／已有登入碼 */
.entry-choice { display: grid; gap: 12px; margin: 8px 0 14px; }
.entry { box-sizing: border-box; width: 100%; margin: 0; display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 18px; text-decoration: none; text-align: left; transition: transform .15s ease; }
.entry:active { transform: scale(.98); }
.entry b { font-size: 18px; }
.entry span { font-size: 13px; opacity: .8; }
.entry.new { background: var(--ink, #3B3561); color: #fff; }
.entry.back { background: var(--surface, #fff); color: var(--ink, #3B3561); border: 1.5px solid var(--line, rgba(0,0,0,.12)); }

/* 偷看（不已讀） */
.peek { max-height: 60vh; overflow-y: auto; padding: 4px 2px 8px; }
.peek .msg { margin: 4px 0; }
.peek-note { font-size: 12px; color: var(--muted); text-align: center; margin: 4px 0 10px; }

/* 已收回的訊息 */
.retracted { text-align: center; font-size: 12px; color: var(--muted); margin: 8px auto; padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--line) 60%, transparent); width: fit-content; }

/* 當面相遇：置中的對白框（交換聯絡方式前），和聊天泡泡分開 */
.face { max-width: 84%; margin: 10px auto; padding: 10px 14px 11px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 3px rgba(0,0,0,.06); text-align: left; }
.face.me { background: var(--paper); border-style: dashed; }
.face .face-who { display: block; font-size: 12px; opacity: .6; margin-bottom: 2px; letter-spacing: .04em; }
.face p { margin: 0; font-size: 16px; line-height: 1.55; }
.exchange-card { text-align: center; }

/* 前導劇情（輕量視覺小說）：場景插圖、旁白打字、角色淡入 */
.vn { position: fixed; inset: 0; z-index: 60; background: #111; overflow: hidden; animation: vnIn .5s ease both; }
.vn.out { animation: vnOut .45s ease both; }
.vn-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: vnPan 18s ease-in-out both; }
.vn-svg { display: flex; align-items: center; background: #cfd6e0; }
.vn-svg svg { width: 100%; height: auto; }
.vn-fx { position: absolute; inset: 0; pointer-events: none; }
.vn.fx-night .vn-fx { background: linear-gradient(180deg, rgba(20,24,60,.45), rgba(10,10,30,.25)); }
.vn.fx-dusk .vn-fx { background: linear-gradient(180deg, rgba(255,150,90,.18), rgba(120,60,120,.18)); }
.vn.fx-rain .vn-fx { background-image: repeating-linear-gradient(105deg, rgba(255,255,255,.0) 0 14px, rgba(255,255,255,.28) 14px 15px, rgba(255,255,255,0) 15px 38px);
  background-size: 120px 220px; animation: vnRain .55s linear infinite; opacity: .55; }
.vn-who { position: absolute; left: 50%; bottom: 31%; transform: translate(-50%, 12px); opacity: 0; transition: opacity .9s ease, transform .9s ease; }
.vn-who.in { opacity: 1; transform: translate(-50%, 0); }
.vn-who img, .vn-who svg { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 8px 24px rgba(0,0,0,.3); display: block; }
.vn-box { position: absolute; left: 14px; right: 14px; bottom: calc(64px + env(safe-area-inset-bottom)); min-height: 140px; padding: 16px 18px 26px;
  border-radius: 16px; background: rgba(255,255,255,.9); color: #2a2633; box-shadow: 0 8px 30px rgba(0,0,0,.25); cursor: pointer; backdrop-filter: blur(6px); }
.vn-box.say { background: rgba(255,252,246,.95); }
.vn-name { position: absolute; top: -14px; left: 16px; padding: 4px 14px; border-radius: 999px; background: var(--accent, #6E4C7E); color: #fff; font-size: 15px; }
.vn-text { margin: 0; font: 19px/1.85 var(--hand, inherit); white-space: pre-wrap; }
.vn-box.say .vn-text { font-family: var(--sans, inherit); }
.vn-next { position: absolute; right: 16px; bottom: 8px; font-size: 11px; opacity: .5; animation: vnBlink 1.2s ease-in-out infinite; }
.vn-skip, .vn-sound { position: absolute; top: calc(14px + env(safe-area-inset-top)); padding: 6px 14px; border-radius: 999px; border: 0; background: rgba(0,0,0,.35); color: #fff; font-size: 13px; }
.vn-skip { right: 14px; } .vn-sound { left: 14px; }
.scene-img img { width: 100%; max-height: 240px; object-fit: cover; border-radius: 14px; display: block; }
@keyframes vnIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes vnOut { to { opacity: 0; } }
@keyframes vnPan { from { transform: scale(1.06); } to { transform: scale(1); } }
@keyframes vnRain { from { background-position: 0 0; } to { background-position: -40px 220px; } }
@keyframes vnBlink { 50% { opacity: .15; } }
@media (prefers-reduced-motion: reduce) { .vn, .vn-bg, .vn.fx-rain .vn-fx, .vn-next { animation: none; } .vn-who { transition: none; } }

.scene.act { font-style: italic; font-size: 13px; opacity: .75; margin: 4px auto 6px; }

.vn-prev { position: absolute; left: 14px; bottom: calc(16px + env(safe-area-inset-bottom)); padding: 8px 16px; border-radius: 999px; border: 0; background: rgba(0,0,0,.4); color: #fff; font-size: 15px; }
.first-tip { position: fixed; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 55; display: flex; gap: 10px; align-items: center;
  padding: 12px 14px; border-radius: 14px; background: var(--ink, #2a2633); color: #fff; font-size: 14px; line-height: 1.5; box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: vnIn .25s ease both; }
.first-tip span { flex: 1; }
.first-tip button { border: 0; background: rgba(255,255,255,.18); color: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
