/* 清除默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    position: relative;
    min-height: 100vh;
    background: #ffffff;
    overflow: hidden;
}

/* 爱心飘落特效 */
.heart-fall {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 9;
}
.heart-fall .heart-item {
    position: absolute;
    color: #ff6b8b;
    opacity: 0;
    animation: heartDrop 7s linear infinite;
}
@keyframes heartDrop {
    0% {
        transform: translateY(-40px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.con {
    position: absolute;
    bottom: 0;
    width: 500px;
    max-width: 92vw;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.con .close {
    position: relative;
    width: 100%;
    display: block;
}

/* 玫瑰：水平居中，不再靠左偏移 */
.con .rose {
    position: absolute;
    left: 50%;
    top: auto;
    bottom: 70px;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    cursor: pointer;
    z-index: 12;
}

/* 标题、日期也水平居中 */
.con h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 170px;
    font-size: 18px;
    color: #444;
    z-index: 11;
}

.con span {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 140px;
    font-size: 14px;
    color: #666;
    z-index: 11;
}

/* 信纸保持：底部压入信封130px */
.letter {
    position: absolute;
    width: 86%;
    left: 50%;
    bottom: 100%;
    margin-bottom: -180px;
    transform: translateX(-50%);
    background-color: #fffef8;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(180, 70, 100, 0.22);
    overflow: hidden;
    transition: height 1.2s ease-out;
    z-index: 8;
    height: 0;
}
.letter.open {
    height: 420px;
}

.letter-inner {
    width: 100%;
    height: 100%;
    padding: 24px 20px;
    overflow-y: auto;
    color: #4b2630;
    line-height: 2;
    font-size: 15px;
}
.letter-inner p {
    margin-bottom: 12px;
}
.letter-inner .sign {
    text-align: right;
    margin-top: 30px;
}

/* 美化滚动条 */
.letter-inner::-webkit-scrollbar {
    width: 5px;
}
.letter-inner::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.04);
}
.letter-inner::-webkit-scrollbar-thumb {
    background: #ff879f;
    border-radius: 3px;
}

audio {
    width: 0;
    height: 0;
}

/* 媒体查询手机端 */
@media screen and (max-width: 540px) {
    .con {
        width: 100vw;
        bottom: 20px;
    }
    .con .rose {
        bottom: 60px;
    }
    .con h1 {
        bottom: 150px;
        font-size: 16px;
    }
    .con span {
        bottom: 120px;
        font-size:13px;
    }
    .letter.open {
        height: 60vh;
    }
    .letter-inner {
        font-size: 14px;
        padding:16px 14px;
    }
}

/* 随机选项默认全部隐藏 */
.rand-item {
    display: none;
}
/* 激活的随机项显示 */
.rand-item.show {
    display: block;
}