:root {
    --primary-purple: #7e5bef;
    --light-purple: #f9f5ff;
    --accent-purple: #9d4edd;
    --dark-purple: #5a189a;
    --text-dark: #2d1b69;
    --text-light: #fbe6ff;
    --card-shadow: 0 8px 32px rgba(126, 91, 239, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* 新增变量：星点流动速度 */
    --star-speed: 20s;
    /* 发光主色 */
    --glow-color: rgba(157, 78, 221, .75);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--light-purple);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.history-title {
    text-align: center;
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    font-weight: 700;
}

.history-title .highlight {
    background: linear-gradient(135deg, var(--primary-purple), var(--accent-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.history-subtitle {
    text-align: center;
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 3rem;
}

/* ===== 筛选器 ===== */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--primary-purple);
    background: transparent;
    color: var(--primary-purple);
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-purple);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(126, 91, 239, 0.3);
}

/* ===== 时间线 ===== */
.timeline-container {
    position: relative;
    padding: 2rem 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-purple), var(--accent-purple));
    transform: translateX(-50%);
    transition: height 0.5s ease;
}

.timeline-event {
    position: relative;
    margin-bottom: 3rem;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s ease;
}

.timeline-event.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    height: 0;
    margin: 0;
    overflow: hidden;
}

/* 左右分布 */
.timeline-event.left .timeline-content {
    margin-right: 50%;
    padding-right: 3rem;
    text-align: right;
}

.timeline-event.right .timeline-content {
    margin-left: 50%;
    padding-left: 3rem;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 1.5rem;
    width: 20px;
    height: 20px;
    background: var(--primary-purple);
    border: 4px solid white;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 0 4px rgba(126, 91, 239, 0.2);
    z-index: 10;
    transition: var(--transition);
}

.timeline-event:hover .timeline-dot {
    transform: translateX(-50%) scale(1.2);
    box-shadow: 0 0 0 6px rgba(126, 91, 239, 0.3);
}

.timeline-content {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(126, 91, 239, 0.1);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}


/* ===== 星空悬浮层 ===== */
/*  悬停：周身霓虹 + 微微上浮 */
.timeline-content:hover{
    background: transparent;          /* 让星空透出来 */
    transform: translateY(-6px) scale(1.03);
    box-shadow:
        0 0 12px 2px  var(--glow-color),
        0 0 24px 6px  rgba(157, 78, 221, .5),
        0 0 48px 12px rgba(126, 91, 239, .25);
}

/* 星空底层（四色渐变，静止） ===== */
.timeline-content::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: 0;
    transition: opacity .4s;
    background: linear-gradient(135deg,
                                #2d1b69 0%,
                                #5a189a 30%,
                                #7e5bef 70%,
                                #9d4edd 100%);
}
.timeline-content:hover::before { opacity: 1; }

/* ===== 星星粒子层（流动） ===== */
.timeline-content::after {
    content: '';
    position: absolute;
    inset: -50%;                /* 溢出一点，让流动更自然 */
    width: 200%;
    height: 200%;
    z-index: -1;
    opacity: 0;
    transition: opacity .4s;
    /* 2×2 像素的白点，随机分布 */
    background:
        radial-gradient(2px 2px at 20% 30%, #fff 0%, transparent 50%),
        radial-gradient(2px 2px at 40% 70%, #fff 0%, transparent 50%),
        radial-gradient(2px 2px at 60% 20%, #fff 0%, transparent 50%),
        radial-gradient(2px 2px at 80% 80%, #fff 0%, transparent 50%),
        radial-gradient(2px 2px at 10% 50%, #fff 0%, transparent 50%),
        radial-gradient(2px 2px at 90% 40%, #fff 0%, transparent 50%),
        radial-gradient(1px 1px at 30% 10%, #fff 0%, transparent 50%),
        radial-gradient(1px 1px at 70% 60%, #fff 0%, transparent 50%),
        radial-gradient(1px 1px at 50% 90%, #fff 0%, transparent 50%);
    background-size: 120px 120px;          /* 控制星场密度 */
    animation: starMove 25s linear infinite;       /* 控制星场流速 */
}
.timeline-content:hover::after { opacity: 1; }

/* 缓慢流动关键帧：斜向漂移 */
@keyframes starMove {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-60px, -60px); }
}

/*  文字反白 + 微光 */
.timeline-content:hover .timeline-date,
.timeline-content:hover .timeline-title,
.timeline-content:hover .timeline-desc{
    color: #fff;
    text-shadow: 0 0 4px rgba(255, 255, 255, .4);
}
.timeline-content:hover .tag{
    background: rgba(255, 255, 255, .2);
    color: #fff;
}



.timeline-content > * {
    position: relative;
    z-index: 1;
}

.timeline-date {
    font-size: 0.9rem;
    color: var(--primary-purple);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 600;
}

.timeline-desc {
    color: var(--text-dark);
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.timeline-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.timeline-image:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.timeline-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ===== 半透明标签 ===== */
.tag {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #fff;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background-color: rgba(239, 190, 250, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

/* 不同类别仅换文字色 */
.tag-服务器 { color: #7e5bef; }
.tag-活动 { color: #f50996; }
.tag-更新 { color: #4facfe; }
.tag-城镇 { color: #440505c9; }
.tag-建筑 { color: #9d4edd; }
.tag-大事件 { color: #5a189a; }

/* ===== 图片查看器 ===== */
.image-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
}

.image-viewer img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-viewer.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .timeline-line {
        left: 2rem;
    }

    .timeline-event.left .timeline-content,
    .timeline-event.right .timeline-content {
        margin-left: 4rem;
        margin-right: 0;
        padding-left: 2rem;
        padding-right: 2rem;
        text-align: left;
    }

    .timeline-dot {
        left: 2rem;
    }

    .timeline-tags {
        justify-content: flex-start;
    }
}