/* 背景图容器样式 */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* 确保在内容下方 */
    opacity: 0; /* 初始隐藏 */
    transition: opacity 0.5s ease-in-out;
}

/* 显示背景时的样式 */
.background-container.visible {
    opacity: 1;
}

/* 背景图片样式 */
.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

/* 当前显示的背景图 */
.background-image.active {
    opacity: 1;
}


/* 页面整体设置 */
body {
    font-family: Arial, sans-serif;
    background-color: #fdfdfd;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    box-sizing: border-box;
    overflow: hidden; /* 隐藏溢出 */
}

/* 便签容器 */
.notes-container {
    position: relative;
    width: 100%;
    height: 90vh;
}

/* 单个便签的样式 (关键更新)
  这是便签的“初始状态”（隐藏且缩小）
*/
.note {
    /* 1. 尺寸和盒模型 */
    width: 200px;
    height: 50px;
    padding: 15px;
    box-sizing: border-box;

    /* 2. 视觉呈现 */
    border-radius: 8px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);

    /* 3. 字体和内容 */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 16px;
    color: #333333;
    line-height: 1.5;

    /* 4. 布局 */
    position: absolute;

    /* 5. 动画和初始状态 (核心变化) 
      - 初始透明度为0 (不可见)
      - 初始缩放为0.5 (缩小)
    */
    opacity: 0;
    transform: scale(0.5) rotate(var(--rotate, 0deg));
    
    /* 过渡动画：
      - transform: 0.3秒 (用于弹出和悬停)
      - opacity: 0.3秒 (用于淡入淡出)
      - ease-out 效果更自然
    */
    transition: transform 0.3s ease-out, 
                opacity 0.3s ease-out,
                box-shadow 0.2s ease-in-out, 
                z-index 0.2s ease-in-out;
}

/* 新增 .visible 类 (核心变化)
  当JS添加这个类时，便签会“弹”到这个状态
*/
.note.visible {
    opacity: 1;
    transform: scale(1) rotate(var(--rotate, 0deg)); /* 放大到原始尺寸 */
}

/* 悬停交互效果 (更新)
  我们只在 .visible 状态下应用悬停
*/
.note.visible:hover {
    transform: scale(1.05) rotate(var(--rotate, 0deg)); /* 在原始尺寸基础上放大 */
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 999 !important;
    cursor: default;
}
/* ... [保持原有的所有CSS代码] ... */

/* --- 新增：神秘礼物模态对话框样式 --- */

/* 模态对话框遮罩层：覆盖整个屏幕 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* 半透明黑色背景 */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; /* 确保它在所有元素之上 */
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

/* 隐藏状态 */
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none; /* 隐藏后阻止点击事件 */
}

/* 模态对话框内容框 */
.modal-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 300px; /* 适当的宽度 */
    text-align: center;
    transform: scale(1);
    transition: transform 0.3s ease-out;
}

/* 头部：标题和图标 */
.modal-header {
    font-size: 20px;
    font-weight: bold;
    color: #ff69b4; /* 粉色主题色，匹配爱心风格 */
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* 新增爱心图标（可通过伪元素实现） */
.modal-header::before {
    content: "❤️";
    margin-right: 8px;
    font-size: 22px;
}


/* 主体：提示信息 */
/* 主体：提示信息 */
.modal-body p {
    font-size: 16px;
    color: #666; /* 稍浅的文字色，更柔和 */
    margin: 15px 0;
    line-height: 1.6;
}


/* 底部：按钮区域 */
.modal-footer {
    padding-top: 10px;
}

/* 确定按钮样式（改为粉色系） */
#openGiftButton {
    padding: 10px 20px;
    background-color: #ff69b4; /* 粉色 */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s;
}

#openGiftButton:hover {
    background-color: #ff1493; /* 深粉色 hover 效果 */
}

