/* ========================================
   歷史沿革時間軸 CSS
   ======================================== */

:root {
    --timeline-color: rgba(43, 206, 167, 1);
    --timeline-light: rgba(43, 206, 167, 0.1);
    --timeline-medium: rgba(43, 206, 167, 0.3);
    --bg-color: #E5F8F3;
}
.exo-2-title {
    font-family: "Exo 2", sans-serif;
    font-optical-sizing: auto;
    font-weight: 800;
    font-style: normal;
}

.exo-2-cont {
    font-family: "Exo 2", sans-serif;
    font-optical-sizing: auto;
    font-weight: 600;
    font-style: normal;
    font-size:1rem;
}

/* 區塊背景色 */
.block-green {
    background-color: #E5F8F3 !important;
}

.title-point {
    width: 4px;
    height: 24px;
    background: var(--timeline-color);
    display: inline-block;
    margin-right: 10px;
    vertical-align: middle;
}

.main-title {
    display: inline-block;
    color: #333;
    font-weight: bold;
}

/* ========================================
   時間軸導航
   ======================================== */
.timeline-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 10px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.timeline-nav-dot {
    width: 12px;
    height: 12px;
    background: #ddd;
    border-radius: 50%;
    margin: 12px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.timeline-nav-dot:hover {
    background: var(--timeline-color);
    transform: scale(1.3);
}

.timeline-nav-dot.active {
    background: var(--timeline-color);
    width: 16px;
    height: 16px;
}

.timeline-nav-dot::after {
    content: attr(data-year);
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    font-size: 12px;
    color: #666;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.timeline-nav-dot:hover::after {
    opacity: 1;
}

/* ========================================
   緣起區塊
   ======================================== */
.origin-section {
    padding: 20px 0 20px;
    margin: 0 auto;
    width: 100%;
}

.origin-content {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
}

.origin-image {
    flex: 0 0 550px;
    border-radius: 15px;
    overflow: hidden;
}

.origin-image img {
    width: 100%;
    height: 300px;
    object-fit: cover;
}

.origin-text h3 {
    color: var(--timeline-color);
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
}

.origin-text p {
    color: #555;
    font-size: 20px;
    line-height: 1.8;
    margin-bottom: 0;
}

/* ========================================
   時間軸容器
   ======================================== */
.timeline-section {
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.timeline-item {
    margin-bottom: 80px;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-content {
    display: flex;
    align-items: center;
    gap: 60px;
    position: relative;
}

.timeline-content.reverse {
    flex-direction: row-reverse;
}

/* ========================================
   圖片區域
   ======================================== */
.timeline-image {
    flex: 0 0 45%;
    position: relative;
    overflow: hidden;
    /*border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);*/
}

.timeline-image img {
    width: 100%;    
    object-fit: contain;  /* cover 改為 contain,完整顯示圖片 */
    object-position: center;
    transition: transform 0.5s ease;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.timeline-item.visible .timeline-image img {
    transform: scale(1);
}

.timeline-item:not(.visible) .timeline-image img {
    transform: scale(1.1);
}

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

/* 年份標記 */
.timeline-year {
    position: absolute;
    top: -10px;
    left: 20px;
    background: var(--timeline-color);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* ========================================
   文字區域
   ======================================== */
.timeline-text {
    flex: 1;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    position: relative;
    margin:50px;
}

.timeline-text h3 {
    color: var(--timeline-color);
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    line-height: 1.3;
}

.timeline-text p {
    color: #555;
    font-size: 20px;
    line-height: 1.8;
    margin-bottom: 0;
}

/* ========================================
   連接線與進度條
   ======================================== */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--timeline-light);
    transform: translateX(-50%);
    z-index: -1;
}

.timeline-progress {
    position: absolute;
    left: 50%;
    top: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--timeline-color), var(--timeline-medium));
    transform: translateX(-50%);
    z-index: 0;
    height: 0;
    transition: height 0.1s linear;
    box-shadow: 0 0 10px rgba(43, 206, 167, 0.5);
}

/* 中央圓點 */
.timeline-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    background: white;
    border: 4px solid var(--timeline-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: all 0.3s ease;
}

.timeline-item.visible .timeline-dot {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(43, 206, 167, 0.7);
    }
    50% {
        box-shadow: 0 0 0 15px rgba(43, 206, 167, 0);
    }
}

/* ========================================
   結束標語
   ======================================== */
.ending-section {
    padding: 250px 0;
    text-align: center;
}

.ending-title-green {
    font-size: 8vw;
    background: linear-gradient(176deg, rgb(27 161 150), #2bcea7, rgb(27 161 150));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    margin: 0;
    animation: fadeInUp 1s ease;
    font-family: "Exo 2", sans-serif;
    font-optical-sizing: auto;
    font-weight: 800;
    font-style: normal;
}
.ending-title-blue {
    font-size: 8vw;
    background: linear-gradient( 120deg, rgb(42 49 137), #3169ab, #3169ab);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 4px;
    margin: 0;
    animation: fadeInUp 1s ease;
    font-family: "Exo 2", sans-serif;
    font-optical-sizing: auto;
    font-weight: 800;
    font-style: normal;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   響應式設計
   ======================================== */
@media (max-width: 992px) {
    .timeline-content,
    .timeline-content.reverse {
        flex-direction: column;
        gap: 0px;
    }

    .timeline-image {
        flex: 0 0 100%;
    }

    .timeline-image img {
        height: 300px;
    }

    .timeline-line,
    .timeline-progress {
        left: 30px;
    }

    .timeline-dot {
        left: 6px;
    }

    .timeline-nav {
        display: none;
    }

    .timeline-text {
        padding: 30px;
    }

    .timeline-text h3 {
        font-size: 22px;
    }

    .timeline-item {
        margin-bottom: 40px;
    }

    .origin-content {
        flex-direction: column;
        padding: 30px;
    }

    .origin-image {
        flex: 0 0 100%;
    }

    .origin-text h3 {
        font-size: 28px;
    }

    .ending-title-blue,.ending-title-green {
        font-size: 7vw;
    }
}

@media (max-width: 768px) {
    .origin-section {
        padding: 20px 15px 30px;
    }

    .origin-content {
        padding: 25px;
    }

    .origin-text h3 {
        font-size: 24px;
    }

    .origin-text p {
        font-size: 15px;
    }

    .origin-image img {
        height: 250px;
    }

    .timeline-section {
        padding: 40px 0;
    }

    .timeline-image img {
        height: 250px;
    }

    .timeline-text {
        padding: 25px;
        width:95%;
    }

        .timeline-text h3 {
            font-size: 20px;
            margin-bottom: 12px;
        }

        .timeline-text p {
            font-size: 15px;
            line-height: 1.7;
        }

    .timeline-year {
        font-size: 12px;
        padding: 6px 15px;
    }

    .timeline-item {
        margin-bottom: 30px;
    }

    .timeline-dot {
        width: 16px;
        height: 16px;
        border-width: 3px;
    }

    .timeline-line,
    .timeline-progress {
        width: 2px;
    }

    .ending-title-blue, .ending-title-green {
        font-size: 7vw;
        letter-spacing: 2px;
    }

    .ending-section {
        padding: 250px 0;
    }
}

@media (max-width: 576px) {
    .origin-text h3 {
        font-size: 22px;
    }

    .origin-text p {
        font-size: 1rem;
    }

    .origin-image img {
        height: 200px;
    }

    .timeline-img-logo{
        height:10vh !important;
    }

    .timeline-image img {
        height: 200px;
    }

    .timeline-text {
        padding: 20px;
    }

        .timeline-text h3 {
            font-size: 18px;
        }

        .timeline-text p {
            font-size: 1rem;
        }

    .timeline-item {
        margin-bottom: 20px;
    }

    .timeline-line,
    .timeline-progress {
        left: 20px;
    }

    .timeline-dot {
        left: -4px;
        width: 14px;
        height: 14px;
    }

    .ending-title-blue, .ending-title-green {
        font-size: 8vw;
    }
}