.yichen_history {
    padding: 0 0 var(--component-gap);
}

.yichen_history_box {
    background-position: bottom;
    background-size: cover;
    background-repeat: no-repeat;
    height: 626px;
}

.yichen_history_box .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.yichen_history_icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.yichen_history_box h2 {
    color: #FFF;
    font-size: var(--title-size-h2);
    font-weight: 700;
    line-height: normal;
    text-transform: capitalize;
}

.yichen_history_box h2 b {
    color: #FF8400;
}

.yichen_history_box p {
    color: #FFF;
    font-size: var(--text-flag-size);
    font-weight: 500;
    line-height: normal;
    text-align: center;
    margin: 27px auto 107px;
}

.yichen_history_icon svg {
    width: 70px;
    height: 35px;
}


.timeline-wrapper {
    position: relative;
    width: 100%;
    min-height: 600px;
    padding: 0 0 180px;
    overflow: hidden;
}

.timeline-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.timeline-items {
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    min-height: 400px;
    z-index: 2;
    gap: 0;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.timeline-item {
    position: relative;
    flex: 0 0 calc(100% / 6);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: calc(100% / 6);
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 根据原始索引设置高度 - 适中的波浪效果 */
/* 策略：使用适中的高度差，配合容器下移抵消累积 */

/* 索引0: 起点 (0px) */
.timeline-item[data-index="0"] {
    margin-bottom: 0px;
}

/* 索引1: 小幅上升 (+30=30px) */
.timeline-item[data-index="1"] {
    margin-bottom: 30px;
}

/* 索引2: 大幅上升 (+70=100px) */
.timeline-item[data-index="2"] {
    margin-bottom: 100px;
}

/* 索引3: 小幅上升 (+30=130px) */
.timeline-item[data-index="3"] {
    margin-bottom: 130px;
}

/* 索引4: 大幅上升 (+70=200px) */
.timeline-item[data-index="4"] {
    margin-bottom: 200px;
}

/* 索引5: 小幅上升 (+30=230px) */
.timeline-item[data-index="5"] {
    margin-bottom: 230px;
}

/* 索引6: 大幅上升 (+70=300px) */
.timeline-item[data-index="6"] {
    margin-bottom: 300px;
}

/* 克隆的元素继续递增，但增幅控制在合理范围 */
/* 克隆索引0 (+30=330px) */
.timeline-item-clone[data-index="0"] {
    margin-bottom: 330px;
}

/* 克隆索引1 (+30=360px) */
.timeline-item-clone[data-index="1"] {
    margin-bottom: 360px;
}

/* 克隆索引2 (+70=430px) */
.timeline-item-clone[data-index="2"] {
    margin-bottom: 430px;
}

/* 克隆索引3 (+30=460px) */
.timeline-item-clone[data-index="3"] {
    margin-bottom: 460px;
}

/* 克隆索引4 (+70=530px) */
.timeline-item-clone[data-index="4"] {
    margin-bottom: 530px;
}

/* 克隆索引5 (+30=560px) */
.timeline-item-clone[data-index="5"] {
    margin-bottom: 560px;
}

/* 默认隐藏所有日期 */
.timeline-date-top,
.timeline-date-bottom {
    display: none;
}

/* 偶数索引（0,2,4,6...）文字在上方，显示顶部日期 */
.timeline-item[data-index="0"] .timeline-content,
.timeline-item[data-index="2"] .timeline-content,
.timeline-item[data-index="4"] .timeline-content,
.timeline-item[data-index="6"] .timeline-content {
    position: absolute;
    bottom: 100%;
    margin-bottom: 25px;
}

.timeline-item[data-index="0"] .timeline-date-top,
.timeline-item[data-index="2"] .timeline-date-top,
.timeline-item[data-index="4"] .timeline-date-top,
.timeline-item[data-index="6"] .timeline-date-top {
    display: block;
}

/* 奇数索引（1,3,5...）文字在下方，显示底部日期 */
.timeline-item[data-index="1"] .timeline-content,
.timeline-item[data-index="3"] .timeline-content,
.timeline-item[data-index="5"] .timeline-content {
    position: absolute;
    top: 100%;
    margin-top: 25px;
}

.timeline-item[data-index="1"] .timeline-date-bottom,
.timeline-item[data-index="3"] .timeline-date-bottom,
.timeline-item[data-index="5"] .timeline-date-bottom {
    display: block;
}

.timeline-dot {
    width: 34px;
    height: 34px;
    background-color: #6279BC;
    border-radius: 50%;
    z-index: 3;
    position: relative;
    transition: all 0.3s ease;
}


.timeline-content {
    text-align: center;
    width: 208px;
}
.timeline-content:hover{
    width: 328px;
}

.timeline-content:hover .timeline-desc{
    max-height: fit-content;
    overflow: visible;
    -webkit-line-clamp: none;
}

/* 只在首次加载时有淡入动画 */
.timeline-item-first-load .timeline-content {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

.timeline-item-first-load[data-index="0"] .timeline-content {
    animation-delay: 0.1s;
}

.timeline-item-first-load[data-index="1"] .timeline-content {
    animation-delay: 0.2s;
}

.timeline-item-first-load[data-index="2"] .timeline-content {
    animation-delay: 0.3s;
}

.timeline-item-first-load[data-index="3"] .timeline-content {
    animation-delay: 0.4s;
}

.timeline-item-first-load[data-index="4"] .timeline-content {
    animation-delay: 0.5s;
}

.timeline-item-first-load[data-index="5"] .timeline-content {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-date {
    color: var(--color-primary);
    font-size: var(--title-size-h2);
    font-weight: 700;
    line-height: normal;
}

.timeline-title {
    color: var(--color-primary);
    font-size: var(--text-flag-size);
    font-weight: 500;
    line-height: normal;
}

.timeline-desc {
    color: #3E3A39;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.4;
    margin-top: 10px;
    max-height: calc(14px * 1.4 * 3);
    display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
overflow: hidden;
}

.line-path {
    stroke-width: 7;
    /* 调整这个数值来改变折线粗细 */
    /* 默认状态：折线已完全绘制 */
    stroke-dasharray: none;
    stroke-dashoffset: 0;
}

/* 首次加载动画：从左到右绘制 */
.line-path.animate-draw {
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    animation: drawLine 3.5s ease-out forwards;
}

/* 动画完成后移除dasharray，让后续切换更流畅 */
.line-path.no-animation {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none;
}

/* 添加蒙版让折线在边缘渐隐 */
.timeline-line {
    mask: linear-gradient(to right,
            transparent 0%,
            black 5%,
            black 95%,
            transparent 100%);
    -webkit-mask: linear-gradient(to right,
            transparent 0%,
            black 5%,
            black 95%,
            transparent 100%);
}

@keyframes drawLine {
    to {
        stroke-dashoffset: 0;
    }
}

@media screen and (max-width: 1200px) {
    .yichen_history_box {
        height: 550px;
    }

    .yichen_history_box p {
        margin: 20px auto 80px;
    }
}

/* 响应式 */
@media screen and (max-width: 992px) {
    .yichen_history {
        background-color: #E2E2E2;
    }

    .yichen_history_timeline {
        padding: 0;
    }

    .timeline-wrapper {
        padding: 40px 0;
        min-height: auto;
        overflow: visible;
        position: relative;
    }

    .timeline-items {
        flex-direction: column;
        gap: 24px;
        align-items: stretch;
        min-height: auto;
        transform: none !important;
        transition: none;
        position: relative;
        z-index: 2;
        padding-left: 0;
        width: 100%;
    }

    .timeline-item {
        width: 100% !important;
        flex: 0 0 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        flex-direction: row !important;
        gap: 12px;
        margin-bottom: 0 !important;
        position: relative;
        align-items: flex-start !important;
    }

    .timeline-item[data-index] .timeline-content {
        position: relative !important;
        margin: 0 !important;
        text-align: left;
        max-width: 100%;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    /* 移动端只显示顶部日期 - 在白色盒子上方 */
    .timeline-item .timeline-date-bottom {
        display: block !important;
        margin: 0 0 8px 0;
        padding: 0;
    }

    .timeline-item .timeline-date-top {
        display: none !important;
    }

    /* 移动端：标题和描述的白色背景盒子（一个整体） */
    .timeline-item .timeline-title {
        background: #FFFFFF;
        padding: 12px 12px 12px;
        margin: 0;
    }

    .timeline-item .timeline-desc {
        background: #FFFFFF;
        padding: 0 12px 12px;
        margin: 0;
        max-height: auto;
    }

    .timeline-line {
        display: none;
    }

    .timeline-dot {
        flex-shrink: 0;
        margin-top: 5px;
        position: relative;
        z-index: 3;
        width: 10px;
        height: 10px;
        background-color: #E2E2E2;
        border-radius: 50%;
        border: 2px solid #A7A6A7;
    }

    .timeline-item {
        position: relative;
    }

    .timeline-item::before {
        content: '';
        position: absolute;
        left: 4px;
        top: 16px;
        width: 1px;
        height: 110%;
        border-left: 2px dashed #A7A6A7;
    }

    .timeline-item:last-child::before {
        display: none;
    }

    .timeline-date {
        font-size: 22px;
    }

    .timeline-title {
        font-size: 15px;
    }

    .timeline-desc {
        font-size: 13px;
    }

    .timeline-content .timeline-desc{
        max-height: fit-content;
        overflow: visible;
        -webkit-line-clamp: none;
    }
}

@media screen and (max-width: 768px) {
    .yichen_history_box {
        height: 400px;
    }

    .yichen_history_icon svg {
        width: 50px;
        height: 25px;
    }
}

@media screen and (max-width: 576px) {
    .timeline-date {
        font-size: 20px;
    }

    .yichen_history_box p {
        margin: 10px auto 60px;
    }

    .timeline-title {
        font-size: 14px;
    }

    .yichen_history_box {
        height: 280px;
    }
}