@font-face {
    font-family: 'CustomFont';
    src: url('./fonts/江城律动宋.ttf') 
}

.timeline-container {
    display: flex;
    justify-content: space-between;
    width: 90%;
    height: 420px;
    gap: 4px;
    margin: 100px auto;
    padding: 10px; 
    background: #f5f5f5;
    border-radius: 16px;
    overflow: visible;
}

.timeline-item {
    flex: 1;
    position: relative;
    height: 100%;
    overflow: visible;
    transition: all 0.3s ease;
    border-radius: 12px;
    display: block; /* 使a标签保持块级特性 */
    text-decoration: none; /* 移除下划线 */
    color: inherit; /* 继承父级文字颜色 */
    cursor: pointer; /* 保持手指指针 */
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        rgba(97, 137, 203, 0) 0%,
        rgba(4, 99, 193, 1) 100%
    );
    opacity: 0.7;
    z-index: 2;
    transition: all 0.3s ease;
    border-radius: 12px;
}

.timeline-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(128, 128, 128, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
    border-radius: 12px;
}

.background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    filter: blur(2px);
    transition: filter 0.3s ease;
}

.year-title-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 4;
    transition: all 0.3s ease;
    /* 新增控制边距的部分 */
    width: 100%;
    /* 控制左右边距总和为40px */
    max-width: calc(100% ); 
    padding: 0px; /* 控制文字与容器边缘间距 */
    box-sizing: border-box; /* 防止padding影响容器尺寸 */
}

.year {
    font-family: 'CustomFont', sans-serif;
    font-size: 48px;
    color: rgb(255, 255, 255);
    margin-bottom: 25px;
    font-weight: bold;
    line-height: 50px;
    transition: opacity 0.3s ease;
}

.title {
    font-family: 'CustomFont', sans-serif;
    font-size: 18px;
    color: white;
    /* max-width: 200px; */
    text-align: center;
    line-height: 1.4;
    transition: opacity 0.3s ease;
}

/* 悬停效果 */
.timeline-item:hover {
    transform: scale(1.2);
    z-index: 10;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    border-radius: 12px;
}

.timeline-item:hover::before,
.timeline-item:hover::after {
    opacity: 0;
}

.timeline-item:hover .year-title-container {
    top: auto;
    right: 100px;
    bottom: 30px;
    left: 0;
    transform: none;
    background: linear-gradient(to right,
        rgba(61, 133, 203, 0) 0%,
        rgba(61, 133, 203, 0.9) 100%
    );
    padding: 10px 20px;
    text-align: right;
}

.timeline-item:hover .year {
    font-size: 24px;
    margin-bottom: 6px;
    margin-left: 0;
    margin-right: 20px;
    text-align: right;
}

.timeline-item:hover .title {
    font-size: 15px;
    max-width: 160px;
    text-align: right;
    white-space: nowrap;
    margin-left: 0;
    margin-right: 20px;
    margin-top: -10px;
    float: right;
}

.timeline-item:last-child {
    border-right: none;
}

.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* background: linear-gradient(to bottom, 
        rgba(97, 137, 203, 0) 0%,
        rgba(4, 99, 193, 1) 100%
    ); */
    opacity: 0.75;
    z-index: 1;
}

.hover-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.hover-content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.timeline-item:hover .hover-content {
    opacity: 1;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, 
        rgba(97, 137, 203, 0) 0%,
        rgba(4, 99, 193, 1) 100%
    );
    opacity: 0.75;
}

.timeline-item:hover .year-title-container {
    border-radius: 0;
}

/* 修改选择器，确保所有非悬停项目都能显示灰色蒙版
.timeline-item:hover ~ .timeline-item::after,
.timeline-item:has(~ :hover)::after {
    opacity: 1;
} */

/* 或者使用这个更简单的方案
.timeline-container:has(.timeline-item:hover) .timeline-item:not(:hover)::after {
    opacity: 1;
} */

/* 当有项目被悬停时，其他项目的文字轻微变暗 *//* 轻微降低不透明度，使文字看起来稍微暗一点 */
/* .timeline-container:has(.timeline-item:hover) .timeline-item:not(:hover) .year,
.timeline-item:has(.timeline-item:hover) .timeline-item:not(:hover) .title {
    opacity: 0.7; 
} */

/* 悬停时移除模糊效果 */
.timeline-item:hover .background-image {
    filter: blur(0);
}

/* 非悬停项目保持或增加模糊效果 */
.timeline-container:has(.timeline-item:hover) .timeline-item:not(:hover) .background-image {
    filter: blur(3px); /* 可以适当调整模糊程度 */
} 