* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
}

body.events-page {
    margin: 0;
    min-height: 100svh;
    padding: calc(var(--header-height) + 24px) 0 32px;
    background: #E9E9E9;
    color: #173057;
    font-family: 'Source Han Sans CN', sans-serif;
}

.events-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

/* ====== Timeline ====== */

.timeline {
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 80px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #0B51FF;
}

.tl-year {
    position: relative;
    margin-bottom: 10px;
}

.tl-year-label {
    position: absolute;
    left: 0;
    top: 2px;
    width: 68px;
    text-align: right;
    font-size: 1.8rem;
    font-weight: 800;
    color: #0B51FF;
    line-height: 1;
}

.tl-year-dot {
    display: none;
}

.tl-year-body {
    margin-left: 100px;
}

.tl-month {
    position: relative;
    margin-bottom: 4px;
}

.tl-month-dot {
    display: none;
}

.tl-month-line {
    position: absolute;
    left: -17px;
    top: 12px;
    width: 85px;
    height: 2px;
    background: #0B51FF;
}

.tl-month-label {
    font-size: 1rem;
    font-weight: 700;
    color: #595959;
    line-height: 24px;
    margin-bottom: 4px;
    padding-left: 75px;
}

.tl-item {
    position: relative;
    margin-bottom: 120px;
}

.tl-item-dot {
    display: none;
}

.tl-item-line {
    position: absolute;
    left: -18px;
    top: 25px;
    width: 85px;
    height: 2px;
    background: #0B51FF;
}

.tl-item--ended .tl-item-line {
    top: 25px;
}

.tl-item-date {
    font-size: 0.88rem;
    font-weight: 700;
    color: #595959;
    padding-left: 75px;
}

.tl-item--ended .tl-item-date {
    margin-bottom: 0;
}

.timeline-card {
    overflow: hidden;
    transition: transform 0.28s ease;
    display: flex;
    align-items: center;
}

.tl-item--ended .timeline-card {
    display: flex;
    align-items: center;
}

.timeline-card:hover {
    transform: translateY(-2px);
}

.timeline-card-image {
    position: relative;
    width: 100%;
    max-height: 360px;
    overflow: hidden;
}

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

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

.timeline-card-badges {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    z-index: 2;
}

.timeline-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #FFFFFF;
}

.timeline-badge--category {
    background: rgba(0, 0, 0, 0.5);
}

.timeline-badge--ongoing {
    background: rgba(10, 154, 103, 0.88);
}

.timeline-badge--upcoming {
    background: rgba(245, 158, 11, 0.88);
}

.timeline-badge--ended {
    background: rgba(102, 119, 144, 0.86);
}

.timeline-card-body {
    padding: 8px 8px;
    display: flex;
    justify-content: space-between;
    background: #A5A5A5;
    color: white;
    align-items: center;
    flex-grow: 1;
    margin-left: 30px;
}

.tl-item:not(.tl-item--ended) .timeline-card-body {
    padding: 20px 24px;
    background: transparent;
    color: inherit;
    display: block;
}

.timeline-card-title {
    margin: 0 0 8px;
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
}

.tl-item:not(.tl-item--ended) .timeline-card-title {
    color: #0B51FF;
}

.timeline-card-daterange {
    margin: 0 0 10px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #595959;
}

.timeline-card-desc {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.7;
    color: white;
}

.tl-item:not(.tl-item--ended) .timeline-card-desc {
    color: #343434;
}

.timeline-empty {
    padding: 60px 24px;
    text-align: center;
    color: #667790;
    font-size: 1rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    body.events-page {
        padding: calc(var(--header-height) + 16px) 0 22px;
    }

    .events-container {
        padding: 0 16px;
    }

    .timeline::before {
        left: 48px;
    }

    .tl-year-label {
        width: 44px;
        font-size: 1.2rem;
    }

    .tl-year-dot {
        left: 39px;
        width: 18px;
        height: 18px;
    }

    .tl-year-body {
        margin-left: 58px;
    }

    .tl-month-dot {
        left: -17px;
        width: 10px;
        height: 10px;
    }

    .tl-month-line {
        left: -7px;
        width: 14px;
    }

    .tl-item-dot {
        left: -16px;
        width: 8px;
        height: 8px;
    }

    .tl-item-line {
        left: -8px;
        width: 14px;
    }

    .tl-item--ended .timeline-card-body {
        padding: 6px 8px;
    }

    .timeline-card-body {
        padding: 16px;
    }
}
