/* ========= 基础重置 ========= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========= 动画背景（浮动粒子） ========= */
.bg-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.5;
}
.bg-animation span {
    position: absolute;
    display: block;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: move 25s linear infinite;
    bottom: -150px;
}
/* 不同大小与延迟的粒子 */
.bg-animation span:nth-child(1) { left: 25%; width: 80px; height: 80px; animation-delay: 0s; }
.bg-animation span:nth-child(2) { left: 10%; width: 20px; height: 20px; animation-delay: 2s; animation-duration: 12s; }
.bg-animation span:nth-child(3) { left: 70%; width: 20px; height: 20px; animation-delay: 4s; }
.bg-animation span:nth-child(4) { left: 40%; width: 60px; height: 60px; animation-delay: 0s; animation-duration: 18s; }
.bg-animation span:nth-child(5) { left: 65%; width: 20px; height: 20px; animation-delay: 0s; }
.bg-animation span:nth-child(6) { left: 75%; width: 110px; height: 110px; animation-delay: 3s; }
.bg-animation span:nth-child(7) { left: 35%; width: 150px; height: 150px; animation-delay: 7s; }
.bg-animation span:nth-child(8) { left: 50%; width: 25px; height: 25px; animation-delay: 15s; animation-duration: 45s; }
.bg-animation span:nth-child(9) { left: 20%; width: 15px; height: 15px; animation-delay: 2s; animation-duration: 35s; }
.bg-animation span:nth-child(10) { left: 85%; width: 150px; height: 150px; animation-delay: 0s; animation-duration: 11s; }

@keyframes move {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; border-radius: 0; }
    100% { transform: translateY(-1000px) rotate(720deg); opacity: 0; border-radius: 50%; }
}

/* ========= 布局容器 ========= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========= 页面头部 ========= */
.header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 1s ease-out;
}
.main-title {
    font-size: 4em;
    color: #fff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}
.subtitle {
    font-size: 1.5em;
    color: #fff;
    opacity: 0.9;
}
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ========= 照片墙 ========= */
.photo-wall {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 50px;
}
.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
    cursor: pointer;
}
.photo-item:hover { transform: translateY(-10px); }
.photo-item img { width: 100%; height: 250px; object-fit: cover; }
.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.photo-item:hover .photo-caption { transform: translateY(0); }

/* ========= Words for you | Time Capsule ========= */
.wishes-container,
.time-capsule {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 40px;
    margin-top: 30px;
    margin-bottom: 25px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    text-align: center;
}
.wishes-title {
    font-size: 2.5em;
    color: #764ba2;
    margin-bottom: 30px;
}

/* ========= 信封展开 ========= */
.envelope {
    width: 100%;
    max-width: 600px;
    min-height: 180px;        
    margin: 0 auto 20px;
    background: #fff9e6;
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.flap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;               /* 封口高度缩小 */
    background: #d0d0d0;
    border-radius: 6px 6px 0 0;
    transform-origin: top center;
    transition: transform 0.6s ease-in-out;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    z-index: 3;
}
.letter {
    padding: 15px 22px;       
    background: #fff9e6;
    transform: translateY(-100%);
    transition: transform 0.8s 0.2s, opacity 0.8s 0.2s;
    opacity: 0;
    font-size:22px;          
    font-family: 'Ma Shan Zheng', cursive;
    line-height: 1.7;
    color: #555;
}
.envelope.open .flap { transform: rotateX(-180deg); }
.envelope.open .letter {
    transform: translateY(0);
    opacity: 1;
    position: relative;       /* 回到文档流，自动撑高 */
}

/* 落款靠右 */
.signature {
    display: block;
    text-align: right;
    margin-top: 10px;   /* 与正文拉开点距离 */
}

/* 第一行（整段）靠左 */
.capsule-text {
    text-align: left;
}

/* 倒计时方框内底色 */
.countdown-box {
    display: inline-block;
    border: 2px solid #6e3d9e;
    border-radius: 8px;
    padding: 6px 14px;
    margin-top: 10px;
    background: rgba(118, 77, 162, 0.1); /* 半透明紫 */
}

/* 打开按钮  */
.openBtn {
    position: absolute;
    bottom: 13px;
    left: 50%;
    transform: translateX(-50%) scale(0.7);
    border: none;
    background: #764ba2;
    color: #fff;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 36px;
    cursor: pointer;
    z-index: 4;
    transition: opacity 0.4s;
}
.envelope.open .openBtn { opacity: 0; pointer-events: none; }

/* ========= 右上角丝带时间卡 ========= */
.time-ribbon {
    position: fixed;
    top: 20px;
    right: 10px;
    width: 230px;     
    padding: 6px 0 4px;
    background: linear-gradient(135deg, #647ce7 0%, #b18cd6 100%);
    color: #fff;
    font-size: 17px;   
    font-family: 'Ma Shan Zheng', cursive;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    z-index: 10001;
    line-height: 1.3;
}

/* ========= 音乐播放器 ========= */
.music-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 50px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}
.play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #667eea;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}
.play-btn:hover { transform: scale(1.1); }

/* ========= 响应式：手机压扁标题 & 单列 ========= */
@media (max-width: 768px) {
    .main-title { font-size: 3em; }
    .photo-wall,
    .wishes-grid { grid-template-columns: 1fr; }
}

/* ========= 艺术字体全局覆盖 ========= */

/* 0. 基础英文+数字也统一风格 */
body {
    font-family: 'Noto Serif SC', serif;   /* 国风正文 */
    letter-spacing: .6px;
}

/* 1. 大标题：招牌手写风 */
.main-title {
    font-family: 'Yesteryear', cursive;
    font-size: 5em;            
    letter-spacing: 2px;
    text-shadow: 3px 3px 0px #764ba2, 6px 6px 0px rgba(255, 255, 255, .2);
}

/* 2. 副标题、段落、按钮：毛笔风 */
.subtitle,
.wish-content,
.capsule-text,
.countdown-box,
.submit-btn,
.openBtn {
    font-family: 'Ma Shan Zheng', cursive;
    font-weight: 400;
}

/* 3. 签名 */
.signature,
.single-wish p {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.5em;            
    line-height: 1.9;
}

/* 4. 右上角丝带时间卡 */
.time-ribbon {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 17px;             
}

/* 5. 音乐播放器文字 */
.music-player span {
    font-family: 'Noto Serif SC', serif;
    font-size: 14px;
}

/* 6. 抗锯齿+润色 */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 页脚 */
.page-footer {
    text-align: center;
    padding: 20px 10px;
    font-size: 14px;
    color: #fff;
    background: rgba(42, 20, 78, 0.25);
    margin-top: 40px;
    border-radius: 8px 8px 0 0;
}