/* ───────── 基礎（顏色都由主題變數控制） ───────── */
:root {
  --bg: #f6efe7; --surface: #fffaf4; --text: #3b2f2a; --muted: #8c7b70; --accent: #d27a7f; --on-accent: #fff;
  --radius: 20px;
  --font: 'Noto Serif TC', serif;
  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --soft: color-mix(in srgb, var(--accent) 13%, var(--surface));
  --shadow: 0 1px 2px color-mix(in srgb, var(--text) 6%, transparent), 0 8px 24px -10px color-mix(in srgb, var(--text) 22%, transparent);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s, color .3s;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
svg { width: 1.1em; height: 1.1em; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 18px calc(env(safe-area-inset-bottom, 0px) + 40px);
  display: flex;
  flex-direction: column;
  gap: 30px;
  position: relative;
  z-index: 1;
}
body.loading .page { opacity: 0; }
body.editing .page { padding-bottom: 62vh; }

/* 出場動畫 */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in, .no-reveal .reveal { opacity: 1; transform: none; }

/* ───────── 背景花紋 ───────── */
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; }
body[data-pattern="dots"]::before {
  background-image: radial-gradient(color-mix(in srgb, var(--text) 13%, transparent) 1.2px, transparent 1.4px);
  background-size: 18px 18px;
}
body[data-pattern="grid"]::before {
  background-image:
    linear-gradient(color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--text) 7%, transparent) 1px, transparent 1px);
  background-size: 24px 24px;
}
body[data-pattern="hearts"]::before {
  background: var(--accent);
  opacity: .09;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M14 22s-7-4.3-9-8.6C3.6 10.1 5.7 6.5 9.1 6.5c2 0 3.4 1 4.2 2.4.3.4.5.4.8 0 .8-1.4 2.2-2.4 4.2-2.4 3.4 0 5.5 3.6 4.1 6.9C21 17.7 14 22 14 22z'/%3E%3Cpath transform='translate(28 28) scale(.6)' d='M14 22s-7-4.3-9-8.6C3.6 10.1 5.7 6.5 9.1 6.5c2 0 3.4 1 4.2 2.4.3.4.5.4.8 0 .8-1.4 2.2-2.4 4.2-2.4 3.4 0 5.5 3.6 4.1 6.9C21 17.7 14 22 14 22z'/%3E%3C/svg%3E") 0 0 / 56px 56px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56'%3E%3Cpath d='M14 22s-7-4.3-9-8.6C3.6 10.1 5.7 6.5 9.1 6.5c2 0 3.4 1 4.2 2.4.3.4.5.4.8 0 .8-1.4 2.2-2.4 4.2-2.4 3.4 0 5.5 3.6 4.1 6.9C21 17.7 14 22 14 22z'/%3E%3Cpath transform='translate(28 28) scale(.6)' d='M14 22s-7-4.3-9-8.6C3.6 10.1 5.7 6.5 9.1 6.5c2 0 3.4 1 4.2 2.4.3.4.5.4.8 0 .8-1.4 2.2-2.4 4.2-2.4 3.4 0 5.5 3.6 4.1 6.9C21 17.7 14 22 14 22z'/%3E%3C/svg%3E") 0 0 / 56px 56px;
}
body[data-pattern="paper"]::before {
  opacity: .5;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .45 0 0 0 0 .4 0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ───────── 卡片樣式 ───────── */
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; }
body[data-card="soft"] .card { box-shadow: var(--shadow); }
body[data-card="outline"] .card { border: 1px solid var(--line); }
body[data-card="flat"] .card { background: var(--soft); }
body[data-card="none"] .card { background: transparent; padding-left: 4px; padding-right: 4px; }

/* 區塊標題 */
.sec-title {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 600; letter-spacing: .22em;
  color: var(--muted);
  margin-bottom: 14px;
}
.sec-title::before, .sec-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.card > .sec-title { margin-bottom: 10px; }

/* ───────── 封面 ───────── */
.hero { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hero-banner { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--radius); margin-bottom: 8px; }
.hero-title { font-size: clamp(30px, 9vw, 40px); line-height: 1.2; font-weight: 700; letter-spacing: .02em; margin-top: 6px; }
.hero-tag { color: var(--muted); font-size: 15px; }

.avatar {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  border: 4px solid var(--surface);
  background: var(--soft);
  box-shadow: 0 4px 16px -6px color-mix(in srgb, var(--text) 35%, transparent);
}
.avatar-empty { display: inline-grid; place-items: center; font-size: 32px; font-weight: 700; color: var(--accent); }
.avatar.lg { width: 112px; height: 112px; }
.avatar.md { width: 72px; height: 72px; }
.avatar.md.avatar-empty { font-size: 26px; }

.pair { display: flex; align-items: center; }
.pair .avatar:first-child { margin-right: -14px; }
.pair .avatar:last-child { margin-left: -14px; }
.pair-heart {
  position: relative; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  border: 3px solid var(--surface);
  animation: beat 1.8s ease-in-out infinite;
}
.pair-heart svg { width: 18px; height: 18px; }
@keyframes beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.15); } 24% { transform: scale(1); } 36% { transform: scale(1.1); } }

.side-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.side-row figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 600; }
.side-heart { color: var(--accent); animation: beat 1.8s ease-in-out infinite; }
.side-heart svg { width: 28px; height: 28px; }

.hero-cover { margin: calc(-28px - env(safe-area-inset-top, 0px)) -18px 0; position: relative; min-height: 72svh; justify-content: flex-end; color: #fff; }
.hero-img { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 35%, rgba(0,0,0,.6)); }
.hero-over { position: relative; padding: 0 22px 34px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.hero-cover .hero-tag { color: rgba(255,255,255,.85); }
.pair-sm .avatar { width: 58px; height: 58px; border-width: 3px; }
.pair-sm .avatar-empty { font-size: 22px; }
.pair-sm .avatar:first-child { margin-right: -8px; }
.pair-sm .avatar:last-child { margin-left: 0; }

/* ───────── 天數 ───────── */
.counter { text-align: center; padding-top: 22px; padding-bottom: 22px; }
.counter-num { font-size: clamp(60px, 20vw, 84px); line-height: 1.05; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.counter-num small { font-size: 20px; margin-left: 6px; color: var(--text); font-weight: 600; letter-spacing: 0; }
.counter-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.counter-clock { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 15px; letter-spacing: .12em; color: var(--muted); margin-top: 2px; }
.chip { display: inline-block; margin-top: 14px; padding: 6px 14px; border-radius: 999px; background: var(--soft); font-size: 13.5px; }
.chip b { color: var(--accent); }

/* ───────── 兩人 ───────── */
.people { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.person { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 20px 14px; }
.person h3 { font-size: 18px; margin-top: 4px; }
.person-bio { font-size: 13.5px; line-height: 1.6; }
.ig-btn {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; text-decoration: none; padding: 5px 12px; border-radius: 999px;
  background: var(--soft); color: var(--text); max-width: 100%;
}
.ig-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 4px; }
@media (max-width: 340px) { .people { grid-template-columns: 1fr; } }

/* ───────── 連結 ───────── */
.links { display: flex; flex-direction: column; gap: 10px; }
.link-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 18px; border-radius: var(--radius);
  background: var(--surface); text-decoration: none; font-weight: 600;
  transition: transform .15s, background-color .15s;
}
body[data-card="soft"] .link-btn { box-shadow: var(--shadow); }
body[data-card="outline"] .link-btn, body[data-card="none"] .link-btn { border: 1px solid var(--line); }
body[data-card="flat"] .link-btn { background: var(--soft); }
.link-btn:active { transform: scale(.98); }
.link-btn svg { color: var(--accent); }
.link-btn.mini { padding: 4px 10px; font-size: 12.5px; font-weight: 500; border-radius: 999px; box-shadow: none !important; border: 1px solid var(--line); background: transparent; }

/* ───────── 紀念日 ───────── */
.day-hero { display: flex; align-items: center; gap: 14px; background: var(--accent) !important; color: var(--on-accent); margin-bottom: 12px; border: 0 !important; }
.day-hero .muted { color: inherit; opacity: .8; }
.day-hero .day-left small { color: inherit; opacity: .85; }
.day-hero .day-left b { color: inherit; font-size: 34px; }
.days { list-style: none; margin: 0; padding: 6px 18px; }
.day-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.day-row + .day-row { border-top: 1px solid var(--line); }
.day-emoji { font-size: 24px; width: 36px; text-align: center; flex: none; }
.day-hero > div, .day-row > div { flex: 1; min-width: 0; }
.day-title { font-weight: 600; font-size: 15.5px; }
.day-left { text-align: right; white-space: nowrap; line-height: 1.1; }
.day-left b { font-size: 24px; color: var(--accent); font-variant-numeric: tabular-nums; }
.day-left small { font-size: 12px; color: var(--muted); margin-left: 2px; }

/* ───────── 回憶 ───────── */
.mem { padding: 0; overflow: hidden; }
.mem-body { padding: 16px 18px 18px; }
body[data-card="none"] .mem-body { padding-left: 0; padding-right: 0; }
.mem-date { font-size: 12.5px; color: var(--muted); letter-spacing: .06em; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.mem-place { display: inline-flex; align-items: center; gap: 2px; }
.mem-place svg { width: 13px; height: 13px; }
.mem-title { font-size: 18px; margin-top: 2px; }
.mem-text { margin-top: 6px; font-size: 15px; white-space: pre-line; }
.mem-ig { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 13px; color: var(--accent); text-decoration: none; }

.strip { position: relative; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 4px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip img { flex: 0 0 100%; aspect-ratio: 4 / 3; object-fit: cover; scroll-snap-align: start; cursor: zoom-in; background: var(--soft); }
.strip.multi img { flex-basis: 86%; }
.strip-wrap { position: relative; }
.strip-count { position: absolute; top: 10px; right: 10px; pointer-events: none; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(0,0,0,.5); color: #fff; font-family: system-ui, sans-serif; }

/* 時間軸 */
.tl { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; }
.tl::before { content: ''; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 2px; }
.tl-item { position: relative; margin-bottom: 16px; }
.tl-item::before { content: ''; position: absolute; left: -21px; top: 20px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); }
.tl-year { position: relative; font-weight: 700; font-size: 20px; margin: 6px 0 10px -22px; padding-left: 0; color: var(--accent); background: var(--bg); width: max-content; padding-right: 8px; }

/* 卡片 */
.mem-cards { display: flex; flex-direction: column; gap: 16px; }

/* 拍立得 */
.mem-polaroid { display: flex; flex-direction: column; gap: 26px; padding: 6px 4px; }
body .mem-polaroid .mem {
  background: #fdfcf8 !important; -webkit-backdrop-filter: none; backdrop-filter: none; color: #2b2723; border-radius: 3px; padding: 12px 12px 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,.08), 0 14px 30px -14px rgba(0,0,0,.35) !important; border: 0 !important;
  transform: rotate(-1.2deg);
}
.mem-polaroid .mem:nth-child(even) { transform: rotate(1.1deg); }
.mem-polaroid .strip img { aspect-ratio: 1; }
.mem-polaroid .mem-body { padding: 14px 4px 12px; }
.mem-polaroid .mem-date { color: #8a8278; }
.mem-polaroid .mem-title { font-family: 'LXGW WenKai TC', var(--font); }

/* ───────── IG ───────── */
.ig-posts { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ig-posts .instagram-media { margin: 0 !important; min-width: 0 !important; width: 100% !important; border-radius: var(--radius) !important; }
.ig-posts blockquote:not(iframe) { background: var(--surface); padding: 20px; text-align: center; border-radius: var(--radius); }

/* ───────── 想說的話 ───────── */
.note { text-align: center; padding: 26px 22px; }
.note-text { white-space: pre-line; font-size: 17px; line-height: 1.9; }
.note-sign { margin-top: 14px; color: var(--muted); font-size: 14px; }

/* ───────── 頁尾 ───────── */
.foot { text-align: center; color: var(--muted); font-size: 13px; padding-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lock-btn { background: none; border: 0; color: var(--muted); opacity: .45; padding: 10px; cursor: pointer; }
.lock-btn:hover { opacity: .9; }

/* ───────── 燈箱 ───────── */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(8,8,10,.93); display: grid; place-items: center; touch-action: pan-y; }
.lightbox img { max-width: 100vw; max-height: 86svh; object-fit: contain; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer; }
.lb-close { top: calc(env(safe-area-inset-top, 0px) + 14px); right: 14px; }
.lb-prev { left: 10px; top: 50%; translate: 0 -50%; }
.lb-next { right: 10px; top: 50%; translate: 0 -50%; }
.lightbox.single .lb-prev, .lightbox.single .lb-next { display: none; }
.lb-count { position: absolute; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); color: rgba(255,255,255,.75); font: 13px system-ui, sans-serif; }

@media (prefers-reduced-motion: reduce) {
  .pair-heart, .side-heart { animation: none; }
}

/* ───────── 進場畫面 ───────── */
body.gated { overflow: hidden; }
.intro {
  position: fixed; inset: 0; z-index: 95;
  display: grid; place-items: center; text-align: center;
  padding: 24px; cursor: pointer; overflow: hidden;
  background: var(--bg); color: var(--text);
  opacity: 0; transition: opacity .7s ease;
  -webkit-tap-highlight-color: transparent; outline: none;
}
.intro::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 62%);
}
.intro.show { opacity: 1; }
.intro.out { opacity: 0; pointer-events: none; }
.intro-bg { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(16px) brightness(.5); transform: scale(1.08); }
.intro.has-cover { color: #fff; }
.intro.has-cover::before { display: none; }
.intro-inner { position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px; transition: transform .9s cubic-bezier(.2,.7,.2,1), filter .9s; }
.intro.out .intro-inner { transform: scale(1.06); filter: blur(6px); }
.intro-title { font-size: clamp(26px, 8vw, 34px); line-height: 1.25; margin-top: 4px; }
.intro-cta {
  margin-top: 22px; font-size: 13.5px; letter-spacing: .4em; padding-left: .4em;
  animation: breathe 2.6s ease-in-out infinite;
}
.intro-minimal .intro-cta { margin-top: 0; font-size: 16px; }
.intro-sub { font-size: 14px; opacity: .7; }
.intro-sound { font: 11px system-ui, sans-serif; letter-spacing: .25em; opacity: .45; margin-top: 2px; }
@keyframes breathe { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

/* ───────── 音樂播放器 ───────── */
.mp {
  position: fixed; z-index: 45; left: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  font-family: system-ui, -apple-system, 'PingFang TC', 'Noto Sans TC', sans-serif; color: var(--text);
}
.mp button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mp button svg { width: 20px; height: 20px; }

.mp-pill {
  display: flex; align-items: center; gap: 4px; padding: 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 0 0 1px var(--line), 0 10px 26px -12px color-mix(in srgb, var(--text) 45%, transparent);
}
.mp-open { display: flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0 6px 0 0; font-size: 13px; max-width: 150px; min-width: 0; }
.mp-pill-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mp-mini-disc, .mp-disc {
  border-radius: 50%; flex: none; position: relative;
  background: repeating-radial-gradient(circle, #1d1d1d 0 1.5px, #0d0d0d 1.5px 3.5px);
  animation: spin 6s linear infinite paused;
}
.mp-mini-disc { width: 32px; height: 32px; }
.mp-mini-disc::after { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: var(--accent); }
.mp.playing .mp-mini-disc, .mp.playing .mp-disc { animation-play-state: running; }
@keyframes spin { to { transform: rotate(360deg); } }
.mp-pill-toggle { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent) !important; display: grid; place-items: center; flex: none; }
.mp-pill-toggle svg { width: 16px; height: 16px; }

.mp-panel {
  position: absolute; left: 0; bottom: calc(100% + 10px);
  width: min(320px, calc(100vw - 28px));
  padding: 16px 16px 12px; border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px -20px rgba(0,0,0,.5);
  transform-origin: bottom left;
  transition: opacity .22s ease, transform .22s ease;
}
.mp.mini .mp-panel { opacity: 0; transform: translateY(8px) scale(.96); pointer-events: none; }
.mp-hide { position: absolute; top: 8px; right: 8px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--surface) 70%, transparent); display: grid; place-items: center; }

.mp-media { display: flex; justify-content: center; margin-bottom: 12px; }
.mp-video { width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.mp-video iframe { width: 100%; height: 100%; display: block; border: 0; }
.mp[data-source="files"] .mp-video, .mp[data-source="youtube"] .mp-disc { display: none; }
.mp-disc { width: 140px; height: 140px; display: grid; place-items: center; box-shadow: 0 12px 30px -12px rgba(0,0,0,.55); }
.mp-disc span { width: 44%; height: 44%; border-radius: 50%; background: var(--accent) center / cover no-repeat; border: 3px solid #0d0d0d; }

.mp-meta { text-align: center; min-width: 0; }
.mp-title { font-weight: 700; font-size: 15.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mp-artist { font-size: 12.5px; color: var(--muted); min-height: 1.4em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.mp-progress { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mp input[type=range] {
  flex: 1; min-width: 0; height: 4px; margin: 10px 0; border-radius: 4px;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background: linear-gradient(var(--accent), var(--accent)) 0 / var(--p, 0%) 100% no-repeat, var(--line);
}
.mp-volume { --p: 70%; }
.mp input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 0; }
.mp input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 0; }

.mp-ctrls { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 4px; }
.mp-ctrls button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; }
.mp-ctrls .mp-big { width: 58px; height: 58px; background: var(--accent); color: var(--on-accent); }
.mp-ctrls .mp-big svg { width: 24px; height: 24px; }
.mp-shuffle { opacity: .35; }
.mp.shuffle-on .mp-shuffle { opacity: 1; color: var(--accent); }
.mp[data-source="youtube"] .mp-listbtn { visibility: hidden; }

.mp-vol { display: flex; align-items: center; gap: 8px; }
.mp-vol button { width: 36px; height: 36px; border: 0; background: none; display: grid; place-items: center; flex: none; }
.mp.muted .mp-vol button { color: var(--accent); }
.mp-note { font-size: 12px; color: var(--muted); }

.mp-list { list-style: none; margin: 6px 0 0; padding: 6px 0 0; border-top: 1px solid var(--line); max-height: 190px; overflow-y: auto; }
.mp-list button { width: 100%; text-align: left; border: 0; background: none; padding: 8px 6px; border-radius: 10px; display: flex; flex-direction: column; }
.mp-list button span { font-size: 14px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mp-list button small { font-size: 11.5px; color: var(--muted); }
.mp-list button.on { color: var(--accent); background: var(--soft); font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .mp-mini-disc, .mp-disc, .intro-cta { animation: none; }
}
body.has-music .page { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); }


/* ═════════ 特效與進階樣式 ═════════ */

/* 特效畫布 */
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fx-back { z-index: 0; }
.fx-front { z-index: 6; }

/* 出場動畫 */
body[data-reveal="zoom"] .reveal { transform: scale(.94); }
body[data-reveal="blur"] .reveal { transform: none; filter: blur(10px); transition: opacity .9s ease, filter .9s ease; }
body[data-reveal="none"] .reveal { opacity: 1; transform: none; transition: none; }
body .reveal.in, .no-reveal body .reveal { opacity: 1; transform: none; filter: none; }

/* 標題特效 */
.hero-cover, .intro.has-cover { --tt: #fff; }
body[data-title="shimmer"] :is(.hero-title, .intro-title) {
  background: linear-gradient(90deg, var(--tt, var(--text)) 0%, var(--tt, var(--text)) 35%, var(--accent) 50%, var(--tt, var(--text)) 65%, var(--tt, var(--text)) 100%) 0 0 / 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 4.5s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: 0 0; } }
body[data-title="glow"] :is(.hero-title, .intro-title) { animation: glow 3.2s ease-in-out infinite; }
@keyframes glow {
  0%, 100% { text-shadow: 0 0 14px color-mix(in srgb, var(--accent) 65%, transparent), 0 0 38px color-mix(in srgb, var(--accent) 35%, transparent); }
  50% { text-shadow: 0 0 6px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 18px color-mix(in srgb, var(--accent) 20%, transparent); }
}

/* 背景：流動漸層 */
body[data-pattern="gradient"]::before {
  inset: -20%;
  background:
    radial-gradient(38% 32% at 22% 18%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    radial-gradient(42% 36% at 82% 40%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    radial-gradient(48% 40% at 30% 82%, color-mix(in srgb, var(--muted) 24%, transparent), transparent 70%);
  animation: drift 20s ease-in-out infinite alternate;
}
@keyframes drift { to { transform: translate3d(4%, -3%, 0) scale(1.1) rotate(4deg); } }

/* 卡片：毛玻璃 */
body[data-card="glass"] :is(.card, .link-btn) {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid color-mix(in srgb, #fff 50%, transparent);
  box-shadow: 0 10px 30px -14px color-mix(in srgb, var(--text) 30%, transparent);
}
body[data-card="glass"][data-dark] :is(.card, .link-btn) { border-color: color-mix(in srgb, #fff 12%, transparent); }

/* 卡片：柔軟立體（新擬態） */
body[data-card="neo"] :is(.card, .link-btn) {
  background: var(--bg);
  box-shadow: 7px 7px 16px color-mix(in srgb, var(--text) 16%, var(--bg)), -7px -7px 16px color-mix(in srgb, #fff 80%, var(--bg));
}
body[data-card="neo"][data-dark] :is(.card, .link-btn) {
  box-shadow: 7px 7px 16px rgba(0,0,0,.5), -6px -6px 14px color-mix(in srgb, #fff 7%, var(--bg));
}
body[data-card="neo"] .link-btn:active { box-shadow: inset 4px 4px 10px color-mix(in srgb, var(--text) 16%, var(--bg)), inset -4px -4px 10px color-mix(in srgb, #fff 80%, var(--bg)); }

/* 卡片：粗框（Y2K） */
body[data-card="brutal"] :is(.card, .link-btn) { background: var(--surface); border: 2px solid var(--text); box-shadow: 5px 5px 0 var(--text); }
body[data-card="brutal"] .day-hero { border: 2px solid var(--text) !important; }
body[data-card="brutal"] .link-btn { transition: transform .1s, box-shadow .1s; }
body[data-card="brutal"] .link-btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--text); }
body[data-card="brutal"] .avatar { border-color: var(--text); border-width: 2.5px; }

/* 卡片：紙膠帶 */
body[data-card="tape"] :is(.card, .link-btn) {
  position: relative; background: var(--surface);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 12px 22px -16px rgba(0,0,0,.45);
}
body[data-card="tape"] .card::before {
  content: ''; position: absolute; z-index: 2; top: -10px; left: 50%; width: 80px; height: 22px;
  translate: -50% 0; rotate: -3deg;
  background: color-mix(in srgb, var(--accent) 40%, transparent);
  clip-path: polygon(0 8%, 4% 0, 96% 6%, 100% 0, 98% 50%, 100% 94%, 95% 100%, 5% 94%, 0 100%, 2% 50%);
}
body[data-card="tape"] .people .card:nth-child(even)::before, body[data-card="tape"] .tl-item:nth-child(even) .card::before { rotate: 4deg; }
body[data-card="tape"] .mem { overflow: visible; }
body[data-card="tape"] .mem .strip-wrap { border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; }
body[data-card="tape"] .counter { rotate: -.6deg; }
body[data-card="tape"] .note { rotate: .6deg; }

/* 卡片：漸層框 */
body[data-card="gradient"] :is(.card, .link-btn) {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 25%, var(--surface)) 50%, var(--accent)) border-box;
  box-shadow: 0 12px 30px -18px var(--accent);
}
/* 進場畫面時特效也顯示在最上層 */
body.gated .fx { z-index: 96; }

/* ═════════ 節日裝飾與祝福 ═════════ */
.fest-banner { text-align: center; }
.fest-banner span {
  display: inline-block; padding: 8px 18px; border-radius: 999px;
  background: var(--soft); color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: .04em;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent), 0 8px 22px -12px var(--accent);
  animation: banner-glow 3s ease-in-out infinite;
}
.fest-banner i { font-style: normal; opacity: .5; margin: 0 4px; }
.fest-banner span { max-width: 100%; border-radius: 20px; line-height: 1.6; }
.fest-banner b { font-weight: inherit; white-space: nowrap; display: inline-block; }
body[data-deco="lanterns"] .fest-banner { padding-inline: 52px; }
@keyframes banner-glow { 50% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent), 0 8px 28px -8px var(--accent); } }
.intro-fest { font-size: 13.5px; font-weight: 600; color: var(--accent); margin-top: -2px; }
.intro.has-cover .intro-fest { color: #fff; }

.deco { position: absolute; top: 0; left: 0; right: 0; height: 0; z-index: 7; pointer-events: none; }
body.gated .deco { position: fixed; z-index: 97; }

/* 春節燈籠 */
.lantern { position: absolute; top: -4px; transform-origin: 50% 0; animation: swing 3.4s ease-in-out infinite; filter: drop-shadow(0 6px 14px rgba(200, 30, 20, .35)); }
.lantern.l1 { left: 10px; }
.lantern.l2 { right: 10px; animation-delay: -1.7s; }
.lantern svg { display: block; width: 50px; height: 100px; }
@keyframes swing { 0%, 100% { rotate: -5deg; } 50% { rotate: 5deg; } }

/* 中秋月亮 */
.moon {
  position: absolute; top: calc(env(safe-area-inset-top, 0px) + 18px); right: 18px; width: 72px; height: 72px; border-radius: 50%;
  background:
    radial-gradient(circle at 62% 38%, rgba(214, 170, 80, .28) 0 7%, transparent 8%),
    radial-gradient(circle at 38% 64%, rgba(214, 170, 80, .22) 0 10%, transparent 11%),
    radial-gradient(circle at 70% 70%, rgba(214, 170, 80, .18) 0 5%, transparent 6%),
    radial-gradient(circle at 35% 32%, #fffdf0, #f8e6a8 58%, #eccb73);
  box-shadow: 0 0 34px 10px rgba(255, 216, 130, .45), 0 0 110px 40px rgba(255, 206, 110, .18);
  animation: moon-glow 5s ease-in-out infinite;
}
@keyframes moon-glow { 50% { box-shadow: 0 0 44px 14px rgba(255, 216, 130, .55), 0 0 130px 50px rgba(255, 206, 110, .22); } }

/* 聖誕燈串 */
.lights { position: absolute; top: env(safe-area-inset-top, 0px); left: 0; right: 0; height: 36px; }
.lights svg { position: absolute; inset: 0 0 auto; width: 100%; height: 24px; }
.moon, .lights, .lantern { will-change: auto; }
.lights i {
  position: absolute; top: 11px; width: 9px; height: 14px; margin-left: -4.5px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: var(--c); box-shadow: 0 3px 12px 2px var(--c);
  animation: bulb 1.4s ease-in-out var(--d) infinite alternate;
}
.lights i::before { content: ''; position: absolute; top: -3px; left: 2px; width: 5px; height: 4px; border-radius: 1px; background: #3a4a3a; }
@keyframes bulb { to { opacity: .35; box-shadow: 0 2px 4px 0 var(--c); } }
body[data-deco="lights"] .page { padding-top: calc(env(safe-area-inset-top, 0px) + 50px); }
body[data-deco="lights"] .hero-cover { margin-top: calc(-50px - env(safe-area-inset-top, 0px)); }

@media (prefers-reduced-motion: reduce) {
  .lantern, .moon, .lights i, .fest-banner span { animation: none; }
}
