/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* 使用本地照片作为背景 - 请将您的照片重命名为background.jpg并放在images文件夹中 */
    background-image: url('./images/IMG20250712125151.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: #333;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    /* 添加背景叠加层以提高文字可读性 */
    background-color: rgba(0, 0, 0, 0.2);
    background-blend-mode: overlay;
}

/* 粒子背景 */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

/* 头部 */
header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

header h1 {
    font-size: 3.5rem;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

/* 倒计时样式 */
.birthday-countdown {
    display: flex;
    justify-content: center;
    gap: 2rem;
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.birthday-countdown span {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 主内容 */
main {
    background: rgba(255, 255, 255, 0.9);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
}

/* 爱心容器 */
.heart-container {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.heart {
    width: 100px;
    height: 90px;
    background: #ff6b8b;
    position: relative;
    transform: rotate(45deg);
    animation: heartbeat 1.5s infinite;
}

.heart:before,
.heart:after {
    content: '';
    width: 100px;
    height: 90px;
    background: #ff6b8b;
    border-radius: 50%;
    position: absolute;
}

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

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

/* 甜言蜜语 */
.love-message {
    margin-bottom: 3rem;
    line-height: 2;
}

.love-message p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

.love-message p:nth-child(1) { animation-delay: 0.2s; }
.love-message p:nth-child(2) { animation-delay: 0.4s; }
.love-message p:nth-child(3) { animation-delay: 0.6s; }
.love-message p:nth-child(4) { animation-delay: 0.8s; }
.love-message p:nth-child(5) { animation-delay: 1s; }
.love-message p:nth-child(6) { animation-delay: 1.2s; }

/* 照片展示 */
.photo-placeholder {
    width: 350px; /* 您可以自定义大小 */
    height: 350px; /* 您可以自定义大小 */
    border-radius: 15px;
    position: relative; /* 关键：作为图片定位的父容器 */
    overflow: hidden;   /* 关键：隐藏超出边界的内容 */
    background: #f0f0f0; /* 添加一个背景色以防图片加载慢 */
    flex-shrink: 0;
}

/* 新增的图片样式 */
.slideshow-image {
    position: absolute; /* 关键：让所有图片重叠在一起 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 让图片填满容器且不变形 */
    
    /* 关键：动画效果 */
    opacity: 0; /* 默认所有图片透明 */
    transition: opacity 1.5s ease-in-out; /* 设置1.5秒的淡入淡出过渡 */
}

/* 新增的 active 类样式 */
.slideshow-image.active {
    opacity: 1; /* 拥有 active 类的图片完全显示 */
}

/* 内容包装器 - 用于水平排列照片和文字 */
.content-wrapper {
    display: flex;
    justify-content: center;
    gap: 8rem;
    align-items: center;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    /* 确保在Edge浏览器中的兼容性 */
    -ms-flex-pack: center;
    -ms-flex-align: center;
}

/* 调整文字祝福语在水平布局中的样式 */
.content-wrapper .love-message {
    /* flex: 1; */
    text-align: left;
    margin-bottom: 0;
    min-width: 0; /* 确保文本内容不会溢出容器 */
}

.photo-placeholder {
    width: 400px;
    height: 400px;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.photo-placeholder:hover {
    background: #f0f0f0;
    border-color: #aaa;
}

.photo-placeholder p {
    margin-bottom: 1rem;
    color: #999;
}

#photo-upload {
    display: none;
}

/* 互动按钮 */
.interactive-buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.btn {
    padding: 0.8rem 2rem;
    background: #ff6b8b;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 139, 0.3);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 139, 0.4);
    background: #ff5277;
}

/* 页脚 */
footer {
    text-align: center;
    margin-top: 3rem;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* 动画效果 */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes heartbeat {
    0% {
        transform: rotate(45deg) scale(1);
    }
    14% {
        transform: rotate(45deg) scale(1.3);
    }
    28% {
        transform: rotate(45deg) scale(1);
    }
    42% {
        transform: rotate(45deg) scale(1.3);
    }
    70% {
        transform: rotate(45deg) scale(1);
    }
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 漂浮爱心 */
.floating-heart {
    position: fixed;
    font-size: 2rem;
    color: #ff6b8b;
    opacity: 0;
    pointer-events: none;
    animation: floatUp 3s ease-in forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }
    
    .birthday-countdown {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    main {
        padding: 2rem;
    }
    
    .interactive-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
    }
}

/* 新增：隐藏“获取爱心”和“播放音乐”按钮 */
#love-button,
#music-button {
    display: none;
}

/* --- 鼠标跟随爱心的样式 --- */
.floating-heart {
    position: fixed; /* 使用 fixed 定位，使其相对于浏览器窗口 */
    font-size: 28px; /* 爱心的大小 - 已调大 */
    /* * 设置一个非常高的 z-index，确保爱心显示在所有其他元素（包括 particles-js 画布）的上方
     */
    z-index: 9999;
    
    /* * 关键属性：让爱心本身不捕捉鼠标事件。
     * 如果没有这个，快速生成的爱心会干扰后续鼠标事件的触发，导致效果卡顿或中断。
     */
    pointer-events: none;

    /* 添加一个向上漂浮并消失的动画效果 */
    animation: floatUpAndFade 2s forwards;
}

/* 定义动画关键帧 */
@keyframes floatUpAndFade {
    0% {
        transform: translateY(0) scale(0.7); /* 初始状态：在鼠标位置，已调大 */
        opacity: 1;
    }
    100% {
        transform: translateY(-150px) scale(1.5); /* 结束状态：向上移动150px，已调大 */
        opacity: 0;
    }
}