﻿/* 基础变量与重置 */
:root {
    --primary-color: #0b164a;
    --accent-color: #1a73e8;
    --text-main: #333333;
    --text-light: #666666;
    --bg-gray: #f8f9fa;
    --border-color: #eaeaea;
    --bg-light-blue: #f0f5ff;
    --success-color: #2e7d32;
    --success-bg: #e8f5e9;
}

/* 时间轴容器 */
.timeline {
    position: relative;
    padding-bottom: 40px;
}

    .timeline::before {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        left: 20px;
        width: 4px;
        background: var(--border-color);
        border-radius: 2px;
    }

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 40px;
}

    .timeline-item::before {
        content: '';
        position: absolute;
        left: 12px;
        top: 6px;
        width: 20px;
        height: 20px;
        background: #ffffff;
        border: 4px solid var(--accent-color);
        border-radius: 50%;
        z-index: 1;
        transition: transform 0.3s ease;
    }

    .timeline-item:hover::before {
        transform: scale(1.2);
        background: var(--accent-color);
    }

.year-title {
    font-size: 1.6rem;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 16px;
}

.history-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.3s ease;
    overflow: hidden; /* 防止滚动条溢出卡片 */
}

    .history-card:hover {
        box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    }

    .history-card p {
        font-size: 0.95rem;
        color: var(--text-light);
        margin-bottom: 12px;
    }

        .history-card p:last-child {
            margin-bottom: 0;
        }

    .history-card a {
        color: var(--accent-color);
        text-decoration: none;
        font-weight: 500;
        word-break: break-all;
    }

        .history-card a:hover {
            text-decoration: underline;
        }

.index-badge {
    display: inline-flex;
    align-items: center;
    background-color: var(--success-bg);
    color: var(--success-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 8px 0 16px 0;
    border: 1px solid rgba(46, 125, 50, 0.2);
}

/* ===== 横向滚动照片画廊 ===== */
.photo-scroll-wrapper {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px dashed var(--border-color);
}

.photo-scroll-title {
    font-size: 0.95rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.photo-scroll-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px; /* 留出滚动条空间 */
    scroll-snap-type: x mandatory; /* 滚动吸附 */
    -webkit-overflow-scrolling: touch; /* 手机端平滑滚动 */
}

    /* 美化滚动条 (Webkit) */
    .photo-scroll-container::-webkit-scrollbar {
        height: 8px;
    }

    .photo-scroll-container::-webkit-scrollbar-track {
        background: var(--bg-gray);
        border-radius: 4px;
    }

    .photo-scroll-container::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 4px;
    }

        .photo-scroll-container::-webkit-scrollbar-thumb:hover {
            background: var(--accent-color);
        }

/* 图片容器 */
.photo-item {
    flex: 0 0 240px; /* 固定宽度，不伸缩 */
    scroll-snap-align: start;
    cursor: zoom-in;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

    .photo-item img {
        width: 100%;
        height: 160px;
        object-fit: cover;
        display: block;
        transition: transform 0.3s ease;
    }

    .photo-item:hover img {
        transform: scale(1.05);
    }

/* ===== 全屏灯箱 (Lightbox) ===== */
.lightbox {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px); /* 背景模糊效果 */
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .lightbox.active {
        display: flex;
        opacity: 1;
    }

    .lightbox img {
        max-width: 90%;
        max-height: 85vh;
        object-fit: contain;
        border-radius: 4px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        transform: scale(0.95);
        transition: transform 0.3s ease;
    }

    .lightbox.active img {
        transform: scale(1);
    }

/* 关闭按钮 */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #ffffff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

    .lightbox-close:hover {
        color: var(--accent-color);
    }

/* 移动端适配 */
@media (max-width: 768px) {
    .timeline::before {
        left: 10px;
    }

    .timeline-item {
        padding-left: 36px;
    }

        .timeline-item::before {
            left: 2px;
            width: 16px;
            height: 16px;
            top: 8px;
        }

    .year-title {
        font-size: 1.3rem;
    }

    .history-card {
        padding: 16px;
    }

    .photo-item {
        flex: 0 0 200px; /* 手机端照片稍微变窄 */
    }

        .photo-item img {
            height: 130px;
        }
}