/* ==================== 首页分段样式 ==================== */

/* 首页容器 */
#home {
    padding: 0;
    margin: 0;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100vh;
    scroll-behavior: smooth;
}

/* 每个section占满屏幕 */
.home-section {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==================== 第一部分：图片轮播 ==================== */

#home-section-1 {
    background-image: url("res/homeBg.png");  /* 添加蓝色渐变背景 */
}

.carousel-container {
    position: relative;
    width: 80%;
    height: 80vh;
    overflow: hidden;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;

}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-slide  img{
    width: 100%;
    height: 100%;
    object-fit: cover;

}

.carousel-caption {
    position: absolute;
    bottom: 20%;
    left: 5%;
    color: white;
    z-index: 2;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
    transition: opacity 0s;
}

.carousel-caption h2 {
    text-align: left;
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.5s ease-out;
}

.carousel-caption span {
    border-top: 1px solid white ;
    padding-top: 2vh ;
    text-align: left;
    font-size: 1.5rem;
    animation: fadeInUp 0.5s ease-out 0.15s backwards;
}



/* 轮播按钮 */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;  /* 透明背景 */
    color: white;
    border: none;
    font-size: 3rem;  /* 增大箭头 */
    padding: 10px;
    cursor: pointer;
    z-index: 3;
    transition: all 0.3s;
    opacity: 0;  /* 默认半透明 */
}

.carousel-btn:hover {
    opacity: 1;  /* 悬停时完全不透明 */
    transform: translateY(-50%) scale(1.2);  /* 悬停时放大 */
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

/* 轮播指示器 */
.carousel-indicators {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.3s;
}

.indicator.active {
    background: white;
}

/* 向下滚动提示 */
.scroll-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    z-index: 3;
    animation: bounce 2s infinite;
    line-height: 0.2; /* 减小行高 */
    opacity: 0;
}

.scroll-hint p {
    margin-bottom: 10px;
    font-size: 1rem;
}

.scroll-arrow {
    font-size: 2rem;
}

.scroll-hint:hover{
    opacity: 1;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 第二部分：时间轴 ==================== */

#home-section-2 {
    padding: 80px 20px;
}

.timeline-container {
    max-width: 1200px;
    width: 100%;
    padding: 40px 20px;
}

.timeline-title {
    text-align: center;
    font-size: 3rem;
    color: white;
    margin-bottom: 60px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.timeline-item {
    display: flex;
    margin-bottom: 60px;
    position: relative;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.6s ease-out;
    cursor: pointer;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:hover .timeline-date {
    color: #ffd700;
}

.timeline-item:hover .timeline-date::after {
    background: #ffd700;
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.4);
}

.timeline-item:hover .timeline-content {
    border: 2px solid #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.timeline-item:hover .timeline-image img {
    transform: scale(1.05);
}

.timeline-date {
    flex: 0 0 150px;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    padding-right: 50px;
    text-align: right;
    position: relative;
    align-self: center;
}

/* 时间轴线 */
.timeline-date::after {
    content: '';
    position: absolute;
    right: 21px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: white;
    transition: all 0.3s ease;
}

.timeline-date::before {
    display: none; /* 废弃旧的线 */
}

/* 把线移到 item 层级来适应整体高度 */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 142px; /* 150px宽度 - 26px右边距 */
    top: 50%;
    width: 2px;
    height: calc(100% + 60px); /* 100%自身高度 + 60px下方margin */
    background: gray;
    z-index: 0;
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-content {
    flex: 1;
    display: flex;
    gap: 30px;
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.timeline-text {
    flex: 1;
}

.timeline-text h3 {
    font-size: 2rem;
    color: white;
    margin-bottom: 15px;
}

.timeline-text p {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    line-height: 1.8;
    text-align: left;
}

.timeline-image {
    flex: 0 0 300px;
}

.timeline-image img {
    width: 273px;
    height: 153.5px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

/* ==================== 右侧部分导航 ==================== */

.section-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.section-dot::before {
    content: attr(data-section);
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.section-dot:hover::before {
    opacity: 1;
}

.section-dot.active {
    background: white;
    transform: scale(1.5);
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 768px) {

    /* --- 轮播图 --- */
    .carousel-container {
        width: 95%;
        height: 70vh;
    }

    .carousel-caption {
        bottom: 10%;
        left: 3%;
    }

    .carousel-caption h2 {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }

    .carousel-caption span {
        font-size: 0.9rem;
        padding-top: 1vh;
    }

    .carousel-btn {
        font-size: 2rem;
        padding: 5px;
        opacity: 0.5; /* 手机端始终显示按钮 */
    }

    .carousel-btn.prev {
        left: 5px;
    }

    .carousel-btn.next {
        right: 5px;
    }

    /* --- 时间轴 --- */
    #home-section-2 {
        padding: 40px 10px;
    }

    .timeline-title {
        font-size: 1.5rem;
        margin-bottom: 30px;
    }

    .timeline-item {
        flex-direction: row; /* 保持水平布局 */
        margin-bottom: 40px;
    }

    .timeline-date {
        flex: 0 0 90px;
        font-size: 0.9rem;
        padding-right: 35px;
    }

    .timeline-item::before {
        left: 65px; /* 重新对齐线的位置 */
    }

    .timeline-date::after {
        right: 12px;
        width: 8px;
        height: 8px;
    }

    .timeline-content {
        padding: 15px;
        gap: 10px;
        flex-direction: column;
    }

    .timeline-text h3 {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }

    .timeline-text p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .timeline-image {
        flex: none;
    }

    .timeline-image img {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    /* --- 右侧导航 --- */
    .section-nav {
        right: 10px;
        gap: 12px;
    }

    .section-dot {
        width: 8px;
        height: 8px;
    }

    /* --- 滚动提示 --- */
    .scroll-hint {
        bottom: 10px;
    }

    .scroll-hint p {
        font-size: 0.8rem;
    }

    .scroll-arrow {
        font-size: 1.5rem;
    }
}
