.timeline-shortcode {
    width: 100%;
    max-width: 100%;
}

.timeline-container {
    position: relative;
    padding:0 0 20px 0;
}

.timeline-header {
    text-align: center;
    margin-bottom: 30px;
}

.timeline-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.timeline-navigation {
    position: relative;
    padding: 20px 0 40px;
    overflow: hidden;
}

.timeline-years {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.timeline-years:before {
    content: '';
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--primary-color);
    z-index: 1;
}

.timeline-year-item {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
    padding-top: 30px;
    cursor: pointer;
}

.timeline-year-item:before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background-color: #fff;
    top: 2px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 0 0 5px #fff;
    transition: all 0.3s ease;
}

.timeline-year-item.active:before {
    width: 16px;
    height: 16px;
    top: 2px;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 添加脉冲动画效果 */
.timeline-year-item.active .pulse-animation {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(14, 114, 181, 0.7);
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    box-shadow: 0 0 0 5px rgba(14, 114, 181, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translateX(-50%) scale(0.8);
        opacity: 0.8;
    }
    70% {
        transform: translateX(-50%) scale(1.2);
        opacity: 0;
    }
    100% {
        transform: translateX(-50%) scale(1.2);
        opacity: 0;
    }
}

.timeline-year {
    position: relative;
    display: inline-block;
    padding: 5px 10px;
    color: #333;
    font-weight: bold;
    font-size: 20px;
    margin: 0 auto;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-year-item.active .timeline-year {
    color: #0e72b5;
}

.timeline-contents {
    position: relative;
    width: 100%;
    margin-top: 20px;
}

.timeline-content-item {
    display: none;
    width: 100%;
    padding: 0;
}

.timeline-content-item.active {
    display: block;
}

.timeline-content-inner {
    padding: 30px 15px;
}

/* 添加横贯整个wrapper的线条 */
.timeline-years-wrapper:before {
    content: '';
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--primary-color);
    z-index: 1;
    width: 100%;
}
/* 响应式样式 */
@media (min-width: 768px) {
    .timeline-years {
        max-width: 80%;
        margin-top: 20px;
    }
    
    .timeline-content-inner {
        padding: 40px 15px;
    }
}

/* 小屏幕适配 */
@media (max-width: 767px) {
    /* 添加横贯整个wrapper的线条 */
    .timeline-years-wrapper:before {
        top: 10px;
    }
    .timeline-navigation {
        position: relative;
        overflow: visible;
        padding-bottom: 5px;
    }
	.timeline-contents{margin-top:5px;}
    .timeline-years-wrapper {
        position: relative;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        margin: 0 -15px;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
    }
    
    .timeline-years-wrapper::-webkit-scrollbar {
        display: none; /* Chrome, Safari, Opera */
    }
    
    /* 修改时间线结构，确保线条和圆点在滚动时正确显示 */
    .timeline-years {
        overflow-x: visible;
        justify-content: flex-start;
        width: auto;
        display: inline-flex;
        position: relative;
        padding: 0;
    }
    
    /* 使用独立的线条元素，而不是伪元素 */
    .timeline-line {
        position: absolute;
        top: 10px;
        left: 0;
        right: 0;
        height: 1px;
        background-color: var(--primary-color);
        z-index: 1;
        width: 100%;
    }
    
    /* 隐藏原来的线条 */
    .timeline-years:before {
        display: none;
    }
    
    /* 为每个年份项目添加独立的线条 */
    .timeline-year-item:after {
        content: '';
        position: absolute;
        top: 10px;
        left: 0;
        right: 0;
        height: 1px;
        background-color: var(--primary-color);
        z-index: 1;
        width: 100%;
    }
    
    .timeline-year-item {
        flex: 0 0 auto;
        min-width: 80px;
        margin-right: 0;
        padding-left: 10px;
        padding-right: 10px;
        position: relative;
    }
    
    .timeline-year-item:first-child {
        padding-left: 10px;
        margin-left: 10px;
    }
    
    .timeline-year-item:last-child {
        margin-right: 10px;
        padding-right: 10px;
    }
    
    /* 确保每个年份项目的圆点都显示 */
    .timeline-year-item:before {
        content: '';
        position: absolute;
        width: 14px;
        height: 14px;
        border-radius: 50%;
        border: 2px solid var(--primary-color);
        background-color: #fff;
        top: 3px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 3;
        box-shadow: 0 0 0 5px #fff;
    }
    
    .timeline-year-item.active:before {
        background-color: var(--primary-color);
    }
    
    /* 添加脉冲动画元素，不影响线条 */
    .timeline-year-item.active .pulse-animation {
        position: absolute;
        width: 28px;
        height: 28px;
        top: -4px;
        left: 50%;
        transform: translateX(-50%);
        background-color: rgba(14, 114, 181, 0.7);
        border-radius: 50%;
        box-shadow: 0 0 0 5px rgba(14, 114, 181, 0.7);
        animation: pulse 2s infinite;
        z-index: 2;
    }
    
    .timeline-year {
        font-size: 16px;
        white-space: nowrap;
    }
}

/* UX Builder后台年份显示样式 - 与前端样式保持一致 */
.timeline-year-display {
    position: relative;
    display: inline-block !important;
    padding: 5px 10px;
    margin: 0 auto 20px auto;
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border: 1px dashed var(--primary-color, #0073aa);
    border-radius: 4px;
    opacity: 0.8;
}

.timeline-year-title {
    margin: 0 !important;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    display: inline-block;
}

/* 在前端隐藏年份显示（因为前端使用时间线导航） */
body:not([class*="ux-builder"]):not(.ux-builder-iframe) .timeline-shortcode .timeline-year-display {
    display: none !important;
} 