:root {
  color-scheme: dark;
  --ink: #eff8f7;
  --muted: #a3b3c5;
  --mint: #b1f0df;
  --line: rgba(191, 215, 240, .2);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #05050d;
  color: var(--ink);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; background: #03040b; }
body { margin: 0; min-width: 280px; overflow: hidden; overscroll-behavior: none; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--mint); outline-offset: 5px; }
[hidden] { display: none !important; }
#gift { position: relative; width: 100%; height: 100svh; height: 100dvh; overflow: hidden; isolation: isolate; background: radial-gradient(ellipse at 50% 52%, #101329 0%, #080914 35%, #05050d 70%); }
#universe { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
body.is-dragging #universe, body.is-dragging .orbit-card { cursor: grabbing; }
.topbar { position: absolute; z-index: 5; inset: calc(20px + env(safe-area-inset-top, 0px)) 24px auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; pointer-events: none; }
.wordmark { font-size: .75rem; letter-spacing: .2em; color: #9ca6b9; }
.top-actions { display: flex; gap: 8px; pointer-events: auto; }
.icon-button { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: rgba(9, 13, 25, .72); color: #dcebe8; box-shadow: inset 0 0 18px rgba(153, 206, 221, .035), 0 8px 28px rgba(0, 0, 0, .2); backdrop-filter: blur(9px); }
.icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.sound-off { position: absolute; left: 10px; top: 20px; width: 24px; height: 1px; background: #dcebe8; transform: rotate(-45deg); box-shadow: 0 1px 0 #0a101c; }
#soundButton[aria-pressed="true"] .sound-off { display: none; }
.play-mark { display: none; }
#motionButton[aria-pressed="true"] .play-mark { display: block; }
#motionButton[aria-pressed="true"] .pause-mark { display: none; }
.welcome { position: absolute; z-index: 2; left: 22px; right: 22px; top: 43%; transform: translateY(-40%); text-align: center; transition: opacity .55s ease, transform .55s ease, filter .55s ease; }
.eyebrow { margin: 0 0 22px; font-size: .8125rem; letter-spacing: .22em; color: #adc4ce; line-height: 1.7; }
.welcome h1 { margin: 0; font-family: "Songti SC", "STSong", "SimSun", serif; font-size: clamp(2rem, 5.6vw, 3.4rem); font-weight: 400; line-height: 1.65; letter-spacing: .07em; text-shadow: 0 0 45px #a4c5ff40; white-space: pre-line; overflow-wrap: anywhere; }
.welcome-note { margin: 22px 0 40px; font-size: 1rem; color: var(--muted); line-height: 1.8; }
.glow-button { border: 1px solid #d4fff099; min-height: 50px; padding: 14px 27px; border-radius: 999px; font-size: .9375rem; letter-spacing: .08em; color: #062722; background: linear-gradient(110deg, #e4f7ec, #84dfcd); box-shadow: 0 0 18px #7dedcd4a, 0 0 65px #79baa526; transition: box-shadow .25s ease, transform .25s ease; touch-action: manipulation; }
.glow-button span { margin-left: 12px; }
.glow-button:hover { box-shadow: 0 0 30px #7dedcd55, 0 0 90px #79baa528; transform: translateY(-2px); }
.glow-button:active { transform: scale(.98); }
body[data-view="intro"] .welcome { opacity: 0; transform: translateY(-48%) scale(.98); filter: blur(3px); pointer-events: none; }
.scene-overlay { position: absolute; z-index: 2; inset: 0; pointer-events: none; }
.scene-caption { position: absolute; top: max(calc(78px + env(safe-area-inset-top, 0px)), 11%); left: 25px; right: 25px; text-align: center; pointer-events: none; }
.scene-caption .eyebrow { margin-bottom: 12px; color: #8ca2b5; font-size: .75rem; }
.scene-caption h1 { margin: 0; color: #d4fff0; font-family: "Songti SC", "STSong", "SimSun", serif; font-size: clamp(1.6rem, 4.6vw, 2.3rem); font-weight: 400; letter-spacing: .09em; line-height: 1.5; }
.scene-caption p:last-child { margin: 13px auto 0; max-width: 38em; font-size: .9375rem; color: var(--muted); line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
body[data-view="intro"] .scene-caption { opacity: 0; }
body[data-view="cake"] .scene-caption, body[data-view="photos"] .scene-caption { animation: caption-in .65s ease both; }
.gesture-hint { position: absolute; bottom: calc(133px + env(safe-area-inset-bottom, 0px)); width: calc(100% - 40px); left: 20px; margin: 0; text-align: center; font-size: .875rem; color: #9baec1; line-height: 1.6; }
body[data-view="intro"] .gesture-hint { opacity: 0; }
.scene-controls { position: absolute; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); left: 20px; right: 20px; display: flex; justify-content: center; flex-wrap: wrap; gap: 9px; pointer-events: auto; }
.pill { min-height: 44px; border: 1px solid #8daccd40; border-radius: 999px; padding: 10px 16px; font-size: .875rem; line-height: 1.6; background: #111527c9; color: #c4d3e5; white-space: nowrap; backdrop-filter: blur(10px); touch-action: manipulation; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.pill[aria-pressed="true"] { color: #c8fcf0; background: #162b30dd; border-color: #87cfc273; }
.pill--mint { color: #c9f8ec; border-color: #86d3be66; background: #102521bb; }
.pill:hover { border-color: #b6e6deaa; }
.pill:active { transform: scale(.96); }
.bottom-mark { position: absolute; bottom: calc(25px + env(safe-area-inset-bottom, 0px)); left: 16px; right: 16px; text-align: center; font-size: .75rem; letter-spacing: .16em; color: #728195; line-height: 1.6; pointer-events: none; }
.photo-orbit { position: absolute; inset: 0; pointer-events: none; }
body[data-view="photos"] .photo-orbit { animation: orbit-in .95s .28s ease both; }
.orbit-card { position: absolute; width: 72px; height: 96px; padding: 3px; border: 1px solid #d8f6ef75; border-radius: 7px; background: #13202be8; pointer-events: auto; box-shadow: 0 0 20px #9cdcf12b, 0 12px 34px #0007; will-change: transform, opacity; touch-action: none; overflow: hidden; user-select: none; }
.orbit-card::after { content: ""; position: absolute; inset: 3px; border-radius: 3px; pointer-events: none; background: linear-gradient(125deg, rgba(255,255,255,.16), transparent 28%, transparent 70%, rgba(174,255,235,.08)); }
.orbit-card img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 2px; background: #080c16; }
.orbit-card:focus-visible { outline-offset: 6px; }
.orbit-card:active { box-shadow: 0 0 30px #b2fbe754, 0 6px 22px #0009; }
.wish-panel { position: absolute; inset: 0; padding: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: radial-gradient(ellipse, #080a1699, transparent 65%); pointer-events: none; }
.wish-panel h2 { margin: 0 0 22px; font-family: "Songti SC", "STSong", "SimSun", serif; font-weight: 400; font-size: clamp(1.85rem, 5vw, 3rem); line-height: 1.6; }
.wish-panel > p:not(.eyebrow) { max-width: 35em; font-size: 1rem; line-height: 2; color: #c6d8e7; white-space: pre-line; overflow-wrap: anywhere; }
.wish-panel .signature { margin: 14px 0 38px; color: #b9f2dd !important; }
.wish-panel .pill { pointer-events: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
dialog { width: min(92vw, 470px); max-height: min(calc(100dvh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)), 850px); border: 1px solid #8db3c073; border-radius: 20px; padding: 28px 24px 24px; background: linear-gradient(155deg, #10182a, #090e1a 72%); color: #eaf5f5; overflow-x: hidden; overscroll-behavior: contain; box-shadow: 0 20px 120px #000c, inset 0 0 60px rgba(117, 185, 205, .035); }
dialog::backdrop { background: #03050dde; }
dialog:not([open]) { display: none; }
.close-memory { position: absolute; right: 14px; top: 12px; }
dialog .eyebrow { margin: 0 50px 24px 0; font-size: .75rem; min-height: 20px; }
.memory-image-wrap { width: 100%; height: min(49dvh, 460px); background: #070b15; display: grid; place-items: center; border: 1px solid rgba(166, 205, 219, .1); border-radius: 9px; overflow: hidden; touch-action: pan-y; }
.memory-image-wrap img { display: block; max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; }
#memoryFallback { color: #bddbcf; font: 1.2rem "Songti SC", serif; }
dialog h2 { font-family: "Songti SC", "SimSun", serif; font-size: 1.4rem; font-weight: 400; line-height: 1.6; margin: 20px 0 8px; }
#memoryText { color: #aebed0; font-size: .9375rem; line-height: 1.8; margin: 0; white-space: pre-line; }
.memory-navigation { margin-top: 22px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.swipe-note { font-size: .75rem; color: #92a1b7; }
.canvas-fallback { position: absolute; inset: 38% 25px auto; text-align: center; font: 1.8rem "Songti SC", serif; color: #d4fff0; pointer-events: none; line-height: 1.8; }
.noscript { position: absolute; inset: auto 24px 90px; text-align: center; color: #cbece3; }
@media (min-width: 800px) { .topbar { inset-inline: 42px; } .orbit-card { width: 86px; height: 114px; } .scene-controls { gap: 14px; } .pill { padding-inline: 23px; } }
@media (max-width: 350px) { .topbar { inset-inline: 16px; } .wordmark { letter-spacing: .1em; } .scene-controls { left: 10px; right: 10px; gap: 6px; } .pill { padding-inline: 12px; } .swipe-note { display: none; } .orbit-card { width: 58px; height: 78px; } }
@media (max-height: 650px) { .scene-caption { top: 85px; } .scene-caption .eyebrow { margin-bottom: 6px; } .scene-caption p:last-child { margin-top: 6px; } .gesture-hint { bottom: calc(113px + env(safe-area-inset-bottom, 0px)); } .scene-controls { bottom: calc(55px + env(safe-area-inset-bottom, 0px)); } .bottom-mark { bottom: calc(17px + env(safe-area-inset-bottom, 0px)); } .welcome-note { margin: 15px 0 27px; } }
@media (orientation: landscape) and (max-height: 600px) { .scene-caption { top: 70px; left: 15px; width: 30%; right: auto; text-align: left; } .scene-caption .eyebrow { display: none; } .scene-caption h1 { font-size: 1.4rem; } .scene-caption p:last-child { font-size: .875rem; } .gesture-hint { bottom: 88px; } .scene-controls { bottom: 34px; } .bottom-mark { display: none; } .welcome { top: 45%; } .welcome h1 { font-size: 1.75rem; line-height: 1.3; } .welcome .eyebrow { margin-bottom: 10px; } .welcome-note { margin: 12px 0 18px; } }
@media (max-width: 600px) { dialog { width: calc(100vw - 20px); padding: 24px 18px 20px; border-radius: 18px; } dialog .eyebrow { margin-bottom: 18px; } .memory-navigation { margin-top: 18px; } }
@media (max-height: 540px) and (orientation: portrait) { .scene-caption { top: 76px; } .scene-caption .eyebrow { display: none; } .scene-caption p:last-child { margin-top: 5px; font-size: .82rem; } .gesture-hint { bottom: 103px; font-size: .78rem; } .scene-controls { bottom: 49px; } .bottom-mark { display: none; } dialog h2 { margin-top: 15px; } #memoryText { line-height: 1.65; } .memory-image-wrap { height: 36dvh; } }
@keyframes caption-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes orbit-in { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
