﻿

.timeline-container {
    position: relative;
    width: 100%;
    min-width: 320px;
    height: auto;
    min-height: 400px;
    margin:0px auto;
}

.timeline-row {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: auto;
    min-height: 200px;
    margin-bottom: 50px;
}

.top-row {
    top: 0;
}

.bottom-row {
    top: 0;
    flex-direction: row-reverse;
}

.timeline-item {
    position: relative;
    display: flex;
 width: 10%;
    flex-direction: column;
    align-items: center;
    flex: 1;
    height: 100%;
    min-height: 200px;
    padding: 0 0px;
}

.bottom-row .timeline-item {
    flex-direction: column-reverse;


}

/* 年份圆圈 */
.year-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: bold;
    position: relative;
    z-index: 3;
    flex-shrink: 0;
}

/* 事件圆圈 */
.event-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    font-size: 12px;
    padding: 15px;
    margin: 15px 0;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

/* 颜色主题 */
.timeline-item[data-color="green"] .year-circle {
    background: linear-gradient(135deg, #8bc34a, #689f38);
}

.timeline-item[data-color="green"] .event-circle {
    background: linear-gradient(135deg, #8bc34a, #689f38);
}

.timeline-item[data-color="teal"] .year-circle {
    background: linear-gradient(135deg, #26a69a, #00695c);
}

.timeline-item[data-color="teal"] .event-circle {
    background: linear-gradient(135deg, #26a69a, #00695c);
}

.timeline-item[data-color="blue"] .year-circle {
    background: linear-gradient(135deg, #2196f3, #1565c0);
}

.timeline-item[data-color="blue"] .event-circle {
    background: linear-gradient(135deg, #2196f3, #1565c0);
}

.timeline-item[data-color="orange"] .year-circle {
    background: linear-gradient(135deg, #ff9800, #e65100);
}

.timeline-item[data-color="orange"] .event-circle {
    background: linear-gradient(135deg, #ff9800, #e65100);
}

/* 连接线 */
.timeline-item::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 6px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 1;
}

.top-row .timeline-item::before {
    background: linear-gradient(90deg, transparent 0%, var(--line-color) 20%, var(--line-color) 80%, transparent 100%);
}

.bottom-row .timeline-item::before {
    background: linear-gradient(270deg, transparent 0%, var(--line-color) 20%, var(--line-color) 80%, transparent 100%);
}

/* 箭头效果 */
.timeline-item::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    z-index: 2;
}

.top-row .timeline-item::after {
    right: -8px;
    transform: translateY(-50%);
    border-left: 12px solid var(--line-color);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.bottom-row .timeline-item::after {
    left: -8px;
    transform: translateY(-50%);
    border-right: 12px solid var(--line-color);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

/* 最后一个元素不显示箭头 */
.timeline-item:last-child::after {
    display: none;
}

/* 设置每个项目的线条颜色 */
.timeline-item[data-color="green"] {
    --line-color: #8bc34a;
}

.timeline-item[data-color="teal"] {
    --line-color: #26a69a;
}

.timeline-item[data-color="blue"] {
    --line-color: #2196f3;
}

.timeline-item[data-color="orange"] {
    --line-color: #ff9800;
}

/* 垂直连接线 */
.year-circle::before {
    content: '';
    position: absolute;
    width: 3px;
    height: 30px;
    background: var(--line-color);
    z-index: 1;
}

.top-row .year-circle::before {
    bottom: -30px;
}

.bottom-row .year-circle::before {
    top: -30px;
}

/* 悬停效果 */
.timeline-item:hover .year-circle,
.timeline-item:hover .event-circle {
    transform: scale(1.05);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* 桌面端 (1200px+) */
@media (min-width: 1200px) {
 
    
    .timeline-container {
        height: 600px;
        min-width: 95%;
    }
    
    .timeline-row {
        height: 250px;
        margin-bottom: 0;
    }
    
    .bottom-row {
        top: 100px;
    }
    
    .timeline-item {
        min-height: auto;
        padding: 0;
    }
    
    .year-circle {
        width: 80px;
        height: 80px;
        font-size: 18px;
    }
    
    .event-circle {
        width: 150px;
        height: 150px;
        font-size: 14px;
        padding: 20px;
        margin: 20px 0;
    }
    
    .timeline-item::before {
        height: 8px;
    }
    
    .timeline-item::after {
        border-left-width: 15px;
        border-right-width: 15px;
        border-top-width: 8px;
        border-bottom-width: 8px;
    }
    
    .top-row .timeline-item::after {
        right: -10px;
    }
    
    .bottom-row .timeline-item::after {
        left: -10px;
    }
    
    .year-circle::before {
        width: 4px;
        height: 40px;
    }
    
    .top-row .year-circle::before {
        bottom: -40px;
    }
    
    .bottom-row .year-circle::before {
        top: -40px;
    }
    
    .timeline-item:hover .year-circle,
    .timeline-item:hover .event-circle {
        transform: scale(1.1);
        box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    }
}

/* 平板端 (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
 
    
    .timeline-container {
        min-width: 768px;
        height: auto;
    }
    
    .timeline-row {
        height: auto;
        min-height: 220px;
        margin-bottom: 30px;
    }
    
    .timeline-item {
        min-height: 220px;
        padding: 0 8px;
    }
    
    .year-circle {
        width: 70px;
        height: 70px;
        font-size: 17px;
    }
    
    .event-circle {
        width: 135px;
        height: 135px;
        font-size: 13px;
        padding: 18px;
        margin: 18px 0;
    }
    
    .timeline-item::before {
        height: 7px;
    }
    
    .timeline-item::after {
        border-left-width: 13px;
        border-right-width: 13px;
        border-top-width: 7px;
        border-bottom-width: 7px;
    }
    
    .top-row .timeline-item::after {
        right: -9px;
    }
    
    .bottom-row .timeline-item::after {
        left: -9px;
    }
    
    .year-circle::before {
        width: 3.5px;
        height: 35px;
    }
    
    .top-row .year-circle::before {
        bottom: -35px;
    }
    
    .bottom-row .year-circle::before {
        top: -35px;
    }
}

/* 手机端 (320px - 767px) */
@media (max-width: 767px) {
 
    .timeline-container {
        min-width: 320px;
        height: auto;
    }
    
    .timeline-row {
        flex-direction: column;
        height: auto;
        min-height: auto;
        margin-bottom: 20px;
    }
    
    .bottom-row {
        flex-direction: column;
        top: 0;
    }
    
    .timeline-item {
       
        margin-bottom: 30px;
        min-height: auto;
        padding: 0;
    }
    
    .timeline-item::before,
    .timeline-item::after {
        display: none;
    }
    
    .year-circle::before {
        display: block;
    }
    
    .event-circle {
        width: 200px;
        height: 100px;
        border-radius: 50px;
        font-size: 14px;
        padding: 20px;
    }
    
    .year-circle {
        width: 80px;
        height: 80px;
        font-size: 18px;
    }
}

