/**
 * 时光播放特效样式
 * 华丽温馨的时光树动态展示效果
 */

/* 控制按钮区域 */
.timeline-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* 播放按钮 */
.timeline-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 2rem;
    background: linear-gradient(135deg, #d4a574, #c9a96e);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
}

.timeline-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.4);
}

.timeline-play-btn.playing {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    animation: pulse-glow 1.5s ease-in-out infinite;
}

.timeline-play-btn .play-icon {
    font-size: 1.1rem;
}

/* 重置按钮 */
.timeline-reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    color: #c9a96e;
    border: 1px solid rgba(201, 169, 110, 0.3);
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-reset-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(201, 169, 110, 0.5);
}

/* 时光粒子层 */
.timeline-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.timeline-particles.active {
    opacity: 1;
}

/* 光点粒子 */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #ffd700, #c9a96e);
    border-radius: 50%;
    opacity: 0;
    animation: particle-fall 4s ease-in-out infinite;
    filter: blur(1px);
}

.particle::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4), transparent);
    border-radius: 50%;
    animation: particle-glow 2s ease-in-out infinite;
}

/* 星星粒子 */
.particle-star {
    position: absolute;
    font-size: 14px;
    color: #ffd700;
    opacity: 0;
    animation: star-fall 3s ease-in-out forwards;
    filter: drop-shadow(0 0 5px #ffd700);
    pointer-events: none;
}

@keyframes star-fall {
    0% {
        opacity: 0;
        transform: translateY(-50px) scale(0.5);
    }
    10% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    90% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(200px) scale(0.3);
    }
}

@keyframes star-fall-to {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.3);
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(var(--fall-distance, 300px)) scale(0.2);
    }
}

@keyframes star-twinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes particle-fall {
    0% {
        opacity: 0;
        transform: translateY(-20px) rotate(0deg);
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(360deg);
    }
}

@keyframes particle-glow {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.5); }
}

@keyframes star-twinkle {
    0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
    50% { opacity: 1; transform: scale(1.2) rotate(180deg); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3); }
    50% { box-shadow: 0 4px 25px rgba(231, 76, 60, 0.6), 0 0 30px rgba(231, 76, 60, 0.3); }
}

/* 时光节点样式 */
.timeline-item {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 播放前 - 隐藏状态 */
.timeline-item.timeline-hidden {
    opacity: 0;
    transform: translateY(40px) scale(0.92);
    filter: blur(8px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 播放中 - 展开动画 */
.timeline-item.timeline-reveal {
    animation: timeline-reveal 1.2s cubic-bezier(0.34, 1.1, 0.64, 1) forwards;
}

@keyframes timeline-reveal {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.92);
        filter: blur(8px);
    }
    25% {
        opacity: 0.6;
        transform: translateY(15px) scale(0.97);
        filter: blur(3px);
    }
    50% {
        opacity: 0.85;
        transform: translateY(-8px) scale(1.03);
        filter: blur(1px);
    }
    75% {
        opacity: 1;
        transform: translateY(3px) scale(0.99);
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* 年份标题特效 */
.timeline-item.timeline-reveal .timeline-year {
    animation: year-shine 1.5s ease-out forwards;
}

@keyframes year-shine {
    0% {
        color: #c9a96e;
        text-shadow: none;
    }
    50% {
        color: #ffd700;
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 0 40px rgba(201, 169, 110, 0.3);
    }
    100% {
        color: #c9a96e;
        text-shadow: 0 2px 10px rgba(201, 169, 110, 0.3);
    }
}

/* 图片展示动画 */
.timeline-item.timeline-reveal .timeline-photos img {
    animation: photo-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(var(--photo-index, 0) * 0.15s + 0.3s);
    opacity: 0;
}

@keyframes photo-pop {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
        filter: brightness(1.5) saturate(0);
    }
    70% {
        opacity: 1;
        transform: scale(1.05) rotate(2deg);
        filter: brightness(1.1) saturate(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: brightness(1) saturate(1);
    }
}

/* 进度指示器 */
.timeline-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(201, 169, 110, 0.2);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-progress.active {
    opacity: 1;
}

.timeline-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #d4a574, #ffd700, #c9a96e);
    width: 0%;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* 当前节点高亮 */
.timeline-item.timeline-current {
    background: rgba(255, 215, 0, 0.05);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(201, 169, 110, 0.2);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 完成状态 */
.timeline-item.timeline-done {
    opacity: 0.7;
    transform: none !important;
    filter: none !important;
    animation: none !important;
    transition: opacity 0.5s ease, box-shadow 0.3s ease;
}

/* 响应式 */
@media (max-width: 768px) {
    .timeline-play-btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }

    .particle {
        width: 5px;
        height: 5px;
    }

    .particle-star {
        font-size: 8px;
    }
}

/* ===== 2026最终章特效 ===== */

/* 全屏闪光 */
.timeline-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 215, 0, 0.6) 0%, rgba(255, 215, 0, 0.3) 30%, transparent 70%);
    z-index: 9999;
    pointer-events: none;
    animation: flash-burst 1s ease-out forwards;
}

@keyframes flash-burst {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    20% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* 最终章年份文字特效 */
.timeline-year-finale {
    animation: year-grand-finale 2s ease-out forwards !important;
}

@keyframes year-grand-finale {
    0% {
        color: #c9a96e;
        text-shadow: none;
        transform: scale(1);
    }
    30% {
        color: #ffd700;
        text-shadow: 0 0 30px rgba(255, 215, 0, 0.8), 0 0 60px rgba(255, 215, 0, 0.5), 0 0 90px rgba(201, 169, 110, 0.3);
        transform: scale(1.3);
    }
    60% {
        color: #ffd700;
        text-shadow: 0 0 25px rgba(255, 215, 0, 0.7), 0 0 50px rgba(201, 169, 110, 0.4);
        transform: scale(1.2);
    }
    100% {
        color: #c9a96e;
        text-shadow: 0 2px 10px rgba(201, 169, 110, 0.3);
        transform: scale(1);
    }
}

/* 庆祝状态下的时光节点 */
.timeline-item.timeline-celebrate {
    animation: celebrate-glow 1s ease-out forwards !important;
}

@keyframes celebrate-glow {
    0% {
        filter: brightness(1);
    }
    50% {
        filter: brightness(1.5) saturate(1.3);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
    }
    100% {
        filter: brightness(1);
        box-shadow: none;
    }
}

/* 最终章粒子 */
.particle-finale {
    background: radial-gradient(circle, #ffd700, #ff6b6b, #c9a96e) !important;
    width: 12px !important;
    height: 12px !important;
    animation: particle-explode 3s ease-out forwards !important;
}

@keyframes particle-explode {
    0% {
        opacity: 0;
        transform: scale(0) translateY(0);
    }
    20% {
        opacity: 1;
        transform: scale(1.2) translateY(-20px);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) translateY(-100px);
    }
}

/* 最终章星星 */
.particle-star-finale {
    animation: star-explode 2s ease-out forwards !important;
    filter: drop-shadow(0 0 10px #ffd700) !important;
}

@keyframes star-explode {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    30% {
        opacity: 1;
        transform: scale(1.5) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(360deg) translateY(-50px);
    }
}

/* 最终章背景渐变 */
body.timeline-finale-bg {
    background: linear-gradient(180deg,
        rgba(255, 215, 0, 0.05) 0%,
        rgba(255, 255, 255, 0) 30%,
        rgba(201, 169, 110, 0.03) 100%) !important;
    animation: bg-finale-pulse 3s ease-out forwards !important;
}

@keyframes bg-finale-pulse {
    0% {
        background-color: transparent;
    }
    30% {
        background-color: rgba(255, 215, 0, 0.08);
    }
    100% {
        background-color: transparent;
    }
}

/* 播放完成按钮状态 */
.timeline-play-btn.playing-complete {
    background: linear-gradient(135deg, #ffd700, #c9a96e) !important;
    animation: btn-grand-finale 2s ease-out forwards !important;
}

@keyframes btn-grand-finale {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.6), 0 0 80px rgba(201, 169, 110, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
    }
}