/* ========================================
   旅游行程时间轴 - 竖线独立贯穿版
   手机端修复：圆点精确居中在竖线上
   ======================================== */

.travel-timeline {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    position: relative;
}

/* ⭐ 竖线：容器的独立子元素，完整贯穿 */
.timeline-line-global {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #2c6e9c;
    z-index: 0;
}

/* ========================================
   电脑端 (≥769px)
   ======================================== */
@media (min-width: 769px) {

    .timeline-line-global {
        left: 50%;
        transform: translateX(-50%);
    }

    .timeline-item {
        display: grid;
        grid-template-columns: 1fr 80px 1fr;
        align-items: center;
        margin-bottom: 50px;
        padding: 0;
        position: relative;
        z-index: 1;
    }

    .timeline-item:last-child {
        margin-bottom: 0;
    }

    /* 圆点：在中间列 */
    .timeline-item .timeline-dot {
        grid-column: 2 / 3;
        grid-row: 1;
        justify-self: center;
        width: 16px;
        height: 16px;
        background: #ffffff;
        border: 3px solid #2c6e9c;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(44, 110, 156, 0.2);
        transition: all 0.3s ease;
        z-index: 2;
        flex-shrink: 0;
    }

    .timeline-item:hover .timeline-dot {
        background: #2c6e9c;
        transform: scale(1.2);
    }

    /* 左右交替 */
    .timeline-left .timeline-image {
        grid-column: 1 / 2;
        grid-row: 1;
        padding-right: 24px;
    }
    .timeline-left .timeline-content {
        grid-column: 3 / 4;
        grid-row: 1;
        text-align: left;
        padding-left: 24px;
    }
    .timeline-left .timeline-content .day-title::after {
        margin-left: 0;
        margin-right: auto;
    }

    .timeline-right .timeline-image {
        grid-column: 3 / 4;
        grid-row: 1;
        padding-left: 24px;
    }
    .timeline-right .timeline-content {
        grid-column: 1 / 2;
        grid-row: 1;
        text-align: right;
        padding-right: 24px;
    }
    .timeline-right .timeline-content .day-title::after {
        margin-left: auto;
        margin-right: 0;
    }

    .timeline-item:not(.has-image) .timeline-image {
        background: transparent;
    }
    .timeline-item:not(.has-image).timeline-left .timeline-content {
        padding-left: 24px;
    }
    .timeline-item:not(.has-image).timeline-right .timeline-content {
        padding-right: 24px;
    }
}

/* ========================================
   通用样式
   ======================================== */

.timeline-image {
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: transparent;
    width: 100%;
}

.timeline-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.timeline-item:hover .timeline-image img {
    transform: scale(1.03);
}

.timeline-image:empty {
    background: transparent;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10px 0;
    width: 100%;
}

.timeline-content .day-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.timeline-content .day-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    background: #2c6e9c;
    margin-top: 6px;
    border-radius: 2px;
}

.timeline-content .day-text {
    font-size: 16px;
    line-height: 1.9;
    color: #334155;
    margin: 0;
    word-wrap: break-word;
}

/* ========================================
   📱 手机端 (≤768px) - 修复圆点居中
   ======================================== */
@media (max-width: 768px) {

    .timeline-line-global {
        left: 32px;
        transform: none;
    }

    .timeline-item {
        display: flex;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 35px;
        padding: 0;
        position: relative;
        z-index: 1;
        flex-wrap: wrap;
    }

    .timeline-item:last-child {
        margin-bottom: 0;
    }

    /* ⭐ 圆点：使用绝对定位，精确对准竖线中心 */
    .timeline-item .timeline-dot {
        position: absolute;
        left: 12px;              /* 竖线left(32px) - 容器padding(20px)，圆点中心对齐竖线中心 */
        top: 14px;
        width: 14px;
        height: 14px;
        background: #ffffff;
        border: 3px solid #2c6e9c;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(44, 110, 156, 0.2);
        transition: all 0.3s ease;
        z-index: 2;
        flex-shrink: 0;
        transform: translateX(calc(3px / 2 - 50%));
    }

    .timeline-item:hover .timeline-dot {
        background: #2c6e9c;
        transform: translateX(calc(3px / 2 - 50%)) scale(1.15);
    }

    /* 内容区域：左侧留空给圆点 */
    .timeline-item .timeline-content {
        flex: 1;
        min-width: 0;
        padding: 0;
        padding-left: 48px;      /* 32px + 16px gap */
        text-align: left !important;
    }

    .timeline-item .timeline-content .day-title {
        font-size: 18px;
        margin-bottom: 4px;
    }
    .timeline-item .timeline-content .day-title::after {
        margin-left: 0 !important;
        margin-right: auto !important;
    }
    .timeline-item .timeline-content .day-text {
        font-size: 15px;
        line-height: 1.8;
        margin-bottom: 12px;
    }

    /* 图片：与内容对齐 */
    .timeline-item .timeline-image {
        flex: 0 0 100%;
        width: 100%;
        padding: 0 !important;
        margin-top: 4px;
        padding-left: 48px !important;
        box-sizing: border-box;
    }

    .timeline-item:not(.has-image) .timeline-image {
        display: none !important;
    }

    /* 无图片时，圆点位置不变 */
    .timeline-item:not(.has-image) .timeline-dot {
        top: 14px;
    }
}

/* ========================================
   小屏手机 (≤480px)
   ======================================== */
@media (max-width: 480px) {

    .timeline-line-global {
        left: 26px;
    }

    .timeline-item .timeline-dot {
        left: 6px;               /* 竖线left(26px) - 容器padding(20px)，圆点中心对齐竖线中心 */
        width: 12px;
        height: 12px;
        border-width: 2.5px;
        top: 12px;
        transform: translateX(calc(3px / 2 - 50%));
    }

    .timeline-item:hover .timeline-dot {
        transform: translateX(calc(3px / 2 - 50%)) scale(1.15);
    }

    .timeline-item .timeline-content {
        padding-left: 38px;
    }

    .timeline-item .timeline-image {
        padding-left: 38px !important;
    }

    .timeline-item .timeline-content .day-title {
        font-size: 17px;
    }
    .timeline-item .timeline-content .day-text {
        font-size: 14px;
        line-height: 1.7;
    }
}