* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', serif;
    color: #fff;
    overflow-x: hidden;
    background-color: #000;
    height: 100vh;
    perspective: 1px;
    scroll-behavior: smooth;
    position: relative;
}

/* 星空背景 */
.stars, .twinkling, .clouds {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.stars {
    /* background: #000 url(https://cdn.staticaly.com/gh/htmlstudy/stars@main/stars.png) repeat top center; */
    z-index: -3;
    opacity: 1;
}

.twinkling {
    /* background: transparent url(https://cdn.staticaly.com/gh/htmlstudy/stars@main/twinkling.png) repeat top center; */
    z-index: -2;
    animation: move-twink-back 200s linear infinite;
    opacity: 0.8;
}

.clouds {
    /* background: transparent url(https://cdn.staticaly.com/gh/htmlstudy/stars@main/clouds.png) repeat top center; */
    z-index: -1;
    opacity: 0.3;
    animation: move-clouds-back 200s linear infinite;
}

@keyframes move-twink-back {
    from {background-position: 0 0;}
    to {background-position: -10000px 5000px;}
}

@keyframes move-clouds-back {
    from {background-position: 0 0;}
    to {background-position: 10000px 0;}
}

/* 改进背景样式 - 添加微妙的渐变和装饰元素 */

/* 在星空背景之上添加渐变叠加层 */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at top, rgba(110, 0, 100, 0.1) 0%, transparent 60%), 
                radial-gradient(ellipse at bottom, rgba(0, 30, 60, 0.1) 0%, transparent 60%);
    pointer-events: none;
    z-index: -1;
}

/* 添加一些微妙的装饰元素 */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.bg-decoration::before {
    content: "";
    position: absolute;
    top: 15%;
    left: 10%;
    width: 150px;
    height: 150px;
    background: rgba(255, 143, 177, 0.03);
    border-radius: 50%;
    filter: blur(40px);
    animation: float-slow 30s infinite alternate ease-in-out;
}

.bg-decoration::after {
    content: "";
    position: absolute;
    bottom: 15%;
    right: 10%;
    width: 180px;
    height: 180px;
    background: rgba(137, 207, 240, 0.03);
    border-radius: 50%;
    filter: blur(50px);
    animation: float-slow 25s infinite alternate-reverse ease-in-out;
}

/* 添加一个微妙的心形装饰 */
.heart-decoration {
    position: fixed;
    width: 100px;
    height: 100px;
    z-index: -1;
    opacity: 0.03;
    filter: blur(5px);
    pointer-events: none;
}

.heart-decoration:nth-child(1) {
    top: 20%;
    right: 15%;
    transform: rotate(15deg) scale(0.8);
    animation: float-very-slow 45s infinite alternate ease-in-out;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ff8fb1' d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
}

.heart-decoration:nth-child(2) {
    top: 65%;
    left: 12%;
    transform: rotate(-10deg) scale(0.6);
    animation: float-very-slow 50s infinite alternate-reverse ease-in-out;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ff8fb1' d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E");
}

/* 添加极慢动画关键帧 */
@keyframes float-very-slow {
    0%, 100% {
        transform: translateY(0) translateX(0) rotate(0deg) scale(1);
    }
    50% {
        transform: translateY(-30px) translateX(15px) rotate(5deg) scale(1.05);
    }
}

/* 页面样式 */
.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, transform 0.8s ease;
    opacity: 0;
    transform: translateY(50px);
    pointer-events: none;
    z-index: 1;
}

.page.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
    z-index: 5;
}

.content {
    width: 90%;
    max-width: 1200px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    text-align: center;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.content::-webkit-scrollbar {
    display: none;
}

/* 首页样式 */
.love-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 4rem;
    margin-bottom: 2rem;
    color: #fff;
    text-align: center;
    width: 100%;
    /*text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.3), 0 0 30px rgba(255, 255, 255, 0.2);
     animation: glow 2s ease-in-out infinite alternate; */
}

@keyframes glow {
    from {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.3), 0 0 30px rgba(255, 255, 255, 0.2);
    }
    to {
        text-shadow: 0 0 15px rgba(255, 255, 255, 0.6), 0 0 25px rgba(255, 255, 255, 0.4), 0 0 35px rgba(255, 255, 255, 0.3);
    }
}

.love-time {
    text-align: center;
    width: 100%;
    margin-bottom: 2rem;
}

.timer {
    margin-top: 1rem;
    font-size: 2rem;
    font-weight: 300;
}

.timer span {
    display: inline-block;
    min-width: 40px;
    margin: 0 5px;
    font-weight: 700;
    color: #ff8fb1;
}

.scroll-tip {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
    opacity: 0.7;
    animation: fade 2s ease-in-out infinite;
}

@keyframes fade {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* 情书样式 */
.letter {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: rotate(-2deg);
    transition: all 0.5s ease;
    text-align: center;
}

.letter:hover {
    transform: rotate(0deg) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.letter h2 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #ff8fb1;
    text-align: center;
    margin-top: 2rem;
}

.letter p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    text-align: left;
}

.letter p:last-child {
    text-align: right;
    font-style: italic;
    margin-top: 2rem;
}

/* 照片墙样式增强 */
.photo-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* 保持自动填充列，每列最小250px */
    grid-auto-flow: dense;
    gap: 25px; /* 增加间距 */
    padding: 25px;
    width: 100%;
    max-width: 100%; /* 去掉宽度限制，利用整个容器宽度 */
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10;
    position: relative;
    scroll-padding: 15px;
    justify-content: center; /* 确保居中显示 */
    margin: 0 auto;
}

@media (max-width: 768px) {
    .photo-wall {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* 为平板调整列宽 */
        gap: 15px;
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .photo-wall {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* 为手机调整列宽 */
        gap: 10px;
        padding: 10px;
    }
}

/* 照片卡片基础样式优化 */
.photo-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(15px) scale(0.95);
    opacity: 0;
    animation: fadeIn 0.6s forwards;
    animation-fill-mode: both;
    background: rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 143, 177, 0.2); /* 添加轻微的点击反馈 */
}

/* 为照片添加精致边框效果 */
.photo-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 10px;
    padding: 2px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,143,177,0.12), rgba(255,255,255,0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* 照片卡片悬停效果 */
.photo-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    z-index: 5;
}

/* 悬停时显示边框渐变 */
.photo-card:hover::before {
    opacity: 1;
}

/* 照片图片样式细化 */
.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease, filter 0.5s ease;
    display: block;
}

.photo-card:hover img {
    transform: scale(1.05);
    filter: brightness(1.1) contrast(1.05);
}

/* 照片标签样式 */
.photo-tag {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transform: translateY(-30px);
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.photo-card:hover .photo-tag {
    transform: translateY(0);
    opacity: 1;
}

/* 照片信息改进样式 */
.photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
}

.photo-card:hover .photo-info {
    transform: translateY(0);
    opacity: 1;
}

/* 加载和错误状态样式 */
.photo-card.loaded {
    opacity: 1;
}

.photo-card.error {
    background: rgba(255, 50, 50, 0.05);
    border-color: rgba(255, 50, 50, 0.2);
}

/* 改进照片加载动画 */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(0.98);
    }
}

/* 手机端优化 - 确保竖屏每张照片占一行 */
@media (max-width: 768px) {
    .photo-wall {
        grid-template-columns: 1fr; /* 每行只显示一张照片 */
        grid-auto-rows: auto;
        gap: 15px;
        padding: 15px;
        max-height: 75vh;
        z-index: 20;
    }
    
    .photo-card {
        height: 350px; /* 固定高度，使照片更醒目 */
        transform: translateY(0) scale(0.98);
        animation-duration: 0.4s;
        /* 允许过渡效果 - 只用于边框颜色变化 */
        transition: border-color 0.15s ease !important;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    
    /* 自定义手机端动画 */
    @keyframes fadeIn {
        0% {
            opacity: 0;
            transform: translateY(15px) scale(0.95);
        }
        100% {
            opacity: 1;
            transform: translateY(0) scale(0.98);
        }
    }
    
    /* 完全禁用移动端hover效果 */
    .photo-card:hover {
        transform: none !important;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3) !important;
        z-index: 5;
    }
    
    /* 禁用hover时的照片放大效果 */
    .photo-card:hover img {
        transform: none !important;
        filter: brightness(1) contrast(1) !important;
    }
    
    /* 禁用hover时的边框渐变效果 */
    .photo-card:hover::before {
        opacity: 0 !important;
    }
    
    /* 确保照片信息始终显示 */
    .photo-info {
        transform: translateY(0) !important;
        opacity: 0.9 !important;
        padding: 15px;
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    }
    
    /* 照片信息调整 */
    .photo-caption {
        font-size: 16px;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    }
    
    /* 始终显示照片标签 */
    .photo-tag {
        transform: translateY(0) !important;
        opacity: 0.9 !important;
    }
    
    /* 移动端照片卡片点击效果 - 添加柔和的粉红色边框效果 */
    .photo-card:active {
        transform: none !important;
        transition: none !important;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3) !important;
        border: 1px solid rgba(255, 143, 177, 0.7) !important; /* 更细的边框，半透明效果 */
    }
    
    /* 禁用hover时的边框效果 */
    .photo-card:hover .photo-border {
        opacity: 0 !important;
    }
    
    /* 禁用hover时的日期戳效果 */
    .photo-card:hover .photo-date-stamp {
        opacity: 0.8 !important;
        transform: none !important;
    }
}

/* 照片卡片特殊装饰 - 添加年代相机效果 */
.photo-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 8px solid rgba(255, 255, 255, 0.9);
    border-bottom-width: 24px;
    opacity: 0;
    transition: all 0.4s ease;
    pointer-events: none;
    transform: scale(1.1);
    z-index: 2;
}

.photo-card:hover .photo-border {
    opacity: 0.15;
    transform: scale(1);
}

/* 添加照片底部日期样式 */
.photo-date-stamp {
    position: absolute;
    bottom: 8px;
    right: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    font-family: monospace;
    z-index: 3;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 6px;
    border-radius: 3px;
}

.photo-card:hover .photo-date-stamp {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式全屏查看器优化 */
@media (max-width: 768px) {
    .fullscreen-close-btn {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }
    
    .fullscreen-caption {
        font-size: 18px;
    }
    
    .fullscreen-date {
        font-size: 14px;
    }
}

/* 诗篇样式 */
.poem {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.poem h2 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #ff8fb1;
    text-align: center;
}

.poem p {
    font-size: 1.2rem;
    line-height: 2;
    margin-bottom: 2rem;
}

/* 心愿树样式优化 - 更浪漫更有趣的版本 */
.wish-tree {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px;
    text-align: center;
    position: relative;
}

/* 添加装饰元素 */
.wish-tree::before {
    content: "♥";
    position: absolute;
    top: 10px;
    left: 30px;
    font-size: 24px;
    color: rgba(255, 143, 177, 0.6);
    animation: float-slow 4s ease-in-out infinite;
}

.wish-tree::after {
    content: "♥";
    position: absolute;
    bottom: 20px;
    right: 40px;
    font-size: 20px;
    color: rgba(255, 143, 177, 0.6);
    animation: float-slow 5s ease-in-out infinite;
}

.wish-tree h2 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.8rem;
    margin-bottom: 15px;
    color: #ff8fb1;
    text-shadow: 0 0 15px rgba(255, 143, 177, 0.5);
    animation: glow-soft 3s infinite alternate;
}

@keyframes glow-soft {
    from { text-shadow: 0 0 10px rgba(255, 143, 177, 0.5); }
    to { text-shadow: 0 0 20px rgba(255, 143, 177, 0.8); }
}

.wish-tree p {
    margin-bottom: 2rem;
    opacity: 0.9;
    font-size: 1.1rem;
    color: #ffd1dc;
}

.wish-container {
    position: relative;
    min-height: 450px;
    width: 100%;
    margin-top: 20px;
    /* 添加花瓣背景 */
    background-image: radial-gradient(circle at 10% 20%, rgba(255, 143, 177, 0.05) 0%, transparent 60%),
                      radial-gradient(circle at 80% 70%, rgba(255, 143, 177, 0.05) 0%, transparent 60%);
}

/* 更自然的网格布局 */
.wish-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(120px, auto);
    grid-gap: 25px;
    padding: 20px;
    max-height: 450px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 143, 177, 0.2) transparent;
}

@media (max-width: 768px) {
    /* 更自然的网格布局 */
    .wish-grid {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        grid-auto-rows: minmax(120px, auto);
        grid-gap: 25px;
        padding: 20px;
        max-height: 450px;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 143, 177, 0.2) transparent;
    }
}

/* 让每个网格项有一些随机偏移，使布局更自然 */
.wish-grid > div:nth-child(odd) {
    transform: translateY(5px);
}

.wish-grid > div:nth-child(3n+1) {
    transform: translateY(-8px);
}

.wish-grid > div:nth-child(4n) {
    transform: translateX(8px);
}

.wish-grid > div:nth-child(5n) {
    transform: translateX(-5px) translateY(10px);
}

/* 更美观的愿望卡片 */
.wish {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 20px;
    border-radius: 15px;
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15), 
                inset 0 0 15px rgba(255, 255, 255, 0.1);
    transition: all 0.5s ease;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 3px solid transparent;
    border-image: linear-gradient(to bottom, transparent, #ff8fb1, transparent);
    border-image-slice: 1;
    text-align: center;
    overflow: hidden;
    line-height: 1.5;
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* 随机边框颜色 */
.wish:nth-child(3n+1) {
    border-image: linear-gradient(to bottom, transparent, #ff8fb1, transparent);
    border-image-slice: 1;
}

.wish:nth-child(3n+2) {
    border-image: linear-gradient(to bottom, transparent, #bd9cf8, transparent);
    border-image-slice: 1;
}

.wish:nth-child(3n+3) {
    border-image: linear-gradient(to bottom, transparent, #98d6ea, transparent);
    border-image-slice: 1;
}

/* 悬停效果增强 */
.wish:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2),
                inset 0 0 20px rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.15);
    z-index: 10;
}

/* 为已完成的愿望添加更梦幻的风格 */
.wish.completed {
    background: rgba(144, 238, 144, 0.15);
    border-image: linear-gradient(to bottom, transparent, #90ee90, transparent);
    border-image-slice: 1;
    position: relative;
}

.wish.completed::before {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 16px;
    color: #90EE90;
    background: rgba(0, 0, 0, 0.2);
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(144, 238, 144, 0.5);
}

.wish.completed::after {
    content: "";
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    color: #a0f0a0;
    opacity: 0.9;
    font-weight: 300;
}

/* 完成的愿望悬浮时有特殊效果 */
.wish.completed:hover {
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2),
                inset 0 0 20px rgba(144, 238, 144, 0.2),
                0 0 15px rgba(144, 238, 144, 0.3);
}

/* 更丰富的动画 */
@keyframes float-slow {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) translateZ(0);
    }
    25% {
        transform: translateY(-8px) rotate(1deg) translateZ(0);
    }
    50% {
        transform: translateY(-12px) rotate(-1deg) translateZ(0);
    }
    75% {
        transform: translateY(-6px) rotate(1deg) translateZ(0);
    }
}

/* 让每个卡片有不同的浮动动画 */
.wish {
    animation: float 6s ease-in-out infinite;
}

.wish:nth-child(2n) {
    animation-delay: 0.7s;
    animation-duration: 7s;
}

.wish:nth-child(3n) {
    animation-delay: 1.2s;
    animation-duration: 8s;
}

.wish:nth-child(4n) {
    animation-delay: 1.8s;
    animation-duration: 9s;
}

.wish:nth-child(5n) {
    animation-delay: 2.3s;
    animation-duration: 10s;
}

/* 日期标签更美观 */
.wish-date {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 11px;
    opacity: 0.8;
    color: #ddf;
    font-style: italic;
    letter-spacing: 0.5px;
}

/* 自定义滚动条 */
.wish-grid::-webkit-scrollbar {
    width: 6px;
}

.wish-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.wish-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 143, 177, 0.3);
    border-radius: 10px;
}

.wish-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 143, 177, 0.5);
}

.wish-input-panel {
    position: fixed;
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 15px 15px 0 0;
    padding: 20px;
    transition: bottom 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.wish-input-panel.active {
    bottom: 0;
}

#wishText {
    width: 100%;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    color: #fff;
    font-family: 'Noto Serif SC', serif;
    resize: none;
}

#wishText::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#addWishBtn {
    background: linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
    border: none;
    border-radius: 25px;
    padding: 10px 25px;
    color: #333;
    font-family: 'Noto Serif SC', serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#addWishBtn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 结尾页样式 */
.end-content {
    text-align: center;
}

.floating-heart {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    /* background-image: url(https://cdn.staticaly.com/gh/htmlstudy/stars@main/heart.png); */
    background-size: cover;
    background-position: center;
    animation: floatHeart 4s ease-in-out infinite;
}

@keyframes floatHeart {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    50% {
        transform: translateX(-50%) translateY(-20px);
    }
}

.end-content h2 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: #ff8fb1;
}

.signature {
    font-style: italic;
    margin-bottom: 3rem;
    font-size: 1.2rem;
    text-align: center;
}

.restart-btn {
    display: inline-block;
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
}

.restart-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 修改分页导航样式 - 从底部移回右侧 */
.pagination {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 50;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 10px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

.dot.active {
    background: #ff8fb1;
    box-shadow: 0 0 10px #ff8fb1;
}


/* 修复滚动条问题 */
html, body {
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
}


/* 添加可滚动内容区域的样式 */
.scrollable-content {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* 为iOS添加平滑滚动 */
    max-height: 60vh; /* 限制高度以启用滚动 */
    padding-right: 10px; /* 为滚动条留出空间 */
}



#letterContent p, #poemContent p {
    text-align: center;
    margin-bottom: 1.5em;
    line-height: 1.8;
}

/* 让已实现的愿望有微妙的发光效果 */
@keyframes completedGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(144, 238, 144, 0.3); }
    50% { box-shadow: 0 0 10px rgba(144, 238, 144, 0.5); }
}

.wish.completed {
    animation: completedGlow 3s infinite ease-in-out, float 5s ease-in-out infinite;
}

/* 增强愿望卡片的可读性 */
.wish-content {
    width: 100%;
    position: relative;
    z-index: 2;
}

/* 日期标签样式 */
.wish-date {
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 10px;
    opacity: 0.7;
    color: #ddd;
}

/* 为许愿树添加页面预加载样式 */
.page-5:not(.active) .wish {
    opacity: 0 !important;
    transform: translateY(20px) !important;
    transition: none !important;
}

/* 许愿树页面激活时的入场动画 */
.page-5.active .wish {
    animation-play-state: running;
}

/* 调整动画性能 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg) translateZ(0);
    }
    25% {
        transform: translateY(-8px) rotate(1deg) translateZ(0);
    }
    50% {
        transform: translateY(-12px) rotate(-1deg) translateZ(0);
    }
    75% {
        transform: translateY(-6px) rotate(1deg) translateZ(0);
    }
}


@keyframes scrollText {
    0%, 10% { transform: translateX(0); }
    90%, 100% { transform: translateX(-100%); }
}

.attention-hint {
    animation: attention 0.82s cubic-bezier(.36,.07,.19,.97) both;
    transform: translateX(0);
    transition: none !important;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

@keyframes pulse-icon {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* 确保照片墙可滚动 */
.photo-wall {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 75vh;
    padding-right: 10px;
}

/* 确保情书页可滚动 */
.letter-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 80vh;
}

/* 增强触摸设备上的滚动体验 */
@media (max-width: 768px) {
    .scrollable-content,
    .photo-wall,
    .wish-container,
    .letter-content {
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        max-height: 70vh;
    }
    
    /* 为移动设备优化内容布局 */
    .content {
        /* padding: 20px; */
        max-height: 85vh;
        overflow: hidden;
    }
}


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

@keyframes promptFloat {
    from { transform: translateY(0); }
    to { transform: translateY(-5px); }
}

/* 添加全屏照片查看器样式 */
.photo-fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: viewerFadeIn 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    touch-action: none; /* 防止默认触摸行为 */
    overflow: hidden; /* 防止内容溢出 */
    overscroll-behavior: contain; /* 防止过度滚动影响外部 */
}

.photo-fullscreen-viewer.closing {
    animation: viewerFadeOut 0.3s ease forwards;
}

.fullscreen-img-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 85vh;
    overflow: hidden;
    touch-action: none; /* 防止默认触摸行为 */
}

.fullscreen-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    transition: transform 0.1s ease-out;
    transform-origin: center center;
    will-change: transform; /* 优化性能 */
    touch-action: none; /* 防止默认触摸行为 */
}

.fullscreen-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fullscreen-close-btn:hover {
    background: #ff8fb1;
    transform: rotate(90deg);
}

.fullscreen-info {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    max-width: 80%;
}

.fullscreen-caption {
    font-size: 24px;
    margin-bottom: 5px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.fullscreen-date {
    font-size: 16px;
    opacity: 0.8;
}

@keyframes viewerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes viewerFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes imgZoomIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* 自定义全局滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 143, 177, 0.3);
    border-radius: 10px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 143, 177, 0.5);
}

/* 针对Firefox的自定义滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 143, 177, 0.3) rgba(0, 0, 0, 0.2);
}

/* 添加一个美观的自定义滚动指示器 */
.custom-scroll-indicator {
    display: none; /* 隐藏而不是完全删除 */
}

/* 优化页面导航指示器样式 */
.page-indicator {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background-color: #ff8fb1;
    box-shadow: 0 0 10px rgba(255, 143, 177, 0.5);
    transform: scale(1.5);
}

/* 信件页面特殊导航 - 只在信件页面显示 */
.letter-navigation {
    position: absolute;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    display: none; /* 默认隐藏 */
    flex-direction: column;
    gap: 15px;
    z-index: 10;
}

.page-3.active .letter-navigation {
    display: flex; /* 仅在信件页面激活时显示 */
}

.letter-progress-bar {
    display: none; /* 默认隐藏 */
}

.page-3.active .letter-progress-bar {
    display: block; /* 仅在信件页面激活时显示 */
}

/* 添加缩放提示 */
.zoom-hint {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .fullscreen-close-btn {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }
    
    .fullscreen-info {
        position: absolute;
        bottom: 20px;
        padding: 0 20px;
        transition: opacity 0.3s ease;
        text-align: center;
        max-width: 100%;
        width: 100%;
        background: linear-gradient(transparent, rgba(0,0,0,0.7));
        padding-top: 30px;
    }
    
    .fullscreen-caption {
        font-size: 16px;
    }
    
    .fullscreen-date {
        font-size: 12px;
    }
}

/* 音乐播放器样式 */
.music-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(20, 20, 25, 0.75);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3), 
                0 0 15px rgba(255, 143, 177, 0.2),
                inset 0 0 10px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 50px;
    overflow: hidden;
    opacity: 0; /* 初始时隐藏 */
    visibility: hidden; /* 确保完全隐藏 */
    transform: translateY(20px); /* 初始位置偏移，为动画做准备 */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 显示音乐播放器时的状态 */
.music-player.ready {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.music-player.expanded {
    width: 300px;
    border-radius: 30px;
    background: rgba(20, 20, 25, 0.85);
}

/* 非展开状态下使用圆形边框 */
.music-player:not(.expanded) {
    border-radius: 50%;
    width: 60px;
    height: 60px;
    padding: 12px;
    justify-content: center;
    background: rgba(20, 20, 25, 0.75);
}

.music-player:not(.expanded) .player-controls,
.music-player:not(.expanded) .song-info {
    display: none;
}

.music-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 18px;
    min-width: 36px;
    position: relative;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8fb1, #bd9cf8);
    margin-right: 8px;
    box-shadow: 0 2px 8px rgba(255, 143, 177, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 非展开状态下移除右边距 */
.music-player:not(.expanded) .music-icon {
    margin-right: 0;
}

.music-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 12px rgba(255, 143, 177, 0.4);
}

.music-icon svg {
    transform: scale(1.1);  /* 稍微放大图标 */
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));  /* 添加微妙的阴影效果 */
}

.music-icon::after {
    content: "";
    position: absolute;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, rgba(255, 143, 177, 0.5), rgba(189, 156, 248, 0.5));
    border-radius: 50%;
    z-index: -1;
    animation: pulse-music 2s infinite;
    opacity: 0.7;
    filter: blur(8px);
}

@keyframes pulse-music {
    0% {
        transform: scale(1);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.4;
    }
    100% {
        transform: scale(1);
        opacity: 0.7;
    }
}

.song-info {
    margin: 0 15px;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

/* 歌曲名样式 */
.song-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    position: relative;
    padding-left: 2px;
}

/* 歌手名样式 */
.song-artist {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    padding-left: 2px;
    font-weight: 300;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 8px;
}

.control-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    font-size: 14px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
}

.control-btn:hover {
    opacity: 1;
    color: #ff8fb1;
    background-color: rgba(255, 255, 255, 0.1);
}

.play-pause-btn {
    opacity: 0.9;
    font-size: 16px;
    background: linear-gradient(135deg, rgba(255, 143, 177, 0.3), rgba(189, 156, 248, 0.3));
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.play-pause-btn:hover {
    opacity: 1;
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(255, 143, 177, 0.4), rgba(189, 156, 248, 0.4));
}

/* 添加播放进度效果 */
.music-player.playing .music-icon::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    animation: rotate 8s linear infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* 播放状态下图标微弱跳动 */
.music-player.playing .music-icon svg {
    animation: slight-bounce 2s ease-in-out infinite;
}

@keyframes slight-bounce {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.15); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 移动端样式 */
@media (max-width: 768px) {
    .music-player {
        bottom: 15px;
        right: 15px;
    }
    
    .music-player.expanded {
        width: 280px;
    }
}

/* 文本滚动容器 */
.text-scroll-container {
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* 当文本需要滚动时的样式 */
.text-scroll {
    display: inline-block;
    padding-right: 20px; /* 为滚动添加一些空间 */
    animation: none; /* 默认不滚动 */
}

/* 需要滚动时添加的类 */
.text-scroll.scrolling {
    animation: textScroll 8s linear infinite;
    animation-delay: 2s; /* 延迟开始滚动 */
}

/* 文本滚动动画 */
@keyframes textScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* 创建渐变遮罩效果，使文本开始和结束时有淡入淡出效果 */
.song-info::before,
.song-info::after {
    content: '';
    position: absolute;
    top: 0;
    width: 15px;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.song-info::before {
    left: 0;
    background: linear-gradient(to right, rgba(20, 20, 25, 0.85) 0%, rgba(20, 20, 25, 0) 100%);
}

.song-info::after {
    right: 0;
    background: linear-gradient(to left, rgba(20, 20, 25, 0.85) 0%, rgba(20, 20, 25, 0) 100%);
}

/* 新增图库样式 */
.gallery-wall {
    display: grid; /* 改用grid布局代替flex，更好控制列数 */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* 自动填充列，每列最小250px */
    gap: 25px; /* 增加间距 */
    padding: 25px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: center;
    margin: 0 auto; /* 居中整个墙 */
}

.gallery-card {
    position: relative;
    width: 100%; /* 宽度改为100%，适应grid单元格宽度 */
    min-height: 270px; /* 改为最小高度 */
    height: auto; /* 允许根据内容自动调整高度 */
    margin-bottom: 0; /* 移除底部外边距，由grid间距控制 */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    transform: translateY(30px);
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex; /* 添加弹性布局 */
    flex-direction: column; /* 垂直排列子元素 */
}

.gallery-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 143, 177, 0.3); /* 悬停时添加粉色边框效果 */
}

.gallery-photo-container {
    position: relative;
    width: 100%;
    height: 220px; /* 保持固定高度 */
    min-height: 220px; /* 确保最小高度 */
    overflow: hidden;
    flex: 0 0 auto; /* 不伸缩，保持大小 */
}

/* 图库封面 */
.gallery-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-cover {
    transform: scale(1.1);
}

/* 多照片叠加效果 */
.gallery-multi {
    position: relative;
}

.gallery-multi::before,
.gallery-multi::after {
    content: '';
    position: absolute;
    width: 95%; /* 增加宽度，使叠加更明显 */
    height: 95%; /* 增加高度，使叠加更明显 */
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: -1;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.gallery-multi::before {
    top: -5px;
    right: -5px;
    transform: rotate(3deg);
}

.gallery-multi::after {
    bottom: -5px;
    left: -5px;
    transform: rotate(-2deg);
}

/* 图库计数标签 */
.gallery-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 15px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
}

.gallery-count svg {
    margin-right: 4px;
    stroke: #ffffff; /* 白色图标 */
    vertical-align: text-bottom;
}

.gallery-date svg {
    margin-right: 4px;
    stroke: #ff9fd1; /* 使用粉色以匹配网站主题 */
    vertical-align: text-bottom;
    position: relative;
    top: -1px; /* 微调对齐 */
}

/* 图库信息 */
.gallery-info {
    padding: 8px 12px; /* 保持适当的内边距 */
    background-color: rgba(0, 0, 0, 0.7); /* 深色背景 */
    min-height: 50px; /* 改为最小高度而不是固定高度 */
    height: auto; /* 允许自动扩展高度 */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 保持居中对齐 */
    flex: 0 0 auto; /* 修改为不拉伸，使用自身高度 */
}

.gallery-title {
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 4px 0; /* 添加底部间距 */
    color: #fff;
    white-space: normal; /* 允许文本换行 */
    overflow: visible; /* 确保文本可见 */
    line-height: 1.2; /* 添加合适的行高 */
    max-height: none; /* 移除最大高度限制 */
}

.gallery-description {
    display: none; /* 隐藏描述，专注于标题和日期 */
}

.gallery-date {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    margin-top: 2px; /* 保持小间距 */
}

/* 相册展示蒙层 */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow: hidden; /* 防止内容溢出 */
    overscroll-behavior: contain; /* 防止过度滚动影响外部 */
    -webkit-tap-highlight-color: transparent; /* 移除触摸高亮 */
}

.gallery-modal.active {
    opacity: 1;
    visibility: visible;
}

.gallery-modal-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    z-index: 1002;
}

.gallery-modal-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.gallery-close-btn {
    width: 30px;
    height: 30px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gallery-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

/* 相册幻灯片 */
.gallery-slider {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-slide {
    position: absolute;
    width: 80%;
    height: 80%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.5s ease;
    opacity: 0;
    transform: scale(0.8);
}

.gallery-slide.active {
    opacity: 1;
    transform: scale(1);
}

.gallery-slide img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    pointer-events: none; /* 防止图片被拖动 */
    user-select: none; /* 防止图片被选中 */
    -webkit-user-drag: none; /* 防止图片被拖拽 */
}

.gallery-caption {
    margin-top: 15px;
    color: #fff;
    text-align: center;
    max-width: 90%;
    font-size: 14px;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .gallery-caption {
        font-size: 13px;
        margin-top: 12px;
        padding: 6px 10px;
    }
}

.gallery-navigation {
    position: absolute;
    bottom: 50px; /* 进一步提高位置，从30px上移到50px */
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1002;
}

.gallery-dots {
    display: flex;
    gap: 10px;
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.gallery-dot.active {
    background-color: #fff;
    transform: scale(1.2);
}

.gallery-prev, .gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1002;
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

.gallery-prev:hover, .gallery-next:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .gallery-wall {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); /* 调整移动端列宽 */
        gap: 15px;
        padding: 15px;
    }
    
    .gallery-card {
        min-height: 210px;
        height: auto;
        /* 允许过渡效果 - 只用于边框颜色变化 */
        transition: border-color 0.15s ease !important;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* 完全禁用hover效果 */
    .gallery-card:hover {
        transform: none !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
    }
    
    /* 添加图库卡片的点击效果 - 柔和的粉红色边框 */
    .gallery-card:active {
        transform: none !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2) !important;
        border: 1px solid rgba(255, 143, 177, 0.7) !important; /* 更细的边框，半透明效果 */
    }
    
    /* 禁用封面图片的hover效果 */
    .gallery-card:hover .gallery-cover {
        transform: none !important;
    }
    
    .gallery-photo-container {
        height: 170px;
        min-height: 170px;
        flex: 0 0 auto;
    }
    
    .gallery-info {
        padding: 6px 10px;
        min-height: 40px; /* 改为最小高度 */
        height: auto; /* 允许自动扩展 */
        flex: 0 0 auto; /* 修改为不拉伸，使用自身高度 */
    }
    
    .gallery-title {
        font-size: 12px;
        line-height: 1.2; /* 确保合适的行高 */
        margin: 0 0 2px 0; /* 更小的底部间距 */
    }
    
    .gallery-date {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .gallery-wall {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* 更小屏幕更窄列 */
        gap: 10px;
        padding: 10px;
    }
    
    .gallery-card {
        min-height: 190px; /* 更小屏幕减小卡片最小高度 */
        height: auto;
    }
    
    .gallery-photo-container {
        height: 150px;
        min-height: 150px;
        flex: 0 0 auto;
    }
    
    .gallery-info {
        min-height: 40px; /* 改为最小高度 */
        height: auto; /* 允许自动扩展 */
        padding: 5px 8px;
        flex: 0 0 auto; /* 修改为不拉伸，使用自身高度 */
    }
    
    .gallery-title {
        font-size: 11px;
        line-height: 1.2;
        margin: 0 0 1px 0; /* 更小的底部间距 */
    }
    
    .gallery-date {
        font-size: 9px;
        margin-top: 1px;
    }
}

/* 适配现有照片墙的动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 添加幻灯片切换动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 添加移动端滑动过渡效果 */
@media (max-width: 768px) {
    .gallery-slide {
        transition: transform 0.3s ease, opacity 0.3s ease;
        will-change: transform, opacity;
    }
    
    /* 确保容器能接收触摸事件 */
    .gallery-slider {
        position: relative;
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        touch-action: pan-y;
        user-select: none;
    }
    
    /* 隐藏移动端的导航按钮 */
    .gallery-prev, 
    .gallery-next {
        display: none;
    }
    
    /* 调整移动端导航点的样式 */
    .gallery-navigation {
        bottom: 50px; /* 进一步提高位置，从30px上移到50px */
    }
    
    .gallery-dots {
        gap: 8px; /* 缩小间距 */
    }
    
    /* 缩小移动端导航点的大小 */
    .gallery-dot {
        width: 8px;
        height: 8px;
        margin: 0 2px;
        opacity: 0.6; /* 降低默认不活跃状态的不透明度 */
    }
    
    .gallery-dot.active {
        width: 9px;
        height: 9px;
        opacity: 1;
        background-color: #fff;
    }
    
    /* 提升导航点的淡出效果 */
    .gallery-swipe-hint {
        bottom: 100px !important; /* 提高滑动提示的位置，避免与导航点重叠 */
    }
}

/* 添加在CSS文件的末尾 */

/* 音乐播放器离线状态样式 */
.music-player.offline .music-icon::after {
    content: "";
    position: absolute;
    top: -5px;
    right: -5px;
    width: 12px;
    height: 12px;
    background-color: #ff5252;
    border-radius: 50%;
    border: 2px solid #000;
    animation: pulse-offline 2s infinite;
}

@keyframes pulse-offline {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 5px rgba(255, 82, 82, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 82, 82, 0); }
}

/* 通知样式 */
.music-notification {
    position: fixed;
    bottom: 80px;
    right: 20px;
    padding: 8px 12px;
    border-radius: 4px;
    color: white;
    font-size: 14px;
    z-index: 1001;
    opacity: 1;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    max-width: 250px;
}

.music-notification.error {
    background-color: rgba(255, 87, 87, 0.85);
}

.music-notification.success {
    background-color: rgba(75, 181, 67, 0.85);
}

.music-notification.info {
    background-color: rgba(0, 0, 0, 0.7);
}
