/* 才不是你的小麦 - 回忆页面样式 */

.memory-view {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: fixed;
    inset: 0;
    overflow: hidden;
    padding: 0;
    z-index: 1;
}

/* 粒子背景 */
.memory-particles {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.memory-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: float 15s infinite;
    box-shadow: 
        0 0 10px rgba(255, 255, 255, 0.8),
        0 0 20px rgba(255, 255, 255, 0.4),
        0 0 30px rgba(255, 200, 150, 0.3);
}

/* 不同大小的粒子 */
.memory-particle:nth-child(3n) {
    width: 6px;
    height: 6px;
    background: rgba(255, 220, 150, 0.9);
    box-shadow: 
        0 0 15px rgba(255, 220, 150, 0.9),
        0 0 30px rgba(255, 200, 100, 0.5);
}

.memory-particle:nth-child(5n) {
    width: 3px;
    height: 3px;
    background: rgba(200, 220, 255, 0.9);
    box-shadow: 
        0 0 10px rgba(200, 220, 255, 0.9),
        0 0 20px rgba(150, 200, 255, 0.5);
}

.memory-particle:nth-child(7n) {
    width: 5px;
    height: 5px;
    background: rgba(255, 180, 200, 0.9);
    box-shadow: 
        0 0 12px rgba(255, 180, 200, 0.9),
        0 0 25px rgba(255, 150, 180, 0.5);
}

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(0);
        opacity: 0;
    }
    5% {
        opacity: 1;
        transform: translateY(90vh) rotate(36deg) scale(1);
    }
    95% {
        opacity: 1;
        transform: translateY(-10vh) rotate(684deg) scale(1);
    }
    100% {
        transform: translateY(-20vh) rotate(720deg) scale(0);
        opacity: 0;
    }
}

/* 背景动画效果 */
.memory-view::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 40%);
    animation: backgroundPulse 8s ease-in-out infinite;
    z-index: 1;
}

@keyframes backgroundPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* 滚动照片墙容器 - 参考手机销售页面 */
.memory-photo-wall-container {
    position: fixed;
    inset: 0;
    z-index: 99;
    pointer-events: none;
    overflow: hidden;
    filter: saturate(115%) contrast(96%);
    animation: wallTiltDrift 140s linear infinite alternate;
    transform-origin: 50% 50%;
}

/* 倾斜角度动画 */
@keyframes wallTiltDrift {
    0% {
        transform: rotate(-6deg) translate3d(0, -3%, 0) scale(1.18);
    }
    100% {
        transform: rotate(-6deg) translate3d(-10%, 6%, 0) scale(1.18);
    }
}

/* 照片墙 - 多行滚动 */
.memory-photo-wall {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 0;
    will-change: transform;
}

/* 滚动行 - 减慢速度 */
.photo-row {
    display: flex;
    gap: 12px;
    width: max-content;
    will-change: transform;
    animation: wallSlide 240s linear infinite alternate;
}

.photo-row:nth-child(2) {
    animation-duration: 280s;
}

.photo-row:nth-child(3) {
    animation-duration: 320s;
}

.photo-row:nth-child(4) {
    animation-duration: 260s;
}

.photo-row:nth-child(5) {
    animation-duration: 300s;
}

.photo-row:nth-child(6) {
    animation-duration: 270s;
}

.photo-row:nth-child(7) {
    animation-duration: 330s;
}

@keyframes wallSlide {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* 照片项 - 统一尺寸 */
.memory-photo-item {
    position: relative;
    flex: 0 0 auto;
    width: 220px;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.14);
    background: white;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.memory-photo-item:hover {
    transform: translateY(-10px) scale(1.08);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(255, 119, 198, 0.2);
    z-index: 100;
    opacity: 1;
}

.memory-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: all 0.4s ease;
}

.memory-photo-item:hover img {
    transform: scale(1.1);
}

/* 半透明遮罩预览 */
.memory-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.memory-preview-overlay.active {
    opacity: 1;
    visibility: visible;
}

.memory-preview-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.memory-preview-overlay.active .memory-preview-content {
    transform: scale(1);
}

.memory-preview-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.memory-preview-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.memory-preview-close:hover {
    transform: scale(1.1);
    background: var(--sakura-pink);
    color: white;
}

/* 加载动画 */
.memory-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50vh;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

.memory-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--wheat-gold);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .memory-photo-wall-container {
        z-index: 99;
    }

    .photo-row {
        gap: 8px;
        animation-duration: 160s;
    }

    .photo-row:nth-child(2) {
        animation-duration: 180s;
    }

    .photo-row:nth-child(3) {
        animation-duration: 200s;
    }

    .photo-row:nth-child(4) {
        animation-duration: 170s;
    }

    .photo-row:nth-child(5) {
        animation-duration: 190s;
    }

    .photo-row:nth-child(6) {
        animation-duration: 175s;
    }

    .photo-row:nth-child(7) {
        animation-duration: 205s;
    }

    .memory-photo-item {
        width: 160px;
        height: 120px;
        border-radius: 10px;
    }

    .memory-preview-content {
        max-width: 95%;
    }

    .memory-preview-content img {
        max-height: 70vh;
    }

    .memory-preview-close {
        top: -40px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .photo-row {
        gap: 6px;
    }

    .memory-photo-item {
        width: 130px;
        height: 100px;
        border-radius: 8px;
    }
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .photo-row {
        animation: none !important;
    }
    .memory-view::before {
        animation: none;
    }
    .memory-header h2 {
        animation: none;
    }
    .memory-photo-wall-container {
        animation: none;
        transform: rotate(-6deg) scale(1.18);
    }
}

/* 照片项悬停时的光晕效果 */
.memory-photo-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%, rgba(255,255,255,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.memory-photo-item:hover::before {
    opacity: 1;
}