:root {
    --primary-color: #FFD1DC;
    --secondary-color: #E6F7FF;
    --accent-color: #FFF9F0;
    --text-color: #333333;
}

@font-face {
    font-family: 'YangRenDongZhuShiTi-Semibold';
    src: url('../../fonts/YRDZSSemibold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'YeZiGongChangGangFengSong';
    src: url('../../fonts/YeZiGongChangGangFengSong.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'YangRenDongZhuShiTi-Semibold', 'YeZiGongChangGangFengSong', sans-serif;
    background-color: var(--accent-color);
    min-height: 100vh;
    overflow-x: hidden;
}

.bg-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    z-index: -1;
}

.content-container {
    backdrop-filter: blur(3px);
    background-color: rgba(255, 255, 255, 0.6);
}

/* 爱心动画 */
@keyframes heartbeat {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1);
    }
    75% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.heart {
    animation: heartbeat 1.5s infinite, float 4s ease-in-out infinite;
}

.love-letter {
    position: relative;
    border-radius: 12px;
    background-color: rgba(255, 242, 245, 0.85);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    backdrop-filter: blur(4px);
}

.love-letter::after {
    content: "";
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid rgba(255, 242, 245, 0.85);
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("origin-pre.jpg");
    z-index: 1000;
    transition: opacity 0.5s ease;
}

.loader-heart {
    width: 50px;
    height: 50px;
    background-color: #F2D8D1;
    transform: rotate(45deg);
    animation: heartbeat 2s infinite alternate;
    position: relative;
}

.loader-heart:before, .loader-heart:after {
    content: "";
    width: 50px;
    height: 50px;
    background-color: #F2D8D1;
    border-radius: 50%;
    position: absolute;
}

.loader-heart:before {
    top: -25px;
    left: 0;
}

.loader-heart:after {
    top: 0;
    left: -25px;
}

.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* 飘落的花瓣 */
.petal {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.7;
    animation: fall linear forwards;
}

@keyframes fall {
    0% {
        transform: translate(0, -10%) rotate(0deg);
    }
    100% {
        transform: translate(calc(var(--random-x) * 1vw), calc(var(--fall-height) * 1vh)) rotate(calc(var(--random-rotate) * 1deg));
    }
}


/* 音乐按钮样式 */
.music-btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: none;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background-color: rgba(255, 182, 193, 0.8); /* 浅粉色背景 */
}

.music-btn:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.music-btn:hover:before {
    width: 300px;
    height: 300px;
}

.music-btn.playing {
    animation: rotate 3s linear infinite;
    background-color: rgba(255, 105, 180, 0.9); /* 播放时稍微深一点的粉色 */
}

/* 移动端适配 */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .music-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: 4px;
        right: 4px;
        background-color: rgba(255, 182, 193, 0.8); /* 浅粉色背景 */
    }

    .music-btn.playing {
        background-color: rgba(255, 105, 180, 0.9); /* 播放时稍微深一点的粉色 */
    }

    h1 {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }

    .love-letter {
        margin: 0 16px;
        padding: 20px !important;
        max-width: calc(100vw - 32px);
    }

    .love-letter h2 {
        font-size: 1.5rem !important;
    }

    .love-letter p {
        font-size: 1rem !important;
        line-height: 1.6;
    }

    .heart {
        width: 48px !important;
        height: 48px !important;
    }

    .container {
        padding: 16px !important;
    }

    .pt-8 {
        padding-top: 2rem !important;
    }

    .pb-8 {
        padding-bottom: 2rem !important;
    }

    .space-x-4 > * + * {
        margin-left: 0.5rem !important;
    }

    .loader p {
        font-size: 1rem !important;
        padding: 0 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem !important;
    }

    .music-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
        top: 2px;
        right: 2px;
        background-color: rgba(255, 182, 193, 0.8); /* 浅粉色背景 */
    }

    .music-btn.playing {
        background-color: rgba(255, 105, 180, 0.9); /* 播放时稍微深一点的粉色 */
    }

    .love-letter {
        margin: 0 12px;
        padding: 16px !important;
        max-width: calc(100vw - 24px);
    }

    .love-letter h2 {
        font-size: 1.25rem !important;
        margin-bottom: 12px !important;
    }

    .love-letter p {
        font-size: 0.9rem !important;
    }

    .heart, .love-letter img {
        width: 40px !important;
        height: 40px !important;
    }

    .flex.justify-center.space-x-4 {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .flex.justify-center.space-x-4 > * + * {
        margin-left: 0 !important;
    }

    .flex.justify-center.space-x-4 img {
        width: 32px !important;
        height: 32px !important;
    }

    .flex.justify-center.space-x-4 p {
        font-size: 1rem !important;
        text-align: center;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .petal {
        opacity: 0.5;
    }

    .heart {
        animation-duration: 2s;
    }
}

/* 署名字体样式 */
.love-signature {
    font-weight: normal;
    color: #ff6b8b;
    text-align: right;
    margin-top: 1rem;
}

@media (min-width: 768px) {
}

@media (max-width: 768px) {
    .love-signature {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .love-signature {
        font-size: 1.25rem;
    }
}