/* 时间轴容器 */
.timeline-wrapper {
    position: relative;
    padding: 340px 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* 电脑端水平时间轴样式 */
.timeline {
    position: relative;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    padding: 40px 20px;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    transform: translateY(-50%);
    background: linear-gradient(to right, #1b6e3f, #2a8f5f);
    z-index: 1;
}

/* 时间轴项样式 */
.timeline-item {
    display: inline-block;
    position: relative;
    width: 224px;
    padding: 0;
    vertical-align: top;
    white-space: normal;
}

.timeline-item:last-of-type {
    width: 300px;
}

.timeline-item:last-of-type .timeline-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 时间轴卡片样式 */
.timeline-card {
    position: absolute;
    width: 300px;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:nth-child(odd) .timeline-card {
    bottom: 100%;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px 1px rgba(27, 110, 63, 0.1);
}

.timeline-item:nth-child(even) .timeline-card {
    top: 100%;
    margin-top: 30px;
    box-shadow: 0 -4px 12px 1px rgba(27, 110, 63, 0.1);
}

/* 时间轴圆点样式 */
.timeline-dot {
    position: absolute;
    top: 50%;
    left: calc(50% + 38px);
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: #1b6e3f;
    border: 4px solid #fff;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 12px 0 rgb(27 110 63 / 50%);
    transition: transform 0.3s ease;
}

.timeline-image {
    aspect-ratio: 16 / 9;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
}

/* 电脑端水平时间轴小尾巴 */
.timeline-item:nth-child(odd) .timeline-card::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}

.timeline-item:nth-child(even) .timeline-card::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #fff;
}

.timeline-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(27, 110, 63, 0.2);
}

.timeline-date {
    color: #1b6e3f;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: #0009;
}

.timeline-content {
    color: #00000080;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 电脑端水平时间轴响应式样式 */
@media (min-width: 768px) {
    .timeline-content-title {
        line-height: 1.5;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
        overflow: hidden;
        text-overflow: ellipsis;
        word-break: break-word;
    }

    .timeline {
        margin: 0 20px;
    }
}

/* 手机、平板端垂直时间轴响应式样式 */
@media screen and (max-width: 767.98px) {
    h1 {
        font-size: 2rem;
    }

    .timeline-wrapper {
        max-height: 600px;
        padding: 20px 0;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .timeline {
        display: block;
        white-space: normal;
        padding: 0 0 20px 30px;
    }

    .timeline::before {
        top: 0;
        bottom: 0;
        left: 30px;
        width: 2px;
        height: 100%;
        transform: none;
        background: linear-gradient(to bottom, #1b6e3f, #2a8f5f);
    }

    .timeline-item {
        display: block;
        width: 100%;
        padding: 16px 10px 0 10px;
    }

    .timeline-item:last-of-type {
        width: 100%;
    }

    .timeline-item:last-of-type .timeline-dot {
        left: 0;
        top: 38px;
    }

    .timeline-item:nth-child(odd) .timeline-card,
    .timeline-item:nth-child(even) .timeline-card {
        position: relative;
        width: calc(100% - 30px);
        margin: 0;
        margin-left: 14px;
        bottom: auto;
        top: auto;
        left: auto;
        right: auto;
        transform: none;
    }

    .timeline-dot {
        left: 0;
        top: 38px;
        width: 20px;
        height: 20px;
        border: 3px solid #fff;
    }

    .timeline-item:nth-child(odd) .timeline-card,
    .timeline-item:nth-child(even) .timeline-card {
        box-shadow: -4px 4px 12px 1px rgba(27, 110, 63, 0.1);
    }

    /* 手机端垂直时间轴小尾巴 */
    .timeline-item:nth-child(odd) .timeline-card::after,
    .timeline-item:nth-child(even) .timeline-card::after {
        content: "";
        position: absolute;
        top: 20px;
        left: -8px;
        transform: translateY(-50%);
        border-top: 8px solid transparent;
        border-bottom: 8px solid transparent;
        border-right: 8px solid #fff;
        border-left: none;
    }

    .timeline-card {
        padding: 16px;
    }
}

/* 时间轴容器滚动条样式 */
.timeline-wrapper::-webkit-scrollbar {
    width: 6px;
    height: 6px;
    background-color: transparent;
}

.timeline-wrapper:hover::-webkit-scrollbar {
    background-color: rgba(0, 0, 0, 0);
}

.timeline-wrapper::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.timeline-wrapper:hover::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0);
}

.timeline-wrapper::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 4px;
    background-clip: padding-box;
}

.timeline-wrapper:hover::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
}

.timeline-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0, 0, 0, 0.4);
}
