body {
    background-color: #f1d5da; /* 浅粉色 */
    text-align: center;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

.container {
    width: 90%; /* 适应手机屏幕宽度 */
    max-width: 500px; /* 最大宽度限制 */
    margin-top: 20px;
    position: relative;
    z-index: 10;
}

#mainImage {
    width: 100%; /* 图片宽度自适应容器 */
    max-width: 200px; /* 最大宽度限制 */
    transition: all 0.3s ease;
}

h1 {
    font-size: 5vw; /* 字体大小根据视口宽度变化 */
    color: #68495b;
    margin: 20px 0; /* 增加上下间距 */
}

.love-text {
    text-align: left;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    margin: 15px 0;
    max-height: 40vh;
    overflow-y: auto;
}

.love-text p {
    font-size: 3.5vw;
    line-height: 1.6;
    color: #68495b;
    margin: 10px 0;
}

button {
    font-size: 4vw; /* 字体大小根据视口宽度变化 */
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
}

#yes {
    background-color: #d4818e; /* 粉色 */
    color: white;
}

#no {
    background-color: #6784b1; /* 蓝色 */
    color: white;
    position: relative;
}

.text-container {
    max-height: 200px; /* 设置最大高度 */
    overflow-y: auto; /* 允许垂直滚动 */
    padding: 10px;
    border: 1px solid #ccc; /* 边框样式 */
    border-radius: 5px; /* 圆角 */
    background-color: #f9f9f9; /* 背景颜色 */
}

/* 美化密码输入框样式 */
.styled-input {
    padding: 10px;
    border: 2px solid #d4818e; /* 粉色边框 */
    border-radius: 5px;
    font-size: 16px;
    width: 200px;
    margin-bottom: 10px;
}

.styled-input:focus {
    border-color: #6784b1; /* 蓝色边框在聚焦时 */
    outline: none; /* 去掉默认的聚焦轮廓 */
}

.styled-button {
    background-color: #d4818e; /* 粉色背景 */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.styled-button:hover {
    background-color: #6784b1; /* 蓝色背景在悬停时 */
}

/* 电脑端样式优化 */
@media (min-width: 768px) { 
    /* 现有电脑端样式保持不变 */
}

/* 小屏幕样式优化 */
@media (max-width: 480px) {
    h1 {
        font-size: 6vw; /* 增加小屏幕上的字体大小 */
    }

    .love-text p {
        font-size: 4vw;
    }

    button {
        font-size: 5vw; /* 增加小屏幕上的按钮字体大小 */
        padding: 8px 16px; /* 调整按钮的内边距 */
    }
}

.heart {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 60% 60%, #ff6b9e, #ff3864);
    transform: rotate(45deg);
    opacity: 0;
    animation: fall linear infinite;
    z-index: 1;
}

.heart::before, .heart::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: inherit;
}

.heart::before {
    top: -10px;
    left: 0;
}

.heart::after {
    top: 0;
    left: -10px;
}

@keyframes fall {
    0% {
        top: -50px;
        opacity: 1;
        transform: rotate(45deg) translateX(0);
    }
    100% {
        top: 100vh;
        opacity: 0;
        transform: rotate(45deg) translateX(calc(var(--x-offset) * 1px));
    }
}
