/* ===== 基础 body ===== */
body {
    background-color: #f1d5da;
    text-align: center;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;

    position: relative;
    overflow: hidden;

    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* ===== 粉色遮罩（让照片像背景） ===== */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(241, 213, 218, 0.55);
    pointer-events: none;
    z-index: 0;
}

/* ===== 三张背景照片通用样式 ===== */
.bg-photo {
    position: fixed;
    width: 260px;
    height: 260px;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.18);

    opacity: 0;
    pointer-events: none;
    z-index: 0;

    will-change: transform, opacity;
}

/* ===== 每张照片：路径 + 初始位置 + 动画 ===== */
.bg1 {
    background-image: url("photos/111.png");
    left: 4vw;
    top: 6vh;
    animation: float1 22s linear infinite, fade1 10s ease-in-out infinite;
}

.bg2 {
    background-image: url("photos/222.png");
    right: 4vw;
    top: 14vh;
    width: 220px;
    height: 220px;
    animation: float2 26s linear infinite, fade2 12s ease-in-out infinite;
}

.bg3 {
    background-image: url("photos/333.png");
    left: 8vw;
    bottom: 8vh;
    width: 240px;
    height: 240px;
    animation: float3 24s linear infinite, fade3 11s ease-in-out infinite;
}

/* ===== 漂浮动画（GPU transform，极顺） ===== */
@keyframes float1 {
    0%   { transform: translate(0, 0) rotate(-2deg); }
    25%  { transform: translate(12px, -8px) rotate(1deg); }
    50%  { transform: translate(20px, 6px) rotate(2deg); }
    75%  { transform: translate(8px, 12px) rotate(-1deg); }
    100% { transform: translate(0, 0) rotate(-2deg); }
}

@keyframes float2 {
    0%   { transform: translate(0, 0) rotate(2deg); }
    25%  { transform: translate(-10px, 10px) rotate(-1deg); }
    50%  { transform: translate(-18px, 4px) rotate(-2deg); }
    75%  { transform: translate(-6px, -10px) rotate(1deg); }
    100% { transform: translate(0, 0) rotate(2deg); }
}

@keyframes float3 {
    0%   { transform: translate(0, 0) rotate(-1deg); }
    25%  { transform: translate(10px, 12px) rotate(1deg); }
    50%  { transform: translate(16px, -6px) rotate(2deg); }
    75%  { transform: translate(6px, -12px) rotate(-1deg); }
    100% { transform: translate(0, 0) rotate(-1deg); }
}

/* ===== 淡入淡出（错峰出现） ===== */
@keyframes fade1 {
    0%, 20%   { opacity: 0; }
    40%, 70%  { opacity: 0.28; }
    90%, 100% { opacity: 0; }
}

@keyframes fade2 {
    0%, 30%   { opacity: 0; }
    50%, 75%  { opacity: 0.25; }
    95%, 100% { opacity: 0; }
}

@keyframes fade3 {
    0%, 15%   { opacity: 0; }
    35%, 65%  { opacity: 0.26; }
    85%, 100% { opacity: 0; }
}

/* ===== 前景内容层（盖过背景） ===== */
.container {
    width: 90%;
    max-width: 500px;
    position: relative;
    z-index: 1;
}

#mainImage {
    width: 100%;
    max-width: 200px;
    transition: all 0.3s ease;
}

h1 {
    font-size: 5vw;
    color: #68495b;
    margin: 20px 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;
}

.yes-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffdae0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.yes-text {
    font-size: 7vw;
}

.yes-image {
    width: 50%;
    max-width: 300px;
}

/* ===== 电脑端优化 ===== */
@media (min-width: 768px) {
    body {
        display: block;
    }

    .container {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: auto;
        max-width: none;
    }

    #mainImage {
        width: 200px;
    }

    h1 {
        font-size: 28px;
        margin: 20px 0;
    }

    button {
        font-size: 18px;
    }

    .yes-text {
        font-size: 36px;
    }

    .yes-image {
        width: 300px;
    }
}

/* ===== 系统减少动画时自动关闭（更稳） ===== */
@media (prefers-reduced-motion: reduce) {
    .bg-photo {
        animation: none !important;
        opacity: 0.25;
    }
}
