/**
 * 时光轴「流金岁月」样式
 * 每一年像一帧被时光染上颜色的老电影
 */

/* ==================== 时光轴区域 ==================== */
.timeline-section {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(250, 248, 245, 0.95));
    border-radius: 24px;
    padding: 30px 25px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

/* 装饰边框 */
.timeline-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg,
        var(--secondary) 0%,
        var(--accent) 25%,
        var(--secondary) 50%,
        var(--accent) 75%,
        var(--secondary) 100%
    );
    background-size: 200% 100%;
    animation: timeline-border-flow 4s linear infinite;
}

@keyframes timeline-border-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* 角落装饰 */
.timeline-section::after {
    content: '✎';
    position: absolute;
    bottom: 15px;
    right: 20px;
    font-size: 1.5rem;
    opacity: 0.15;
    color: var(--secondary);
}

/* ==================== 时间线 ==================== */
.timeline {
    position: relative;
    padding-left: 50px;
}

/* 主时间线 - 渐变色带 */
.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom,
        transparent 0%,
        var(--secondary) 5%,
        var(--accent) 30%,
        var(--secondary) 60%,
        var(--accent) 85%,
        transparent 100%
    );
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

/* ==================== 时间节点 ==================== */
.timeline-item {
    position: relative;
    padding-bottom: 25px;
    padding-left: 30px;
}

/* 时间胶囊 */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -42px;
    top: -5px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    border-radius: 50%;
    border: 4px solid var(--card-bg);
    box-shadow:
        0 0 0 2px var(--secondary),
        0 0 15px rgba(231, 76, 60, 0.4);
    z-index: 2;
}

/* 时间胶囊脉冲动画 */
.timeline-item::after {
    content: '';
    position: absolute;
    left: -42px;
    top: -5px;
    width: 24px;
    height: 24px;
    background: var(--secondary);
    border-radius: 50%;
    opacity: 0;
    animation: timeline-pulse 2s ease-out infinite;
    z-index: 1;
}

@keyframes timeline-pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* ==================== 年份标签 ==================== */
.timeline-year {
    font-family: 'ZCOOL XiaoWei', 'Noto Serif SC', serif;
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

/* 年份装饰框 */
.timeline-year::before {
    content: '';
    position: absolute;
    left: -10px;
    right: -10px;
    top: -5px;
    bottom: -5px;
    border: 2px solid var(--secondary);
    border-radius: 8px;
    opacity: 0.2;
    transform: skewX(-5deg);
}

.timeline-year::after {
    content: '';
    position: absolute;
    left: -30px;
    top: 50%;
    width: 20px;
    height: 2px;
    background: linear-gradient(to left, var(--secondary), transparent);
}

/* ==================== 事件内容 ==================== */
.timeline-event {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(250, 248, 245, 0.7));
    padding: 18px 20px;
    border-radius: 12px;
    border-left: 4px solid var(--accent);
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.7;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    position: relative;
    transition: all 0.3s ease;
}

.timeline-event:hover {
    transform: translateX(5px);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border-left-color: var(--secondary);
}

/* 事件内容引号装饰 */
.timeline-event::before {
    content: '"';
    position: absolute;
    top: 5px;
    left: 10px;
    font-size: 2rem;
    color: var(--accent);
    opacity: 0.2;
    font-family: serif;
}

/* ==================== 照片展示 ==================== */
.timeline-photos {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.timeline-photos img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    filter: sepia(0.1);
}

.timeline-photos img:hover {
    transform: scale(1.1) rotate(2deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    filter: sepia(0);
}

/* ==================== 入场动画 ==================== */
@keyframes timeline-arrive {
    0% {
        opacity: 0;
        transform: translateX(-30px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

.timeline-item {
    animation: timeline-arrive 0.6s ease-out backwards;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.6s; }
.timeline-item:nth-child(7) { animation-delay: 0.7s; }
.timeline-item:nth-child(8) { animation-delay: 0.8s; }
.timeline-item:nth-child(9) { animation-delay: 0.9s; }
.timeline-item:nth-child(10) { animation-delay: 1s; }

/* ==================== 夜间模式 ==================== */
body.night-mode .timeline-section {
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.95), rgba(22, 33, 62, 0.98)) !important;
}

body.night-mode .timeline::before {
    background: linear-gradient(to bottom,
        transparent 0%,
        var(--secondary) 5%,
        var(--accent) 30%,
        var(--secondary) 60%,
        var(--accent) 85%,
        transparent 100%
    );
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.3);
}

body.night-mode .timeline-item::before {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    border-color: var(--bg);
    box-shadow:
        0 0 0 2px var(--secondary),
        0 0 20px rgba(243, 156, 18, 0.4);
}

body.night-mode .timeline-year {
    color: var(--accent);
}

body.night-mode .timeline-year::before {
    border-color: var(--accent);
    opacity: 0.3;
}

body.night-mode .timeline-event {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9), rgba(22, 33, 62, 0.8));
    color: var(--text);
    border-left-color: var(--accent);
}

body.night-mode .timeline-event:hover {
    background: linear-gradient(135deg, rgba(37, 37, 69, 0.9), rgba(26, 40, 64, 0.8));
    border-left-color: var(--secondary);
}

body.night-mode .timeline-photos img {
    filter: sepia(0.2) brightness(0.9);
}

body.night-mode .timeline-photos img:hover {
    filter: sepia(0) brightness(1);
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 768px) {
    .timeline-section {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .timeline {
        padding-left: 40px;
    }

    .timeline::before {
        left: 12px;
        width: 3px;
    }

    .timeline-item {
        padding-bottom: 30px;
        padding-left: 20px;
    }

    .timeline-item::before {
        left: -35px;
        width: 20px;
        height: 20px;
    }

    .timeline-item::after {
        left: -35px;
        width: 20px;
        height: 20px;
    }

    .timeline-year {
        font-size: 1.2rem;
    }

    .timeline-year::before {
        display: none;
    }

    .timeline-year::after {
        width: 15px;
    }

    .timeline-event {
        padding: 14px 16px;
        font-size: 0.9rem;
    }

    .timeline-photos img {
        width: 55px;
        height: 55px;
    }
}

@media (max-width: 480px) {
    .timeline-section {
        padding: 25px 15px;
    }

    .timeline {
        padding-left: 35px;
    }

    .timeline::before {
        left: 10px;
    }

    .timeline-item::before {
        left: -30px;
        width: 16px;
        height: 16px;
    }

    .timeline-item::after {
        left: -30px;
        width: 16px;
        height: 16px;
    }

    .timeline-year {
        font-size: 1.1rem;
    }

    .timeline-event {
        padding: 12px 14px;
        font-size: 0.85rem;
        line-height: 1.6;
    }

    .timeline-photos {
        gap: 6px;
    }

    .timeline-photos img {
        width: 48px;
        height: 48px;
    }
}

/* 时光上传提示 */
.timeline-upload-tip {
    font-size: 0.85rem;
    color: #5d4037;
    text-align: center;
    margin-top: 1.5rem;
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    border: 1px solid rgba(212, 165, 116, 0.35);
}

@keyframes tip-glow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(212, 165, 116, 0.1);
    }
    50% { 
        box-shadow: 0 0 15px rgba(212, 165, 116, 0.2);
    }
}

.timeline-upload-tip a {
    transition: all 0.3s ease;
}

.timeline-upload-tip a:hover {
    color: #e0b584;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .timeline-upload-tip {
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
    }
}
