*{box-sizing:border-box}body{margin:0;background:#a71d44;font-family:"PingFang SC","Microsoft YaHei",sans-serif;color:#b51e4e}main{width:min(100%,55vh);margin:auto;container-type:inline-size}section{position:relative;width:100%;aspect-ratio:1/2;background-size:100% auto;background-repeat:no-repeat;background-color:#e9335b}section[hidden]{display:none}#home{background-image:url(images/index_bg.webp)}#videos{background-image:url(images/p1_bg.webp)}#year{background-image:url(images/p2_bg.webp)}#message{background-image:url(images/p2_bg.webp)}#list{background-image:url(images/p4_bg.webp)}#sent{background-image:url(images/p2_bg.webp)}button,select{font:inherit;color:inherit;cursor:pointer}button{padding:0;border:0;background:transparent}button:active{filter:brightness(.93)}button img,#output{width:100%;display:block}.homebtn{position:absolute;width:27.07%;left:38%}.first{top:43.5%}.second{top:60.3%}.card{position:absolute;left:12%;width:75%;top:61.5%;height:22%;background:#fff;border:2px solid #f3cc93;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:3%;font-size:4cqw}.card p{margin:0 0 5%}.pick{background:#ca2854;color:white;padding:1% 7%}select{font-size:7cqw;font-weight:bold;background:white;border:0;margin:0 2cqw}nav{position:absolute;top:86%;left:15%;width:70%;display:flex;justify-content:space-between}nav button{width:41%}.share,.gallery-home,.finish{border:2px solid #e3b86a;background:#c3284f;color:white;border-radius:7px;padding:1.5% 3%;margin:auto;font-weight:bold;font-size:4cqw}.messages{position:absolute;top:9%;left:14%;width:71%;height:56%;display:flex;flex-direction:column;justify-content:space-between}.messages button{background:#fff1e6;border:1px solid #dfb0a4;box-shadow:0 2px #da8396;font-size:3.4cqw;height:7.5%;font-weight:bold}.gallery{position:absolute;top:55%;bottom:8%;left:2%;right:2%;overflow:auto;display:grid;grid-template-columns:1fr 1fr;align-content:start;gap:2cqw}.gallery article{background:#fff;padding:1cqw}.gallery video{width:100%;aspect-ratio:16/10;background:#210914;display:block}.gallery strong{display:block;padding:2cqw;font-size:3.4cqw}.gallery-home{position:absolute;bottom:1.2%;left:50%;transform:translateX(-50%);white-space:nowrap}.finish{position:absolute;right:2%;bottom:1%;font-size:3cqw}#output{height:auto}@media(max-width:600px){main{width:100%;max-width:60svh}}

.year-line{display:flex;align-items:center;justify-content:center;gap:3cqw;white-space:nowrap}
.year-scroll{--row:clamp(20px,6cqw,34px);height:calc(3 * var(--row));width:22cqw;overflow-y:auto;overscroll-behavior:contain;scroll-snap-type:y mandatory;text-align:center;color:#bc7688;scrollbar-width:thin}
.year-scroll::before,.year-scroll::after{content:"";display:block;height:var(--row)}
.year-scroll div{height:var(--row);line-height:var(--row);scroll-snap-align:center;cursor:pointer}
.year-scroll .current{color:#c72555;font-weight:bold;font-size:5.5cqw}
.wish-heading{position:absolute;top:8%;width:100%;text-align:center;font-size:3.4cqw;line-height:1.55}
.messages{top:15%;height:50%;overflow-y:auto;justify-content:flex-start;gap:1.4cqw;overscroll-behavior:contain}
.messages button{flex:none;min-height:8.2cqw;height:auto;padding:1cqw}
#music-toggle{position:fixed;z-index:2;top:max(8px,env(safe-area-inset-top));right:max(8px,calc((100vw - min(100vw,55vh))/2 + 8px));width:36px;height:36px;border-radius:50%;background:#fff3e9;color:#922247;border:1px solid currentColor;font-size:20px}
#music-toggle[aria-pressed=true]{background:#992444;color:white}
#danmu{position:absolute;top:9.4%;left:0;right:0;height:16.5%;display:grid;grid-template-rows:repeat(4,1fr);overflow:hidden;pointer-events:none}
#danmu>div{position:relative}
#danmu span{position:absolute;left:100%;display:flex;align-items:center;gap:1cqw;background:rgba(183,29,75,.78);color:white;font-size:2.9cqw;white-space:nowrap;border-radius:4cqw;padding:.55cqw 1.7cqw .55cqw .65cqw;animation:bullet-flight 13s linear forwards}
#danmu img{width:4.4cqw;height:4.4cqw;border-radius:50%;object-fit:cover}
@keyframes bullet-flight{to{transform:translateX(calc(-100cqw - 100%))}}
#poster-wait:not([hidden]){position:fixed;inset:0;z-index:10;display:grid;place-items:center;background:rgba(55,17,28,.25)}
#poster-wait span{display:flex;align-items:center;gap:.7em;padding:1em 1.3em;border-radius:12px;background:#fff8ef;color:#922247;font-size:16px;box-shadow:0 4px 20px #571b3224}
#poster-wait span::before{content:"";width:1em;height:1em;border:2px solid #ecd1d8;border-top-color:#ac294f;border-radius:50%;animation:poster-spin .8s linear infinite}
@keyframes poster-spin{to{transform:rotate(1turn)}}
@media(prefers-reduced-motion:reduce){#poster-wait span::before{animation:none}}
