:root {
  color-scheme: dark;
  --midnight: #141c37;
  --cream: #f6eedc;
  --peach: #f1ad96;
  --gold: #e6c18e;
  --muted: #c3c4ce;
  --serif: "Songti SC","STZhongsong","华文中宋","Noto Serif CJK SC","Source Han Serif SC","SimSun","宋体",serif;
  --sans: "Inter","PingFang SC","Microsoft YaHei","Noto Sans CJK SC",sans-serif;
  --mono: "IBM Plex Mono",Consolas,"Courier New",monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 280px; }
body { margin: 0; background: var(--midnight); color: var(--cream); font-family: var(--sans); }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, html[data-input="keyboard"] #skip:focus { outline: 2px solid var(--gold); outline-offset: 6px; }
.scene-anchor:focus, #sealedTitle:focus, #letterTitle:focus, html[data-input="pointer"] #skip:focus { outline: none; box-shadow: none; }
button:disabled { cursor: default; }
button, h1, h2, h3, p { margin: 0; }
.icon-defs, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.icon { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sky { position: absolute; inset: 0 0 auto; height: max(100svh, 750px); pointer-events: none; z-index: -2;
  background: url("campus-night.svg") center bottom 81px / 100% calc(100% - 81px) no-repeat, radial-gradient(ellipse at 69% 55%,#2a365a 0%,#202b4a 30%,#18223e 58%,#121a33 100%); }
.grain { position: fixed; inset: 0; pointer-events: none; z-index: 8; background: url("paper-grain.png"); opacity: .17; }
.airmail-rule, .letter-rule { height: 5px; background: repeating-linear-gradient(122deg,#cf897e 0 13px,#d7d0ba 13px 24px,#69778c 24px 37px,#d7d0ba 37px 49px); }
.airmail-rule { opacity: .93; }
.shell { width: 100%; min-height: calc(100svh - 5px); display: flex; flex-direction: column; }
.masthead { height: 81px; width: min(89%,1420px); margin: 0 auto; flex-shrink: 0; border-bottom: 1px solid #c5c5ce30; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 13px; font: 600 1.3rem var(--serif); letter-spacing: .09em; }
.brand-icon { display: inline-grid; position: relative; place-items: center; color: var(--peach); transform: rotate(-9deg); }
.brand-icon .icon { width: 34px; height: 34px; stroke-width: 1.3; }
.brand-icon i { position: absolute; top: -2px; right: -4px; font-size: 13px; line-height: 1; background: #17203a; color: var(--gold); }
.brand-en { font: 500 .77rem var(--mono); letter-spacing: .15em; color: #b1b6c6; border-left: 1px solid #9295a266; padding-left: 16px; margin-left: 3px; }
.audio-button { display: flex; align-items: center; gap: 9px; border: 1px solid #b5b9c24d; padding: 8px 15px; border-radius: 99px; color: #e0dfdf; background: #17213b66; font-size: .875rem; }
.audio-button .icon { width: 16px; height: 16px; }
.sound-control { position: relative; }
.audio-hint { position: absolute; top: calc(100% + 4px); right: 0; width: max-content; color: var(--muted); font-size: .78rem; line-height: 1.25; }
.audio-button:hover { border-color: #e1c09c; color: var(--cream); }
.home { flex: 1; display: flex; flex-direction: column; }
.hero { flex: 1; display: grid; grid-template-columns: 46% 54%; width: min(84%,1250px); margin: 0 auto; align-items: center; min-height: 565px; padding: clamp(40px,5.8vh,90px) 0 clamp(92px,13vh,145px); }
.intro { position: relative; z-index: 1; }
.kicker { display: inline-flex; align-items: center; gap: .7rem; margin-bottom: 1.65rem; font-size: .87rem; line-height: 1.2; font-weight: 500; letter-spacing: .16em; color: var(--gold); }
.kicker i { width: 24px; height: 1px; background: var(--gold); opacity: .65; }
.tiny-star { font-size: 1.1rem; }
h1 { font: 600 clamp(3.15rem,5.25vw,5rem)/1.25 var(--serif); letter-spacing: .035em; white-space: nowrap; }
h1 > span { color: #f5b59d; }
.bang { margin-left: -.08em; }
.lead { font-size: clamp(1rem,1.2vw,1.16rem); line-height: 1.95; letter-spacing: .055em; color: #d1d2d9; margin: 1.25rem 0 1.85rem; }
.launch { display: flex; align-items: flex-start; flex-direction: column; gap: 12px; }
.press-button { position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: .85rem; border: 1px solid #ffd8c2; border-radius: 8px; padding: 0 26px; min-height: 56px; font-weight: 650; letter-spacing: .08em; font-size: 1.04rem; color: #362735; background: #efb198; box-shadow: 0 3px 0 #be806f,0 8px 24px #0a10232e; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .18s,box-shadow .18s; }
.press-button:hover { transform: translateY(-2px); box-shadow: 0 4px 0 #be806f,0 10px 28px #0a10234d; }
.press-button.holding { transform: translateY(1px); box-shadow: 0 1px 0 #be806f; }
.press-button > * { pointer-events: none; }
.press-button .icon { width: 23px; height: 23px; }
.press-fill { position: absolute; inset: 0; background: #ffdc9c; transform: scaleX(var(--hold,0)); transform-origin: left; z-index: -1; }
.hint { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; line-height: 1.5; letter-spacing: .03em; color: #b7bdcd; }
.hold-meter { display: inline-flex; gap: 2px; }
.hold-meter i { height: 5px; width: 4px; border: 1px solid #d2bd9b80; border-radius: 1px; }
.hold-meter i:first-child { background: var(--gold); }
.art { width: 100%; aspect-ratio: 1.33; position: relative; align-self: center; margin-top: 1%; }
.envelope { width: 93%; height: auto; position: absolute; left: 3%; top: 6.5%; transform: rotate(-9deg); filter: drop-shadow(0 18px 17px #090f2550); user-select: none; }
.seal-hit { position: absolute; left: 46.4%; top: 55.8%; width: 19%; aspect-ratio: 1; transform: translate(-50%,-50%); border: 0; border-radius: 50%; background: transparent; touch-action: manipulation; -webkit-touch-callout: none; user-select: none; }
.seal-hit:active, .seal-hit:focus-visible { box-shadow: 0 0 0 3px #efc397b0, 0 0 22px #f5c6888c; }
.postmark { width: 30%; max-width: 152px; position: absolute; top: -6.5%; right: -3.5%; transform: rotate(11deg); color: #afa5a1; opacity: .66; }
.flight { position: absolute; width: 110%; height: 110%; left: -7%; top: -1%; color: #cab99b; opacity: .48; }
.handwriting { position: absolute; width: 48%; height: auto; max-height: 22%; object-fit: contain; bottom: -2.5%; right: 7%; transform: rotate(-8deg); opacity: .95; }
.dispatch { position: relative; padding: 19px 5.5%; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #121b31f5; border-top: 1px solid #d5c8b231; min-height: 81px; }
.dispatch-items { display: flex; align-items: center; }
.dispatch-item { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding-right: clamp(25px,4vw,78px); margin-right: clamp(25px,3vw,60px); border-right: 1px solid #a5adbd32; }
.dispatch-item:last-child { margin: 0; border: 0; padding-right: 0; }
.meta-label { font: .75rem/1.2 var(--mono); color: #adb3c2; letter-spacing: .08em; white-space: nowrap; }
.meta-label b { font-weight: normal; color: #ccab8d; }
.dispatch-item strong { font-weight: 500; font-size: .95rem; color: #e6dfd2; letter-spacing: .12em; }
.ticket-code { display: flex; flex-direction: column; align-items: center; gap: 3px; font: .75rem var(--mono); letter-spacing: .09em; color: #bcb7ad; opacity: .8; }
.bars { width: 128px; height: 20px; background: repeating-linear-gradient(90deg,#bcb7ad 0 2px,transparent 2px 4px,#bcb7ad 4px 5px,transparent 5px 8px,#bcb7ad 8px 12px,transparent 12px 14px,#bcb7ad 14px 15px,transparent 15px 19px); }
.show { position: fixed; inset: 0; z-index: 10; background: #141a33; display: grid; place-items: center; }
.show canvas { width: 100%; height: 100%; display: block; }
#skip { position: absolute; top: max(22px,env(safe-area-inset-top)); right: max(22px,env(safe-area-inset-right)); color: var(--cream); border: 0; background: transparent; padding: .65rem 1rem; font-size: .875rem; }
#skip:hover { text-decoration: underline; text-underline-offset: .25em; }
.show-footer { position: absolute; bottom: 9%; letter-spacing: .18em; text-align: center; font: 1rem var(--serif); color: #e8decf; }
.show-footer b { font-size: .85rem; color: var(--gold); padding: 0 .6rem; }
.delivery { width: 100%; flex: 1; margin: 0 auto; padding: clamp(36px,6vh,75px) 18px 35px; }
.letter-wrap { width: min(650px,100%); margin: 0 auto; text-align: center; }
.delivery-kicker { display: flex; justify-content: center; align-items: center; gap: 14px; letter-spacing: .18em; font-size: .84rem; color: var(--gold); margin-bottom: 23px; }
.delivery-kicker span { font-size: .72rem; }
.sealed h2 { font: 600 clamp(2.4rem,4vw,3.7rem)/1.4 var(--serif); letter-spacing: .05em; }
.unseal { display: flex; flex-direction: column; align-items: center; gap: 18px; width: min(380px,85%); border: none; background: transparent; color: var(--cream); margin: 22px auto 26px; }
.unseal img { width: 100%; height: auto; transform: rotate(-6deg); transition: transform .4s; filter: drop-shadow(0 8px 10px #0b102c70); }
.unseal:hover img { transform: translateY(-3px) rotate(-3deg); }
.unseal span { display: inline-flex; align-items: center; gap: 10px; background: var(--peach); color: #362735; border: 1px solid #fbd3bd; padding: 10px 22px; border-radius: 7px; }
.end-actions { display: flex; align-items: center; justify-content: center; gap: 12px; color: #aeacac; margin: 18px 0 5px; }
.end-actions button { display: inline-flex; align-items: center; gap: 6px; padding: 8px; background: none; color: #d0ced3; border: 0; font-size: .875rem; }
.end-actions button:hover { color: var(--gold); }
.end-actions .icon { width: 16px; height: 16px; }
.letter { position: relative; text-align: left; overflow: hidden; color: #393344; background: linear-gradient(#f7edd9ce,#f7edd9ce), #f7edd9 url("paper-grain.png"); border-radius: 3px; box-shadow: 0 15px 50px #070b2040; padding: 30px clamp(22px,4vw,58px) 34px; animation: unfold .55s ease-out both; }
.letter-rule { position: absolute; inset: 0 0 auto; }
.letter-metadata { display: flex; justify-content: space-between; color: #756b67; font: .79rem var(--mono); letter-spacing: .12em; padding-bottom: 14px; border-bottom: 1px solid #5a4c462e; margin-bottom: 22px; }
.letter-metadata i { font-style: normal; color: #a46452; }
.letter h2 { color: #433948; font: 600 clamp(1.75rem,4vw,2.15rem)/1.5 var(--serif); margin-bottom: 12px; }
.letter > p { font: 1.06rem/1.95 var(--serif); letter-spacing: .03em; margin-bottom: 12px; }
.letter .signoff { margin: 18px 0 23px; }
.signoff span { display: block; text-align: right; color: #77594d; font-family: "STKaiti","KaiTi",var(--serif); font-size: 1.3rem; }
.signoff span.ink-star { display: inline; font-size: 1rem; margin-left: 5px; }
.wish-area { display: flex; align-items: center; gap: 23px; padding-top: 23px; border-top: 1px dashed #9e8a71; }
.wish-stamp { flex: 0 0 85px; position: relative; height: 108px; display: grid; justify-content: center; align-content: end; border: 5px dotted #f7edd9; outline: 1px dashed #bd9e87; background: #516782; color: #fae4ba; text-align: center; transform: rotate(-5deg); margin: 3px; }
.stamp-value { position: absolute; top: 4px; left: 7px; font: italic 1.3rem Georgia,serif; }
.stamp-date { display: block; margin: 8px 0 6px; font: .65rem var(--mono); letter-spacing: .13em; }
.cake { position: relative; width: 49px; height: 18px; background: #e3aa87; border-radius: 4px 4px 2px 2px; box-shadow: inset 0 -5px #cc8779; }
.cake-base { position: absolute; height: 2px; inset: auto -4px -3px; background: #edd6a7; }
.icing { position: absolute; top: -2px; left: 0; width: 100%; height: 6px; background: #f6e5c9; border-radius: 50% 50% 5px 5px; }
.candle { position: absolute; bottom: 100%; left: 22px; width: 6px; height: 16px; background: repeating-linear-gradient(-35deg,#e8c9a3 0 4px,#bc7267 4px 8px); }
.flame { position: absolute; width: 8px; height: 12px; left: -1px; bottom: 100%; border-radius: 80% 25% 65% 50%; background: #ffcb64; box-shadow: 0 0 10px #f7b16b; transform: rotate(10deg); transition: opacity .3s,transform .4s; }
.wished .flame { opacity: 0; transform: translateY(-4px) scale(.2); }
.wish-text h3 { font: 600 1.25rem var(--serif); margin-bottom: 6px; }
.wish-text p { font-size: .9rem; line-height: 1.6; color: #685c5d; }
#wishButton { display: inline-flex; align-items: center; gap: 6px; color: #744c48; border: 1px solid #b28776; background: transparent; border-radius: 5px; margin-top: 10px; padding: 7px 11px; font-size: .87rem; }
#wishButton .icon { height: 15px; width: 15px; }
#wishButton:hover { background: #ffead2; }
body.inside .sky { position: fixed; height: 100svh; background-position: center bottom,center; background-size: 100% 100%,cover; }
.keepsake { display: grid; grid-template-columns: 104px minmax(0,1fr); align-items: center; gap: 22px; padding: 23px 22px; margin-top: 24px; background: #253349; color: var(--cream); border-radius: 4px; }
.keepsake-thumb { display: block; width: 100%; height: auto; transform: rotate(-4deg); box-shadow: 1px 4px 9px #1016266b; }
.keepsake-kicker { color: #e5ba94; font-size: .78rem; letter-spacing: .1em; }
.keepsake-info h3 { margin: 7px 0 5px; font: 600 clamp(1.35rem,3vw,1.65rem)/1.3 var(--serif); letter-spacing: .045em; }
.keepsake-note { font: .94rem/1.6 var(--serif); color: #e3ded3; }
.keepsake-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; margin-top: 13px; }
#downloadCard, #previewCard, #closeCard { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; font: .9rem var(--sans); }
#downloadCard { gap: 7px; padding: 8px 13px; color: #342c36; background: #eeb498; border: 1px solid #f3c8ae; border-radius: 5px; text-decoration: none; white-space: nowrap; }
#downloadCard:hover { background: #ffd0ab; }
#downloadCard .icon { width: 16px; height: 16px; }
#downloadCard:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
#previewCard { color: #f7dfbe; background: none; padding: 4px 1px; border: 0; text-underline-offset: 4px; text-decoration: underline; white-space: nowrap; }
.card-dialog { color: #f8edd6; background: #1b253c; border: 1px solid #9b9285; border-radius: 9px; padding: 0; width: min(590px,calc(100% - 24px)); max-height: 94vh; max-height: 94dvh; box-shadow: 0 16px 75px #0609149e; }
.card-dialog[open] { display: flex; flex-direction: column; }
.card-dialog::backdrop { background: #090e1de8; }
body:has(.card-dialog[open]) { overflow: hidden; }
.card-viewer-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 15px 4px 19px; flex-shrink: 0; }
.card-viewer-head h2 { font: 600 1.15rem var(--serif); letter-spacing: .06em; }
#closeCard { color: var(--cream); padding: 6px 8px; border: 0; background: transparent; }
.card-image-area { display: flex; min-height: 0; justify-content: center; padding-inline: 12px; }
#cardOriginal { display: block; max-width: 100%; width: auto; height: auto; max-height: calc(94vh - 103px); max-height: calc(94dvh - 103px); object-fit: contain; -webkit-touch-callout: default; }
#cardHelp { padding: 12px 9px 15px; font-size: .8rem; line-height: 1.5; color: #dad6d2; text-align: center; flex-shrink: 0; }
#cardHelp span { padding-inline: 3px; }
@media (max-width: 560px) {
  .keepsake { padding: 18px 14px; gap: 16px; grid-template-columns: minmax(58px,27%) minmax(0,1fr); }
  .keepsake-actions { gap: 3px 12px; margin-top: 9px; }
  #downloadCard { padding-inline: 9px; }
}
@media (max-width: 370px) {
  .keepsake { grid-template-columns: 54px minmax(0,1fr); gap: 11px; padding: 15px 11px; }
  .keepsake-note { font-size: .87rem; }
}
@keyframes unfold { from { opacity: 0; transform: translateY(12px) rotate(-.5deg); } to { opacity: 1; transform: none; } }
@media (min-width: 1550px) { .hero { max-width: 1350px; } }
@media (max-width: 890px) and (min-width: 651px) {
  .hero { width: 88%; grid-template-columns: 48% 52%; }
  h1 { font-size: 3.3rem; }
  .lead { font-size: 1rem; letter-spacing: 0; }
  .art { margin-top: 0; }
}
@media (max-height: 730px) and (min-width: 651px) {
  .sky { height: max(100svh,590px); }
  .masthead { height: 65px; }
  .hero { min-height: 440px; padding: 30px 0 62px; }
  .kicker { margin-bottom: 1rem; }
  .lead { margin: .85rem 0 1.25rem; }
  .art { width: 90%; justify-self: center; }
  .dispatch { padding-block: 14px; min-height: 70px; }
}
@media (max-width: 650px) {
  .masthead { height: 64px; width: calc(100% - 40px); }
  .brand { gap: 9px; font-size: 1.06rem; }
  .brand-icon .icon { width: 28px; height: 28px; }
  .brand-en { font-size: .65rem; padding-left: 10px; margin: 0; letter-spacing: .09em; }
  .audio-button { padding: 8px 10px; gap: 6px; font-size: .8rem; }
  .sky { height: max(100svh,680px); background-position: center bottom 69px,center; background-size: 165% 80%,cover; }
  .hero { width: 100%; display: flex; flex-direction: column; justify-content: center; min-height: 0; padding: 28px 18px 35px; gap: 12px; }
  .intro { display: contents; }
  .kicker { order: 0; margin: 0; font-size: .8rem; gap: .55rem; }
  h1 { order: 1; font-size: clamp(2.42rem,8.8vw,3.1rem); text-align: center; line-height: 1.22; letter-spacing: .03em; }
  h1 br { display: none; }
  h1 > span { display: block; }
  .art { order: 2; flex-shrink: 0; width: min(72vw,330px); margin: 6px 0 1px; }
  .postmark { top: -2%; right: -8%; }
  .handwriting { bottom: -3%; }
  .lead { order: 3; font-size: .94rem; margin: 3px 0 0; line-height: 1.8; text-align: center; letter-spacing: .035em; }
  .launch { order: 4; align-items: center; gap: 9px; margin-top: 3px; }
  .press-button { min-height: 50px; padding: 0 23px; font-size: 1rem; }
  .hint { font-size: .78rem; }
  .dispatch { padding: 14px 20px; min-height: 69px; }
  .dispatch-items { width: 100%; justify-content: space-between; }
  .dispatch-item { padding: 0 12px 0 0; margin: 0; border: 0; }
  .meta-label { font-size: .68rem; }
  .dispatch-item strong { font-size: .86rem; }
  .ticket-code { display: none; }
  .wish-area { gap: 16px; }
  .letter { padding-bottom: 25px; }
  .letter > p { font-size: 1.05rem; }
}
@media (max-width: 360px) { .brand-en { display: none; } .dispatch { padding-inline: 14px; } .wish-area { gap: 12px; } .wish-stamp { flex-basis: 64px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }
