/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: linear-gradient(135deg, #ffeef8 0%, #ffe0f0 50%, #ffd1e8 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* 飘落的爱心动画 */
#hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.heart {
    position: absolute;
    color: rgba(255, 105, 180, 0.6);
    animation: fall linear infinite;
    font-size: 20px;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 100px)) rotate(360deg);
        opacity: 0;
    }
}

/* 头部样式 */
.gallery-header {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 105, 180, 0.3);
    position: relative;
    z-index: 10;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.gallery-title {
    font-family: 'Dancing Script', cursive;
    font-size: 3.5rem;
    color: #d63384;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: heartbeat 2s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.gallery-subtitle {
    font-size: 1.2rem;
    color: #8e5a5a;
    margin-bottom: 20px;
    font-weight: 300;
}

.back-btn {
    display: inline-block;
    padding: 12px 25px;
    background: linear-gradient(45deg, #ff6b9d, #ff8e9e);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.4);
}

/* 相册容器 */
.gallery-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 相册项目 */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: itemFadeIn 0.8s ease-out backwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }
.gallery-item:nth-child(7) { animation-delay: 0.7s; }
.gallery-item:nth-child(8) { animation-delay: 0.8s; }

@keyframes itemFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8) rotateY(90deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotateY(0deg);
    }
}

.photo-frame {
    position: relative;
    width: 100%;
    height: 250px;
    background: white;
    padding: 10px;
    border: 3px solid transparent;
    background-image: linear-gradient(white, white), 
                      linear-gradient(45deg, #ff6b9d, #ff8e9e);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.5s ease;
}

.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 107, 157, 0.8) 100%);
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
    border-radius: 8px;
}

.photo-info {
    color: white;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.photo-info h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.photo-info p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.gallery-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 35px rgba(255, 107, 157, 0.3);
}

.gallery-item:hover .gallery-image {
    transform: scale(1.1);
}

.gallery-item:hover .photo-overlay {
    opacity: 1;
}

.gallery-item:hover .photo-info {
    transform: translateY(0);
}

/* 灯箱效果 */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: 5% auto;
    text-align: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-info {
    color: white;
    margin-top: 20px;
}

.lightbox-info h3 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.lightbox-info p {
    font-size: 1.1rem;
    opacity: 0.8;
}

.close-lightbox {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.close-lightbox:hover {
    transform: rotate(90deg);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.prev-btn, .next-btn {
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: rgba(255, 107, 157, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.prev-btn:hover, .next-btn:hover {
    background: rgba(255, 107, 157, 0.8);
    transform: scale(1.1);
}

/* 页脚 */
.gallery-footer {
    text-align: center;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    border-top: 2px solid rgba(255, 105, 180, 0.3);
    margin-top: 60px;
    position: relative;
    z-index: 10;
}

.gallery-footer p {
    color: #8e5a5a;
    font-size: 1.1rem;
    font-weight: 300;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .gallery-title {
        font-size: 2.5rem;
    }
    
    .gallery-subtitle {
        font-size: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .photo-frame {
        height: 200px;
    }
    
    .lightbox-nav {
        padding: 0 10px;
    }
    
    .prev-btn, .next-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .gallery-title {
        font-size: 2rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gallery-container {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .photo-frame {
        height: 180px;
    }
    
    .lightbox-info h3 {
        font-size: 1.4rem;
    }
    
    .lightbox-info p {
        font-size: 1rem;
    }
}