body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    width: 100vw;
    height: 100vh;
    font-family: 'Rubik', sans-serif;
    background-color: #ffebee; /* 粉色背景，营造浪漫氛围 */
    background-image: url('https://cdn.pixabay.com/photo/2017/08/30/01/05/milky-way-2695569_1280.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    font-size: 10px;
    position: relative;
}

/* 浮动爱心样式 */
.floating-hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

@keyframes floatHeart {
    0% {
        transform: translateY(100%) scale(0.5);
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* 动态生成的爱心元素会应用这些样式 */
.heart {
    position: absolute;
    bottom: -10%;
    color: #e91e63;
    font-size: 2em;
    animation: floatHeart 15s linear infinite;
    z-index: -1;
}

@media screen and (max-width: 768px) {
    .container {
        font-size: 8px;
    }
    
    .title {
        font-size: 2.8em;
    }
    
    .subtitle {
        font-size: 1.8em;
        top: 20%;
    }
    
    .face-slider {
        width: 24em;
        height: 24em;
    }
    
    .button {
        font-size: 1.8em;
        padding: 1em 2em;
    }
    
    .button-unhappy {
        font-size: 1.4em;
    }
}

@media screen and (max-width: 480px) {
    .container {
        font-size: 5px;
    }
    
    .title {
        font-size: 2.5em;
        top: 5%;
    }
    
    .subtitle {
        font-size: 1.6em;
        top: 15%;
    }
    
    .face-slider {
        width: 20em;
        height: 20em;
    }
    
    .button {
        font-size: 1.6em;
        padding: 0.8em 1.6em;
        margin-bottom: 1em;
    }
    
    .button-unhappy {
        font-size: 1.2em;
    }
}

.container,
.container * {
    box-sizing: border-box;
}

.content {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    position: relative;
    margin: 2em 4em;
    font-size: 100%;
    height: 100%;
}

.title {
    margin: 0;
    padding: 0;
    position: absolute;
    top: 8%;
    text-align: center;
    width: 100%;
    font-size: 3em;
    color: #e91e63; /* 粉红色标题 */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: bold;
}

.subtitle {
    margin: 0;
    padding: 0;
    position: absolute;
    top: 18%;
    text-align: center;
    width: 100%;
    font-size: 2em;
    color: #9c27b0; /* 紫色副标题 */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.button {
    color: #fff;
    border-radius: 2em;
    text-decoration: none;
    padding: 1.2em 2.5em;
    margin-bottom: 1.5em;
    text-align: center;
    font-size: 2em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    z-index: -1;
}

.button:hover::before {
    left: 0;
}

.button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.button-happy {
    background-color: #e91e63; /* 粉红色按钮 */
    border: 2px solid #c2185b;
}

.button-happy:hover {
    background-color: #d81b60;
}

.button-unhappy {
    background-color: #9e9e9e; /* 灰色按钮 */
    border: 2px solid #757575;
    font-size: 1.5em;
    padding: 1em 2em;
    opacity: 0.8;
}

.button-unhappy:hover {
    background-color: #757575;
    opacity: 1;
}

.face-slider {
    --happiness: 0.9;
    --derp: 1;
    --px: 0.5;
    --py: 0.5;
    width: 28em;
    max-width: 100%;
    height: 28em;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-image: radial-gradient(#f7e0b2, #eb5);
    border-radius: 100%;
    overflow: hidden;
    margin: 0;
    align-self: center;
    flex: 0 0 auto;
    border: solid 4px #ecb23e;
    box-shadow: 0px 0px 20px rgba(233, 30, 99, 0.4);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0px 0px 20px rgba(233, 30, 99, 0.4);
    }
    50% {
        box-shadow: 0px 0px 30px rgba(233, 30, 99, 0.7);
    }
    100% {
        box-shadow: 0px 0px 20px rgba(233, 30, 99, 0.4);
    }
}

.face-slider,
.face-slider * {
    position: absolute;
}

.face-slider::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: linear-gradient(to bottom, #5a8, rgba(85, 170, 136, 0));
    opacity: calc(1 - var(--happiness));
}

.face-slider-blush {
    width: 20%;
    height: 10%;
    background-color: rgba(255, 100, 100, 0.3);
    border: 3px solid rgba(255, 100, 100, 0.3);
    top: calc(45% + var(--py) * 10%);
    border-radius: 100%;
    opacity: calc(var(--happiness) * var(--happiness) * 0.9 + 0.1);
}

.face-slider-blush-left {
    left: calc(7% + var(--px) * 2%);
}

.face-slider-blush-right {
    right: calc(9% - var(--px) * 2%);
}

.face-slider-eye {
    width: calc(26% - var(--happiness) * 2%);
    height: calc(26% - var(--happiness) * 2%);
    background-color: #f6f6f6;
    border-radius: 100%;
    top: calc(25% + var(--py) * 10%);
    overflow: hidden;
}

.face-slider-eye-left {
    left: calc(18% + var(--px) * 4%);
}

.face-slider-eye-left::after {
    transform: translate(calc((var(--px) + var(--derp) * 0.5) * 100%), calc((var(--py) + var(--derp) * 0.5) * 100%));
}

.face-slider-eye-right {
    right: calc(22% - var(--px) * 4%);
}

.face-slider-eye-right::after {
    transform: translate(calc((var(--px) + var(--derp) * -0.3) * 100%), calc((var(--py) + var(--derp) * -0.3) * 100%));
}

.face-slider-eye::after {
    content: '';
    display: block;
    background-color: #421;
    width: calc(55% - var(--happiness) * 10%);
    height: calc(55% - var(--happiness) * 10%);
    border-radius: 100%;
}

.face-slider-mouth {
    width: calc(51% - var(--happiness) * 2%);
    height: calc(26% - var(--happiness) * 2%);
    background-color: #a33;
    border-radius: calc((1 - var(--happiness)) * 10em) calc((1 - var(--happiness)) * 10em) calc(var(--happiness) * 16em) calc(var(--happiness) * 16em);
    top: calc(57.5% + var(--py) * 5%);
    left: calc(47.5% + var(--px) * 5%);
    transform: translateX(-50%);
    overflow: hidden;
    border: 3px solid #962d2d;
}

.face-slider-mouth::before {
    content: '';
    display: block;
    position: absolute;
    width: 20%;
    height: 20%;
    top: 0;
    left: 50%;
    background-color: white;
    border-radius: 0 0 0.5em 0.5em;
}

.face-slider-mouth::after {
    content: '';
    display: block;
    position: absolute;
    width: 60%;
    height: 50%;
    left: 10%;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 20em 20em 0 0;
}